xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / btrfs / 015
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/015
6 #
7 # Regression test to make sure we can create a snapshot after mounting with
8 # readonly and remounting rw.
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16
17 status=1        # failure is the default!
18
19 _cleanup()
20 {
21         rm -f $tmp.*
22 }
23
24 trap "_cleanup ; exit \$status" 0 1 2 3 15
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 # real QA test starts here
31 _supported_fs btrfs
32 _require_scratch
33
34 rm -f $seqres.full
35
36 _scratch_mkfs > /dev/null 2>&1
37 _scratch_mount -o ro
38 _scratch_mount -o rw,remount
39
40 $BTRFS_UTIL_PROG subvolume snapshot $SCRATCH_MNT $SCRATCH_MNT/snap >> $seqres.full 2>&1 \
41         || _fail "couldn't create snapshot"
42
43 echo "Silence is golden"
44 status=0 ; exit