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
35 _scratch_mkfs > /dev/null 2>&1
38 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/newvol >> $seqres.full 2>&1 \
39 || _fail "couldn't create subvol"
40 subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT newvol)
41 $BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT >> $seqres.full 2>&1 \
42 || _fail "couldn't set default"
43 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/newvol >> $seqres.full 2>&1
45 _try_scratch_mount || _fail "mount should have succeeded"
47 echo "Silence is golden"