]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix recent regression in tail inotify test
authorPádraig Brady <P@draigBrady.com>
Thu, 5 Feb 2015 16:32:49 +0000 (16:32 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 6 Feb 2015 09:48:13 +0000 (09:48 +0000)
* tests/tail-2/inotify-rotate.sh (cleanup_fail_): Set fail=1
so that failures are identified.  Regression in v8.23-63-g111a2b9
Also use print_ver_ rather than open coding --verbose support.
Also check for more than a single 'b' which seems brittle.

tests/tail-2/inotify-rotate.sh

index 63ab2f1d23b2c391cbcc031ee164622b0fce5c42..913bf992cb8e3b912a6207a8a1cd71bf01c7eb0c 100755 (executable)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if test "$VERBOSE" = yes; then
-  set -x
-  tail --version
-fi
-
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ tail
 
 grep '^#define HAVE_INOTIFY 1' "$CONFIG_HEADER" >/dev/null \
   || expensive_
@@ -44,6 +40,7 @@ cleanup_fail()
   cat out
   warn_ $1
   kill $pid
+  fail=1
 }
 
 # Perform at least this many iterations, because on multi-core systems
@@ -59,9 +56,9 @@ for i in $(seq 50); do
     timeout 60 tail -s.1 --max-unchanged-stats=1 -F k > out 2>&1 &
     pid=$!
 
-    echo b > k;
-    # wait for b to appear in out
-    grep_timeout 'b' || { cleanup_fail 'failed to find b in out'; break; }
+    echo 'tailed' > k;
+    # wait for 'tailed' to appear in out
+    grep_timeout 'tailed' || { cleanup_fail 'failed to find "tailed"'; break; }
 
     mv x k
     # wait for tail to detect the rename