2 # Ensure that tail -f works on an append-only file
3 # Requires root access to do chattr +a, as well as an ext[23] or xfs file system
5 if test "$VERBOSE" = yes; then
10 PRIV_CHECK_ARG=require-root . $srcdir/../priv-check
13 t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
14 trap 'status=$?; cd $pwd; chmod -R u+rwx $t0; rm -rf $t0 && exit $status' 0
15 trap '(exit $?); exit $?' 1 2 13 15
18 mkdir -p $tmp || framework_failure=1
19 cd $tmp || framework_failure=1
22 chattr +a f 2>/dev/null || framework_failure=1
23 ( echo x > f ) 2>/dev/null && framework_failure=1
24 echo x >> f || framework_failure=1
26 if test $framework_failure = 1; then
27 echo "$0: failure in testing framework" 1>&2
35 tail --pid=$pid -f f > /dev/null 2>&1 || fail=1
36 chattr -a f 2>/dev/null
38 (exit $fail); exit $fail