]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: don't fail tests when failing to write files
authorPádraig Brady <P@draigBrady.com>
Tue, 29 Aug 2017 04:51:37 +0000 (21:51 -0700)
committerPádraig Brady <P@draigBrady.com>
Tue, 29 Aug 2017 07:37:59 +0000 (00:37 -0700)
* tests/sample-test: Use framework_error_ rather than fail=1
* tests/chown/deref.sh: Likewise.
* tests/chown/preserve-root.sh: Likewise.
* tests/cp/src-base-dot.sh: Likewise.
* tests/dd/unblock-sync.sh: Likewise.
* tests/du/2g.sh: Likewise.
* tests/du/inacc-dest.sh: Likewise.
* tests/du/one-file-system.sh: Likewise.
* tests/fmt/goal-option.sh: Likewise.
* tests/ln/hard-backup.sh: Likewise.
* tests/ls/color-dtype-dir.sh: Likewise.
* tests/ls/m-option.sh: Likewise.
* tests/ls/stat-dtype.sh: Likewise.
* tests/ls/time-style-diag.sh: Likewise.
* tests/ls/x-option.sh: Likewise.
* tests/misc/chcon.sh: Likewise.
* tests/misc/nohup.sh: Likewise.
* tests/misc/od-N.sh: Likewise.
* tests/misc/sort-compress.sh: Likewise.
* tests/misc/tac-continue.sh: Likewise.
* tests/misc/time-style.sh: Likewise.
* tests/mv/backup-dir.sh: Likewise.
* tests/mv/dir2dir.sh: Likewise.
* tests/rm/dir-no-w.sh: Likewise.
* tests/rm/dir-nonrecur.sh: Likewise.
* tests/rm/inaccessible.sh: Likewise.
* tests/rm/interactive-always.sh: Likewise.
* tests/rm/interactive-once.sh: Likewise.
* tests/rm/rm3.sh: Likewise.
* tests/rm/v-slash.sh: Likewise.
* tests/touch/relative.sh: Likewise.

47 files changed:
tests/chown/deref.sh
tests/chown/preserve-root.sh
tests/cp/backup-1.sh
tests/cp/src-base-dot.sh
tests/dd/skip-seek2.sh
tests/dd/unblock-sync.sh
tests/du/2g.sh
tests/du/inacc-dest.sh
tests/du/long-sloop.sh
tests/du/one-file-system.sh
tests/fmt/goal-option.sh
tests/install/strip-program.sh
tests/ln/hard-backup.sh
tests/ls/color-clear-to-eol.sh
tests/ls/color-dtype-dir.sh
tests/ls/m-option.sh
tests/ls/quote-align.sh
tests/ls/stat-dtype.sh
tests/ls/time-style-diag.sh
tests/ls/x-option.sh
tests/misc/chcon.sh
tests/misc/nohup.sh
tests/misc/od-N.sh
tests/misc/readlink-fp-loop.sh
tests/misc/shred-exact.sh
tests/misc/sort-NaN-infloop.sh
tests/misc/sort-compress.sh
tests/misc/sort-merge-fdlimit.sh
tests/misc/tac-2-nonseekable.sh
tests/misc/tac-continue.sh
tests/misc/time-style.sh
tests/mkdir/selinux.sh
tests/mkdir/smack-no-root.sh
tests/mv/backup-dir.sh
tests/mv/childproof.sh
tests/mv/dir2dir.sh
tests/mv/part-symlink.sh
tests/mv/update.sh
tests/rm/dir-no-w.sh
tests/rm/dir-nonrecur.sh
tests/rm/inaccessible.sh
tests/rm/interactive-always.sh
tests/rm/interactive-once.sh
tests/rm/rm3.sh
tests/rm/v-slash.sh
tests/sample-test
tests/touch/relative.sh

index 4c8628deaf9ea4f65ed49ceec3c272b1353cbb72..87c2027e03909513e6bbb79e5f1ad4d96dc515e5 100755 (executable)
@@ -29,7 +29,7 @@ set _ $(ls -ldo dangle); shift; user=$3
 chown --dereference $user dangle 2> out1 && fail=1
 sed 's/: [^:]*$//' out1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 chown: cannot dereference 'dangle'
 EOF
 
index 76d0a3fd01f0ae47b69507a5e4e68f002b4041ec..d5c370ff2c4d00c01fb4a2011670564387f11d97 100755 (executable)
@@ -37,16 +37,16 @@ chmod -R --preserve-root u+r / >> out 2>&1 && fail=1
 # With -RHh, --preserve-root should trigger nothing,
 # since the symlink in question is not a command line argument.
 # Contrary to the above commands, these two should succeed.
-echo '==== test -RHh' >> out
+echo '==== test -RHh' >> out || framework_failure_
 chown -RHh --preserve-root $(id -u) d >> out 2>&1 || fail=1
 chgrp -RHh --preserve-root $(id -g) d >> out 2>&1 || fail=1
 
 # These must fail.
