From 294a26c23c10e77e888069524a353b55846df399 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 9 Dec 2002 09:41:53 +0000 Subject: Don't get a test failure if /no exists. Instead, evoke a framework failure if /no-$$ exists. --- tests/touch/fail-diag | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/touch/fail-diag') 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 < /dev/null 2>&1 && break -- cgit v1.2.3-70-g09d2