render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
a41c76
From eae7db4b5daa44a6bf83e2d57601d108d3b93beb Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <eae7db4b5daa44a6bf83e2d57601d108d3b93beb@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Mon, 30 Mar 2020 17:21:39 +0200
a41c76
Subject: [PATCH] qemuxml2xmltest: Wire up 'disk-network-http' case
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
(cherry picked from commit c34ec56abad4b2286ef82a0a3ab9deb4d807a9bf)
a41c76
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
a41c76
a41c76
Conflicts: The XML output file differs in the <cpu> element as changes
a41c76
           in default cpu handling were not backported.
a41c76
Message-Id: <dd5d567d2c6f0a0e50f9184360265fc0aff78296.1585581552.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
a41c76
---
a41c76
 .../disk-network-http.x86_64-latest.xml       | 68 +++++++++++++++++++
a41c76
 tests/qemuxml2xmltest.c                       |  2 +
a41c76
 2 files changed, 70 insertions(+)
a41c76
 create mode 100644 tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
a41c76
a41c76
diff --git a/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
a41c76
new file mode 100644
a41c76
index 0000000000..238a5fef58
a41c76
--- /dev/null
a41c76
+++ b/tests/qemuxml2xmloutdata/disk-network-http.x86_64-latest.xml
a41c76
@@ -0,0 +1,68 @@
a41c76
+<domain type='kvm'>
a41c76
+  <name>QEMUGuest1</name>
a41c76
+  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
a41c76
+  <memory unit='KiB'>219136</memory>
a41c76
+  <currentMemory unit='KiB'>219136</currentMemory>
a41c76
+  <vcpu placement='static'>1</vcpu>
a41c76
+  <os>
a41c76
+    <type arch='x86_64' machine='pc'>hvm</type>
a41c76
+    <boot dev='hd'/>
a41c76
+  </os>
a41c76
+  <clock offset='utc'/>
a41c76
+  <on_poweroff>destroy</on_poweroff>
a41c76
+  <on_reboot>restart</on_reboot>
a41c76
+  <on_crash>destroy</on_crash>
a41c76
+  <devices>
a41c76
+    <emulator>/usr/bin/qemu-system-x86_64</emulator>
a41c76
+    <disk type='network' device='disk'>
a41c76
+      <driver name='qemu' type='raw'/>
a41c76
+      <source protocol='http' name='test.img'>
a41c76
+        <host name='example.org' port='80'/>
a41c76
+        <timeout seconds='1234'/>
a41c76
+      </source>
a41c76
+      <target dev='vda' bus='virtio'/>
a41c76
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
a41c76
+    </disk>
a41c76
+    <disk type='network' device='disk'>
a41c76
+      <driver name='qemu' type='raw'/>
a41c76
+      <source protocol='https' name='test2.img'>
a41c76
+        <host name='example.org' port='443'/>
a41c76
+        <readahead size='1024'/>
a41c76
+      </source>
a41c76
+      <target dev='vdb' bus='virtio'/>
a41c76
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
a41c76
+    </disk>
a41c76
+    <disk type='network' device='disk'>
a41c76
+      <driver name='qemu' type='raw'/>
a41c76
+      <source protocol='http' name='test3.img'>
a41c76
+        <host name='example.org' port='1234'/>
a41c76
+        <cookies>
a41c76
+          <cookie name='test'>testcookievalue</cookie>
a41c76
+          <cookie name='test2'>blurb</cookie>
a41c76
+        </cookies>
a41c76
+      </source>
a41c76
+      <target dev='vdc' bus='virtio'/>
a41c76
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
a41c76
+    </disk>
a41c76
+    <disk type='network' device='disk'>
a41c76
+      <driver name='qemu' type='raw'/>
a41c76
+      <source protocol='https' name='test4.img'>
a41c76
+        <host name='example.org' port='1234'/>
a41c76
+        <ssl verify='no'/>
a41c76
+        <cookies>
a41c76
+          <cookie name='test'>testcookievalue</cookie>
a41c76
+          <cookie name='test2'>blurb</cookie>
a41c76
+        </cookies>
a41c76
+      </source>
a41c76
+      <target dev='vdd' bus='virtio'/>
a41c76
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
a41c76
+    </disk>
a41c76
+    <controller type='usb' index='0' model='piix3-uhci'>
a41c76
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
a41c76
+    </controller>
a41c76
+    <controller type='pci' index='0' model='pci-root'/>
a41c76
+    <input type='mouse' bus='ps2'/>
a41c76
+    <input type='keyboard' bus='ps2'/>
a41c76
+    <memballoon model='none'/>
a41c76
+  </devices>
a41c76
+</domain>
a41c76
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
a41c76
index f77f59fa3c..15110dd104 100644
a41c76
--- a/tests/qemuxml2xmltest.c
a41c76
+++ b/tests/qemuxml2xmltest.c
a41c76
@@ -1089,6 +1089,8 @@ mymain(void)
a41c76
     DO_TEST("disk-backing-chains-index", NONE);
a41c76
     DO_TEST("disk-backing-chains-noindex", NONE);
a41c76
 
a41c76
+    DO_TEST_CAPS_LATEST("disk-network-http");
a41c76
+
a41c76
     DO_TEST("chardev-label",
a41c76
             QEMU_CAPS_DEVICE_VIRTIO_RNG);
a41c76
 
a41c76
-- 
a41c76
2.26.0
a41c76