diff options
Diffstat (limited to 'tests/ls')
34 files changed, 75 insertions, 44 deletions
diff --git a/tests/ls/abmon-align.sh b/tests/ls/abmon-align.sh index 7630889e..088be160 100755 --- a/tests/ls/abmon-align.sh +++ b/tests/ls/abmon-align.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure ls output is aligned when using abbreviated months from the locale -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/block-size.sh b/tests/ls/block-size.sh index c4861629..9208b40d 100755 --- a/tests/ls/block-size.sh +++ b/tests/ls/block-size.sh @@ -1,7 +1,7 @@ #!/bin/sh # Exercise ls --block-size and related options. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/capability.sh b/tests/ls/capability.sh index 54ba296c..bd32be26 100755 --- a/tests/ls/capability.sh +++ b/tests/ls/capability.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure "ls --color" properly colorizes file with capability. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/color-clear-to-eol.sh b/tests/ls/color-clear-to-eol.sh index a9cc6e91..54878184 100755 --- a/tests/ls/color-clear-to-eol.sh +++ b/tests/ls/color-clear-to-eol.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that ls --color works well when a colored name is wrapped -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/color-dtype-dir.sh b/tests/ls/color-dtype-dir.sh index 559a1884..2c891727 100755 --- a/tests/ls/color-dtype-dir.sh +++ b/tests/ls/color-dtype-dir.sh @@ -4,7 +4,7 @@ # directories the same as the first one -- but only on a file system # with dirent.d_type support. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/color-norm.sh b/tests/ls/color-norm.sh index 23c01871..8d86f19a 100755 --- a/tests/ls/color-norm.sh +++ b/tests/ls/color-norm.sh @@ -1,9 +1,9 @@ #!/bin/sh # Ensure "ls --color" properly colors "normal" text and files. -# I.E. that it uses NORMAL to style non file name output and +# I.e., that it uses NORMAL to style non file name output and # file names with no associated color (unless FILE is also set). -# Copyright (C) 2010-2014 Free Software Foundation, Inc. +# Copyright (C) 2010-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/color-term.sh b/tests/ls/color-term.sh index 8eb3783a..97b0aa36 100755 --- a/tests/ls/color-term.sh +++ b/tests/ls/color-term.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure "ls --color" doesn't output colors for TERM=dumb -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2014-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/dangle.sh b/tests/ls/dangle.sh index 628f760b..d27f03fe 100755 --- a/tests/ls/dangle.sh +++ b/tests/ls/dangle.sh @@ -1,7 +1,7 @@ #!/bin/sh # Make sure ls properly handles dangling symlinks vs. ls's -L, -H, options. -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,9 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ ls +LS_MINOR_PROBLEM=1 +LS_FAILURE=2 + ln -s no-such-file dangle || framework_failure_ mkdir -p dir/sub || framework_failure_ ln -s dir slink-to-dir || framework_failure_ @@ -27,11 +30,10 @@ ln -s no-such d/dangle || framework_failure_ printf '? dangle\n' > subdir_Li_exp || framework_failure_ printf 'total 0\n? dangle\n' > subdir_Ls_exp || framework_failure_ - # This must exit nonzero. -ls -L dangle > /dev/null 2>&1 && fail=1 +returns_ $LS_FAILURE ls -L dangle > /dev/null 2>&1 || fail=1 # So must this. -ls -H dangle > /dev/null 2>&1 && fail=1 +returns_ $LS_FAILURE ls -H dangle > /dev/null 2>&1 || fail=1 # This must exit successfully. ls dangle >> out || fail=1 @@ -51,12 +53,12 @@ compare exp out || fail=1 # Ensure that ls -Li prints "?" as the inode of a dangling symlink. rm -f out -ls -Li d > out 2>/dev/null && fail=1 +returns_ $LS_MINOR_PROBLEM ls -Li d > out 2>/dev/null || fail=1 compare subdir_Li_exp out || fail=1 # Ensure that ls -Ls prints "?" as the allocation of a dangling symlink. rm -f out -ls -Ls d > out 2>/dev/null && fail=1 +returns_ $LS_MINOR_PROBLEM ls -Ls d > out 2>/dev/null || fail=1 compare subdir_Ls_exp out || fail=1 Exit $fail diff --git a/tests/ls/dired.sh b/tests/ls/dired.sh index e87590e7..6a501ad1 100755 --- a/tests/ls/dired.sh +++ b/tests/ls/dired.sh @@ -1,7 +1,7 @@ #!/bin/sh # make sure --dired option works -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/file-type.sh b/tests/ls/file-type.sh index 0afa4d4e..e594c999 100755 --- a/tests/ls/file-type.sh +++ b/tests/ls/file-type.sh @@ -1,7 +1,7 @@ #!/bin/sh # contrast ls -F, ls -p, and ls --indicator-style=file-type -# Copyright (C) 2002-2014 Free Software Foundation, Inc. +# Copyright (C) 2002-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/follow-slink.sh b/tests/ls/follow-slink.sh index 3357439a..edf6a481 100755 --- a/tests/ls/follow-slink.sh +++ b/tests/ls/follow-slink.sh @@ -1,7 +1,7 @@ #!/bin/sh # make sure ls -L always follows symlinks -# Copyright (C) 2000-2014 Free Software Foundation, Inc. +# Copyright (C) 2000-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,6 +19,8 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ ls +LS_FAILURE=2 + # Isolate output files from directory being listed mkdir dir dir/sub dir1 || framework_failure_ cd dir || framework_failure_ @@ -32,7 +34,7 @@ ls -F link > /dev/null || framework_failure_ # When explicitly listing a broken link, the command must fail. -ls -L link 2> /dev/null && fail=1 +returns_ $LS_FAILURE ls -L link 2> /dev/null || fail=1 # When encountering a broken link implicitly, Solaris 9 and OpenBSD 3.4 # list the link, provided no further information about the link needed diff --git a/tests/ls/getxattr-speedup.sh b/tests/ls/getxattr-speedup.sh index 0144571e..be43c50e 100755 --- a/tests/ls/getxattr-speedup.sh +++ b/tests/ls/getxattr-speedup.sh @@ -4,7 +4,7 @@ # This test is skipped on systems that lack LD_PRELOAD support; that's fine. # Similarly, on a system that lacks getxattr altogether, skipping it is fine. -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -55,7 +55,7 @@ gcc_shared_ k.c k.so \ seq 20 | xargs touch || framework_failure_ # Finally, run the test: -LD_PRELOAD=./k.so ls --color=always -l . || fail=1 +LD_PRELOAD=$LD_PRELOAD:./k.so ls --color=always -l . || fail=1 test -f x || skip_ "internal test failure: maybe LD_PRELOAD doesn't work?" diff --git a/tests/ls/hex-option.sh b/tests/ls/hex-option.sh new file mode 100755 index 00000000..3f915ee7 --- /dev/null +++ b/tests/ls/hex-option.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# accept hex/oct numbers to -w and -T + +# Copyright (C) 2014-2015 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src +print_ver_ ls + +ls -x -T0x10 -w010 || fail=1 + +Exit $fail diff --git a/tests/ls/infloop.sh b/tests/ls/infloop.sh index 48d356a0..34dbfb2c 100755 --- a/tests/ls/infloop.sh +++ b/tests/ls/infloop.sh @@ -2,7 +2,7 @@ # show that the following no longer makes ls infloop # mkdir loop; cd loop; ln -s ../loop sub; ls -RL # Also ensure ls exits with status = 2 in that case. -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/inode.sh b/tests/ls/inode.sh index e09efa60..ea5494e9 100755 --- a/tests/ls/inode.sh +++ b/tests/ls/inode.sh @@ -1,7 +1,7 @@ #!/bin/sh # Make sure that ls -i works properly on symlinks. -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/m-option.sh b/tests/ls/m-option.sh index 2255b6eb..ca8e01b5 100755 --- a/tests/ls/m-option.sh +++ b/tests/ls/m-option.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise the -m option -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/multihardlink.sh b/tests/ls/multihardlink.sh index 4407ba61..25ed08f3 100755 --- a/tests/ls/multihardlink.sh +++ b/tests/ls/multihardlink.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure "ls --color" properly colorizes hard linked files. -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/nameless-uid.sh b/tests/ls/nameless-uid.sh index db6c56ea..cd3a4094 100755 --- a/tests/ls/nameless-uid.sh +++ b/tests/ls/nameless-uid.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that ls -l works on files with nameless uid and/or gid -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/no-arg.sh b/tests/ls/no-arg.sh index e356a296..793080f1 100755 --- a/tests/ls/no-arg.sh +++ b/tests/ls/no-arg.sh @@ -1,7 +1,7 @@ #!/bin/sh # make sure ls and 'ls -R' do the right thing when invoked with no arguments. -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/no-cap.sh b/tests/ls/no-cap.sh index a75180c2..ecbfb31c 100755 --- a/tests/ls/no-cap.sh +++ b/tests/ls/no-cap.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that an empty "ca=" attribute disables ls's capability-checking -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -20,13 +20,14 @@ print_ver_ ls require_strace_ capget +LS_COLORS=ca=1; export LS_COLORS strace -e capget ls --color=always > /dev/null 2> out || fail=1 $EGREP 'capget\(' out || skip_ "your ls doesn't call capget" rm -f out -eval "$(TERM=xterm dircolors -b | sed 's/ca=[^:]*:/ca=:/')" -strace -e capget ls --color=always > /dev/null 2> out || fail=1 +LS_COLORS=ca=:; export LS_COLORS +strace -e capget ls --color=always > /dev/null 2> out || fail=1 $EGREP 'capget\(' out && fail=1 Exit $fail diff --git a/tests/ls/proc-selinux-segfault.sh b/tests/ls/proc-selinux-segfault.sh index 1b7a39be..333e040d 100755 --- a/tests/ls/proc-selinux-segfault.sh +++ b/tests/ls/proc-selinux-segfault.sh @@ -1,7 +1,7 @@ #!/bin/sh # ls -l /proc/sys would segfault when built against libselinux1 2.0.15-2+b1 -# Copyright (C) 2008-2014 Free Software Foundation, Inc. +# Copyright (C) 2008-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/readdir-mountpoint-inode.sh b/tests/ls/readdir-mountpoint-inode.sh index 83ebe68c..e566dc24 100755 --- a/tests/ls/readdir-mountpoint-inode.sh +++ b/tests/ls/readdir-mountpoint-inode.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that ls -i works also for mount points -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/recursive.sh b/tests/ls/recursive.sh index be2d849b..05a384c7 100755 --- a/tests/ls/recursive.sh +++ b/tests/ls/recursive.sh @@ -2,7 +2,7 @@ # 4.1.1 and 4.1.2 had a bug whereby some recursive listings # didn't include a blank line between per-directory groups of files. -# Copyright (C) 2001-2014 Free Software Foundation, Inc. +# Copyright (C) 2001-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/root-rel-symlink-color.sh b/tests/ls/root-rel-symlink-color.sh index 2318a479..0b977fcb 100755 --- a/tests/ls/root-rel-symlink-color.sh +++ b/tests/ls/root-rel-symlink-color.sh @@ -1,7 +1,7 @@ #!/bin/sh # Exercise the 8.17 ls bug with coloring relative-named symlinks in "/". -# Copyright (C) 2012-2014 Free Software Foundation, Inc. +# Copyright (C) 2012-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/rt-1.sh b/tests/ls/rt-1.sh index 99c62afe..44e02476 100755 --- a/tests/ls/rt-1.sh +++ b/tests/ls/rt-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Make sure name is used as secondary key when sorting on mtime or ctime. -# Copyright (C) 1998-2014 Free Software Foundation, Inc. +# Copyright (C) 1998-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/slink-acl.sh b/tests/ls/slink-acl.sh index 8ba3be15..05b98cec 100755 --- a/tests/ls/slink-acl.sh +++ b/tests/ls/slink-acl.sh @@ -1,7 +1,7 @@ #!/bin/sh # verify that ls -lL works when applied to a symlink to an ACL'd file -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/stat-dtype.sh b/tests/ls/stat-dtype.sh index 01da0c8a..1d6f5ec3 100755 --- a/tests/ls/stat-dtype.sh +++ b/tests/ls/stat-dtype.sh @@ -3,7 +3,7 @@ # Also check for the dtype-related (and fs-type dependent) bug # in coreutils-6.0 that made ls -CF columns misaligned. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/stat-failed.sh b/tests/ls/stat-failed.sh index 9de018f3..002b71cf 100755 --- a/tests/ls/stat-failed.sh +++ b/tests/ls/stat-failed.sh @@ -2,7 +2,7 @@ # Verify that ls works properly when it fails to stat a file that is # not mentioned on the command line. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ print_ver_ ls skip_if_root_ +LS_MINOR_PROBLEM=1 + mkdir d || framework_failure_ ln -s / d/s || framework_failure_ chmod 600 d || framework_failure_ @@ -38,7 +40,7 @@ sed 's/^l/?/' out | compare exp - || fail=1 # Ensure that the offsets in --dired output are accurate. rm -f out exp -ls --dired -l d > out && fail=1 +returns_ $LS_MINOR_PROBLEM ls --dired -l d > out || fail=1 cat <<\EOF > exp || fail=1 total 0 diff --git a/tests/ls/stat-free-color.sh b/tests/ls/stat-free-color.sh index 72a09bb6..fb2ee8b5 100755 --- a/tests/ls/stat-free-color.sh +++ b/tests/ls/stat-free-color.sh @@ -1,7 +1,7 @@ #!/bin/sh # Show that --color need not use stat, as long as we have d_type support. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/stat-free-symlinks.sh b/tests/ls/stat-free-symlinks.sh index 0bc4c6aa..a9322e03 100755 --- a/tests/ls/stat-free-symlinks.sh +++ b/tests/ls/stat-free-symlinks.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that ls does not stat a symlink in an unusual case -# Copyright (C) 2007-2014 Free Software Foundation, Inc. +# Copyright (C) 2007-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/stat-vs-dirent.sh b/tests/ls/stat-vs-dirent.sh index 57c718a9..9903d27b 100755 --- a/tests/ls/stat-vs-dirent.sh +++ b/tests/ls/stat-vs-dirent.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that d_ino (from ls -di) and st_ino (from stat --format=%i) match. -# Copyright (C) 2006-2014 Free Software Foundation, Inc. +# Copyright (C) 2006-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/symlink-slash.sh b/tests/ls/symlink-slash.sh index da5da28f..4f521b9e 100755 --- a/tests/ls/symlink-slash.sh +++ b/tests/ls/symlink-slash.sh @@ -1,7 +1,7 @@ #!/bin/sh # Do dereference a symlink arg if its name is written with a trailing slash. -# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Copyright (C) 1999-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/time-style-diag.sh b/tests/ls/time-style-diag.sh index d292c982..1d6d8616 100755 --- a/tests/ls/time-style-diag.sh +++ b/tests/ls/time-style-diag.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that an invalid --time-style=ARG is diagnosed the way we want. -# Copyright (C) 2011-2014 Free Software Foundation, Inc. +# Copyright (C) 2011-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/tests/ls/x-option.sh b/tests/ls/x-option.sh index f009cdc2..1ec23d5b 100755 --- a/tests/ls/x-option.sh +++ b/tests/ls/x-option.sh @@ -1,7 +1,7 @@ #!/bin/sh # Exercise the -x option. -# Copyright (C) 2007-2014 Free Software Foundation, Inc. +# Copyright (C) 2007-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |