dc9e9fc460e07a0202335741883e1f4493d9ec54
[xfstests-dev.git] / tests / btrfs / 032
1 #!/bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Fujitsu.  All Rights Reserved.
4 #
5 # FS QA Test No. btrfs/032
6 #
7 # Regression test for transaction abortion when remounting RW to RO
8 # with flushoncommit option enabled.
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
18 _cleanup()
19 {
20     rm -f $tmp.*
21 }
22
23 trap "_cleanup ; exit \$status" 0 1 2 3 15
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28
29 # real QA test starts here
30 _supported_fs btrfs
31 _supported_os Linux
32 _require_scratch
33
34 _scratch_mkfs > /dev/null 2>&1
35 _scratch_mount "-o flushoncommit"
36
37 $XFS_IO_PROG -f -c "pwrite 0 10M" "$SCRATCH_MNT/tmpfile" | _filter_xfs_io
38
39 _scratch_mount "-o remount,ro"
40
41 status=0 ; exit