xfstests: convert tests to use new results directory
[xfstests-dev.git] / tests / xfs / 282
1 #! /bin/bash
2 # FS QA Test No. 282
3 #
4 # Test incremental dumps containing a mix of dump formats.
5 # level 0 - format 2
6 # level 1 - current format
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2012 SGI.  All Rights Reserved.
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
14 #
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23 #
24 #-----------------------------------------------------------------------
25 #
26
27 seq=`basename $0`
28 seqres=$RESULT_DIR/$seq
29 seqres=$RESULT_DIR/$seq
30 seqres=$RESULT_DIR/$seq
31 echo "QA output created by $seq"
32
33 here=`pwd`
34 tmp=/tmp/$$
35 status=1        # failure is the default!
36 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
37
38 # get standard environment, filters and checks
39 . ./common.rc
40 . ./common.dump
41
42 # real QA test starts here
43 _supported_fs xfs
44 _supported_os Linux
45
46 _require_legacy_v2_format
47
48 _create_dumpdir_fill
49 # ensure file/dir timestamps precede dump timestamp
50 sleep 2
51 src/bstat $SCRATCH_MNT >>$here/$seqres.full
52
53 echo "*** Level 0 dump, format 2"
54 _do_dump_file -f $tmp.l0 -K
55
56 _append_dumpdir_fill
57 src/bstat $SCRATCH_MNT >>$here/$seqres.full
58
59 echo "*** Level 1 dump, current format"
60 _do_dump_file -l 1 -f $tmp.l1
61
62 echo "*** Restore using format 2 level 0"
63 _prepare_restore_dir
64 _do_restore_file_cum -f $tmp.l0
65
66 echo "*** Restore using current format level 1"
67 _do_restore_file_cum -f $tmp.l1
68 _diff_compare
69
70 # success, all done
71 status=0
72 exit