[libvirt] [PATCH 05/24] tests: qemuxml2argv: Unify network cdrom source testing

Peter Krempa pkrempa at redhat.com
Thu Jul 19 15:50:57 UTC 2018


Unify most of the tests into a common test named disk-cdrom-network by
adding multiple cdroms. The 'http' test is dropped since there can be
only 4 cdroms.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args | 27 ----------------
 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml  | 36 ----------------------
 .../qemuxml2argvdata/disk-cdrom-network-ftps.args  | 27 ----------------
 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml | 36 ----------------------
 .../qemuxml2argvdata/disk-cdrom-network-http.args  | 27 ----------------
 tests/qemuxml2argvdata/disk-cdrom-network-http.xml | 36 ----------------------
 .../qemuxml2argvdata/disk-cdrom-network-tftp.args  | 27 ----------------
 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml | 36 ----------------------
 ...-network-https.args => disk-cdrom-network.args} |  9 ++++++
 ...om-network-https.xml => disk-cdrom-network.xml} | 27 ++++++++++++++++
 tests/qemuxml2argvtest.c                           |  6 +---
 11 files changed, 37 insertions(+), 257 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-http.xml
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml
 rename tests/qemuxml2argvdata/{disk-cdrom-network-https.args => disk-cdrom-network.args} (58%)
 rename tests/qemuxml2argvdata/{disk-cdrom-network-https.xml => disk-cdrom-network.xml} (52%)

diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args b/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
deleted file mode 100644
index e9eab22aaf..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=ftp://host.name:21/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml b/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
deleted file mode 100644
index b4e3311606..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftp.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='kvm'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc-1.2'>hvm</type>
-    <boot dev='cdrom'/>
-  </os>
-  <features>
-    <acpi/>
-    <apic/>
-    <pae/>
-  </features>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <disk type='network' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <source protocol='ftp' name='/url/path/file.iso'>
-        <host name='host.name' port='21'/>
-      </source>
-      <target dev='hdc' bus='ide'/>
-      <readonly/>
-      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <controller type='ide' index='0'/>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args b/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
deleted file mode 100644
index d334f7938f..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml b/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
deleted file mode 100644
index 4e6ca1bad1..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-ftps.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='kvm'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc-1.2'>hvm</type>
-    <boot dev='cdrom'/>
-  </os>
-  <features>
-    <acpi/>
-    <apic/>
-    <pae/>
-  </features>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <disk type='network' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <source protocol='ftps' name='/url/path/file.iso'>
-        <host name='host.name' port='990'/>
-      </source>
-      <target dev='hdc' bus='ide'/>
-      <readonly/>
-      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <controller type='ide' index='0'/>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-http.args b/tests/qemuxml2argvdata/disk-cdrom-network-http.args
deleted file mode 100644
index cca0c6c3be..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-http.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=http://host.name:80/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-http.xml b/tests/qemuxml2argvdata/disk-cdrom-network-http.xml
deleted file mode 100644
index 0eed65672b..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-http.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='kvm'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc-1.2'>hvm</type>
-    <boot dev='cdrom'/>
-  </os>
-  <features>
-    <acpi/>
-    <apic/>
-    <pae/>
-  </features>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <disk type='network' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <source protocol='http' name='/url/path/file.iso'>
-        <host name='host.name' port='80'/>
-      </source>
-      <target dev='hdc' bus='ide'/>
-      <readonly/>
-      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <controller type='ide' index='0'/>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-tftp.args b/tests/qemuxml2argvdata/disk-cdrom-network-tftp.args
deleted file mode 100644
index 8882c2c915..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-tftp.args
+++ /dev/null
@@ -1,27 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-x86_64 \
--name QEMUGuest1 \
--S \
--machine pc-1.2,accel=kvm,usb=off,dump-guest-core=off \
--m 1024 \
--smp 1,sockets=1,cores=1,threads=1 \
--uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
--display none \
--no-user-config \
--nodefaults \
--chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
-server,nowait \
--mon chardev=charmonitor,id=monitor,mode=control \
--rtc base=utc \
--no-shutdown \
--boot d \
--usb \
--drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
-id=drive-ide0-1-0,media=cdrom,readonly=on \
--device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
--device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml b/tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml
deleted file mode 100644
index 1c3b185b00..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-network-tftp.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='kvm'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>1048576</memory>
-  <currentMemory unit='KiB'>1048576</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='x86_64' machine='pc-1.2'>hvm</type>
-    <boot dev='cdrom'/>
-  </os>
-  <features>
-    <acpi/>
-    <apic/>
-    <pae/>
-  </features>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>restart</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-x86_64</emulator>
-    <disk type='network' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <source protocol='tftp' name='/url/path/file.iso'>
-        <host name='host.name' port='69'/>
-      </source>
-      <target dev='hdc' bus='ide'/>
-      <readonly/>
-      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <controller type='ide' index='0'/>
-    <memballoon model='virtio'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-https.args b/tests/qemuxml2argvdata/disk-cdrom-network.args
similarity index 58%
rename from tests/qemuxml2argvdata/disk-cdrom-network-https.args
rename to tests/qemuxml2argvdata/disk-cdrom-network.args
index b62186270f..6dee39e3fd 100644
--- a/tests/qemuxml2argvdata/disk-cdrom-network-https.args
+++ b/tests/qemuxml2argvdata/disk-cdrom-network.args
@@ -21,7 +21,16 @@ server,nowait \
 -no-shutdown \
 -boot d \
 -usb \
