xfstests: cleanup duplicates in all tests
[xfstests-dev.git] / tests / xfs / 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
25 seq=`basename $0`
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 status=1        # failure is the default!
32
33 # get standard environment, filters and checks
34 . ./common/rc
35 . ./common/filter
36 . ./common/log
37 . ./common/quota
38
39 # real QA test starts here
40 _supported_fs xfs
41 _supported_os IRIX Linux
42
43 _cleanup()
44 {
45     cd /
46     _cleanup_logfiles
47     rm -f $tmp.*
48     echo "*** unmount"
49     umount $SCRATCH_MNT 2>/dev/null
50 }
51 trap "_cleanup; exit \$status" 0 1 2 3 15
52
53 # prelim
54 rm -f $seqres.full $tmp.*
55 _require_scratch
56 _require_xfs_quota
57 _require_v2log
58  
59 echo "*** init FS"
60 umount $SCRATCH_DEV >/dev/null 2>&1
61
62 # do a simple quota test to ensure DQUOT data is happening
63 export MOUNT_OPTIONS="-o quota,gquota"
64
65 if [ "$HOSTOS" = "IRIX" ]; then 
66     start=0
67 else
68     start=2
69 fi
70
71 # mount with quotas?
72 _scratch_mkfs_xfs "-l version=1" 1>/dev/null 2>&1
73 _qmount
74 src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
75 umount $SCRATCH_MNT
76
77 _mkfs_log "-l version=1"
78 _create_log
79 _check_log
80 _print_transaction_inode $start
81 _cmp_output $seq.ugquota.trans_inode $filtered
82
83 # got thru it all so we may have success
84 status=0
85 exit