This test uses cache.direct=true, but does not check if O_DIRECT
is supported by the underlying filesystem, and fails, for example,
on a tmpfs (which is rather common on various auto-builders, in CI,
etc).

Fix this by using _require_o_direct.

This example shows where our testing framework is significantly
lacking.  In this test, qemu produces an error message on stderr
at startup, because it can't use O_DIRECT mode.  But this error
message is not shown anywhere at all, even when running this test
separately outside of meson framework, - stderr is completely
hidden, and the only error we're getting is

 +Timeout waiting for capabilities on handle 0

so it's rather painful to find what the actual error is.  I think
that besides this change, we should also change the testing framework
to show stderr at least in case of test failure, and especially when
the failure occurs at the very beginning when we're checking for
sanity.

Fixes: c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches"
Signed-off-by: Michael Tokarev <m...@tls.msk.ru>
---
 tests/qemu-iotests/tests/mirror-sparse | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/qemu-iotests/tests/mirror-sparse 
b/tests/qemu-iotests/tests/mirror-sparse
index cfcaa600ab..19843a622c 100755
--- a/tests/qemu-iotests/tests/mirror-sparse
+++ b/tests/qemu-iotests/tests/mirror-sparse
@@ -41,6 +41,7 @@ _supported_fmt qcow2 raw  # Format of the source. dst is 
always raw file
 _supported_proto file
 _supported_os Linux
 _require_disk_usage
+_require_o_direct
 
 echo
 echo "=== Initial image setup ==="
-- 
2.47.2


Reply via email to