coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: fix issues with recently added tail test


From: Pádraig Brady
Subject: [PATCH] tests: fix issues with recently added tail test
Date: Wed, 7 Jun 2017 00:22:57 -0700

* tests/tail-2/inotify-dir-recreate.sh: Skip when
inotify is not usable.  Also remove a bash specific &> construct.
---
 tests/tail-2/inotify-dir-recreate.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/tail-2/inotify-dir-recreate.sh 
b/tests/tail-2/inotify-dir-recreate.sh
index eaa8422..02ddf96 100755
--- a/tests/tail-2/inotify-dir-recreate.sh
+++ b/tests/tail-2/inotify-dir-recreate.sh
@@ -3,7 +3,7 @@
 # of the watched file was removed and recreated.
 # (...instead of getting stuck forever)
 
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2017 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -21,6 +21,8 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ tail
 
+grep '^#define HAVE_INOTIFY 1' "$CONFIG_HEADER" >/dev/null && is_local_dir_ . \
+  || skip_ 'inotify is not supported'
 
 # Terminate any background tail process
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }
@@ -52,10 +54,14 @@ grep_timeout_ ()
 mkdir dir && echo 'inotify' > dir/file || framework_failure_
 
 #tail must print content of the file to stdout, verify
-timeout 60 tail -F dir/file &>out & pid=$!
+timeout 60 tail -F dir/file >out 2>&1 & pid=$!
 grep_timeout_ 'inotify' 'out' ||
 { cleanup_fail_ 'file to be tailed does not exist'; }
 
+inotify_failed_re='inotify (resources exhausted|cannot be used)'
+grep -E "$inotify_failed_re" out &&
+  skip_ "inotify can't be used"
+
 # Remove the directory, should get the message about the deletion
 rm -r dir || framework_failure_
 grep_timeout_ 'polling' 'out' ||
-- 
2.9.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]