From 0127b79e8b9f91c69885e8d425648c16f3bb12ec Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 1 Sep 2017 11:54:33 +0100 Subject: 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 Message-Id: <20170901105434.3288-2-berrange@redhat.com> Reviewed-by: Eric Blake Tested-by: Fam Zheng Signed-off-by: Eric Blake --- tests/qemu-iotests/192 | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'tests') 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" -- cgit v1.2.3 From 3f5c4076f118072ac7403ca092d63a1766cd5e04 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 1 Sep 2017 11:54:34 +0100 Subject: iotests: blacklist 194 with the luks driver The 194 test has a lot of code that assumes a simple image file. Rewriting this to work with luks is possible, but non-trivial, so blacklist the luks format for now. Signed-off-by: Daniel P. Berrange Message-Id: <20170901105434.3288-3-berrange@redhat.com> Reviewed-by: Eric Blake Tested-by: Fam Zheng [eblake: commit message typo fixed] Reviewed-by: Kashyap Chamarthy Reviewed-by: Stefan Hajnoczi Signed-off-by: Eric Blake --- tests/qemu-iotests/194 | 1 + tests/qemu-iotests/iotests.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qemu-iotests/194 b/tests/qemu-iotests/194 index 6449b9b64a..8d973b440f 100755 --- a/tests/qemu-iotests/194 +++ b/tests/qemu-iotests/194 @@ -21,6 +21,7 @@ import iotests +iotests.verify_image_format(unsupported_fmts=['luks']) iotests.verify_platform(['linux']) with iotests.FilePath('source.img') as source_img_path, \ diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 07fa1626a0..1af117e37d 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -421,9 +421,11 @@ def notrun(reason): print '%s not run: %s' % (seq, reason) sys.exit(0) -def verify_image_format(supported_fmts=[]): +def verify_image_format(supported_fmts=[], unsupported_fmts=[]): if supported_fmts and (imgfmt not in supported_fmts): notrun('not suitable for this image format: %s' % imgfmt) + if unsupported_fmts and (imgfmt in unsupported_fmts): + notrun('not suitable for this image format: %s' % imgfmt) def verify_platform(supported_oses=['linux']): if True not in [sys.platform.startswith(x) for x in supported_oses]: -- cgit v1.2.3 From 030fa7f6f950f5c8963f1dee8e6bb7387ed86a99 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 5 Sep 2017 14:11:14 -0500 Subject: nbd: Use new qio_channel_*_all() functions Rather than open-coding our own read/write-all functions, we can make use of the recently-added qio code. It slightly changes the error message in one of the iotests. Signed-off-by: Eric Blake Message-Id: <20170905191114.5959-4-eblake@redhat.com> Reviewed-by: Daniel P. Berrange --- tests/qemu-iotests/083.out | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out index fb71b6f8ad..25dde519e3 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -69,12 +69,12 @@ read failed: Input/output error === Check disconnect 4 reply === -End of file +Unexpected end-of-file before all bytes were read read failed: Input/output error === Check disconnect 8 reply === -End of file +Unexpected end-of-file before all bytes were read read failed: Input/output error === Check disconnect before data === @@ -180,12 +180,12 @@ read failed: Input/output error === Check disconnect 4 reply === -End of file +Unexpected end-of-file before all bytes were read read failed: Input/output error === Check disconnect 8 reply === -End of file +Unexpected end-of-file before all bytes were read read failed: Input/output error === Check disconnect before data === -- cgit v1.2.3