Abort tests if a failure is encountered while creating/writing test files.
[xfstests-dev.git] / 079
1 #! /bin/sh
2 # FS QA Test No. 079
3 #
4 # Run the t_immutable test program for immutable/append-only files.
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=nathans@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 timmutable=$here/src/t_immutable
18 tmp=/tmp/$$
19 status=1        # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24     cd /
25     echo "*** cleaning up"
26     $timmutable -r $SCRATCH_MNT/$seq
27     umount $SCRATCH_MNT
28 }
29
30 # get standard environment, filters and checks
31 . ./common.rc
32 . ./common.filter
33
34 _supported_fs xfs
35 _supported_os Linux
36
37 _require_scratch
38 [ -x $timmutable ] || _notrun "t_immutable was not built for this platform"
39
40 # real QA test starts here
41 _scratch_mkfs_xfs 2>&1 >/dev/null || _fail "mkfs failed"
42 _scratch_mount || _fail "mount failed"
43
44 echo "*** starting up"
45 $timmutable -c $SCRATCH_MNT/$seq
46 status=$?
47 exit