Put _qmount_option into common.quota for other quota tests to use.
[xfstests-dev.git] / 003
1 #! /bin/sh
2 #
3 # FS QA Test No. 003
4 #
5 # exercise xfs_db bug #784078
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
9 #-----------------------------------------------------------------------
10 #
11 # creator
12 owner=nathans@sgi.com
13
14 seq=`basename $0`
15 echo "QA output created by $seq"
16
17 # get standard environment, filters and checks
18 . ./common.rc
19 . ./common.filter
20
21 tmp=/tmp/$$
22 here=`pwd`
23 status=0        # success is the default!
24 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
25
26 _need_to_be_root
27
28 # real QA test starts here
29 _supported_fs xfs
30 _supported_os IRIX Linux
31
32 [ -f core ] && rm -f core
33 [ -f core ] && echo "Warning: can't nuke existing core file!"
34
35 test_done()
36 {
37         sts=$?
38         [ -f core ] && echo "FAILED - core file"
39         [ ! -f core -a $sts != 0 ] && echo "FAILED - non-zero exit status"
40         rm -f core
41 }
42
43 # real QA test starts here
44
45 echo "=== TEST 1 ==="
46 xfs_db -r -c 'pop' -c 'type sb' $TEST_DEV
47 test_done
48
49 echo "=== TEST 2 ==="
50 xfs_db -r -c 'push sb' $TEST_DEV
51 test_done
52
53 echo "=== TEST 3 ==="
54 xfs_db -r -c 'pop' -c 'push sb' $TEST_DEV
55 test_done
56
57 echo "=== TEST 4 ==="
58 xfs_db -r -c 'type sb' -c 'print' $TEST_DEV
59 test_done
60
61 echo "=== TEST 5 ==="
62 xfs_db -r -c 'inode 128' -c 'push' -c 'type' $TEST_DEV >$tmp.out 2>&1
63 test_done
64 # On IRIX we lose state after a "push" operation and don't
65 # know the type is still inode
66 # Probably not worth changing xfs_db on IRIX for this.
67 if [ "$HOSTOS" != "IRIX" ]; then
68     if ! grep -q "current type is \"inode\"" $tmp.out
69     then
70             cat $tmp.out
71     fi
72 fi
73
74 echo "=== TEST 6 ==="
75 xfs_db -r -c 'sb' -c 'a' $TEST_DEV >$tmp.out 2>&1 # don't care about output
76 test_done
77
78 echo "=== TEST 7 ==="
79 xfs_db -r -c 'ring' $TEST_DEV
80 test_done