xfstests: include test subdirectory support
[xfstests-dev.git] / 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 echo "QA output created by $seq"
27
28 here=`pwd`
29 tmp=/tmp/$$
30 status=1        # failure is the default!
31 trap "_cleanup; exit \$status" 0 1 2 3 15
32
33 # get standard environment, filters and checks
34 . ./common.rc
35 . ./common.filter
36 . ./common.dump
37
38 _cleanup()
39 {
40     cd /
41     rm -f $tmp.*
42     _cleanup_testdir
43 }
44
45 # real QA test starts here
46 _supported_fs xfs
47 _supported_os IRIX Linux
48
49 _setup_testdir
50
51 _my_stat_filter()
52 {
53     grep "[sS]ize" | sed "s/.*[sS]ize[: ]*\([[:digit:]]*\).*/\1 largefile/g"
54 }
55
56 rm -f $testdir/testfile
57 if src/feature -t $testdir/testfile; then
58         :
59 else
60         _notrun "Installed libc doesn't correctly handle setrlimit/ftruncate64"
61 fi
62
63 _create_dumpdir_largefile
64 echo "ls dumpdir/largefile"
65 stat $dump_dir | _my_stat_filter
66 _do_dump_file
67 _do_restore_file
68 echo "ls restoredir/largefile"
69 stat $restore_dir/$dump_sdir | _my_stat_filter
70
71 # success, all done
72 status=0
73 exit