]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: improve one of the tail --pid tests
authorPádraig Brady <P@draigBrady.com>
Wed, 12 Aug 2009 18:46:27 +0000 (19:46 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 12 Aug 2009 21:03:33 +0000 (22:03 +0100)
* tests/tail-2/pid: Speed up the test by specifying a
timeout of 100ms rather than the default 1s.  Also
skip the test instead of failing in the unlikely case
were the pid required to be missing pid is present.

tests/tail-2/pid

index b290f012c3f601cfc999361972ee1c660a0e2e7b..86e3d60c0839ce584d3eb49b28576e5ac23b325e 100755 (executable)
@@ -66,9 +66,12 @@ if test -n "$state"; then
 fi
 
 # Ensure that tail --pid=PID exits successfully when PID is dead.
-# Use an unlikely-to-be-live PID: 2^31-1
+# Use an unlikely-to-be-live PID
 getlimits_
-tail --pid=$INT_MAX -f /dev/null || fail=1
+timeout 1 tail -s.1 --pid=$PID_T_MAX -f /dev/null
+ret=$?
+test $ret = 124 && skip_test_ "pid $PID_T_MAX present"
+test $ret = 0 || fail=1
 
 # Ensure fractional sleep parameter is honored with --pid
 timeout 1 tail -s.1 -f /dev/null --pid=$PID_T_MAX