xfs/419: remove irrelevant swapfile test
[xfstests-dev.git] / tests / xfs / 220
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2009 Christoph Hellwig.  All Rights Reserved.
4 #
5 # FS QA Test No. 220
6 #
7 # Test quota off handling.
8 #
9 # Based on bug reports from Utako Kusaka <u-kusaka@wm.jp.nec.com> and
10 # Ryota Yamauchi <r-yamauchi@vf.jp.nec.com>.
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19
20 _cleanup()
21 {
22         cd /
23         _scratch_unmount >/dev/null 2>&1
24 }
25 trap "_cleanup; exit \$status" 0 1 2 3 15
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30 . ./common/quota
31
32 # real QA test starts here
33 _supported_fs xfs
34
35 _require_scratch
36 _require_quota
37
38 # Only mount with the specific quota options mentioned below
39 _qmount_option "defaults"
40
41 echo "Silence is golden."
42
43 # create scratch filesystem
44 _scratch_mkfs_xfs >/dev/null 2>&1
45
46 # mount  with quotas enabled
47 _scratch_mount -o uquota
48
49 # turn off quota
50 xfs_quota -x -c off $SCRATCH_DEV
51
52 # and unmount (this used to crash)
53 _scratch_unmount
54
55 # create scratch filesystem
56 _scratch_mkfs_xfs >/dev/null 2>&1
57
58 # mount  with quotas enabled
59 _scratch_mount -o uquota
60
61 # turn off quota and remove space allocated to the quota files
62 # (this used to give wrong ENOSYS returns in 2.6.31)
63 xfs_quota -x -c off -c remove $SCRATCH_DEV
64
65 # and unmount again
66 _scratch_unmount
67
68 status=0
69 exit $status