-echo '==== test -RLh' >> out
+echo '==== test -RLh' >> out || framework_failure_
 chown -RLh --preserve-root $(id -u) d >> out 2>&1 && fail=1
 chgrp -RLh --preserve-root $(id -g) d >> out 2>&1 && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 chown: it is dangerous to operate recursively on '/'
 chown: use --no-preserve-root to override this failsafe
 chgrp: it is dangerous to operate recursively on '/'
index 86d14e10f71e4259b084e78b5b0493a60bbc6385..8f7a3d4146bd17e78b668be2cb7e57ce2831997d 100755 (executable)
@@ -23,7 +23,7 @@ suffix=.b
 file=F
 file_backup="$file$suffix"
 
-echo test > $file || fail=1
+echo test > $file || framework_failure_
 
 # Specify both version control and suffix so the environment variables
 # (possibly set by the user running these tests) aren't used.
index dfa3acdf9f3435714b3e25bf88121745efafcecd..7acd5de0707baaed4adae6533df9d3b703e7cc6c 100755 (executable)
@@ -21,12 +21,8 @@ print_ver_ cp
 
 mkdir x y || framework_failure_
 
-
 cd y
 cp --verbose -ab ../x/. . > out 2>&1 || fail=1
-cat <<\EOF > exp || fail=1
-EOF
-
-compare exp out || fail=1
+compare /dev/null out || fail=1
 
 Exit $fail
index 3250a3d358c0cbaf5bcd156b7120285013dd57f1..ed242d87acfcff3bdbed57931963fc6810b9a277 100755 (executable)
 print_ver_ dd
 
 
-echo LA:3456789abcdef > in || fail=1
+echo LA:3456789abcdef > in || framework_failure_
 (dd bs=1 skip=3 count=0 && dd bs=5) < in > out 2> /dev/null || fail=1
 case $(cat out) in
   3456789abcdef) ;;
   *) fail=1 ;;
 esac
 
-echo LA:3456789abcdef > in || fail=1
+echo LA:3456789abcdef > in || framework_failure_
 (dd bs=1 skip=3 count=0 && dd bs=5 count=2) < in > out 2> /dev/null || fail=1
 case $(cat out) in
   3456789abc) ;;
index 0ae6442e2cad5700a79b30c0f37d5013316ccf63..4c0786bfe5aef87e781ad7ac5aaadad589c54f8a 100755 (executable)
@@ -23,7 +23,7 @@ printf 000100020003xx > in || framework_failure_
 
 
 dd cbs=4 ibs=4 conv=unblock,sync < in > out 2> /dev/null || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 0001
 0002
 0003
index e3045b352122355fbbfa9ebe9645adaceb9ab77d..3a74d2f719bc1e8fde84ad56d8d06d6d80e51ae5 100755 (executable)
@@ -62,7 +62,7 @@ du -k $big > out1 || fail=1
 rm -f $big
 sed 's/^2[0-9][0-9][0-9][0-9][0-9][0-9]        '$big'$/~2M/' out1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ~2M
 EOF
 
index 2d5439755a7d05f3119add7a99244285a220165c..f9144bad4790b7afa17c20bac9d5164bb822ac12 100755 (executable)
@@ -33,7 +33,7 @@ du > ../t 2>&1 && fail=1
 # /proc support, nor native openat support.
 
 sed 's/^[0-9][0-9]*    //' ../t | sort -u > out
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 .
 ./a
 ./b
index beb557dd6d1be0254935676d3bb986abfb2e5827..e761a651719d029de93b5edf3dbecaa98cc53430 100755 (executable)
@@ -42,7 +42,7 @@ for i in $dir_list $(expr $n + 1); do
   esac
   i_minus_1=$i
 done
-echo foo > $i
+echo foo > $i || framework_failure_
 
 # If a system can handle this many symlinks in a file name,
 # just skip this test.
@@ -63,9 +63,9 @@ too_many=$(sed 's/.*: //' err)
 # With coreutils-5.94 we get the desired diagnostic:
 # du: cannot access '1/s/s/s/.../s': Too many levels of symbolic links
 du -L 1 > /dev/null 2> out1 && fail=1
-sed "s, .1/s/s/s/[/s]*',," out1 > out || fail=1
+sed "s, .1/s/s/s/[/s]*',," out1 > out || framework_failure_
 
-echo "du: cannot access: $too_many" > exp || fail=1
+echo "du: cannot access: $too_many" > exp || framework_failure_
 
 compare exp out || fail=1
 
index e21c90c3b6d05579c1110406acde4dc7e237fae0..7c6436a6df7ef0b47ced629dd7b7d556e34ed3af 100755 (executable)
@@ -28,8 +28,8 @@ ln -s "$other_partition_tmpdir/x" d || framework_failure_
 # would not traverse into second and subsequent directories listed
 # on the command line.
 du -ax b y > t || fail=1