+-drive file=ftp://host.name:21/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-0-0,media=cdrom,readonly=on \
+-device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
+-drive file=ftps://host.name:990/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-0-1,media=cdrom,readonly=on \
+-device ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 \
 -drive file=https://host.name:443/url/path/file.iso,format=raw,if=none,\
 id=drive-ide0-1-0,media=cdrom,readonly=on \
 -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-drive file=tftp://host.name:69/url/path/file.iso,format=raw,if=none,\
+id=drive-ide0-1-1,media=cdrom,readonly=on \
+-device ide-drive,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \
 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
diff --git a/tests/qemuxml2argvdata/disk-cdrom-network-https.xml b/tests/qemuxml2argvdata/disk-cdrom-network.xml
similarity index 52%
rename from tests/qemuxml2argvdata/disk-cdrom-network-https.xml
rename to tests/qemuxml2argvdata/disk-cdrom-network.xml
index cd92fe44a8..0bdc0e1883 100644
--- a/tests/qemuxml2argvdata/disk-cdrom-network-https.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom-network.xml
@@ -19,6 +19,24 @@
   <on_crash>restart</on_crash>
   <devices>
     <emulator>/usr/bin/qemu-system-x86_64</emulator>
+    <disk type='network' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='ftp' name='/url/path/file.iso'>
+        <host name='host.name' port='21'/>
+      </source>
+      <target dev='hda' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
+    </disk>
+    <disk type='network' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='ftps' name='/url/path/file.iso'>
+        <host name='host.name' port='990'/>
+      </source>
+      <target dev='hdb' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
+    </disk>
     <disk type='network' device='cdrom'>
       <driver name='qemu' type='raw'/>
       <source protocol='https' name='/url/path/file.iso'>
@@ -28,6 +46,15 @@
       <readonly/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
     </disk>
+    <disk type='network' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <source protocol='tftp' name='/url/path/file.iso'>
+        <host name='host.name' port='69'/>
+      </source>
+      <target dev='hdd' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
+    </disk>
     <controller type='usb' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
     <controller type='ide' index='0'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 4bf826177f..44b6245747 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -990,11 +990,7 @@ mymain(void)
     DO_TEST("nosharepages", QEMU_CAPS_MEM_MERGE);
     DO_TEST("disk-cdrom", NONE);
     DO_TEST("disk-iscsi", NONE);
-    DO_TEST("disk-cdrom-network-http", QEMU_CAPS_KVM);
-    DO_TEST("disk-cdrom-network-https", QEMU_CAPS_KVM);
-    DO_TEST("disk-cdrom-network-ftp", QEMU_CAPS_KVM);
-    DO_TEST("disk-cdrom-network-ftps", QEMU_CAPS_KVM);
-    DO_TEST("disk-cdrom-network-tftp", QEMU_CAPS_KVM);
+    DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM);
     DO_TEST("disk-cdrom-empty", NONE);
     DO_TEST("disk-cdrom-tray",
             QEMU_CAPS_VIRTIO_TX_ALG);
-- 
2.16.2




More information about the libvir-list mailing list