c401cc
From 71b3990901a14d3ce956cb582a02a573d88db12e Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <71b3990901a14d3ce956cb582a02a573d88db12e@dist-git>
c401cc
From: Peter Krempa <pkrempa@redhat.com>
c401cc
Date: Wed, 26 Feb 2014 14:54:41 +0100
c401cc
Subject: [PATCH] qemuxml2argv: Add test for disk type='volume' with iSCSI
c401cc
 pools
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1032370
c401cc
c401cc
Tweak the existing file so that it can be tested for command line
c401cc
corectness.
c401cc
c401cc
(cherry picked from commit 7e831969c07737fe36348ee6e1923c6e1e8450d7)
c401cc
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args | 10 ++++++++++
c401cc
 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml  |  4 ++--
c401cc
 tests/qemuxml2argvtest.c                                       |  2 ++
c401cc
 3 files changed, 14 insertions(+), 2 deletions(-)
c401cc
 create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args
c401cc
c401cc
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args
c401cc
new file mode 100644
c401cc
index 0000000..708a351
c401cc
--- /dev/null
c401cc
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.args
c401cc
@@ -0,0 +1,10 @@
c401cc
+LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
c401cc
+/usr/bin/qemu -S -M pc -m 214 -smp 1 -nographic -nodefconfig -nodefaults \
c401cc
+-monitor unix:/tmp/test-monitor,server,nowait -no-acpi -boot c -usb -drive \
c401cc
+file=/some/block/device/unit:0:0:1,if=none,media=cdrom,id=drive-ide0-0-1 -device \
c401cc
+ide-drive,bus=ide.0,unit=1,drive=drive-ide0-0-1,id=ide0-0-1 -drive \
c401cc
+file=iscsi://iscsi.example.com:3260/demo-target/2,if=none,media=cdrom,id=drive-ide0-0-2 \
c401cc
+-device ide-drive,bus=ide.0,unit=2,drive=drive-ide0-0-2,id=ide0-0-2 -drive \
c401cc
+file=/tmp/idedisk.img,if=none,id=drive-ide0-0-3 -device \
c401cc
+ide-drive,bus=ide.0,unit=3,drive=drive-ide0-0-3,id=ide0-0-3 -device \
c401cc
+virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4
c401cc
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml
c401cc
index b907633..9f90293 100644
c401cc
--- a/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml
c401cc
+++ b/tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool-mode.xml
c401cc
@@ -15,7 +15,7 @@
c401cc
   <devices>
c401cc
     <emulator>/usr/bin/qemu</emulator>
c401cc
     <disk type='volume' device='cdrom'>
c401cc
-      <source pool='blk-pool0' volume='blk-pool0-vol0' mode='host' startupPolicy='optional'>
c401cc
+      <source pool='pool-iscsi-auth' volume='unit:0:0:1' mode='host'>
c401cc
         <seclabel model='selinux' relabel='yes'>
c401cc
           <label>system_u:system_r:public_content_t:s0</label>
c401cc
         </seclabel>
c401cc
@@ -25,7 +25,7 @@
c401cc
       <address type='drive' controller='0' bus='0' target='0' unit='1'/>
c401cc
     </disk>
c401cc
     <disk type='volume' device='cdrom'>
c401cc
-      <source pool='blk-pool0' volume='blk-pool0-vol1' mode='direct' startupPolicy='optional'>
c401cc
+      <source pool='pool-iscsi' volume='unit:0:0:2' mode='direct'>
c401cc
         <seclabel model='selinux' relabel='yes'>
c401cc
           <label>system_u:system_r:public_content_t:s0</label>
c401cc
         </seclabel>
c401cc
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
c401cc
index 2b42713..e79141c 100644
c401cc
--- a/tests/qemuxml2argvtest.c
c401cc
+++ b/tests/qemuxml2argvtest.c
c401cc
@@ -783,6 +783,8 @@ mymain(void)
c401cc
             QEMU_CAPS_DRIVE_CACHE_V2, QEMU_CAPS_DRIVE_FORMAT);
c401cc
     DO_TEST("disk-source-pool",
c401cc
             QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
c401cc
+    DO_TEST("disk-source-pool-mode",
c401cc
+            QEMU_CAPS_DRIVE, QEMU_CAPS_DEVICE, QEMU_CAPS_NODEFCONFIG);
c401cc
     DO_TEST("disk-ioeventfd",
c401cc
             QEMU_CAPS_DRIVE, QEMU_CAPS_VIRTIO_IOEVENTFD,
c401cc
             QEMU_CAPS_VIRTIO_TX_ALG, QEMU_CAPS_DEVICE,
c401cc
-- 
c401cc
1.9.0
c401cc