Blob Blame History Raw
From fd023e14201b25017fa747e572030f8a56e24a60 Mon Sep 17 00:00:00 2001
Message-Id: <fd023e14201b25017fa747e572030f8a56e24a60@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Wed, 26 Feb 2014 14:54:40 +0100
Subject: [PATCH] qemuxml2argv: Add test to verify correct usage of disk
 type="volume"

https://bugzilla.redhat.com/show_bug.cgi?id=1032370

Tweak the existing file to test command line generator too.

(cherry picked from commit 9f9906727b4865d4b8b2175e710d968f8393051a)

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args | 8 ++++++++
 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml  | 2 +-
 tests/qemuxml2argvtest.c                                  | 2 ++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args

diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
new file mode 100644
index 0000000..8e04b12
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.args
@@ -0,0 +1,8 @@
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -drive \
+file=/some/block/device/cdrom,if=none,media=cdrom,id=drive-ide0-0-1 -device \
+ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive \
+file=/tmp/idedisk.img,if=none,id=drive-ide0-0-2 -device \
+ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 -device \
+virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
index 465a539..6ca5cf7 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml
@@ -15,7 +15,7 @@
   <devices>
     <emulator>/usr/bin/qemu</emulator>
     <disk type='volume' device='cdrom'>
-      <source pool='blk-pool0' volume='blk-pool0-vol0' startupPolicy='optional'>
+      <source pool='pool-disk' volume='block+cdrom'>
         <seclabel model='selinux' relabel='yes'>
           <label>system_u:system_r:public_content_t:s0</label>
         </seclabel>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 3c969e2..2b42713 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -781,6 +781,8 @@ mymain(void)
     DO_TEST("disk-aio",
             QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_AIO,
             QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
+    DO_TEST("disk-source-pool",
+            QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
     DO_TEST("disk-ioeventfd",
             QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_IOEVENTFD,
             QEMU_CAPS_VIRTIO_TX_ALG, QEMU_CAPS_DEVICE,
-- 
1.9.0