From 53d36aaf9a856f523bd52de479a88f14338edda3 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 13 Sep 2007 08:44:26 +0200 Subject: Adapt tests/tail-2/ to use test-lib.sh. --- tests/tail-2/append-only | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'tests/tail-2/append-only') 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 -- cgit v1.2.3-54-g00ecf