ebe539ab99793100ca56edd4feee6247e92d2ebd
[xfstests-dev.git] / tests / xfs / 022
1 #! /bin/bash
2 # FS QA Test No. 022
3 #
4 # Test out a level 0 dump/restore to a tape of a subdir
5 # i.e. it is testing out drive_scsitape.c
6 #
7 # Use fsstress to create a directory structure with a mix of files
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #
25 #-----------------------------------------------------------------------
26 #
27
28 seqfull=$0
29 seq=`basename $0`
30 seqres=$RESULT_DIR/$seq
31 echo "QA output created by $seq"
32
33 here=`pwd`
34 tmp=/tmp/$$
35 status=0        # success is the default!
36 trap "rm -rf $tmp.*; exit \$status" 0 1 2 3 15
37
38 . ./common/rc
39 . ./common/dump
40
41 # real QA test starts here
42 _supported_fs xfs
43 _supported_os Linux
44
45 _require_tape $TAPE_DEV
46
47 # note: fsstress uses an endian dependent random number generator, running this
48 # will produce different output for big/little endian machines.
49 _create_dumpdir_stress
50 _erase_hard
51 _do_dump_sub
52 # filter out the file count, it changes as fsstress adds new operations
53 _do_restore | sed -e "/entries processed$/s/[0-9][0-9]*/NUM/g"
54 _ls_compare_sub
55
56 # success, all done
57 exit