diff options
author | Fam Zheng <famz@redhat.com> | 2017-04-20 08:54:28 +0800 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2017-04-27 16:01:11 +0200 |
commit | 24dfdfd0ff79ea094c41eb34d9acdc0a689d5617 (patch) | |
tree | b0c245e4b6f6ec492ccebd62f79b24109599fbe8 /tests/qemu-iotests/109 | |
parent | 8248169497ec8b15504815e86bb85b588dbe0592 (diff) |
iotests: 109: Filter out "len" of failed jobs
Mirror calculates job len from current I/O progress:
s->common.len = s->common.offset +
(cnt + s->sectors_in_flight) * BDRV_SECTOR_SIZE;
The final "len" of a failed mirror job in iotests 109 depends on the
subtle timing of the completion of read and write issued in the first
mirror iteration. The second iteration may or may not have run when the
I/O error happens, resulting in non-deterministic output of the
BLOCK_JOB_COMPLETED event text.
Similar to what was done in a752e4786, filter out the field to make the
test robust.
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/109')
-rwxr-xr-x | tests/qemu-iotests/109 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/qemu-iotests/109 b/tests/qemu-iotests/109 index 6161633a52..3b496a3918 100755 --- a/tests/qemu-iotests/109 +++ b/tests/qemu-iotests/109 @@ -81,7 +81,8 @@ for fmt in qcow qcow2 qed vdi vmdk vpc; do # This first test should fail: The image format was probed, we may not # write an image header at the start of the image - run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" + run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" | + _filter_block_job_len $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io @@ -104,7 +105,8 @@ for sample_img in empty.bochs iotest-dirtylog-10G-4M.vhdx parallels-v1 \ _make_test_img 64M bzcat "$SAMPLE_IMG_DIR/$sample_img.bz2" > "$TEST_IMG.src" - run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" | _filter_block_job_offset + run_qemu "$TEST_IMG" "$TEST_IMG.src" "" "BLOCK_JOB_ERROR" | + _filter_block_job_offset | _filter_block_job_len $QEMU_IO -c 'read -P 0 0 64k' "$TEST_IMG" | _filter_qemu_io run_qemu "$TEST_IMG" "$TEST_IMG.src" "'format': 'raw'," "BLOCK_JOB_READY" |