xfs: no excessive warnings about dprecated mount options on remount
[xfstests-dev.git] / tests / xfs / 302
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2013 SGI.  All Rights Reserved.
4 #
5 # FS QA Test No. 302
6 #
7 # Dump and restore partialmax + 1 wholly-sparse files
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 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 _cleanup()
19 {
20     _cleanup_dump
21     cd /
22     rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/dump
29
30 # real QA test starts here
31
32 # Modify as appropriate.
33 _supported_fs xfs
34 _require_scratch
35
36 rm -f $seqres.full
37
38 echo "Silence is golden."
39 _wipe_fs
40 mkdir $dump_dir >> $seqres.full 2>&1 || _fail "mkdir \"$dump_dir\" failed"
41 for i in `seq 1 4`; do
42         $XFS_IO_PROG -f -c "truncate 1t" $dump_dir/sparsefile$i \
43                 >> $seqres.full 2>&1 || _fail "failed to create sparsefile\"$i\""
44 done
45 # Dump and restore the files
46 _prepare_restore_dir
47 $XFSDUMP_PROG -L session -M label1 -M label2 -f $tmp.stream1 \
48         -f $tmp.stream2 $SCRATCH_MNT -s $dump_sdir \
49         >> $seqres.full 2>&1 || _fail "dump failed"
50 $XFSRESTORE_PROG -F -f $tmp.stream1 -f $tmp.stream2 $restore_dir \
51         >> $seqres.full 2>&1 || _fail "restore failed"
52 status=0
53 exit