-sed 's/^[0-9][0-9]*    //' t > out
-cat <<\EOF > exp || fail=1
+sed 's/^[0-9][0-9]*    //' t > out || framework_failure_
+cat <<\EOF > exp || framework_failure_
 b/c
 b
 y/z
@@ -41,16 +41,16 @@ compare exp out || fail=1
 # "du -xL" reported a zero count for a file in a different file system,
 # instead of ignoring it.
 du -xL d > u || fail=1
-sed 's/^[0-9][0-9]*    //' u > out1
-echo d > exp1 || fail=1
+sed 's/^[0-9][0-9]*    //' u > out1 || framework_failure_
+echo d > exp1 || framework_failure_
 compare exp1 out1 || fail=1
 
 # With coreutils-8.15, "du -xs FILE" would print no output.
 touch f
 for opt in -x -xs; do
   du $opt f > u || fail=1
-  sed 's/^[0-9][0-9]*  //' u > out2
-  echo f > exp2 || fail=1
+  sed 's/^[0-9][0-9]*  //' u > out2 || framework_failure_
+  echo f > exp2 || framework_failure_
   compare exp2 out2 || fail=1
 done
 
index 1ebf714eafb22aef8c1f40efe2a9743bf14ae623..eda086b1fa35e55bf33bfaaaa3722b3d63c72a0f 100755 (executable)
@@ -19,7 +19,7 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ fmt
 
-cat <<\_EOF_ > base || fail=1
+cat <<\_EOF_ > base || framework_failure_
 
 @command{fmt} prefers breaking lines at the end of a sentence, and tries to
 avoid line breaks after the first word of a sentence or before the last word
@@ -36,7 +36,7 @@ _EOF_
 
 fmt -g 60 -w 72 base > out || fail=1
 
-cat <<\_EOF_ > exp
+cat <<\_EOF_ > exp || framework_failure_
 
 @command{fmt} prefers breaking lines at the end of a sentence,
 and tries to avoid line breaks after the first word of a sentence
index 028558edd08f760ad76c1d63e74cf9cf61d6ab03..516a48857c24e8b4e118c94c96fdc99a5ef1b05c 100755 (executable)
@@ -28,8 +28,8 @@ EOF
 chmod a+x b || framework_failure_
 
 
-echo abc > src || fail=1
-echo aBc > exp || fail=1
+echo abc > src || framework_failure_
+echo aBc > exp || framework_failure_
 ginstall src dest -s --strip-program=./b || fail=1
 compare exp dest || fail=1
 
index a983292f44dad0653602e905f882d16610a5c67a..53e59176081e43f9c6bf236129dafcebc7049d14 100755 (executable)
@@ -23,7 +23,7 @@ touch f || framework_failure_
 
 
 ln --backup f f 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ln: 'f' and 'f' are the same file
 EOF
 
index cf65455b3d52dd345184d06665bcc9283674e550..6c3dc6cda754fa63256073cce457c959197a21e1 100755 (executable)
@@ -32,7 +32,7 @@ env TERM=xterm COLUMNS=80 LS_COLORS="*.foo=$color_code" TIME_STYLE=+T \
   ls -og --color=always $long_name > out || fail=1
 
 # Append a newline, to accommodate less-capable versions of sed.
-echo >> out || fail=1
+echo >> out || framework_failure_
 
 sed 's/.*T //' out > k && mv k out
 
index dc5f2db544847b92ec507b56b0d7fcd587711d28..6a71bb9c7d5490c1e5935b950c033a72d38fcdd4 100755 (executable)
@@ -31,10 +31,10 @@ chmod o+t sticky || framework_failure_
 
 
 TERM=xterm ls --color=always > out || fail=1
