render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 566b77b94d498426062dfddaf5a8c77250ba0857 Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <566b77b94d498426062dfddaf5a8c77250ba0857@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:12:00 +0100
fbe740
Subject: [PATCH] qemuxml2argvtest: Add test case for disks with http(s) source
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
Upcoming patches will implement the support for sslverify, cookies,
fbe740
readahead, and timeout properties. Add a test file which will collect
fbe740
the cases.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 3dd7952f6f996d13a0a685e1300c178fd9be6658)
fbe740
fbe740
 Conflicts:
fbe740
  tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args:
fbe740
  Test output differs on the '-cpu qemu64' line due to previous fixes
fbe740
  to the testsuite not being backported
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
fbe740
Message-Id: <4ff67b442d284d3e8cdc9564b9378990b57fa3c0.1584391727.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 .../disk-network-http.x86_64-latest.args      | 56 +++++++++++++++++++
fbe740
 tests/qemuxml2argvdata/disk-network-http.xml  | 50 +++++++++++++++++
fbe740
 tests/qemuxml2argvtest.c                      |  1 +
fbe740
 3 files changed, 107 insertions(+)
fbe740
 create mode 100644 tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
 create mode 100644 tests/qemuxml2argvdata/disk-network-http.xml
fbe740
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
new file mode 100644
fbe740
index 0000000000..d39f357072
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.x86_64-latest.args
fbe740
@@ -0,0 +1,56 @@
fbe740
+LC_ALL=C \
fbe740
+PATH=/bin \
fbe740
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
fbe740
+USER=test \
fbe740
+LOGNAME=test \
fbe740
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
fbe740
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
fbe740
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
fbe740
+QEMU_AUDIO_DRV=none \
fbe740
+/usr/bin/qemu-system-x86_64 \
fbe740
+-name guest=QEMUGuest1,debug-threads=on \
fbe740
+-S \
fbe740
+-object secret,id=masterKey0,format=raw,\
fbe740
+file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
fbe740
+-machine pc,accel=kvm,usb=off,dump-guest-core=off \
fbe740
+-m 214 \
fbe740
+-overcommit mem-lock=off \
fbe740
+-smp 1,sockets=1,cores=1,threads=1 \
fbe740
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
fbe740
+-display none \
fbe740
+-no-user-config \
fbe740
+-nodefaults \
fbe740
+-chardev socket,id=charmonitor,fd=1729,server,nowait \
fbe740
+-mon chardev=charmonitor,id=monitor,mode=control \
fbe740
+-rtc base=utc \
fbe740
+-no-shutdown \
fbe740
+-no-acpi \
fbe740
+-boot strict=on \
fbe740
+-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
fbe740
+-blockdev '{"driver":"http","url":"http://example.org:80/test.img",\
fbe740
+"node-name":"libvirt-4-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+-blockdev '{"node-name":"libvirt-4-format","read-only":false,"driver":"raw",\
fbe740
+"file":"libvirt-4-storage"}' \
fbe740
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x2,drive=libvirt-4-format,\
fbe740
+id=virtio-disk0,bootindex=1 \
fbe740
+-blockdev '{"driver":"https","url":"https://example.org:443/test2.img",\
fbe740
+"node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+-blockdev '{"node-name":"libvirt-3-format","read-only":false,"driver":"raw",\
fbe740
+"file":"libvirt-3-storage"}' \
fbe740
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=libvirt-3-format,\
fbe740
+id=virtio-disk1 \
fbe740
+-blockdev '{"driver":"http","url":"http://example.org:1234/test3.img",\
fbe740
+"node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+-blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"raw",\
fbe740
+"file":"libvirt-2-storage"}' \
fbe740
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=libvirt-2-format,\
fbe740
+id=virtio-disk2 \
fbe740
+-blockdev '{"driver":"https","url":"https://example.org:1234/test4.img",\
fbe740
+"node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
fbe740
+-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw",\
fbe740
+"file":"libvirt-1-storage"}' \
fbe740
+-device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=libvirt-1-format,\
fbe740
+id=virtio-disk3 \
fbe740
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
fbe740
+resourcecontrol=deny \
fbe740
+-msg timestamp=on
fbe740
diff --git a/tests/qemuxml2argvdata/disk-network-http.xml b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
new file mode 100644
fbe740
index 0000000000..83a9865c83
fbe740
--- /dev/null
fbe740
+++ b/tests/qemuxml2argvdata/disk-network-http.xml
fbe740
@@ -0,0 +1,50 @@
fbe740
+<domain type='kvm'>
fbe740
+  <name>QEMUGuest1</name>
fbe740
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
fbe740
+  <memory unit='KiB'>219136</memory>
fbe740
+  <currentMemory unit='KiB'>219136</currentMemory>
fbe740
+  <vcpu placement='static'>1</vcpu>
fbe740
+  <os>
fbe740
+    <type arch='x86_64' machine='pc'>hvm</type>
fbe740
+    <boot dev='hd'/>
fbe740
+  </os>
fbe740
+  <clock offset='utc'/>
fbe740
+  <on_poweroff>destroy</on_poweroff>
fbe740
+  <on_reboot>restart</on_reboot>
fbe740
+  <on_crash>destroy</on_crash>
fbe740
+  <devices>
fbe740
+    <disk type='network' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source protocol='http' name='test.img'>
fbe740
+        <host name='example.org'/>
fbe740
+      </source>
fbe740
+      <target dev='vda' bus='virtio'/>
fbe740
+    </disk>
fbe740
+    <disk type='network' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source protocol='https' name='test2.img'>
fbe740
+        <host name='example.org'/>
fbe740
+      </source>
fbe740
+      <target dev='vdb' bus='virtio'/>
fbe740
+    </disk>
fbe740
+    <disk type='network' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source protocol='http' name='test3.img'>
fbe740
+        <host name='example.org' port='1234'/>
fbe740
+      </source>
fbe740
+      <target dev='vdc' bus='virtio'/>
fbe740
+    </disk>
fbe740
+    <disk type='network' device='disk'>
fbe740
+      <driver name='qemu' type='raw'/>
fbe740
+      <source protocol='https' name='test4.img'>
fbe740
+        <host name='example.org' port='1234'/>
fbe740
+      </source>
fbe740
+      <target dev='vdd' bus='virtio'/>
fbe740
+    </disk>
fbe740
+    <controller type='usb' index='0'/>
fbe740
+    <controller type='pci' index='0' model='pci-root'/>
fbe740
+    <input type='mouse' bus='ps2'/>
fbe740
+    <input type='keyboard' bus='ps2'/>
fbe740
+    <memballoon model='none'/>
fbe740
+  </devices>
fbe740
+</domain>
fbe740
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
fbe740
index 265ffce465..7bc01d55d5 100644
fbe740
--- a/tests/qemuxml2argvtest.c
fbe740
+++ b/tests/qemuxml2argvtest.c
fbe740
@@ -1089,6 +1089,7 @@ mymain(void)
fbe740
             QEMU_CAPS_OBJECT_TLS_CREDS_X509, QEMU_CAPS_NBD_TLS);
fbe740
     DO_TEST_CAPS_VER("disk-network-tlsx509", "2.12.0");
fbe740
     DO_TEST_CAPS_LATEST("disk-network-tlsx509");
fbe740
+    DO_TEST_CAPS_LATEST("disk-network-http");
fbe740
     driver.config->vxhsTLS = 0;
fbe740
     VIR_FREE(driver.config->vxhsTLSx509certdir);
fbe740
     DO_TEST("disk-no-boot", NONE);
fbe740
-- 
fbe740
2.25.1
fbe740