db292497d397c1d82da86e8f12add5f17d6750c3
[xfstests-dev.git] / tests / xfs / 066
1 #! /bin/bash
2 # FS QA Test No. 066
3 #
4 # Test dumping of large files
5 #
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc.  All Rights Reserved.
8 #
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
12 #
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21 #
22 #-----------------------------------------------------------------------
23 #
24
25 seq=`basename $0`
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
28
29 here=`pwd`
30 tmp=/tmp/$$
31 status=1        # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33
34 # get standard environment, filters and checks
35 . ./common/rc
36 . ./common/filter
37 . ./common/dump
38
39 _cleanup()
40 {
41     cd /
42     rm -f $tmp.*
43 }
44
45 # real QA test starts here
46 _supported_fs xfs
47 _supported_os IRIX Linux
48
49 _my_stat_filter()
50 {
51     grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
52 }
53
54 rm -f $TEST_DIR/testfile
55 if src/feature -t $TEST_DIR/testfile; then
56         :
57 else
58         _notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
59 fi
60
61 _create_dumpdir_largefile
62 echo "ls dumpdir/largefile"
63 stat $dump_dir/largefile | _my_stat_filter
64 md5sum $dump_dir/largefile |_filter_scratch
65 _do_dump_file
66 _do_restore_file
67 echo "ls restoredir/largefile"
68 stat $restore_dir/$dump_sdir/largefile | _my_stat_filter
69 md5sum $restore_dir/$dump_sdir/largefile |_filter_scratch
70
71 # success, all done
72 status=0
73 exit