summaryrefslogtreecommitdiff
path: root/tests/touch
diff options
context:
space:
mode:
Diffstat (limited to 'tests/touch')
-rwxr-xr-xtests/touch/empty-file13
-rwxr-xr-xtests/touch/fail-diag13
-rwxr-xr-xtests/touch/fifo10
-rwxr-xr-xtests/touch/no-rights12
-rwxr-xr-xtests/touch/not-owner2
-rwxr-xr-xtests/touch/read-only13
-rwxr-xr-xtests/touch/relative8
7 files changed, 18 insertions, 53 deletions
diff --git a/tests/touch/empty-file b/tests/touch/empty-file
index 013d93f99..296faae27 100755
--- a/tests/touch/empty-file
+++ b/tests/touch/empty-file
@@ -38,16 +38,15 @@ fail=0
: ${TOUCH_DIR_LIST=.}
-framework_failure=0
for d in $TOUCH_DIR_LIST; do
rm -rf $d/a $d/b $d/c
- > $d/a || framework_failure=1
- test -f $d/a || framework_failure=1
- > $d/b || framework_failure=1
- test -f $d/b || framework_failure=1
- > $d/c || framework_failure=1
- test -f $d/c || framework_failure=1
+ > $d/a || framework_failure
+ test -f $d/a || framework_failure
+ > $d/b || framework_failure
+ test -f $d/b || framework_failure
+ > $d/c || framework_failure
+ test -f $d/c || framework_failure
done
echo sleeping for $SLEEP_SECONDS seconds...
diff --git a/tests/touch/fail-diag b/tests/touch/fail-diag
index b1abdba37..018d191e5 100755
--- a/tests/touch/fail-diag
+++ b/tests/touch/fail-diag
@@ -21,23 +21,14 @@ if test "$VERBOSE" = yes; then
touch --version
fi
-. $srcdir/../envvar-check
. $srcdir/../lang-default
-PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
-
. $srcdir/../test-lib.sh
-
-framework_failure=0
+skip_if_root_
d1=no-$$
dir=/$d1/such-dir
# Ensure that $d1 doesn't already exist.
-ls -d $d1 2> /dev/null && framework_failure=1
-
-if test $framework_failure = 1; then
- echo 'failure in testing framework' 1>&2
- (exit 1); exit 1
-fi
+ls -d $d1 2> /dev/null && framework_failure
fail=0
diff --git a/tests/touch/fifo b/tests/touch/fifo
index 0e841a06c..796d330d9 100755
--- a/tests/touch/fifo
+++ b/tests/touch/fifo
@@ -23,13 +23,7 @@ fi
. $srcdir/../test-lib.sh
-framework_failure=0
-
-tmp=fifo-$$
-rm -rf $tmp
-mkfifo $tmp || framework_failure=1
-
-if test $framework_failure = 1; then
+if ! mkfifo fifo; then
# Make an exception of this case -- usually we interpret framework-creation
# failure as a test failure. However, in this case, when running on a SunOS
# system using a disk NFS mounted from OpenBSD, the above fails like this:
@@ -42,6 +36,6 @@ fi
fail=0
-touch $tmp || fail=1
+touch fifo || fail=1
exit $fail
diff --git a/tests/touch/no-rights b/tests/touch/no-rights
index 72c3caad7..7fe9d29c6 100755
--- a/tests/touch/no-rights
+++ b/tests/touch/no-rights
@@ -25,17 +25,11 @@ fi
. $srcdir/../test-lib.sh
# Make sure t2 is newer than t1.
-touch -d '2000-01-01 00:00' t1 || framework_failure=1
-touch -d '2000-01-02 00:00' t2 || framework_failure=1
+touch -d '2000-01-01 00:00' t1 || framework_failure
+touch -d '2000-01-02 00:00' t2 || framework_failure
-framework_failure=0
set x `ls -t t1 t2`
-test "$*" = "x t2 t1" || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+test "$*" = "x t2 t1" || framework_failure
fail=0
diff --git a/tests/touch/not-owner b/tests/touch/not-owner
index a7496a006..9abb36ba1 100755
--- a/tests/touch/not-owner
+++ b/tests/touch/not-owner
@@ -23,7 +23,6 @@ if test "$VERBOSE" = yes; then
fi
. $srcdir/../lang-default
-PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
test=../../src/test
if $test -w /; then
@@ -37,6 +36,7 @@ if $test -O / || $test -G /; then
fi
. $srcdir/../test-lib.sh
+skip_if_root_
fail=0
diff --git a/tests/touch/read-only b/tests/touch/read-only
index 771eca4af..e1389c280 100755
--- a/tests/touch/read-only
+++ b/tests/touch/read-only
@@ -21,18 +21,11 @@ if test "$VERBOSE" = yes; then
touch --version
fi
-PRIV_CHECK_ARG=require-non-root . $srcdir/../priv-check
-
. $srcdir/../test-lib.sh
+skip_if_root_
-framework_failure=0
-: > read-only || framework_failure=1
-chmod 444 read-only || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+: > read-only || framework_failure
+chmod 444 read-only || framework_failure
fail=0
diff --git a/tests/touch/relative b/tests/touch/relative
index 02dfe9c6c..910a3782c 100755
--- a/tests/touch/relative
+++ b/tests/touch/relative
@@ -24,13 +24,7 @@ fi
. $srcdir/../test-lib.sh
-framework_failure=0
-TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure=1
-
-if test $framework_failure = 1; then
- echo "$0: failure in testing framework" 1>&2
- (exit 1); exit 1
-fi
+TZ=UTC0 touch --date='2004-01-16 12:00 +0000' f || framework_failure
fail=0