iotests: Fix 195 if IMGFMT is part of TEST_DIR
PATCH 1/1 iotests: Fix 195 if IMGFMT is part of TEST_DIR
do_run_qemu() in iotest 195 first applies _filter_imgfmt when printing qemu's command line and _filter_testdir only afterwards. Therefore, if the image format is part of the test directory path, _filter_testdir will no longer apply and the actual output will differ from the reference output even in case of success.
For example, TEST_DIR might be "/tmp/test-qcow2", in which case _filter_imgfmt first transforms this to "/tmp/test-IMGFMT" which is no longer recognized as the TEST_DIR by _filter_testdir.
Fix this by not applying _filter_imgfmt in do_run_qemu() but in run_qemu() instead, and only after _filter_testdir.
--- tests/qemu-iotests/195 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
tests/qemu-iotests/195 +4 -3
@@ -44,15 +44,16 @@ _supported_os Linux function do_run_qemu() { - echo Testing: "$@" | _filter_imgfmt + echo Testing: "$@" $QEMU -nographic -qmp-pretty stdio -serial none "$@" echo } function run_qemu() { - do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qemu | _filter_qmp \ - | _filter_qemu_io | _filter_generated_node_ids + do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qemu \ + | _filter_qmp | _filter_qemu_io \ + | _filter_generated_node_ids } size=64M
Signature · 1 line
2.13.5
Quoted 10 lines · Max Reitz
do_run_qemu()in iotest 195 first applies_filter_imgfmtwhen printing qemu's command line and_filter_testdironly afterwards. Therefore, if the image format is part of the test directory path,_filter_testdirwill no longer apply and the actual output will differ from the reference output even in case of success.For example,
TEST_DIRmight be "/tmp/test-qcow2", in which case_filter_imgfmtfirst transforms this to "/tmp/test-IMGFMT" which is no longer recognized as theTEST_DIRby_filter_testdir.
Quoted 7 lines
Fix this by not applying
_filter_imgfmtindo_run_qemu()but inrun_qemu()instead, and only after_filter_testdir.Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/195 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Max Reitz
AppliedQuoted 10 lines · Max Reitz
do_run_qemu()in iotest 195 first applies_filter_imgfmtwhen printing qemu's command line and_filter_testdironly afterwards. Therefore, if the image format is part of the test directory path,_filter_testdirwill no longer apply and the actual output will differ from the reference output even in case of success.For example,
TEST_DIRmight be "/tmp/test-qcow2", in which case_filter_imgfmtfirst transforms this to "/tmp/test-IMGFMT" which is no longer recognized as theTEST_DIRby_filter_testdir.
Quoted 7 lines
Fix this by not applying
_filter_imgfmtindo_run_qemu()but inrun_qemu()instead, and only after_filter_testdir.Signed-off-by Max Reitz <[email protected]>--- tests/qemu-iotests/195 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Applied to my block branch.
Max