d76c62
From eae7db4b5daa44a6bf83e2d57601d108d3b93beb Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <eae7db4b5daa44a6bf83e2d57601d108d3b93beb@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Mon, 30 Mar 2020 17:21:39 +0200
d76c62
Subject: [PATCH] qemuxml2xmltest: Wire up 'disk-network-http' case
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
(cherry picked from commit c34ec56abad4b2286ef82a0a3ab9deb4d807a9bf)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
d76c62
d76c62
Conflicts: The XML output file differs in the <cpu> element as changes
d76c62
           in default cpu handling were not backported.
d76c62
Message-Id: <dd5d567d2c6f0a0e50f9184360265fc0aff78296.1585581552.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
d76c62
---
d76c62
 .../disk-network-http.x86_64-latest.xml       | 68 +++++++++++++++++++
d76c62
 tests/qemuxml2xmltest.c                       |  2 +
d76c62
 2 files changed, 70 insertions(+)
d76c62
 create mode 100644 tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
d76c62
d76c62
diff --git a/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
d76c62
new file mode 100644
d76c62
index 0000000000..238a5fef58
d76c62
--- /dev/null
d76c62
+++ b/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
d76c62
@@ -0,0 +1,68 @@
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
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
d76c62
+    <disk type='network' device='disk'>
d76c62
+      <driver name='qemu' type='raw'/>
d76c62
+      <source protocol='http' name='test.img'>
d76c62
+        <host name='example.org' port='80'/>
d76c62
+        <timeout seconds='1234'/>
d76c62
+      </source>
d76c62
+      <target dev='vda' bus='virtio'/>
d76c62
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
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' port='443'/>
d76c62
+        <readahead size='1024'/>
d76c62
+      </source>
d76c62
+      <target dev='vdb' bus='virtio'/>
d76c62
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
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
+        <cookies>
d76c62
+          <cookie name='test'>testcookievalue</cookie>
d76c62
+          <cookie name='test2'>blurb</cookie>
d76c62
+        </cookies>
d76c62
+      </source>
d76c62
+      <target dev='vdc' bus='virtio'/>
d76c62
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
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
+        <ssl verify='no'/>
d76c62
+        <cookies>
d76c62
+          <cookie name='test'>testcookievalue</cookie>
d76c62
+          <cookie name='test2'>blurb</cookie>
d76c62
+        </cookies>
d76c62
+      </source>
d76c62
+      <target dev='vdd' bus='virtio'/>
d76c62
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
d76c62
+    </disk>
d76c62
+    <controller type='usb' index='0' model='piix3-uhci'>
d76c62
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
d76c62
+    </controller>
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/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
d76c62
index f77f59fa3c..15110dd104 100644
d76c62
--- a/tests/qemuxml2xmltest.c
d76c62
+++ b/tests/qemuxml2xmltest.c
d76c62
@@ -1089,6 +1089,8 @@ mymain(void)
d76c62
     DO_TEST("disk-backing-chains-index", NONE);
d76c62
     DO_TEST("disk-backing-chains-noindex", NONE);
d76c62
 
d76c62
+    DO_TEST_CAPS_LATEST("disk-network-http");
d76c62
+
d76c62
     DO_TEST("chardev-label",
d76c62
             QEMU_CAPS_DEVICE_VIRTIO_RNG);
d76c62
 
d76c62
-- 
d76c62
2.26.0
d76c62