common: kill _supported_os
[xfstests-dev.git] / tests / btrfs / 033
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/033
6 #
7 # Regression test for iterating backrefs
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1        # failure is the default!
16
17 _cleanup()
18 {
19     rm -f $tmp.*
20 }
21
22 trap "_cleanup ; exit \$status" 0 1 2 3 15
23
24 # get standard environment, filters and checks
25 . ./common/rc
26 . ./common/filter
27
28 # real QA test starts here
29 _supported_fs btrfs
30 _require_scratch
31
32 _scratch_mkfs > /dev/null 2>&1
33 _scratch_mount
34
35 touch $SCRATCH_MNT/foo
36
37 # get file with fragments by using backwards writes.
38 for i in `seq 10240 -1 1`; do
39         $XFS_IO_PROG -f -d -c "pwrite $(($i * 4096)) 4096" \
40                 $SCRATCH_MNT/foo > /dev/null
41 done
42
43 # get some snapshots here to make sure we are really
44 # suffering from walking backrefs.
45 for i in `seq 0 50`; do
46         $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT \
47                 $SCRATCH_MNT/snap_$i >> $seqres.full 2>&1
48 done
49
50 $BTRFS_UTIL_PROG send -f $SCRATCH_MNT/send_file \
51         $SCRATCH_MNT/snap_1 >> $seqres.full 2>&1
52
53 echo "Silence is golden"
54 status=0 ; exit