[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 06/12] iotests: 153: Wait for an answer to QMP comman
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 06/12] iotests: 153: Wait for an answer to QMP commands |
Date: |
Tue, 19 Mar 2019 16:46:14 +0100 |
From: Sergio Lopez <address@hidden>
There are various actions in this test that must be executed
sequentially, as the result of it depends on the state triggered by the
previous one.
If the last argument of _send_qemu_cmd() is an empty string, it just
sends the QMP commands without waiting for an answer. While unlikely, it
may happen that the next action in the test gets invoked before QEMU
processes the QMP request.
This issue seems to be easier to reproduce on servers with limited
resources or highly loaded.
With this change, we wait for an answer on all _send_qemu_cmd() calls.
Signed-off-by: Sergio Lopez <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
tests/qemu-iotests/153 | 12 ++++++------
tests/qemu-iotests/153.out | 6 ++++++
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index c989c2495f..08ad8a6730 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -155,7 +155,7 @@ for opts1 in "" "read-only=on"
"read-only=on,force-share=on"; do
_img_info -U | grep 'file format'
fi
done
- _send_qemu_cmd $h "{ 'execute': 'quit', }" ""
+ _send_qemu_cmd $h "{ 'execute': 'quit' }" ''
echo
echo "Round done"
_cleanup_qemu
@@ -219,7 +219,7 @@ echo "Adding drive"
_send_qemu_cmd $QEMU_HANDLE \
"{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_add 0
if=none,id=d0,file=${TEST_IMG}' } }" \
- ""
+ 'return'
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
@@ -230,7 +230,7 @@ echo "== Closing an image should unlock it =="
_send_qemu_cmd $QEMU_HANDLE \
"{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_del d0' } }" \
- ""
+ 'return'
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
@@ -239,7 +239,7 @@ for d in d0 d1; do
_send_qemu_cmd $QEMU_HANDLE \
"{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_add 0
if=none,id=$d,file=${TEST_IMG},readonly=on' } }" \
- ""
+ 'return'
done
_run_cmd $QEMU_IMG info "${TEST_IMG}"
@@ -247,7 +247,7 @@ _run_cmd $QEMU_IMG info "${TEST_IMG}"
_send_qemu_cmd $QEMU_HANDLE \
"{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_del d0' } }" \
- ""
+ 'return'
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
@@ -255,7 +255,7 @@ echo "Closing the other"
_send_qemu_cmd $QEMU_HANDLE \
"{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_del d1' } }" \
- ""
+ 'return'
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index 884254868c..9747ce3c41 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -417,6 +417,7 @@ Is another process using the image [TEST_DIR/t.qcow2]?
_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
{"return": {}}
Adding drive
+{"return": "OKrn"}
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
@@ -425,16 +426,21 @@ Creating overlay with qemu-img when the guest is running
should be allowed
_qemu_img_wrapper create -f qcow2 -b TEST_DIR/t.qcow2 TEST_DIR/t.qcow2.overlay
== Closing an image should unlock it ==
+{"return": ""}
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
Adding two and closing one
+{"return": "OKrn"}
+{"return": "OKrn"}
_qemu_img_wrapper info TEST_DIR/t.qcow2
+{"return": ""}
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
can't open device TEST_DIR/t.qcow2: Failed to get "write" lock
Is another process using the image [TEST_DIR/t.qcow2]?
Closing the other
+{"return": ""}
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
--
2.20.1
- [Qemu-block] [PULL 00/12] Block layer patches, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 03/12] qapi: fix block-latency-histogram-set description and examples, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 01/12] mirror: Confirm we're quiesced only if the job is paused or cancelled, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 06/12] iotests: 153: Wait for an answer to QMP commands,
Kevin Wolf <=
- [Qemu-block] [PULL 05/12] block: Silence Coverity in bdrv_drop_intermediate(), Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 07/12] vl: Fix to create migration object before block backends again, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 02/12] qcow2: Fix data file error condition in qcow2_co_create(), Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 04/12] vmdk: Support version=3 in VMDK descriptor files, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 09/12] blockjob: fix user pause in block_job_error_action, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 08/12] qemu-iotests: Fix 232 for non-qcow2, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 12/12] qemu-iotests: Treat custom TEST_DIR in 051, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 10/12] block: Make bdrv_{copy_on_read, crypto_luks, replication} static, Kevin Wolf, 2019/03/19
- [Qemu-block] [PULL 11/12] blockdev: Check @replaces in blockdev_mirror_common, Kevin Wolf, 2019/03/19
- Re: [Qemu-block] [PULL 00/12] Block layer patches, Peter Maydell, 2019/03/19