summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-06-25 20:19:52 +0000
committerJim Meyering <jim@meyering.net>2000-06-25 20:19:52 +0000
commit0a0e82382c931ccdbf6bccf4825fbb736b9b8c01 (patch)
treee9a3ddaa88eb3f5897d71ba9bc60e46c58954b2a /tests
parent34591391d13efb3d44e658e2c677863a4a7f185c (diff)
downloadcoreutils-0a0e82382c931ccdbf6bccf4825fbb736b9b8c01.tar.xz
*** empty log message ***
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cp/fail-perm13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/cp/fail-perm b/tests/cp/fail-perm
index 332b5b354..160b1e76a 100755
--- a/tests/cp/fail-perm
+++ b/tests/cp/fail-perm
@@ -14,13 +14,24 @@ touch D/a || framework_failure=1
chmod 0 D/a || framework_failure=1
chmod 500 D || framework_failure=1
+touch file || framework_failure=1
+chmod u-w file || framework_failure=1
+(echo foo >> file) >/dev/null 2>&1 && {
+ echo '********************************************'
+ echo "$0: NOTICE: This test case cannot be run as root."
+ echo '********************************************'
+ exit 77
+}
+
if test $framework_failure = 1; then
echo 'failure in testing framework'
exit 1
fi
fail=0
-cp -pR D DD > /dev/null 2>&1 || fail=1
+
+# This is expected to exit non-zero, because it can't read D/a.
+cp -pR D DD > /dev/null 2>&1 && fail=1
# Permissions on DD must be `dr-x------'