]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fincore: (tests) fix tmpfs detection for out-of-tree builds
authorLeonid Znamenok <respublica@altlinux.org>
Mon, 30 Mar 2026 20:33:46 +0000 (00:33 +0400)
committerLeonid Znamenok <respublica@altlinux.org>
Mon, 30 Mar 2026 20:33:46 +0000 (00:33 +0400)
The tmpfs check used $PWD which points to the source directory, not
to the output directory where test files are actually created. When
tests are run with --builddir on tmpfs (e.g. /tmp), the check fails
to detect it and the test produces wrong results because O_DIRECT
has no effect on tmpfs.

Use $TS_OUTDIR instead, which is the actual directory where dd
creates test files and fincore inspects them.

tests/ts/fincore/count

index e873e2f500effa251ea1403eb3721b26b864b03f..24758fddffde0bc813a9aa0f76a2749e532f8223 100755 (executable)
@@ -9,7 +9,7 @@ ts_init "$*"
 ts_check_test_command "$TS_CMD_FINDMNT"
 ts_check_test_command "$TS_HELPER_SYSINFO"
 
-FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$PWD")"
+FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$TS_OUTDIR")"
 if [[ "$FS" = "tmpfs" || "$FS" = "overlay" || "$FS" = "" ]]; then
        ts_skip "fincore does not work on tmpfs or unknown fs"
 fi