]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tail: avoid false failure with overlayfs
authorPádraig Brady <P@draigBrady.com>
Sun, 21 Sep 2025 12:45:54 +0000 (13:45 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 21 Sep 2025 12:45:54 +0000 (13:45 +0100)
* tests/tail/inotify-dir-recreate.sh: Add an extra check
that inotify is in use, as it's required for this test.
Inotify is avoided with overlayfs for which the
df --local check is not sufficient exclusion for.

tests/tail/inotify-dir-recreate.sh

index e99abd842fa2b3065e8aa5e3860e32879ca16714..569a3b1aa77480efc852178fb255a307e9a24694 100755 (executable)
@@ -24,6 +24,14 @@ print_ver_ tail
 grep '^#define HAVE_INOTIFY 1' "$CONFIG_HEADER" >/dev/null && is_local_dir_ . \
   || skip_ 'inotify is not supported'
 
+# There may be a mismatch between is_local_dir_ (gnulib's remoteness check),
+# and coreutils' is_local_fs_type(), so double check we're using inotify.
+touch file.strace
+require_strace_ 'inotify_add_watch'
+returns_ 124 timeout .1 strace -e inotify_add_watch -o strace.out \
+  tail -F file.strace || fail=1
+grep 'inotify' strace.out || skip_ 'inotify not detected'
+
 # Terminate any background tail process
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }