xfs/{263,106}: erase max warnings printout
[xfstests-dev.git] / tests / ext4 / 004
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Fujitsu.  All Rights Reserved.
4 #
5 # FSQA Test No. 004
6 #
7 # Test "dump | restore"(as opposed to a tape)
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         cd /
21         rm -f $tmp.*
22         # remove the generated data, which is much and meaningless.
23         rm -rf $restore_dir
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 dump_dir=$SCRATCH_MNT/dump_restore_dir
31 restore_dir=$TEST_DIR/dump_restore_dir
32
33 workout()
34 {
35         echo "Run fsstress" >> $seqres.full
36         args=`_scale_fsstress_args -z -f creat=5 -f write=20 -f mkdir=5 -n 100 -p 15 -d $dump_dir`
37         echo "fsstress $args" >> $seqres.full
38
39         $FSSTRESS_PROG $args >> $seqres.full 2>&1
40
41         echo "start Dump/Restore" >> $seqres.full
42         cd $TEST_DIR
43
44         $DUMP_PROG -0 -f - $dump_dir 2>/dev/null | $RESTORE_PROG -urvf - >> $seqres.full 2>&1
45         if [ $? -ne 0 ];then
46                 _fail "Dump/Restore failed"
47         fi
48
49         rm -rf restoresymtable
50 }
51
52 # real QA test starts here
53 _supported_fs ext4
54 _supported_os Linux
55
56 _require_test
57 _require_scratch
58
59 _require_command "$DUMP_PROG" dump
60 _require_command "$RESTORE_PROG" restore
61
62 rm -f $seqres.full
63 echo "Silence is golden"
64
65 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
66 _scratch_mount
67 rm -rf $restore_dir $TEST_DIR/restoresymtable
68
69 workout
70 diff -r $dump_dir $restore_dir
71
72 status=0
73 exit