xfs/007: fix regressions on V4 filesystems
[xfstests-dev.git] / tests / xfs / 283
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2012 SGI.  All Rights Reserved.
4 #
5 # FS QA Test No. 283
6 #
7 # Test incremental dumps containing a mix of dump formats.
8 # level 0 - current format
9 # level 1 - format 2
10 #
11 . ./common/preamble
12 _begin_fstest dump ioctl auto quick
13
14 # Override the default cleanup function.
15 _cleanup()
16 {
17         _cleanup_dump
18         cd /
19         rm -f $tmp.*
20 }
21
22 # Import common functions.
23 . ./common/dump
24
25 # real QA test starts here
26 _supported_fs xfs
27
28 _require_legacy_v2_format
29
30 _create_dumpdir_fill
31 # ensure file/dir timestamps precede dump timestamp
32 sleep 2
33 $here/src/bstat $SCRATCH_MNT >>$seqres.full
34
35 echo "*** Level 0 dump, current format"
36 _do_dump_file -f $tmp.l0
37
38 _append_dumpdir_fill
39 $here/src/bstat $SCRATCH_MNT >>$seqres.full
40
41 echo "*** Level 1 dump, format 2"
42 _do_dump_file -l 1 -f $tmp.l1 -K
43
44 # note the first restore has to be told to use format
45 # 2 generation numbers due to the unusual case of
46 # having a new-format dump followed by an old-format.
47 echo "*** Restore using current format level 0"
48 _prepare_restore_dir
49 _do_restore_file_cum -f $tmp.l0 -K
50
51 echo "*** Restore using format 2 level 1"
52 _do_restore_file_cum -f $tmp.l1
53 _diff_compare
54
55 # success, all done
56 status=0
57 exit