2 # Make sure touch can set the mtime on an empty file.
3 # Volker Borchert reported that touch 3.16r (and presumably all before that)
4 # fails to work on SunOS 4.1.3 with `most of the recommended patches' when
5 # the empty file is on an NFS-mounted 4.2 volume.
7 if test "$VERBOSE" = yes; then
12 DEFAULT_SLEEP_SECONDS=2
13 SLEEP_SECONDS=${SLEEP_SECONDS=$DEFAULT_SLEEP_SECONDS}
17 # FIXME: find writable directories on other partitions
18 # and run the test in those directories, too.
24 for d in $TOUCH_DIR_LIST; do
26 > $d/a || framework_failure=1
27 test -f $d/a || framework_failure=1
28 > $d/b || framework_failure=1
29 test -f $d/b || framework_failure=1
30 > $d/c || framework_failure=1
31 test -f $d/c || framework_failure=1
34 if test $framework_failure = 1; then
35 echo 'failure in testing framework'
39 echo sleeping for $SLEEP_SECONDS seconds...
41 for d in $TOUCH_DIR_LIST; do
43 set x `ls -t $d/a $d/b`
44 test "$*" = "x $d/a $d/b" || fail=1
47 echo sleeping for $SLEEP_SECONDS seconds...
49 for d in $TOUCH_DIR_LIST; do
51 set x `ls -t $d/a $d/b`
52 test "$*" = "x $d/b $d/a" || fail=1
54 if touch - 1< $d/c 2> /dev/null; then
55 set x `ls -t $d/a $d/c`
56 test "$*" = "x $d/c $d/a" || fail=1
62 if test $fail != 0; then
64 *** This test has just failed. That can happen when the test is run in an
65 *** NFS-mounted directory on a system whose clock is not well synchronized
66 *** with that of the NFS server. If you think that is the reason, set the
67 *** environment variable SLEEP_SECONDS to some number of seconds larger than
68 *** the default of $DEFAULT_SLEEP_SECONDS and rerun the test.