Skip to contentSkip to conversation

tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

PATCH In review Michael Tokarev 2 participants 2 messages Aug 5, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/qemu-iotests/tests/mirror-sparse: skip if O_DIRECT is not supported

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 _supported_cache_modes none directsync.

Fixes c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches"

---
v2: use _supported_cache_modes none directsync instead of _require_o_direct
as suggested by Philippe.

 tests/qemu-iotests/tests/mirror-sparse | 1 +
 1 file changed, 1 insertion(+)
tests/qemu-iotests/tests/mirror-sparse +1 -0
index cfcaa600ab..3b183eea88 100755
@@ -40,6 +40,7 @@ cd ..
 _supported_fmt qcow2 raw  # Format of the source. dst is always raw file
 _supported_proto file
 _supported_os Linux
+_supported_cache_modes none directsync
 _require_disk_usage
 
 echo
Signature · 1 line
2.47.2
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Michael Tokarev

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 _supported_cache_modes none directsync.

Quoted 8 lines
Fixes c0ddcb2cbc146e "tests: Add iotest mirror-sparse for recent patches"

---
v2: use _supported_cache_modes none directsync instead of _require_o_direct
as suggested by Philippe.

 tests/qemu-iotests/tests/mirror-sparse | 1 +
 1 file changed, 1 insertion(+)