aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/192
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-09-01 11:54:33 +0100
committerEric Blake <eblake@redhat.com>2017-09-05 14:17:26 -0500
commit0127b79e8b9f91c69885e8d425648c16f3bb12ec (patch)
tree539a87a44dcf2139d9ddfbcb7e2ef2f47912d800 /tests/qemu-iotests/192
parentb07d1c2f5607489d4d4a6a65ce36a3e896ac065e (diff)
iotests: rewrite 192 to use _launch_qemu to fix LUKS support
The LUKS driver requires extra args to QEMU to setup passwords. The _launch_qemu function takes care of this, so convert the test to use this function and use correct -drive syntax Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170901105434.3288-2-berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Tested-by: Fam Zheng <famz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/192')
-rwxr-xr-xtests/qemu-iotests/19223
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/qemu-iotests/192 b/tests/qemu-iotests/192
index b50a2c0c8e..595f0d786a 100755
--- a/tests/qemu-iotests/192
+++ b/tests/qemu-iotests/192
@@ -37,6 +37,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
+. ./common.qemu
_supported_fmt generic
_supported_proto file
@@ -49,13 +50,21 @@ fi
size=64M
_make_test_img $size
-{
-echo "nbd_server_start unix:$TEST_DIR/nbd"
-echo "nbd_server_add -w drive0"
-echo "q"
-} | $QEMU -nodefaults -display none -monitor stdio \
- -drive format=$IMGFMT,file=$TEST_IMG,if=ide,id=drive0 \
- -incoming defer 2>&1 | _filter_testdir | _filter_qemu | _filter_hmp
+if test "$IMGOPTSSYNTAX" = "true"
+then
+ DRIVE_ARG=if=ide,id=drive0,$TEST_IMG
+else
+ DRIVE_ARG=if=ide,id=drive0,format=$IMGFMT,file=$TEST_IMG
+fi
+
+qemu_comm_method="monitor"
+_launch_qemu -drive $DRIVE_ARG -incoming defer
+h=$QEMU_HANDLE
+QEMU_COMM_TIMEOUT=1
+
+_send_qemu_cmd $h "nbd_server_start unix:$TEST_DIR/nbd" "(qemu)"
+_send_qemu_cmd $h "nbd_server_add -w drive0" "(qemu)"
+_send_qemu_cmd $h "q" "(qemu)"
# success, all done
echo "*** done"