Replace HMP "info block" with QMP "query-block". The expected
output changes from HMP "Cache mode: writeback/writethrough" to
QMP "writeback": true/false.

Signed-off-by: Marc-André Lureau <[email protected]>
---
 tests/qemu-iotests/157     | 10 +++++-----
 tests/qemu-iotests/157.out | 16 ++++++++--------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tests/qemu-iotests/157 b/tests/qemu-iotests/157
index 531dbd3122b1..2f9d73155a10 100755
--- a/tests/qemu-iotests/157
+++ b/tests/qemu-iotests/157
@@ -41,18 +41,18 @@ _supported_fmt generic
 _supported_proto file
 
 _require_devices virtio-blk
-_require_hmp
 
 do_run_qemu()
 {
     (
+        printf '%s\n' '{"execute":"qmp_capabilities"}'
         if ! test -t 0; then
             while read cmd; do
                 echo $cmd
             done
         fi
-        echo quit
-    ) | $QEMU -nodefaults -nographic -monitor stdio -serial none "$@"
+        printf '%s\n' '{"execute":"quit"}'
+    ) | $QEMU -nodefaults -nographic -qmp stdio -serial none "$@"
     echo
 }
 
@@ -89,10 +89,10 @@ echo
 for cache in "writeback" "writethrough"; do
     for wce in "" ",write-cache=auto" ",write-cache=on" ",write-cache=off"; do
         echo "Testing: cache='$cache' wce='$wce'"
-        echo "info block" \
+        echo '{"execute":"query-block"}' \
             | run_qemu $SYSEMU_EXTRA_ARGS -drive 
"$SYSEMU_DRIVE_ARG,cache=$cache" \
                        -device "virtio-blk,drive=none0$wce" \
-            | grep -e "Testing" -e "Cache mode"
+            | grep -o '"writeback": *[a-z]*'
     done
 done
 
diff --git a/tests/qemu-iotests/157.out b/tests/qemu-iotests/157.out
index fdc807f541f3..f6c345f143cc 100644
--- a/tests/qemu-iotests/157.out
+++ b/tests/qemu-iotests/157.out
@@ -4,19 +4,19 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 === Setting WCE with qdev and with manually created BB ===
 
 Testing: cache='writeback' wce=''
-    Cache mode:       writeback
+"writeback": true
 Testing: cache='writeback' wce=',write-cache=auto'
-    Cache mode:       writeback
+"writeback": true
 Testing: cache='writeback' wce=',write-cache=on'
-    Cache mode:       writeback
+"writeback": true
 Testing: cache='writeback' wce=',write-cache=off'
-    Cache mode:       writethrough
+"writeback": false
 Testing: cache='writethrough' wce=''
-    Cache mode:       writethrough
+"writeback": false
 Testing: cache='writethrough' wce=',write-cache=auto'
-    Cache mode:       writethrough
+"writeback": false
 Testing: cache='writethrough' wce=',write-cache=on'
-    Cache mode:       writeback
+"writeback": true
 Testing: cache='writethrough' wce=',write-cache=off'
-    Cache mode:       writethrough
+"writeback": false
 *** done

-- 
2.56.0.rc0.29.g47ce80527c56


Reply via email to