generic: test MADV_POPULATE_READ with IO errors
[xfstests-dev.git] / tests / btrfs / 009
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/009
6 #
7 # Regression test to make sure we can't delete the default subvol
8 #
9 . ./common/preamble
10 _begin_fstest auto quick subvol
11
12 # Import common functions.
13 . ./common/filter
14
15 # real QA test starts here
16 _supported_fs btrfs
17 _require_scratch
18
19 _scratch_mkfs > /dev/null 2>&1
20 _scratch_mount
21
22 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/newvol >> $seqres.full 2>&1 \
23         || _fail "couldn't create subvol"
24 subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT newvol)
25 $BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT >> $seqres.full 2>&1 \
26         || _fail "couldn't set default"
27 $BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/newvol >> $seqres.full 2>&1
28 _scratch_unmount
29 _try_scratch_mount || _fail "mount should have succeeded"
30
31 echo "Silence is golden"
32 status=0 ; exit