summaryrefslogtreecommitdiff
path: root/tests/touch/empty-file
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-09-07 15:13:48 +0000
committerJim Meyering <jim@meyering.net>1998-09-07 15:13:48 +0000
commita3c0837bc3c8592f5d3886ef13c1f55815a88a2c (patch)
treeea32c92fa42ee46a4d0aba3506e115549753626b /tests/touch/empty-file
parent834b042b9332992285ea3a126d748658d41ceeb2 (diff)
downloadcoreutils-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-xtests/touch/empty-file19
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