Added test for noatime checking
[xfstests-dev.git] / 034
1 #! /bin/sh
2 # FS QA Test No. 034
3 #
4 # pv 801241 - check for reference leaks from the *handle xfsctls
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #-----------------------------------------------------------------------
9 #
10 # creator
11 owner=dxm@sgi.com
12
13 seq=`basename $0`
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19
20 _cleanup()
21 {
22     cd /
23     rm -f $tmp.*
24     echo "*** unmount"
25     umount $SCRATCH_MNT 2>/dev/null
26 }
27 trap "_cleanup; exit \$status" 0 1 2 3 15
28
29 # get standard environment, filters and checks
30 . ./common.rc
31 . ./common.filter
32
33 # real QA test starts here
34 _supported_fs xfs
35 _supported_os Linux
36
37 _require_scratch
38
39 echo "*** init FS"
40
41 rm -f $seq.full
42 umount $SCRATCH_DEV >/dev/null 2>&1
43 echo "*** MKFS ***"                         >>$seq.full
44 echo ""                                     >>$seq.full
45 _scratch_mkfs_xfs                           >>$seq.full 2>&1 \
46     || _fail "mkfs failed"
47 _scratch_mount                              >>$seq.full 2>&1 \
48     || _fail "mount failed"
49
50 echo "*** test"
51
52 _check_scratch_fs
53
54 if ! touch $SCRATCH_MNT/fish
55 then
56     echo "!!! failed to touch fish"
57     exit
58 fi
59
60 if ! src/xfsctl $SCRATCH_MNT $SCRATCH_MNT/fish >>$seq.full 2>&1
61 then
62     echo "!!! failed to run xfsctl test program"
63     exit
64 fi
65
66 if ! rm $SCRATCH_MNT/fish
67 then
68     echo "!!! failed to remove fish"
69     exit
70 fi
71
72 # pv 801241 causes corruption here (inode left in agi_unlinked list)
73 _check_scratch_fs
74
75 echo "*** done"
76 # happy exit
77 status=0
78 exit 0