2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 Fusion IO. All Rights Reserved.
5 # FS QA Test No. btrfs/009
7 # Regression test to make sure we can't delete the default subvol
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
16 status=1 # failure is the default!
23 trap "_cleanup ; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # real QA test starts here
36 _scratch_mkfs > /dev/null 2>&1
39 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/newvol >> $seqres.full 2>&1 \
40 || _fail "couldn't create subvol"
41 subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT newvol)
42 $BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT >> $seqres.full 2>&1 \
43 || _fail "couldn't set default"
44 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/newvol >> $seqres.full 2>&1
46 _try_scratch_mount || _fail "mount should have succeeded"
48 echo "Silence is golden"