summaryrefslogtreecommitdiff
path: root/tests/cp
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-10-29 14:40:40 +0100
committerJim Meyering <meyering@redhat.com>2009-10-29 16:51:07 +0100
commit39da66f979c206946e5593dbd432e88905a9e383 (patch)
treeab796006220074433a99f012d6a67f3b759b6768 /tests/cp
parent22776f84cba4102306a36cd06ea4c54282432423 (diff)
downloadcoreutils-39da66f979c206946e5593dbd432e88905a9e383.tar.xz
tests: don't let a fail=1 env. setting induce unwarranted test failure
* cfg.mk (sc_fail_is_initialized): New rule. Fix the offenders: * tests/cp/acl: Set fail=0 * tests/cp/backup-is-src: Likewise. * tests/cp/file-perm-race: Likewise. * tests/cp/reflink-auto: Likewise. * tests/cp/same-file: Likewise. * tests/ln/backup-1: Likewise. * tests/misc/su-fail: Likewise. * tests/misc/truncate-owned-by-other: Likewise. * tests/mkdir/p-3: Likewise. * tests/mkdir/selinux: Likewise. * tests/mkdir/special-1: Likewise. * tests/mv/acl: Likewise. * tests/mv/backup-is-src: Likewise. * tests/mv/diag: Likewise. * tests/mv/force: Likewise. * tests/mv/hard-link-1: Likewise. * tests/mv/into-self-3: Likewise. * tests/mv/sticky-to-xpart: Likewise. * tests/touch/now-owned-by-other: Likewise.
Diffstat (limited to 'tests/cp')
-rwxr-xr-xtests/cp/acl1
-rwxr-xr-xtests/cp/backup-is-src1
-rwxr-xr-xtests/cp/file-perm-race1
-rwxr-xr-xtests/cp/reflink-auto3
-rwxr-xr-xtests/cp/same-file2
5 files changed, 6 insertions, 2 deletions
diff --git a/tests/cp/acl b/tests/cp/acl
index 2f8742880..059a1e10c 100755
--- a/tests/cp/acl
+++ b/tests/cp/acl
@@ -45,6 +45,7 @@ acl1=`cd a && getfacl file | grep -v ':bin:' | grep -v 'mask::'` \
test $skip = yes &&
skip_test_ "'.' is not on a suitable file system for this test"
+fail=0
# copy a file without preserving permissions
cp a/file b/ || fail=1
diff --git a/tests/cp/backup-is-src b/tests/cp/backup-is-src
index bf03e590a..f226382d0 100755
--- a/tests/cp/backup-is-src
+++ b/tests/cp/backup-is-src
@@ -26,6 +26,7 @@ fi
echo a > a || framework_failure
echo a-tilde > a~ || framework_failure
+fail=0
# This cp command should exit nonzero.
cp --b=simple a~ a > out 2>&1 && fail=1
diff --git a/tests/cp/file-perm-race b/tests/cp/file-perm-race
index 1ff2746c2..8ae7cb04e 100755
--- a/tests/cp/file-perm-race
+++ b/tests/cp/file-perm-race
@@ -23,6 +23,7 @@ fi
. $srcdir/test-lib.sh
+fail=0
umask 022
mkfifo fifo ||
skip_test_ "fifos not supported"
diff --git a/tests/cp/reflink-auto b/tests/cp/reflink-auto
index d1f6b2bca..5e39b7265 100755
--- a/tests/cp/reflink-auto
+++ b/tests/cp/reflink-auto
@@ -28,8 +28,9 @@ cleanup_() { rm -rf "$other_partition_tmpdir"; }
a_other="$other_partition_tmpdir/a"
rm -f "$a_other" || framework_failure
-echo non_zero_size > "$a_other"
+echo non_zero_size > "$a_other" || framework_failure
+fail=0
# we shouldn't be able to reflink() files on separate partitions
cp --reflink "$a_other" b && fail=1
diff --git a/tests/cp/same-file b/tests/cp/same-file
index 6d57ebd6a..d5deb6857 100755
--- a/tests/cp/same-file
+++ b/tests/cp/same-file
@@ -220,7 +220,7 @@ cat <<\EOF | sed "$remove_these_sed" > $expected
EOF
-fail=0;
+fail=0
compare $expected $actual 1>&2 || fail=1