Signed-off-by: Marc-André Lureau <[email protected]>
---
 tests/qemu-iotests/225     | 28 ++++++++++++++++++----------
 tests/qemu-iotests/225.out | 25 +++++++++++++++----------
 2 files changed, 33 insertions(+), 20 deletions(-)

diff --git a/tests/qemu-iotests/225 b/tests/qemu-iotests/225
index 8128d583d609..9ec2741ecd8e 100755
--- a/tests/qemu-iotests/225
+++ b/tests/qemu-iotests/225
@@ -46,7 +46,6 @@ _supported_os Linux
 _unsupported_imgopts "subformat=monolithicFlat" \
                      "subformat=twoGbMaxExtentFlat" \
                      "subformat=twoGbMaxExtentSparse"
-_require_hmp
 
 TEST_IMG="$TEST_IMG.base" _make_test_img 1M
 TEST_IMG="$TEST_IMG.not_base" _make_test_img 1M
@@ -83,11 +82,14 @@ echo
 echo '=== Testing fitting VMDK backing image ==='
 echo
 
-qemu_comm_method=monitor \
-    _launch_qemu -blockdev "$base_opts" -blockdev "$overlay_opts"
+_launch_qemu -blockdev "$base_opts" -blockdev "$overlay_opts"
+_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'qmp_capabilities' }" "return"
 
 # Should not return an error
-_send_qemu_cmd $QEMU_HANDLE 'qemu-io overlay "read 0 512"' 'ops'
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }" \
+    "return"
 
 _cleanup_qemu
 
@@ -96,11 +98,14 @@ echo
 echo '=== Testing unrelated VMDK backing image ==='
 echo
 
-qemu_comm_method=monitor \
-    _launch_qemu -blockdev "$not_base_opts" -blockdev "$overlay_opts"
+_launch_qemu -blockdev "$not_base_opts" -blockdev "$overlay_opts"
+_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'qmp_capabilities' }" "return"
 
 # Should fail (gracefully)
-_send_qemu_cmd $QEMU_HANDLE 'qemu-io overlay "read 0 512"' 'failed'
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }" \
+    "error"
 
 _cleanup_qemu
 
@@ -118,11 +123,14 @@ echo
 # this a FIXME because with -blockdev, you cannot specify "partial"
 # options, so setting file.filename but leaving the rest as specified
 # by the user does not make sense.
-qemu_comm_method=monitor \
-    _launch_qemu -blockdev "$not_vmdk_opts" -blockdev "$overlay_opts"
+_launch_qemu -blockdev "$not_vmdk_opts" -blockdev "$overlay_opts"
+_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'qmp_capabilities' }" "return"
 
 # Should fail (gracefully)
-_send_qemu_cmd $QEMU_HANDLE 'qemu-io overlay "read 0 512"' 'failed'
+_send_qemu_cmd $QEMU_HANDLE \
+    "{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }" \
+    "error"
 
 _cleanup_qemu
 
diff --git a/tests/qemu-iotests/225.out b/tests/qemu-iotests/225.out
index beb8c23bd330..a5815afd0f0c 100644
--- a/tests/qemu-iotests/225.out
+++ b/tests/qemu-iotests/225.out
@@ -5,20 +5,25 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1048576 
backing_file=TEST_DIR/t.
 
 === Testing fitting VMDK backing image ===
 
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qemu-io overlay "read 0 512"
-read 512/512 bytes at offset 0
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+{ 'execute': 'qmp_capabilities' }
+{"return": {}}
+{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }
+{"return": {"human-readable-text": "read 512/512 bytes at offset 0\n512 bytes, 
X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n"}}
 
 === Testing unrelated VMDK backing image ===
 
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qemu-io overlay "read 0 512"
-Error: read failed: Invalid argument
+{ 'execute': 'qmp_capabilities' }
+{"return": {}}
+{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }
+{"error": {"class": "GenericError", "desc": "read failed: Invalid argument"}}
 
 === Testing non-VMDK backing image ===
 
-QEMU X.Y.Z monitor - type 'help' for more information
-(qemu) qemu-io overlay "read 0 512"
-Error: read failed: Invalid argument
+{ 'execute': 'qmp_capabilities' }
+{"return": {}}
+{ 'execute': 'x-qemu-io',
+       'arguments': { 'device': 'overlay', 'command': 'read 0 512' } }
+{"error": {"class": "GenericError", "desc": "read failed: Invalid argument"}}
 *** done

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to