@@ -68,7 +68,9 @@ fi
_make_test_img 4G
$QEMU_IO -c "write -P 55 3G 1k" "$TEST_IMG" | _filter_qemu_io
IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
- _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_create
+ _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | \
+ _filter_img_create_backing_file | \
+ _filter_img_create
$QEMU_IO -f qcow2 -c "write -z -u 1M 64k" "$TEST_WRAP" | _filter_qemu_io
# Ensure that a read of two clusters, but where one is already allocated,
@@ -5,7 +5,7 @@ QA output created by 197
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296
wrote 1024/1024 bytes at offset 3221225472
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=BACKING_FILE backing_fmt=IMGFMT
wrote 65536/65536 bytes at offset 1048576
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 131072/131072 bytes at offset 1048576
@@ -65,7 +65,9 @@ fi
_make_test_img 4G
$QEMU_IO -c "write -P 55 3G 1k" "$TEST_IMG" | _filter_qemu_io
IMGPROTO=file IMGFMT=qcow2 TEST_IMG_FILE="$TEST_WRAP" \
- _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | _filter_img_create
+ _make_test_img --no-opts -F "$IMGFMT" -b "$TEST_IMG" | \
+ _filter_img_create_backing_file | \
+ _filter_img_create
$QEMU_IO -f qcow2 -c "write -z -u 1M 64k" "$TEST_WRAP" | _filter_qemu_io
# Ensure that a read of two clusters, but where one is already allocated,
@@ -5,7 +5,7 @@ QA output created by 215
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=4294967296
wrote 1024/1024 bytes at offset 3221225472
1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=TEST_DIR/t.IMGFMT backing_fmt=IMGFMT
+Formatting 'TEST_DIR/t.wrap.IMGFMT', fmt=IMGFMT size=4294967296 backing_file=BACKING_FILE backing_fmt=IMGFMT
wrote 65536/65536 bytes at offset 1048576
64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
read 131072/131072 bytes at offset 1048576
@@ -206,6 +206,14 @@ _filter_img_create()
done
}
+# When creating additional images with different IMGPROTO, IMGFMT, etc than the
+# main test image, _filter_img_create cannot filter backing_file since it
+# contains different IMGPROTO, IMGFMT, etc values than currently in use.
+_filter_img_create_backing_file()
+{
+ sed -e "s/ backing_file=[^ ]*/ backing_file=BACKING_FILE/g"
+}
+
_filter_img_create_size()
{
gsed -e "s# size=[0-9]\\+# size=SIZE#g"
197 and 215 modify IMGPROTO, IMGFMT, etc temporarily while creating an additional image file after the main test image. The backing file name still has the old IMGPROTO, IMGFMT, etc. This means _filter_img_create will not filter the backing_file= output from qemu-img. Add a helper that filters backing_file= output so these test cases are more robust. This will be necessary in order to enable the io_uring protocol driver in qemu-iotests. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> --- tests/qemu-iotests/197 | 4 +++- tests/qemu-iotests/197.out | 2 +- tests/qemu-iotests/215 | 4 +++- tests/qemu-iotests/215.out | 2 +- tests/qemu-iotests/common.filter | 8 ++++++++ 5 files changed, 16 insertions(+), 4 deletions(-)