]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: skip fallocate/zero-range test when /proc/sys/vm/drop_caches is not writable
authorWanBingjiang <wanbingjiang@webray.com.cn>
Thu, 7 May 2026 07:27:31 +0000 (15:27 +0800)
committerWanBingjiang <wanbingjiang@webray.com.cn>
Thu, 7 May 2026 07:27:31 +0000 (15:27 +0800)
The build (compat, ubuntu:18.04) CI job runs inside a Docker container
where /proc/sys/vm/drop_caches is read-only. Falling back to fallocate
--report-holes with stale VFS cache yields 0 holes instead of 1, causing
the test to fail.

tests/ts/fallocate/zero-range

index ecf9e924e26ae726d01597e87eca9eb660e8bbb1..b685ee8eff421352b5533ffd950a1d420e2ac5d1 100755 (executable)
@@ -20,6 +20,7 @@ TS_DESC="zero-range"
 . "$TS_TOPDIR"/functions.sh
 ts_init "$*"
 ts_skip_nonroot
+[ -w /proc/sys/vm/drop_caches ] || ts_skip "/proc/sys/vm/drop_caches not writable"
 
 ts_check_test_command "$TS_CMD_FALLOCATE"
 ts_check_test_command "$TS_CMD_FINDMNT"