Skip to contentSkip to conversation

make check-block/qemu-iotests fixes

PATCH Applied Kevin Wolf 3 participants 5 messages Sep 30, 2014 – Oct 2, 2014

lore
Share & tools
lore

Kevin Wolf

author
#0 lore raw

cover make check-block/qemu-iotests fixes

Kevin Wolf (2):
make check-block: Use default cache modes
qemu-iotests: Fix supported cache modes for 052

 tests/qemu-iotests-quick.sh | 2 +-
 tests/qemu-iotests/052      | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PATCH 1/2 make check-block: Use default cache modes

When qemu-iotests only gave a choice between cache=none and cache=writethrough, we picked cache=none because it was the option that would complete the test in finite time. Some tests could only work for one of the two options and would be skipped with cache=none, but that was an acceptable trade-off at the time.

Today, however, qemu-iotests is a bit more flexible than that and you can specify any of the cache modes supported by qemu. The default is writeback, like in qemu, which is fast and (unlike cache=none) compatible with any host filesystem. Test cases that have specific requirements for the cache mode can also specify a different default.

In order to get a fast test run that works everywhere and doesn't skip tests that need a different cache mode, not specifying any cache mode and instead relying on the default is the best we can do today.

---
 tests/qemu-iotests-quick.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qemu-iotests-quick.sh +1 -1
index 8a9a4c6..12af731 100755
@@ -3,6 +3,6 @@
 cd tests/qemu-iotests
 
 ret=0
-./check -T -nocache -qcow2 -g quick || ret=1
+./check -T -qcow2 -g quick || ret=1
 
 exit $ret
Signature · 1 line
1.8.3.1
author
#2 lore raw

PATCH 2/2 qemu-iotests: Fix supported cache modes for 052

In reply to Kevin Wolf

The requirement for this test case is really "no O_DIRECT", because the temporary snapshot for BDRV_O_SNAPSHOT is created in /tmp, which often is a tmpfs.

Commit f210a83c ('qemu-iotests: Add _default_cache_mode and _supported_cache_modes') turned the restriction into writethrough-only, but that's not really necessary.

Allow to run the test for any non-O_DIRECT cache modes, and use the global default of writeback if no cache mode is specified.

---
 tests/qemu-iotests/052 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tests/qemu-iotests/052 +3 -2
index 6bdae92..61959e2 100755
@@ -41,8 +41,9 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt generic
 _supported_proto file
 _supported_os Linux
-_default_cache_mode "writethrough"
-_supported_cache_modes "writethrough"
+
+# Don't do O_DIRECT on tmpfs
+_supported_cache_modes "writeback" "writethrough" "unsafe"
 
 size=128M
 _make_test_img $size
Signature · 1 line
1.8.3.1