xfstests: randholes: clean up readblks()
[xfstests-dev.git] / 081
1 #! /bin/bash
2 # FS QA Test No. 081
3 #
4 # To test out logprint with quotas
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2003 Silicon Graphics, Inc.  All Rights Reserved.
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 #
22 #-----------------------------------------------------------------------
23 #
24 # creator
25 owner=tes@sgi.com
26
27 seq=`basename $0`
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33
34 # get standard environment, filters and checks
35 . ./common.rc
36 . ./common.filter
37 . ./common.log
38 . ./common.quota
39
40 # real QA test starts here
41 _supported_fs xfs
42 _supported_os IRIX Linux
43
44 _cleanup()
45 {
46     cd /
47     _cleanup_logfiles
48     rm -f $tmp.*
49     echo "*** unmount"
50     umount $SCRATCH_MNT 2>/dev/null
51 }
52 trap "_cleanup; exit \$status" 0 1 2 3 15
53
54 # prelim
55 rm -f $seq.full $tmp.*
56 _require_scratch
57 _require_xfs_quota
58 _require_v2log
59  
60 echo "*** init FS"
61 umount $SCRATCH_DEV >/dev/null 2>&1
62
63
64 # do a simple quota test to ensure DQUOT data is happening
65 export MOUNT_OPTIONS="-o quota,gquota"
66
67 if [ "$HOSTOS" = "IRIX" ]; then 
68     start=0
69 else
70     start=2
71 fi
72
73 # mount with quotas?
74 _scratch_mkfs_xfs "-l version=1" 1>/dev/null 2>&1
75 _qmount
76 src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
77 umount $SCRATCH_MNT
78
79 _mkfs_log "-l version=1"
80 _create_log
81 _check_log
82 _print_transaction_inode $start
83 _cmp_output $seq.ugquota.trans_inode $filtered
84
85 # got thru it all so we may have success
86 status=0
87 exit