summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-12-09 09:41:53 +0000
committerJim Meyering <jim@meyering.net>2002-12-09 09:41:53 +0000
commit294a26c23c10e77e888069524a353b55846df399 (patch)
tree948a09ae0190bc05b0ec81d256de2b356e12d2a6 /tests
parent833afe42f03c5dea610c76a8c033f56875d8c97c (diff)
downloadcoreutils-294a26c23c10e77e888069524a353b55846df399.tar.xz
Don't get a test failure if /no exists.
Instead, evoke a framework failure if /no-$$ exists.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/touch/fail-diag9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag
index bf77caa5a..a77a89687 100755
--- a/tests/touch/fail-diag
+++ b/tests/touch/fail-diag
@@ -19,6 +19,11 @@ framework_failure=0
mkdir $tmp || framework_failure=1
cd $tmp || framework_failure=1
+d1=/no-$$
+dir=/$d1/such-dir
+# Ensure that $d1 doesn't already exist.
+ld -d $d1 2> /dev/null && framework_failure=1
+
if test $framework_failure = 1; then
echo 'failure in testing framework' 1>&2
(exit 1); exit
@@ -31,14 +36,14 @@ fail=0
# touch: creating `/': Is a directory
touch / > out 2>&1 && fail=1
-touch /no/such-dir >> 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 \`/no/such-dir': No such file or directory
+ touch: creating \`$dir': No such file or directory
EOF
cmp out exp > /dev/null 2>&1 && break