summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-01-07 15:34:34 +0000
committerJim Meyering <jim@meyering.net>2003-01-07 15:34:34 +0000
commit6580a55aeb5b5f8c1f312cfcc74edafc1ae876ed (patch)
tree6e47d0dd2547e4a69e434a707edf4764d0487db6
parent8586d4652e8734987762277d3e754d9ac9d85eab (diff)
downloadcoreutils-6580a55aeb5b5f8c1f312cfcc74edafc1ae876ed.tar.xz
Remove the test for non-owner diagnostic.
Now, this tests only the nonexistent-directory diagnostic.
-rwxr-xr-xtests/touch/fail-diag23
1 files changed, 5 insertions, 18 deletions
diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag
index b7abd195a..f050f5798 100755
--- a/tests/touch/fail-diag
+++ b/tests/touch/fail-diag
@@ -19,7 +19,7 @@ framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
-d1=/no-$$
+d1=no-$$
dir=/$d1/such-dir
# Ensure that $d1 doesn't already exist.
ls -d $d1 2> /dev/null && framework_failure=1
@@ -31,25 +31,12 @@ fi
fail=0
-# Before fileutils-4.1, we'd get the following misleading
-# diagnostic instead of `Permission denied'.
-# touch: creating `/': Is a directory
-touch / > out 2>&1 && fail=1
-
-touch $dir >> out 2>&1 && fail=1
-
-# On SunOS4, EPERM is `Not owner'.
-# On some *BSD systems it's `Operation not permitted'.
-for msg in 'Not owner' 'Operation not permitted' 'Permission denied'; do
- cat > exp <<EOF
- touch: setting times of \`/': $msg
- touch: creating \`$dir': No such file or directory
+touch $dir > out 2>&1 && fail=1
+cat <<EOF > exp
+touch: cannot touch \`$dir': No such file or directory
EOF
- cmp out exp > /dev/null 2>&1 && break
-
-done
-
+cmp out exp || fail=1
test $fail = 1 && diff out exp 2> /dev/null
(exit $fail); exit