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