[libvirt] [PATCH 06/24] tests: qemuxml2argv: Unify testing of local cdroms

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


Test empty cdroms along with cdroms with medium.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 tests/qemuxml2argvdata/disk-cdrom-empty.args  | 28 -------------------
 tests/qemuxml2argvdata/disk-cdrom-empty.xml   | 36 ------------------------
 tests/qemuxml2argvdata/disk-cdrom.args        |  4 ++-
 tests/qemuxml2argvdata/disk-cdrom.xml         |  6 ++++
 tests/qemuxml2argvtest.c                      |  1 -
 tests/qemuxml2xmloutdata/disk-cdrom-empty.xml | 40 ---------------------------
 tests/qemuxml2xmloutdata/disk-cdrom.xml       |  6 ++++
 tests/qemuxml2xmltest.c                       |  1 -
 8 files changed, 15 insertions(+), 107 deletions(-)
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.args
 delete mode 100644 tests/qemuxml2argvdata/disk-cdrom-empty.xml
 delete mode 100644 tests/qemuxml2xmloutdata/disk-cdrom-empty.xml

diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty.args b/tests/qemuxml2argvdata/disk-cdrom-empty.args
deleted file mode 100644
index 1cbc76ab86..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-empty.args
+++ /dev/null
@@ -1,28 +0,0 @@
-LC_ALL=C \
-PATH=/bin \
-HOME=/home/test \
-USER=test \
-LOGNAME=test \
-QEMU_AUDIO_DRV=none \
-/usr/bin/qemu-system-i686 \
--name QEMUGuest1 \
--S \
--machine pc,accel=tcg,usb=off,dump-guest-core=off \
--m 214 \
--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 \
--no-acpi \
--boot c \
--usb \
--drive file=/dev/HostVG/QEMUGuest1,format=raw,if=none,id=drive-ide0-0-0 \
--device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
--drive 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
diff --git a/tests/qemuxml2argvdata/disk-cdrom-empty.xml b/tests/qemuxml2argvdata/disk-cdrom-empty.xml
deleted file mode 100644
index 7de5a6ebf5..0000000000
--- a/tests/qemuxml2argvdata/disk-cdrom-empty.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-i686</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <disk type='file' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <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='ide' index='0'/>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2argvdata/disk-cdrom.args b/tests/qemuxml2argvdata/disk-cdrom.args
index 55a76f6dac..2bef3bd71e 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.args
+++ b/tests/qemuxml2argvdata/disk-cdrom.args
@@ -26,4 +26,6 @@ server,nowait \
 -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 \
 -drive file=/root/boot.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 ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
+-drive 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
diff --git a/tests/qemuxml2argvdata/disk-cdrom.xml b/tests/qemuxml2argvdata/disk-cdrom.xml
index 341025c477..be229657f7 100644
--- a/tests/qemuxml2argvdata/disk-cdrom.xml
+++ b/tests/qemuxml2argvdata/disk-cdrom.xml
@@ -27,6 +27,12 @@
       <readonly/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
     </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <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='ide' index='0'/>
     <controller type='pci' index='0' model='pci-root'/>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 44b6245747..0eac624ebf 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -991,7 +991,6 @@ mymain(void)
     DO_TEST("disk-cdrom", NONE);
     DO_TEST("disk-iscsi", NONE);
     DO_TEST("disk-cdrom-network", QEMU_CAPS_KVM);
-    DO_TEST("disk-cdrom-empty", NONE);
     DO_TEST("disk-cdrom-tray",
             QEMU_CAPS_VIRTIO_TX_ALG);
     DO_TEST("disk-floppy", NONE);
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml b/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml
deleted file mode 100644
index 26ce476557..0000000000
--- a/tests/qemuxml2xmloutdata/disk-cdrom-empty.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<domain type='qemu'>
-  <name>QEMUGuest1</name>
-  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
-  <memory unit='KiB'>219100</memory>
-  <currentMemory unit='KiB'>219100</currentMemory>
-  <vcpu placement='static'>1</vcpu>
-  <os>
-    <type arch='i686' machine='pc'>hvm</type>
-    <boot dev='hd'/>
-  </os>
-  <clock offset='utc'/>
-  <on_poweroff>destroy</on_poweroff>
-  <on_reboot>restart</on_reboot>
-  <on_crash>destroy</on_crash>
-  <devices>
-    <emulator>/usr/bin/qemu-system-i686</emulator>
-    <disk type='block' device='disk'>
-      <driver name='qemu' type='raw'/>
-      <source dev='/dev/HostVG/QEMUGuest1'/>
-      <target dev='hda' bus='ide'/>
-      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
-    </disk>
-    <disk type='file' device='cdrom'>
-      <driver name='qemu' type='raw'/>
-      <target dev='hdc' bus='ide'/>
-      <readonly/>
-      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
-    </disk>
-    <controller type='usb' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
-    </controller>
-    <controller type='ide' index='0'>
-      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
-    </controller>
-    <controller type='pci' index='0' model='pci-root'/>
-    <input type='mouse' bus='ps2'/>
-    <input type='keyboard' bus='ps2'/>
-    <memballoon model='none'/>
-  </devices>
-</domain>
diff --git a/tests/qemuxml2xmloutdata/disk-cdrom.xml b/tests/qemuxml2xmloutdata/disk-cdrom.xml
index 163ce88f19..e96c94097a 100644
--- a/tests/qemuxml2xmloutdata/disk-cdrom.xml
+++ b/tests/qemuxml2xmloutdata/disk-cdrom.xml
@@ -27,6 +27,12 @@
       <readonly/>
       <address type='drive' controller='0' bus='1' target='0' unit='0'/>
     </disk>
+    <disk type='file' device='cdrom'>
+      <driver name='qemu' type='raw'/>
+      <target dev='hdd' bus='ide'/>
+      <readonly/>
+      <address type='drive' controller='0' bus='1' target='0' unit='1'/>
+    </disk>
     <controller type='usb' index='0'>
       <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
     </controller>
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index 6fcadab66b..904b86571f 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -347,7 +347,6 @@ mymain(void)
     DO_TEST("qemu-ns-no-env", NONE);
     DO_TEST("disk-aio", NONE);
     DO_TEST("disk-cdrom", NONE);
-    DO_TEST("disk-cdrom-empty", NONE);
     DO_TEST("disk-floppy", NONE);
     DO_TEST("disk-many", NONE);
     DO_TEST("disk-usb-device", NONE);
-- 
2.16.2




More information about the libvir-list mailing list