xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / xfs / 247
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 247
6 #
7 # Mount a reflink/rmap filesystem ro (so the per-AG reservation isn't
8 # created) and unmount, to ensure that we free correctly.
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 status=1    # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21     cd /
22     rm -rf $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/reflink
29
30 # real QA test starts here
31 _supported_fs xfs
32 _require_scratch_reflink
33
34 rm -f $seqres.full
35
36 echo "Format and mount"
37 _scratch_mkfs > $seqres.full 2>&1
38 _scratch_mount -o ro >> $seqres.full 2>&1
39
40 # success, all done
41 status=0
42 exit