xfs: fix old fuzz test invocations of xfs_repair
[xfstests-dev.git] / tests / xfs / 282
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2012 SGI.  All Rights Reserved.
4 #
5 # FS QA Test No. 282
6 #
7 # Test incremental dumps containing a mix of dump formats.
8 # level 0 - format 2
9 # level 1 - current format
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22         _cleanup_dump
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/dump
30
31 # real QA test starts here
32 _supported_fs xfs
33
34 _require_legacy_v2_format
35
36 _create_dumpdir_fill
37 # ensure file/dir timestamps precede dump timestamp
38 sleep 2
39 $here/src/bstat $SCRATCH_MNT >>$seqres.full
40
41 echo "*** Level 0 dump, format 2"
42 _do_dump_file -f $tmp.l0 -K
43
44 _append_dumpdir_fill
45 $here/src/bstat $SCRATCH_MNT >>$seqres.full
46
47 echo "*** Level 1 dump, current format"
48 _do_dump_file -l 1 -f $tmp.l1
49
50 echo "*** Restore using format 2 level 0"
51 _prepare_restore_dir
52 _do_restore_file_cum -f $tmp.l0
53
54 echo "*** Restore using current format level 1"
55 _do_restore_file_cum -f $tmp.l1
56 _diff_compare
57
58 # success, all done
59 status=0
60 exit