diff options
Diffstat (limited to 'tests/rm')
48 files changed, 75 insertions, 75 deletions
diff --git a/tests/rm/cycle.sh b/tests/rm/cycle.sh index 589ee73a..259efd28 100755 --- a/tests/rm/cycle.sh +++ b/tests/rm/cycle.sh @@ -1,7 +1,7 @@ #!/bin/sh # rm (coreutils-4.5.4) could be tricked into mistakenly reporting a cycle. -# 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/rm/d-1.sh b/tests/rm/d-1.sh index dd7cfd0f..43b753eb 100755 --- a/tests/rm/d-1.sh +++ b/tests/rm/d-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm --dir --verbose". -# 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/rm/d-2.sh b/tests/rm/d-2.sh index 87fb100c..98e39990 100755 --- a/tests/rm/d-2.sh +++ b/tests/rm/d-2.sh @@ -2,7 +2,7 @@ # Ensure that 'rm -d dir' (i.e., without --recursive) gives a reasonable # diagnostic when failing. -# 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/rm/d-3.sh b/tests/rm/d-3.sh index 646ecd06..af39da38 100755 --- a/tests/rm/d-3.sh +++ b/tests/rm/d-3.sh @@ -2,7 +2,7 @@ # Ensure that 'rm -d -i dir' (i.e., without --recursive) gives a prompt and # then deletes the directory if it is empty -# 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/rm/dangling-symlink.sh b/tests/rm/dangling-symlink.sh index 1e5cdfa9..d2e08a8a 100755 --- a/tests/rm/dangling-symlink.sh +++ b/tests/rm/dangling-symlink.sh @@ -4,7 +4,7 @@ # But for fileutils-4.1.9, it would do the former and # for fileutils-4.1.10 the latter. -# 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 @@ -25,9 +25,10 @@ print_ver_ rm ln -s no-file dangle ln -s / symlink +# Terminate any background processes +cleanup_() { kill $pid 2>/dev/null && wait $pid; } -rm ---presume-input-tty dangle symlink & -pid=$! +rm ---presume-input-tty dangle symlink & pid=$! # The buggy rm (fileutils-4.1.9) would hang here, waiting for input. # Wait up to 3.1s for rm to remove the files @@ -40,6 +41,6 @@ check_files_removed() { } retry_delay_ check_files_removed .1 5 || fail=1 -kill $pid > /dev/null 2>&1 +cleanup_ Exit $fail diff --git a/tests/rm/deep-1.sh b/tests/rm/deep-1.sh index 1f1b307c..82b3fe2e 100755 --- a/tests/rm/deep-1.sh +++ b/tests/rm/deep-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm" with a deep hierarchy. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/deep-2.sh b/tests/rm/deep-2.sh index c3ea0856..7a7f6114 100755 --- a/tests/rm/deep-2.sh +++ b/tests/rm/deep-2.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure rm -r DIR does not prompt for very long full relative names in DIR. -# 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/rm/dir-no-w.sh b/tests/rm/dir-no-w.sh index de9035e9..1cecedb4 100755 --- a/tests/rm/dir-no-w.sh +++ b/tests/rm/dir-no-w.sh @@ -2,7 +2,7 @@ # rm (without -r) must give a diagnostic for any directory. # It must not prompt, even if that directory is unwritable. -# 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/rm/dir-nonrecur.sh b/tests/rm/dir-nonrecur.sh index 45956da7..d2dcbb74 100755 --- a/tests/rm/dir-nonrecur.sh +++ b/tests/rm/dir-nonrecur.sh @@ -2,7 +2,7 @@ # Ensure that 'rm dir' (i.e., without --recursive) gives a reasonable # diagnostic when failing. -# Copyright (C) 2005-2014 Free Software Foundation, Inc. +# Copyright (C) 2005-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/rm/dot-rel.sh b/tests/rm/dot-rel.sh index 4e1a8ce0..ac34b0e3 100755 --- a/tests/rm/dot-rel.sh +++ b/tests/rm/dot-rel.sh @@ -2,7 +2,7 @@ # Use rm -r to remove two non-empty dot-relative directories. # This would have failed between 2004-10-18 and 2004-10-21. -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-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/rm/empty-inacc.sh b/tests/rm/empty-inacc.sh index e3771530..791937c7 100755 --- a/tests/rm/empty-inacc.sh +++ b/tests/rm/empty-inacc.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that rm -rf removes an empty-and-inaccessible directory. -# 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/rm/empty-name.pl b/tests/rm/empty-name.pl index b6ee6ad5..a050081f 100755 --- a/tests/rm/empty-name.pl +++ b/tests/rm/empty-name.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # Make sure that rm -r '' fails. -# 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/rm/ext3-perf.sh b/tests/rm/ext3-perf.sh index ef4fee46..baa8d5dc 100755 --- a/tests/rm/ext3-perf.sh +++ b/tests/rm/ext3-perf.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that "rm -rf DIR-with-many-entries" is not O(N^2) -# 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/rm/f-1.sh b/tests/rm/f-1.sh index 0fc95c4f..c068c778 100755 --- a/tests/rm/f-1.sh +++ b/tests/rm/f-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm -f" with a nonexistent file. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/fail-2eperm.sh b/tests/rm/fail-2eperm.sh index 6e8ce9ba..0bbd028d 100755 --- a/tests/rm/fail-2eperm.sh +++ b/tests/rm/fail-2eperm.sh @@ -2,7 +2,7 @@ # Like fail-eperm, but the failure must be for a file encountered # while trying to remove the containing directory with the sticky bit set. -# 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 @@ -32,14 +32,16 @@ touch a/b || framework_failure_ # Try to ensure that $NON_ROOT_USERNAME can access # the required version of rm. rm_version=$( - chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm --version | + chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \ + rm --version | sed -n '1s/.* //p' ) case $rm_version in $PACKAGE_VERSION) ;; *) skip_ "cannot access just-built rm as user $NON_ROOT_USERNAME";; esac -chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" rm -rf a 2> out-t && fail=1 +chroot --skip-chdir --user=$NON_ROOT_USERNAME / \ + env PATH="$PATH" rm -rf a 2> out-t && fail=1 # On some systems, we get 'Not owner'. Convert it. # On other systems (HPUX), we get 'Permission denied'. Convert it, too. diff --git a/tests/rm/fail-eacces.sh b/tests/rm/fail-eacces.sh index dd31ea4c..64242a50 100755 --- a/tests/rm/fail-eacces.sh +++ b/tests/rm/fail-eacces.sh @@ -4,7 +4,7 @@ # With the symlink, rm from coreutils-6.9 would fail with a misleading # ELOOP diagnostic. -# 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/rm/fail-eperm.xpl b/tests/rm/fail-eperm.xpl index b167d0ba..7a5b9ce1 100755 --- a/tests/rm/fail-eperm.xpl +++ b/tests/rm/fail-eperm.xpl @@ -2,7 +2,7 @@ # Ensure that rm gives the expected diagnostic when failing to remove a file # owned by some other user in a directory with the sticky bit set. -# 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 @@ -32,7 +32,6 @@ my $verbose = $ENV{VERBOSE} && $ENV{VERBOSE} eq 'yes'; $ENV{LC_ALL} = 'C'; # Set up a safe, well-known environment -delete @ENV{qw(BASH_ENV CDPATH ENV)}; $ENV{IFS} = ''; # Taint checking requires a sanitized $PATH. This script performs no $PATH diff --git a/tests/rm/hash.sh b/tests/rm/hash.sh index 6bc82bdc..7b0d452f 100755 --- a/tests/rm/hash.sh +++ b/tests/rm/hash.sh @@ -3,7 +3,7 @@ # Before then, rm would fail occasionally, sometimes via # a failed assertion, others with a seg fault. -# 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 diff --git a/tests/rm/i-1.sh b/tests/rm/i-1.sh index 6a4ca64b..1aeec0ca 100755 --- a/tests/rm/i-1.sh +++ b/tests/rm/i-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm -i". -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/i-never.sh b/tests/rm/i-never.sh index 6302174a..751473e4 100755 --- a/tests/rm/i-never.sh +++ b/tests/rm/i-never.sh @@ -2,7 +2,7 @@ # Ensure that rm --interactive=never works does not prompt, even for # an unwritable file. -# 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/rm/i-no-r.sh b/tests/rm/i-no-r.sh index 8a535faf..22819ab6 100755 --- a/tests/rm/i-no-r.sh +++ b/tests/rm/i-no-r.sh @@ -3,7 +3,7 @@ # recurse into directory DIR. rm -i (without -r) must fail in that case. # Fixed in coreutils-4.5.2. -# 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 @@ -26,7 +26,7 @@ echo y > y || framework_failure_ # This must fail. -rm -i dir < y > /dev/null 2>&1 && fail=1 +returns_ 1 rm -i dir < y > /dev/null 2>&1 || fail=1 # The directory must remain. test -d dir || fail=1 diff --git a/tests/rm/ignorable.sh b/tests/rm/ignorable.sh index 8d656eea..e4ddcc2d 100755 --- a/tests/rm/ignorable.sh +++ b/tests/rm/ignorable.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that rm -f existing-non-dir/anything exits successfully -# 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/rm/inaccessible.sh b/tests/rm/inaccessible.sh index e3c48dfe..42cda786 100755 --- a/tests/rm/inaccessible.sh +++ b/tests/rm/inaccessible.sh @@ -2,7 +2,7 @@ # Ensure that rm works even when run from a directory # for which the user has no access at all. -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-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/rm/interactive-always.sh b/tests/rm/interactive-always.sh index 627d923e..ef72002a 100755 --- a/tests/rm/interactive-always.sh +++ b/tests/rm/interactive-always.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test the --interactive[=WHEN] changes added to coreutils 6.0 -# 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/rm/interactive-once.sh b/tests/rm/interactive-once.sh index db10bba6..398826e6 100755 --- a/tests/rm/interactive-once.sh +++ b/tests/rm/interactive-once.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test the -I option added to coreutils 6.0 -# 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/rm/ir-1.sh b/tests/rm/ir-1.sh index 86a5595f..002ea454 100755 --- a/tests/rm/ir-1.sh +++ b/tests/rm/ir-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm -ir". -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/isatty.sh b/tests/rm/isatty.sh index 0ff8d1fa..4eea4432 100755 --- a/tests/rm/isatty.sh +++ b/tests/rm/isatty.sh @@ -1,7 +1,7 @@ #!/bin/sh # Make sure 'chown 0 f; rm f' prompts before removing f. -# 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 @@ -25,10 +25,12 @@ skip_if_root_ ls /dev/stdin >/dev/null 2>&1 \ || skip_ 'there is no /dev/stdin file' +# Terminate any background processes +cleanup_() { kill $pid 2>/dev/null && wait $pid; } + touch f chmod 0 f -rm ---presume-input-tty f > out 2>&1 & -pid=$! +rm ---presume-input-tty f > out 2>&1 & pid=$! # Wait a second, to give a buggy rm (as in fileutils-4.0.40) # enough time to remove the file. @@ -37,7 +39,7 @@ sleep 1 # The file must still exist. test -f f || fail=1 -kill $pid > /dev/null 2>&1 +cleanup_ # Note the trailing 'x' -- so I don't have to have a trailing # blank in this file :-) diff --git a/tests/rm/many-dir-entries-vs-OOM.sh b/tests/rm/many-dir-entries-vs-OOM.sh index c45453d7..e9c95d5d 100755 --- a/tests/rm/many-dir-entries-vs-OOM.sh +++ b/tests/rm/many-dir-entries-vs-OOM.sh @@ -2,7 +2,7 @@ # In coreutils-8.12, rm,du,chmod, etc. would use too much memory # when processing a directory with many entries (as in > 100,000). -# 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/rm/no-give-up.sh b/tests/rm/no-give-up.sh index 41070c9d..a5134d76 100755 --- a/tests/rm/no-give-up.sh +++ b/tests/rm/no-give-up.sh @@ -2,7 +2,7 @@ # With rm from coreutils-5.2.1 and earlier, 'rm -r' would mistakenly # give up too early under some conditions. -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-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 @@ -30,8 +30,8 @@ chmod go=x . || framework_failure_ # This must fail, since '.' is not writable by $NON_ROOT_USERNAME. -chroot --user=$NON_ROOT_USERNAME / env PATH="$PATH" \ - rm -rf d 2>/dev/null && fail=1 +returns_ 1 chroot --skip-chdir --user=$NON_ROOT_USERNAME / env PATH="$PATH" \ + rm -rf d 2>/dev/null || fail=1 # d must remain. test -d d || fail=1 diff --git a/tests/rm/one-file-system.sh b/tests/rm/one-file-system.sh index 09a0464b..11492092 100755 --- a/tests/rm/one-file-system.sh +++ b/tests/rm/one-file-system.sh @@ -1,7 +1,7 @@ #!/bin/sh # Demonstrate rm's new --one-file-system option. -# 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/rm/one-file-system2.sh b/tests/rm/one-file-system2.sh index e4e8a417..1a27dfd1 100755 --- a/tests/rm/one-file-system2.sh +++ b/tests/rm/one-file-system2.sh @@ -1,7 +1,7 @@ #!/bin/sh # Verify --one-file-system does delete within a file system -# 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/rm/r-1.sh b/tests/rm/r-1.sh index 6e1d6089..21564c6a 100755 --- a/tests/rm/r-1.sh +++ b/tests/rm/r-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm -r --verbose". -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/r-2.sh b/tests/rm/r-2.sh index a8049bd2..a99bdbf4 100755 --- a/tests/rm/r-2.sh +++ b/tests/rm/r-2.sh @@ -1,7 +1,7 @@ #!/bin/sh # Test "rm -r --verbose". -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/r-3.sh b/tests/rm/r-3.sh index 82c35bed..a8bea100 100755 --- a/tests/rm/r-3.sh +++ b/tests/rm/r-3.sh @@ -1,7 +1,7 @@ #!/bin/sh # Create and remove a directory with more than 254 files. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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/rm/r-4.sh b/tests/rm/r-4.sh index 095f1516..91a8b58a 100755 --- a/tests/rm/r-4.sh +++ b/tests/rm/r-4.sh @@ -1,7 +1,7 @@ #!/bin/sh # Try to remove '.' and '..' recursively. -# 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 @@ -43,8 +43,8 @@ rmtest 'd/..' || fail=1 rmtest 'd/../' || fail=1 -# This test is too dangerous -- if there's a bug you're wiped out! -# rm -fr / 2>/dev/null && fail=1 +# This test is handled more carefully in r-root.sh +# returns_ 1 rm -fr / 2>/dev/null || fail=1 test -f d/a || fail=1 diff --git a/tests/rm/r-root.sh b/tests/rm/r-root.sh index e17b85bd..c06332ae 100755 --- a/tests/rm/r-root.sh +++ b/tests/rm/r-root.sh @@ -1,7 +1,7 @@ #!/bin/sh # Try to remove '/' recursively. -# Copyright (C) 2013-2014 Free Software Foundation, Inc. +# Copyright (C) 2013-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 @@ -89,7 +89,7 @@ exercise_rm_r_root () fi timeout --signal=KILL 2 \ - env LD_PRELOAD=./k.so $skip_exit \ + env LD_PRELOAD=$LD_PRELOAD:./k.so $skip_exit \ rm -rv --one-file-system "$@" > out 2> err return $? @@ -143,8 +143,7 @@ for opts in \ 'rootlink2/' \ 'rootlink3/' ; do - exercise_rm_r_root $opts \ - && fail=1 + returns_ 1 exercise_rm_r_root $opts || fail=1 # For some of the synonyms, the error diagnostic slightly differs from that # of the basic "/" case (see gnulib's fts_open' and ROOT_DEV_INO_WARN): @@ -178,8 +177,7 @@ done # by setting the following variable. CU_TEST_SKIP_EXIT=1 -exercise_rm_r_root --preserve-root file1 '/' file2 \ - && fail=1 +returns_ 1 exercise_rm_r_root --preserve-root file1 '/' file2 || fail=1 unset CU_TEST_SKIP_EXIT @@ -219,8 +217,7 @@ for file in \ test -d "$file" || continue # if e.g. /etc does not exist. - exercise_rm_r_root --preserve-root "$file" \ - && fail=1 + returns_ 1 exercise_rm_r_root --preserve-root "$file" || fail=1 grep "^rm: refusing to remove '\.' or '\.\.' directory: skipping" err \ || fail=1 @@ -244,11 +241,10 @@ exercise_rm_r_root --interactive=never --no-preserve-root '/' \ || fail=1 # The 'err' file should not contain the above error diagnostic. -grep "^rm: it is dangerous to operate recursively on '/'" err \ - && fail=1 +grep "^rm: it is dangerous to operate recursively on '/'" err && fail=1 # Instead, rm(1) should have called the intercepted unlinkat() function, -# i.e. the evidence file "x" should exist. +# i.e., the evidence file "x" should exist. test -f x || fail=1 test $fail = 1 && { cat out; cat err; } diff --git a/tests/rm/read-only.sh b/tests/rm/read-only.sh index 377305cd..4375f1bc 100755 --- a/tests/rm/read-only.sh +++ b/tests/rm/read-only.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that rm -f nonexistent-file-on-read-only-fs succeeds. -# 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 @@ -47,6 +47,6 @@ compare /dev/null out || fail=1 # However, trying to remove an existing file must fail. rm -f mnt/f > out 2>&1 && fail=1 # with a diagnostic. -test -s out || fail=1 +compare /dev/null out && fail=1 Exit $fail diff --git a/tests/rm/readdir-bug.sh b/tests/rm/readdir-bug.sh index d54a71c1..0ff02714 100755 --- a/tests/rm/readdir-bug.sh +++ b/tests/rm/readdir-bug.sh @@ -2,7 +2,7 @@ # Exercise the Darwin/MacOS bug worked around on 2006-09-29, # whereby rm would fail to remove all entries in a directory. -# 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/rm/rm1.sh b/tests/rm/rm1.sh index 575a78dd..dcdfecf4 100755 --- a/tests/rm/rm1.sh +++ b/tests/rm/rm1.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise another small part of remove.c -# 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/rm/rm2.sh b/tests/rm/rm2.sh index 93ca66e2..2bc558ef 100755 --- a/tests/rm/rm2.sh +++ b/tests/rm/rm2.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise another small part of remove.c -# 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/rm/rm3.sh b/tests/rm/rm3.sh index dda27a60..df426b7e 100755 --- a/tests/rm/rm3.sh +++ b/tests/rm/rm3.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise another small part of remove.c -# 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/rm/rm4.sh b/tests/rm/rm4.sh index 60eb4a78..e0f141fd 100755 --- a/tests/rm/rm4.sh +++ b/tests/rm/rm4.sh @@ -1,7 +1,7 @@ #!/bin/sh # ensure that 'rm dir' fails without --recursive -# 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 @@ -24,7 +24,7 @@ mkdir dir || framework_failure_ # This should fail. -rm dir > /dev/null 2>&1 && fail=1 +returns_ 1 rm dir > /dev/null 2>&1 || fail=1 test -d dir || fail=1 diff --git a/tests/rm/rm5.sh b/tests/rm/rm5.sh index 6ccd6c6b..7e017a68 100755 --- a/tests/rm/rm5.sh +++ b/tests/rm/rm5.sh @@ -1,7 +1,7 @@ #!/bin/sh # a basic test of rm -ri -# 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/rm/sunos-1.sh b/tests/rm/sunos-1.sh index cc8a02b7..db4221f0 100755 --- a/tests/rm/sunos-1.sh +++ b/tests/rm/sunos-1.sh @@ -1,7 +1,7 @@ #!/bin/sh # Make sure that rm -r '' fails. -# Copyright (C) 1997-2014 Free Software Foundation, Inc. +# Copyright (C) 1997-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 @@ -24,6 +24,6 @@ . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src print_ver_ rm -rm -r '' > /dev/null 2>&1 && fail=1 +returns_ 1 rm -r '' > /dev/null 2>&1 || fail=1 Exit $fail diff --git a/tests/rm/unread2.sh b/tests/rm/unread2.sh index 977d557d..3e532497 100755 --- a/tests/rm/unread2.sh +++ b/tests/rm/unread2.sh @@ -1,7 +1,7 @@ #!/bin/sh # exercise one small part of remove.c -# 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/rm/unread3.sh b/tests/rm/unread3.sh index a8df825c..3d9d74cb 100755 --- a/tests/rm/unread3.sh +++ b/tests/rm/unread3.sh @@ -1,7 +1,7 @@ #!/bin/sh # Ensure that rm works even from an unreadable working directory. -# Copyright (C) 2004-2014 Free Software Foundation, Inc. +# Copyright (C) 2004-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/rm/unreadable.pl b/tests/rm/unreadable.pl index 7f0cd3d6..4abf301d 100755 --- a/tests/rm/unreadable.pl +++ b/tests/rm/unreadable.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl # Test "rm" and unreadable directories. -# 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/rm/v-slash.sh b/tests/rm/v-slash.sh index 69730a19..5cabb0bc 100755 --- a/tests/rm/v-slash.sh +++ b/tests/rm/v-slash.sh @@ -1,7 +1,7 @@ #!/bin/sh # avoid extra slashes in --verbose output -# 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 |