summaryrefslogtreecommitdiff
path: root/tests/tail-2/append-only
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-09-13 08:44:26 +0200
committerJim Meyering <jim@meyering.net>2007-09-15 08:40:39 +0200
commit53d36aaf9a856f523bd52de479a88f14338edda3 (patch)
treed43c74c6219ab7e0f8d294c131189034b15bea47 /tests/tail-2/append-only
parent10d190b8b6289f8a4b4818bd03b8f3a5dc87fd14 (diff)
downloadcoreutils-53d36aaf9a856f523bd52de479a88f14338edda3.tar.xz
Adapt tests/tail-2/ to use test-lib.sh.
Diffstat (limited to 'tests/tail-2/append-only')
-rwxr-xr-xtests/tail-2/append-only21
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/tail-2/append-only b/tests/tail-2/append-only
index 30cd2c134..94adba558 100755
--- a/tests/tail-2/append-only
+++ b/tests/tail-2/append-only
@@ -2,7 +2,7 @@
# Ensure that tail -f works on an append-only file
# Requires root access to do chattr +a, as well as an ext[23] or xfs file system
-# Copyright (C) 2006 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -23,22 +23,15 @@ if test "$VERBOSE" = yes; then
fi
PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
+. $srcdir/../test-lib.sh
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
+chattr_a_works=1
touch f
-chattr +a f 2>/dev/null || framework_failure=1
-( echo x > f ) 2>/dev/null && framework_failure=1
-echo x >> f || framework_failure=1
+chattr +a f 2>/dev/null || chattr_a_works=0
+( echo x > f ) 2>/dev/null && chattr_a_works=0
+echo x >> f || chattr_a_works=0
-if test $framework_failure = 1; then
+if test $chattr_a_works = 0; then
echo "$0: chattr +a doesn't work on this file system; skipping this test " 1>&2
(exit 77); exit 77
fi