Skip to contentSkip to conversation

iotest: Fix filtering order in 226

PATCH Applied Max Reitz 3 participants 3 messages Jul 13, 2018 – Jul 23, 2018

lore
Share & tools
lore

Max Reitz

author
#0 lore raw

PATCH 1/1 iotest: Fix filtering order in 226

The test directory should be filtered before the image format, otherwise the test will fail if the image format is part of the test directory, like so:

[...]
-can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory +can't open: Could not open '/tmp/test-IMGFMT/t.IMGFMT': Is a directory [...]

---
 tests/qemu-iotests/226 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/qemu-iotests/226 +2 -2
index 460aea2fc9..a5a1f6720a 100755
@@ -52,10 +52,10 @@ for PROTO in "file" "host_device" "host_cdrom"; do
     echo "=== Testing with driver:$PROTO ==="
     echo
     echo "== Testing RO =="
-    $QEMU_IO -c "open -r -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_imgfmt | _filter_testdir
+    $QEMU_IO -c "open -r -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
     $QEMU_IO -c "open -r -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
     echo "== Testing RW =="
-    $QEMU_IO -c "open -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_imgfmt | _filter_testdir
+    $QEMU_IO -c "open -o driver=$PROTO,filename=$TEST_IMG" 2>&1 | _filter_testdir | _filter_imgfmt
     $QEMU_IO -c "open -o driver=$PROTO,filename=/dev/null" 2>&1 | _filter_imgfmt
 done
 
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Max Reitz

The test directory should be filtered before the image format, otherwise the test will fail if the image format is part of the test directory, like so:

[...]

(quoted diff) +1 -1
-can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
+can't open: Could not open '/tmp/test-IMGFMT/t.IMGFMT': Is a directory
[...]

Too many gotchas in our test suite.

Thanks :(

Applied
#2 lore raw

Am 13.07.2018 um 22:14 hat John Snow geschrieben:

Quoted 12 lines · Max Reitz
Quoted 9 lines

The test directory should be filtered before the image format, otherwise the test will fail if the image format is part of the test directory, like so:

[...]

(quoted diff) +1 -1
-can't open: Could not open 'TEST_DIR/t.IMGFMT': Is a directory
+can't open: Could not open '/tmp/test-IMGFMT/t.IMGFMT': Is a directory
[...]
Quoted 5 lines
Quoted 1 line

Too many gotchas in our test suite.

Thanks :(

Maybe we should start writing tests for our tests? ;-)

Thanks, applied to the block branch.

Kevin