-cat -A out > o1 || fail=1
-mv o1 out || fail=1
+cat -A out > o1 || framework_failure_
+mv o1 out || framework_failure_
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ^[[0m^[[01;34md^[[0m$
 ^[[34;42mother-writable^[[0m$
 out$
@@ -43,7 +43,7 @@ EOF
 
 compare exp out || fail=1
 
-rm exp
+rm exp || framework_failure_
 
 # Turn off colors for other-writable dirs and ensure
 # we fall back to the color for standard directories.
@@ -52,7 +52,7 @@ LS_COLORS="ow=:" ls --color=always > out || fail=1
 cat -A out > o1 || fail=1
 mv o1 out || fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ^[[0m^[[01;34md^[[0m$
 ^[[01;34mother-writable^[[0m$
 out$
index b6e774393a055b77967d1e2457b615f93b4891a3..275ab43974a91e2327307fa14563078d8584f9d3 100755 (executable)
@@ -29,7 +29,7 @@ ls -w2 -m a b > out || fail=1
 # Before coreutils-5.1.1, the following would produce leading white space.
 # All of the sed business is because the sizes are not portable.
 ls -sm a b | sed 's/^[0-9]/0/;s/, [0-9][0-9]* b/, 12 b/' >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 a,
 b
 0 a, 12 b
index f9768fe3059b2fbabf48255b38c355243ce3ce7a..03cc5660fd416876b29905ce81f1a43c6fb69365 100755 (executable)
@@ -52,7 +52,7 @@ for opt in '-w0 -x' '-x' '-og' '-1' '-m' '-C'; do
 done
 
 # Append a newline, to accommodate less-capable versions of sed.
-echo >> out || fail=1
+echo >> out || framework_failure_
 
 # Strip possible varying portion of long format
 sed -e 's/.*T //' -e '/^total/d' out > k && mv k out
index dbd0e31ed95e1ea67ed581f35a086aec3024dae9..550856cd42673682cfef3b763f14114755d939a2 100755 (executable)
@@ -42,19 +42,18 @@ chmod 600 e || framework_failure_
 
 
 ls --file-type d > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 s@
 EOF
 
 compare exp out || fail=1
 
-rm -f out exp
 # Check for the ls -CF misaligned-columns bug:
 ls -CF e > out || fail=1
 
 # coreutils-6.0 would print two spaces after the first slash,
 # rather than the appropriate TAB.
-printf 'a2345/\tb/\n' > exp || fail=1
+printf 'a2345/\tb/\n' > exp || framework_failure_
 
 compare exp out || fail=1
 
index 00c04ddb650edc454d328890fe80900410730a4f..2c67021d36d179d7ae439e604dfa002767c87637 100755 (executable)
@@ -21,7 +21,7 @@ print_ver_ ls
 
 returns_ 2 ls -l --time-style=XX > out 2> err || fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 ls: invalid argument 'XX' for 'time style'
 Valid arguments are:
   - [posix-]full-iso
index e4ee8bb52943b9f4a405a444082960cd6e442a33..224d2b3784da034d375e1c2e70653699c9e6cbf7 100755 (executable)
@@ -27,7 +27,7 @@ touch subdir/a || framework_failure_
 # Coreutils 6.8 and 6.9 would output this in the wrong order.
 ls -x subdir > out || fail=1
 ls -rx subdir >> out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 a  b
 b  a
 EOF
index c9c42f0fdd6f818db662443381d92c57ca2472b1..13a72a04e265bccdbf155759733996112aa0703e 100755 (executable)
@@ -57,7 +57,7 @@ for i in -u$u1 -r$r1 -t$t1; do
   stat --printf="f|$i|"'%C\n' f >> out || fail=1
 done
 
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
 f|$ctx
 g|$ctx
 f|--user=$u2|$u2:$r1:$t1:$range
@@ -72,7 +72,7 @@ EOF
 compare exp out || fail=1
 
 chcon --verbose -u$u1 f > out || fail=1
-echo "changing security context of 'f'" > exp
+echo "changing security context of 'f'" > exp || framework_failure_
 compare exp out || fail=1
 
 Exit $fail
index eae1cd07c1b2ccfa18891b9ce839707cc0c220be..f02045bfd105c10b10d4ac75a7f340d395dfa66a 100755 (executable)
@@ -30,7 +30,7 @@ if test -t 1; then
     echo 'nohup: ignoring input and appending output to 'nohup.out'\'
   else
     echo 'nohup: appending output to 'nohup.out'\'
-  fi >exp || fail=1
+  fi >exp || framework_failure_
 else
   # Here it should not even exist.
   test -f nohup.out && fail=1
@@ -38,9 +38,9 @@ else
     echo 'nohup: ignoring input' >exp
   else
     rm -f exp
-  fi || fail=1
+  fi || framework_failure_
 fi
-echo 'stderr' >> exp || fail=1
+echo 'stderr' >> exp || framework_failure_
 
 compare exp err || fail=1
 rm -f nohup.out err exp
@@ -88,7 +88,7 @@ if test -t 1; then
   compare /dev/null nohup.out || fail=1
 fi
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 nohup: appending output to 'nohup.out'
 nohup: cannot run command 'no-such-command': No such file or directory
 EOF
@@ -108,7 +108,7 @@ if test -t 1; then
   compare /dev/null nohup.out || fail=1
 fi
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 nohup: appending output to 'nohup.out'
 nohup: cannot run command './k': Permission denied
 EOF
index f05b1c7ca60b4258fef8d8d5c680669c7c84ab13..fcf073022b48099258465b1f99c214cd422296a8 100755 (executable)
@@ -23,7 +23,7 @@ echo abcdefg > in || framework_failure_
 
 
 (od -An -N3 -c; od -An -N3 -c) < in > out
-cat <<EOF > exp || fail=1
+cat <<EOF > exp || framework_failure_
    a   b   c
    d   e   f
 EOF
index 1f259ea69d2cf894ee04fb431e7650aa6ffac7e8..86632c529aa3066c1837d0eaeebc695712584f46 100755 (executable)
@@ -34,7 +34,7 @@ ln -s ../s/2 d/1 || framework_failure_
 # With coreutils-6.9, this would fail with ELOOP.
 readlink -v -e p/1 > out || fail=1
 # readlink -e d/2 > exp || fail=1
-echo "$cwd/d/2" > exp || fail=1
+echo "$cwd/d/2" > exp || framework_failure_
 compare exp out || fail=1
 
 # Construct a real loop and make sure readlink still detects it.
@@ -56,7 +56,7 @@ ln -nsf ../p/7 d/6 || framework_failure_
 ln -nsf ../p/8 d/7 || framework_failure_
 echo x > d/8       || framework_failure_
 readlink -v -e p/1 > out || fail=1
-echo "$cwd/d/8" > exp || fail=1
+echo "$cwd/d/8" > exp || framework_failure_
 compare exp out || fail=1
 
 # A trivial loop
index 14c1f6d8045b4231c2fd83aeb1ccd58401696ee0..23b7fdb0e02bf5a7ac3b88bb0b9d5fdf00fc9101 100755 (executable)
@@ -22,9 +22,9 @@ print_ver_ shred
 
 # make sure that neither --exact nor --zero gobbles a command line argument
 for opt in --exact --zero; do
-  echo a > a || fail=1
-  echo bb > b || fail=1
-  echo ccc > c || fail=1
+  echo a > a || framework_failure_
+  echo bb > b || framework_failure_
+  echo ccc > c || framework_failure_
 
   shred --remove $opt a b || fail=1
   test -f a && fail=1
index 6e27112125ca47b0483e32693c864c987dd062c5..e2115ac132ca3a8ab38481f8f1733e98ade2f8d5 100755 (executable)
@@ -19,8 +19,8 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ sort
 
-echo nan > F || fail=1
-printf 'nan\nnan\n' > exp || fail=1
+echo nan > F || framework_failure_
+printf 'nan\nnan\n' > exp || framework_failure_
 timeout 10 sort -g -m F F > out || fail=1
 
 compare exp out || fail=1
index 82b585f7ee91d4819183ec8b47bb9a3e5387bc98..91fad432939d8d5eacefeb7cbb5dc4ad74dfa14a 100755 (executable)
@@ -28,7 +28,7 @@ sort -S 1k in > out || fail=1
 compare exp out || fail=1
 
 # Create our own gzip program that will be used as the default
-cat <<EOF > gzip || fail=1
+cat <<EOF > gzip || framework_failure_
 #!$SHELL
 tr 41 14
 touch ok
index 71eb5ec446b3d21791621cf3b08335abd2c38333..d5b43d3e5609832d0d8df6d9163c38eae6dc8d84 100755 (executable)
@@ -61,8 +61,8 @@ done
 # This test finds the bug only with shells that do not close FDs on
 # exec, and will miss the bug (if present) on other shells, but it's
 # not easy to fix this without running afoul of the OpenBSD-like sh bugs.
-(seq 6 && echo 6) >exp || fail=1
-echo 6 >out || fail=1
+(seq 6 && echo 6) >exp || framework_failure_
+echo 6 >out || framework_failure_
 (exec 3<&- 4<&- 5<&- 6</dev/null 7<&6 8<&6 9<&6 &&
  ulimit -n 10 &&
  sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
index 12162ccc5706d260367bdb5c17d63d40f408c2a9..00f71a03b534a0ce41e24143b7a8a3ba29e9c9b5 100755 (executable)
@@ -20,7 +20,7 @@
 print_ver_ tac
 
 echo x | tac - - > out 2> err || fail=1
-echo x > exp || fail=1
+echo x > exp || framework_failure_
 compare exp out || fail=1
 compare /dev/null err || fail=1
 
index 44cd98bd36555c9fb4d93069cbec7e751adb09a8..dca6b6c35991ccbbbb64c2dc65d8306a0f131d83 100755 (executable)
@@ -63,7 +63,7 @@ mkfifo_or_skip_ fifo
 seq 1000 > fifo & pid=$!
 TMPDIR=$FULL_PARTITION_TMPDIR tac fifo in >out 2>err && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 5
 4
 3
index ec1d4ab67dd048ff033348506aae3cb58c806759..1a88dc66d009f70b0ddba155a60f38ceda06c860 100755 (executable)
@@ -42,7 +42,7 @@ sed 's/[^     ]*      //' duout >dued || framework_failure_
 sed 's/[^ ]* *[^ ]* *[^ ]* *[^ ]* *//' lsout >lsed || framework_failure_
 sed '/^$/d' prout >pred || framework_failure_
 
-cat <<\EOF > duexp || fail=1
+cat <<\EOF > duexp || framework_failure_
 1970-07-08 09:10:11.000000000 +0000    a
 1970-07-08 09:10       a
 1970-07-08     a
@@ -65,7 +65,7 @@ cat <<\EOF > duexp || fail=1
 %bJul%bJul     a
 EOF
 
-cat <<\EOF > lsexp || fail=1
+cat <<\EOF > lsexp || framework_failure_
 1970-07-08 09:10:11.000000000 +0000 a
 1970-07-08 09:10 a
 1970-07-08  a
@@ -92,7 +92,7 @@ Jul  8  1970 a
 %bJul%bJul a
 EOF
 
-cat <<\EOF > prexp || fail=1
+cat <<\EOF > prexp || framework_failure_
 +1970-07-08 09:10:11 +0000 (UTC)                a                 Page 1
 hello
 +%bJul%bJul                           a                           Page 1
index aeb119ed1d8d55b52a9d6991f660f5355d0f54dd..37eb5aa2cfb07ba6b491d14d9d1bbdd3446f7885 100755 (executable)
@@ -34,7 +34,7 @@ for cmd_w_arg in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
   # Running via "env" ensures we run our program and not the built-in.
   env -- $cmd_w_arg --context=$c 2> out && fail=1
   set $cmd_w_arg; cmd=$1
-  echo "$cmd: $msg" > exp || fail=1
+  echo "$cmd: $msg" > exp || framework_failure_
 
   # Some systems fail with ENOTSUP, EINVAL, ENOENT, or even
   # "Unknown system error", or "Function not implemented".
@@ -48,7 +48,7 @@ for cmd_w_arg in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
     -e 's/ Function not implemented$//'        \
     -e 's/ Unsupported attribute value$//'     \
     -e 's/ Unknown error .*$//'        \
-    -e 's/ No such file or directory$//' out > k || fail=1
+    -e 's/ No such file or directory$//' out > k || framework_failure_
   mv k out || fail=1
   compare exp out || fail=1
 done
index eebd59f062c23da727a32159eea85eb8a227b846..2407bf21f3a338def89b6630d7b19af7469441d9 100755 (executable)
@@ -29,9 +29,9 @@ msg="failed to set default file creation context to '$c':"
 for cmd in 'mkdir dir' 'mknod b p' 'mkfifo f'; do
   $cmd --context="$c" 2> out && fail=1
   set $cmd
-  echo "$1: $msg" > exp || fail=1
+  echo "$1: $msg" > exp || framework_failure_
 
-  sed -e 's/ Operation not permitted$//' out > k || fail=1
+  sed -e 's/ Operation not permitted$//' out > k || framework_failure_
   mv k out || fail=1
   compare exp out || fail=1
 done
index 497384e717e79fbf392db475a3a398aef5c7c90c..7263afe0f33cace4f19fea3d4b180533a57e03cb 100755 (executable)
@@ -25,7 +25,7 @@ touch X Y || framework_failure_
 
 # Before coreutils-6.2, the " (backup: 'B.~1~')" suffix was not printed.
 mv --verbose --backup=numbered -T A B > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 renamed 'A' -> 'B' (backup: 'B.~1~')
 EOF
 
index 9f9e19853566f3f0212ca5e47cef066931246319..3de5ec6f9ae257d350fca94356c9e1a3af0f9965 100755 (executable)
@@ -72,8 +72,8 @@ test -f c/g || fail=1
 # Test ln -f.
 
 rm -f a/f b/f c/f
-echo a > a/f || fail=1
-echo b > b/f || fail=1
+echo a > a/f || framework_failure_
+echo b > b/f || framework_failure_
 returns_ 1 ln -f a/f b/f c 2> /dev/null || fail=1
 # a/f and c/f must be linked
 test $(stat --format %i a/f) = $(stat --format %i c/f) || fail=1
index be106912fbf63bebee89e8c3e46cb50c8202d69c..de97abb085af35e1fe7f5c59d8e05948e688a926 100755 (executable)
@@ -33,7 +33,7 @@ mv b/t a 2> out && fail=1
 sed             's/: File exists/: Directory not empty/'<out>o1;mv o1 out
 sed 's/: Device or resource busy/: Directory not empty/'<out>o1;mv o1 out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 mv: cannot move 'b/t' to 'a/t': Directory not empty
 EOF
 
index efeadd067416ce3aeea451463f428a37c81f8d1b..55c6cfa49e5547124e5ba2d827b6969ae4bb7576 100755 (executable)
@@ -73,7 +73,7 @@ for copy in cp mv; do
       case "$args" in *loc_sl*) slink=$loc_sl ;; esac
       case "$args" in *rem_sl*) slink=$rem_sl ;; esac
 
-      echo $contents > "$reg_abs" || fail=1
+      echo $contents > "$reg_abs" || framework_failure_
       ln -nsf "$reg_abs" $slink || fail=1
       actual_args=$(echo $args|sed 's,^,$,;s/ / $/')
       actual_args=$(eval echo $actual_args)
@@ -151,7 +151,7 @@ done
 test $fail = 1 &&
   { (exit 1); exit; }
 
-cat <<\EOF > expected
+cat <<\EOF > expected || framework_failure_
 1 cp loc_reg rem_sl
  [cp: 'loc_reg' and 'rem_sl' are the same file]
  (loc_reg) (rem_sl -> dir/loc_reg)
index e1f4a7a9ef7a65a2c4c066709b9f0d9cd62a3a37..219d76c8edbc145e7c74d2287c9915e242484f9c 100755 (executable)
@@ -42,9 +42,9 @@ test -f new && fail=1
 case "$(cat old)" in new) ;; *) fail=1 ;; esac
 
 # Restore initial conditions.
-echo old > old || fail=1
+echo old > old || framework_failure_
 touch -d yesterday old || fail=1
-echo new > new || fail=1
+echo new > new || framework_failure_
 
 # This will actually perform the copy.
 cp --update new old || fail=1
index 23124d09734b3b88f5fb11fbcd1a9c89a91cbae7..8afc99440d4d31a8185b28188bb8d368a95927ab 100755 (executable)
@@ -25,7 +25,7 @@ mkdir --mode=0500 unwritable-dir || framework_failure_
 
 # For rm from coreutils-5.0.1, this would prompt.
 rm ---presume-input-tty unwritable-dir < /dev/null > out-t 2>&1 && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'unwritable-dir': Is a directory
 EOF
 
index a99184eac8160a3b40e5cdb259ab8010ed929809..e9bda6ef1a05834771bf32b8eeb13ae8a4663894 100755 (executable)
@@ -24,7 +24,7 @@ mkdir d || framework_failure_
 
 
 rm d 2> out && fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'd': Is a directory
 EOF
 
index dfb7c4db71bbbf1854136e4a466474bcfab2d66d..8d8469fe83794084eba0ccabe955f5b289ceabcf 100755 (executable)
@@ -34,7 +34,7 @@ set +x
 test -d "$p/abs1" && fail=1
 test -d "$p/abs2" && fail=1
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 rm: cannot remove 'rel': Permission denied
 EOF
 
index 6ed07db81edc0fa745fd6b955f7a8258c3b53259..fee62dfb2ed88399b99eab5131723d747163e3ec 100755 (executable)
@@ -30,43 +30,41 @@ rm -f out err || framework_failure_
 # The prompt has a trailing space, and no newline, so an extra
 # 'echo .' is inserted after each rm to make it obvious what was asked.
 
-echo 'no WHEN' > err || fail=1
+echo 'no WHEN' > err || framework_failure_
 rm -R --interactive file1-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file1-1 || fail=1
 test -f file1-2 && fail=1
 
-echo 'WHEN=never' >> err || fail=1
+echo 'WHEN=never' >> err || framework_failure_
 rm -R --interactive=never file2-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file2-1 && fail=1
 test -f file2-2 && fail=1
 
-echo 'WHEN=once' >> err || fail=1
+echo 'WHEN=once' >> err || framework_failure_
 rm -R --interactive=once file3-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file3-1 || fail=1
 test -f file3-2 || fail=1
 
-echo 'WHEN=always' >> err || fail=1
+echo 'WHEN=always' >> err || framework_failure_
 rm -R --interactive=always file4-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file4-1 || fail=1
 test -f file4-2 && fail=1
 
-echo '-f overrides --interactive' >> err || fail=1
+echo '-f overrides --interactive' >> err || framework_failure_
 rm -R --interactive=once -f file1-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file1-1 && fail=1
 
-echo '--interactive overrides -f' >> err || fail=1
+echo '--interactive overrides -f' >> err || framework_failure_
 rm -R -f --interactive=once file4-* < in >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file4-1 || fail=1
 
-cat <<\EOF > expout || fail=1
-EOF
-sed 's/@remove_empty/rm: remove regular empty file/g' <<\EOF > experr || fail=1
+cat <<\EOF > experr.t || framework_failure_
 no WHEN
 @remove_empty 'file1-1'? @remove_empty 'file1-2'? .
 WHEN=never
@@ -80,8 +78,10 @@ WHEN=always
 --interactive overrides -f
 rm: remove 1 argument recursively? .
 EOF
+sed 's/@remove_empty/rm: remove regular empty file/g' < experr.t > experr ||
+  framework_failure_
 
-compare expout out || fail=1
+compare /dev/null out || fail=1
 compare experr err || fail=1
 
 Exit $fail
index 583121324e0bcef734185b10b475ad940ca69d40..36ef2cdc9f94bfc6533db39926a954620a1a9992 100755 (executable)
@@ -32,7 +32,7 @@ rm -f out err || framework_failure_
 
 echo 'one file, no recursion' > err || framework_failure_
 rm -I file1-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file1-1 && fail=1
 
 echo 'one file, read only, answer no' >> err || framework_failure_
@@ -44,7 +44,7 @@ if ls /dev/stdin >/dev/null 2>&1; then
     write_prot_msg1="rm: remove write-protected regular empty file 'file1-1'? "
   fi
   rm ---presume-input-tty -I file1-* < in-n >> out 2>> err || fail=1
-  echo . >> err || fail=1
+  echo . >> err || framework_failure_
   if test "$write_prot_msg1"; then
     test -f file1-1 || fail=1
   fi
@@ -54,14 +54,14 @@ fi
 
 echo 'three files, no recursion' >> err || framework_failure_
 rm -I file2-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file2-1 && fail=1
 test -f file2-2 && fail=1
 test -f file2-3 && fail=1
 
 echo 'four files, no recursion, answer no' >> err || framework_failure_
 rm -I file3-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file3-1 || fail=1
 test -f file3-2 || fail=1
 test -f file3-3 || fail=1
@@ -69,7 +69,7 @@ test -f file3-4 || fail=1
 
 echo 'four files, no recursion, answer yes' >> err || framework_failure_
 rm -I file3-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -f file3-1 && fail=1
 test -f file3-2 && fail=1
 test -f file3-3 && fail=1
@@ -86,7 +86,7 @@ if ls /dev/stdin >/dev/null 2>&1; then
     write_prot_msg2="rm: remove write-protected regular file 'file3-4'? "
   fi
   cat in-y in-n | rm ---presume-input-tty -I file3-* >> out 2>> err || fail=1
-  echo . >> err || fail=1
+  echo . >> err || framework_failure_
   test -f file3-1 && fail=1
   test -f file3-2 && fail=1
   test -f file3-3 && fail=1
@@ -99,29 +99,27 @@ fi
 
 echo 'one file, recursion, answer no' >> err || framework_failure_
 rm -I -R dir1-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -d dir1-1 || fail=1
 
 echo 'one file, recursion, answer yes' >> err || framework_failure_
 rm -I -R dir1-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -d dir1-1 && fail=1
 
 echo 'multiple files, recursion, answer no' >> err || framework_failure_
 rm -I -R dir2-* < in-n >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -d dir2-1 || fail=1
 test -d dir2-2 || fail=1
 
 echo 'multiple files, recursion, answer yes' >> err || framework_failure_
 rm -I -R dir2-* < in-y >> out 2>> err || fail=1
-echo . >> err || fail=1
+echo . >> err || framework_failure_
 test -d dir2-1 && fail=1
 test -d dir2-2 && fail=1
 
-cat <<\EOF > expout || fail=1
-EOF
-cat <<EOF > experr || fail=1
+cat <<EOF > experr || framework_failure_
 one file, no recursion
 .
 one file, read only, answer no
@@ -144,7 +142,7 @@ multiple files, recursion, answer yes
 rm: remove 2 arguments recursively? .
 EOF
 
-compare expout out || fail=1
+compare /dev/null out || fail=1
 compare experr err || fail=1
 
 Exit $fail
index 5f29e447118c98a82d553c44b38a57c9aa9343b0..77490cef59654fd415fb2e96bc8f8e13df1a6fb6 100755 (executable)
@@ -31,7 +31,7 @@ chmod u-w fu du empty-u || framework_failure_
 cd ..
 
 
-cat <<EOF > in
+cat <<EOF > in || framework_failure_
 y
 y
 y
@@ -52,9 +52,9 @@ rm -ir z < in > out 2>&1 || fail=1
 # This avoids a bug whereby some vendor-provided (Tru64) versions of sed
 # would mistakenly tack a newline onto the end of the output.
 tr '?' '\n' < out | head --bytes=-1 | sed 's/^ //' |sort > o2
-mv o2 out
+mv o2 out || framework_failure_
 
-sort <<EOF > exp || fail=1
+sort <<EOF > exp || framework_failure_
 rm: descend into directory 'z'
 rm: remove regular empty file 'z/empty'
 rm: remove write-protected regular file 'z/fu'
index 531227898a4eac565806f06d5ec537ba9058c88a..975f92e76e7fa6f609ffac05bf1b0403c9f8dea7 100755 (executable)
@@ -24,7 +24,7 @@ touch a/x || framework_failure_
 
 
 rm --verbose -r a/// > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 removed 'a/x'
 removed directory 'a/'
 EOF
index 27fdc3b665bfe5a4a9ccfb9ebc8f40e4e3341e47..80415492c9eb5d74355f7a4235fcefbcdee88b8f 100644 (file)
@@ -27,7 +27,7 @@ print_ver_ FIXME
 # FIXME: . "$abs_srcdir/tests/other-fs-tmpdir"
 
 FIXME > out || fail=1
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 FIXME
 EOF
 
index a2925b2489753d5605bbe6d2981bcd60482a8d43..a83300c77fde0ebabc0c2024921e9fdd18babfca 100755 (executable)
@@ -29,7 +29,7 @@ touch --ref f --date='-5 days' f || fail=1
 TZ=UTC0 ls -og --time-style=+%Y-%m-%d f > out.1 || fail
 sed 's/ f$//;s/.* //' out.1 > out
 
-cat <<\EOF > exp || fail=1
+cat <<\EOF > exp || framework_failure_
 2004-01-11
 EOF