>From e77dc43cae17883cefb5766e6932fde359806dbd Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 29 Mar 2021 17:35:08 +0200 Subject: [PATCH] iotests/qsd-jobs: Make output deterministic By making the commit job perform work and limiting its speed, we can prevent it from reaching the 'ready' state before the 'quit' command is accepted by qemu. Instead, it will only change its state once the 'quit' command is received (to 'aborting'). Reported-by: Peter Maydell Signed-off-by: Max Reitz --- tests/qemu-iotests/tests/qsd-jobs | 11 ++++++++++- tests/qemu-iotests/tests/qsd-jobs.out | 14 +++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/tests/qsd-jobs b/tests/qemu-iotests/tests/qsd-jobs index 972b6b3898..4eb0b9b2e2 100755 --- a/tests/qemu-iotests/tests/qsd-jobs +++ b/tests/qemu-iotests/tests/qsd-jobs @@ -51,12 +51,21 @@ echo echo "=== Job still present at shutdown ===" echo +# This amount of data will be committed instantaneously, but the +# commit job will still wait accordingly to its @speed parameter +# before announcing itself to be ready. (We do not want the job +# to be ready before quitting qemu, so we get deterministic +# output.) +$QEMU_IO -c 'write -P 42 0 64k' "$TEST_IMG" | _filter_qemu_io +echo + # Just make sure that this doesn't crash $QSD --chardev stdio,id=stdio --monitor chardev=stdio \ --blockdev node-name=file0,driver=file,filename="$TEST_IMG" \ --blockdev node-name=fmt0,driver=qcow2,file=file0 <