Test 214 and 236 use the same file names for test files in the TEST
filesystem and don't check/create clean initial test state. Hence if
you run 214 then 236, 236 will fail with:
+link: cannot create link `/mnt/test/ouch2' to `/mnt/test/ouch': File exists
+ctime:
1277076527 ->
1277076527
+Fatal error: ctime not updated after link
Ensure that both tests clean up after themselves properly and also
ensure a clean state before they start.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
_cleanup()
{
+ rm -f $TEST_DIR/ouch*
cd /
rm -f $tmp.*
}
[ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found"
rm -f $seq.full
+rm -f $TEST_DIR/ouch*
_require_xfs_io_falloc
_cleanup()
{
- if [ -a $TEST_DIR/ouch2 ]; then
- rm -f $TEST_DIR/ouch2
- fi
- if [ -a $TEST_DIR/ouch ]; then
- rm -f $TEST_DIR/ouch
- fi
+ rm -f $TEST_DIR/ouch*
}
here=`pwd`
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
# get standard environment, filters and checks
. ./common.rc
# only Linux supports fallocate
_supported_os Linux
+rm -f $TEST_DIR/ouch*
+
# create a file and get its ctime
touch $TEST_DIR/ouch
ctime=`stat -c %Z $TEST_DIR/ouch`
exit 1
fi
-_cleanup
-
echo "Test over."
# success, all done
status=0