btrfs: Verify falloc on multiple holes won't leak qgroup reserved data space
[xfstests-dev.git] / tests / btrfs / 018
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Fusion IO.  All Rights Reserved.
4 #
5 # FS QA Test No. btrfs/018
6 #
7 # Regression test to make sure we can move a subvol into another subvol
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
16 status=1        # failure is the default!
17
18 _cleanup()
19 {
20         rm -f $tmp.*
21 }
22
23 trap "_cleanup ; exit \$status" 0 1 2 3 15
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28
29 # real QA test starts here
30 _supported_fs btrfs
31 _supported_os Linux
32 _require_scratch
33
34 rm -f $seqres.full
35
36 _scratch_mkfs > /dev/null 2>&1
37 _scratch_mount
38 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/test1 >> $seqres.full 2>&1 \
39         || _fail "couldn't create test1"
40 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/test2 >> $seqres.full 2>&1 \
41         || _fail "couldn't create test1"
42 mv $SCRATCH_MNT/test1 $SCRATCH_MNT/test2 || _fail "Problem doing move"
43
44 echo "Silence is golden"
45 status=0 ; exit