render / rpms / libvirt

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