fstests: check for filesystem FS_IOC_FSSETXATTR support
[xfstests-dev.git] / tests / xfs / 003
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 003
6 #
7 # exercise xfs_db bug #784078
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 # get standard environment, filters and checks
14 . ./common/rc
15 . ./common/filter
16
17 tmp=/tmp/$$
18 here=`pwd`
19 status=0        # success is the default!
20 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
21
22 # real QA test starts here
23 _supported_fs xfs
24 _supported_os Linux
25 _require_test
26
27 [ -f core ] && rm -f core
28 [ -f core ] && echo "Warning: can't nuke existing core file!"
29
30 test_done()
31 {
32         sts=$?
33         [ -f core ] && echo "FAILED - core file"
34         [ ! -f core -a $sts != 0 ] && echo "FAILED - non-zero exit status"
35         rm -f core
36 }
37
38 # real QA test starts here
39
40 echo "=== TEST 1 ==="
41 xfs_db -r -c 'pop' -c 'type sb' $TEST_DEV
42 test_done
43
44 echo "=== TEST 2 ==="
45 xfs_db -r -c 'push sb' $TEST_DEV
46 test_done
47
48 echo "=== TEST 3 ==="
49 xfs_db -r -c 'pop' -c 'push sb' $TEST_DEV
50 test_done
51
52 echo "=== TEST 4 ==="
53 xfs_db -r -c 'type sb' -c 'print' $TEST_DEV
54 test_done
55
56 echo "=== TEST 5 ==="
57 xfs_db -r -c 'inode 128' -c 'push' -c 'type' $TEST_DEV >$tmp.out 2>&1
58 test_done
59 if ! grep -q "current type is \"inode\"" $tmp.out; then
60     cat $tmp.out
61 fi
62
63 echo "=== TEST 6 ==="
64 xfs_db -r -c 'sb' -c 'a' $TEST_DEV >$tmp.out 2>&1 # don't care about output
65 test_done
66
67 echo "=== TEST 7 ==="
68 xfs_db -r -c 'ring' $TEST_DEV
69 test_done