]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fadvise: (tests) skip test on tmpfs
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 17 Apr 2023 03:21:47 +0000 (05:21 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Mon, 17 Apr 2023 07:32:38 +0000 (09:32 +0200)
On tmpfs files are always in RAM, which is reflected in mincore().

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
tests/ts/fadvise/drop

index 877d5ab6b5067175374ee14e3e5f0c47d5518370..7c7eee5dc25a34f0885ad161004b9d18418f3de2 100755 (executable)
@@ -8,6 +8,7 @@ ts_init "$*"
 
 ts_check_test_command "$TS_CMD_FADVISE"
 ts_check_test_command "$TS_CMD_FINCORE"
+ts_check_test_command "$TS_CMD_FINDMNT"
 
 ts_check_prog "dd"
 ts_check_prog "sleep"
@@ -18,6 +19,11 @@ FILE="ddtest"
 BS=4k
 COUNT=8
 
+FILE_FS="$("$TS_CMD_FINDMNT" -nr -o FSTYPE -T "$PWD")"
+if [[ "$FILE_FS" = "tmpfs" ]]; then
+       ts_skip "fincore does not work on tmpfs"
+fi
+
 create_file() {
     dd if=/dev/zero of="$FILE" bs=$BS count=$COUNT conv=fsync >& /dev/null
 }