2 # Test some of ls's sorting options.
4 # Copyright (C) 1998-2001, 2004, 2007-2009 Free Software Foundation, Inc.
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 if test "$VERBOSE" = yes; then
26 # Avoid any possible glitches due to daylight-saving changes near the
27 # time stamps used during the test.
39 touch -m -d "$t3" a || framework_failure
40 touch -m -d "$t2" b || framework_failure
41 touch -m -d "$t1" c || framework_failure
43 touch -a -d "$u3" c || framework_failure
44 touch -a -d "$u2" b || framework_failure
45 # Make sure A has ctime at least 1 second more recent than C's.
47 touch -a -d "$u1" a || framework_failure
50 # A has ctime more recent than C.
52 test "$*" = 'a c' || fail=1
54 # Sleep so long in an attempt to avoid spurious failures
55 # due to NFS caching and/or clock skew.
58 # Create a link, updating c's ctime.
59 ln c d || framework_failure
61 # Before we go any further, verify that touch's -m option works.
62 set -- `ls --full -l a`
64 *" $t3:00.000000000 +0000 a") ;;
66 # This might be what's making HPUX 11 systems fail this test.
68 A basic test of touch -m has just failed, so the subsequent
69 tests in this file will not be run.
71 In the output below, the date of last modification for \`a' should
80 # Now test touch's -a option.
81 set -- `ls --full -lu a`
83 *" $u1:00.000000000 +0000 a") ;;
85 # This might be what's making HPUX 11 systems fail this test.
87 A basic test of touch -a has just failed, so the subsequent
88 tests in this file will not be run.
90 In the output below, the date of last access for \`a' should
99 test "$*" = 'c b a' && : || fail=1
100 test $fail = 1 && ls -l --full-time --time=access a b c
103 test "$*" = 'a b c' && : || fail=1
104 test $fail = 1 && ls -l --full-time a b c
106 # Now, C should have ctime more recent than A.
108 if test "$*" = 'c a'; then
111 # In spite of documentation, (e.g., stat(2)), neither link nor chmod
112 # update a file's st_ctime on SunOS4.1.4.
114 failed ls ctime test -- this failure is expected at least for SunOS4.1.4
115 and for tmpfs file systems on Solaris 5.5.1.
117 In the output below, `c' should have had a ctime more recent than
118 that of `a', but does not.
121 ls -ctl --full-time a c