diff options
author | Jim Meyering <jim@meyering.net> | 1998-09-07 15:13:48 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-09-07 15:13:48 +0000 |
commit | a3c0837bc3c8592f5d3886ef13c1f55815a88a2c (patch) | |
tree | ea32c92fa42ee46a4d0aba3506e115549753626b /tests/touch/empty-file | |
parent | 834b042b9332992285ea3a126d748658d41ceeb2 (diff) | |
download | coreutils-a3c0837bc3c8592f5d3886ef13c1f55815a88a2c.tar.xz |
Upon failure, suggest how to rerun the test
with longer delay, in case NFS clock skew was the cause of the failure.
Reported by Kaveh Ghazi.
Diffstat (limited to 'tests/touch/empty-file')
-rwxr-xr-x | tests/touch/empty-file | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/touch/empty-file b/tests/touch/empty-file index 52175dee7..3089ce4de 100755 --- a/tests/touch/empty-file +++ b/tests/touch/empty-file @@ -12,6 +12,11 @@ if test "$VERBOSE" = yes; then $TOUCH --version fi +DEFAULT_SLEEP_SECONDS=2 +SLEEP_SECONDS=${SLEEP_SECONDS=$DEFAULT_SLEEP_SECONDS} + +fail=0 + # FIXME: find writable directories on other partitions # and run the test in those directories, too. @@ -32,14 +37,14 @@ if test $framework_failure = 1; then exit 1 fi -sleep 2 +sleep $SLEEP_SECONDS for d in $TOUCH_DIR_LIST; do $TOUCH $d/a || fail=1 set x `$LS -t $d/a $d/b` test "$*" = "x $d/a $d/b" || fail=1 done -sleep 2 +sleep $SLEEP_SECONDS for d in $TOUCH_DIR_LIST; do $TOUCH $d/b set x `$LS -t $d/a $d/b` @@ -48,4 +53,14 @@ for d in $TOUCH_DIR_LIST; do $RM -rf $d/a $d/b done +if test $fail != 0; then + cat 1>&2 <<EOF +*** This test has just failed. That can happen when the test is run in an +*** NFS-mounted directory on a system whose clock is not well synchronized +*** with that of the NFS server. If you think that is the reason, set the +*** environment variable SLEEP_SECONDS to some number of seconds larger than +*** the default of $DEFAULT_SLEEP_SECONDS and rerun the test. +EOF +fi + exit $fail |