xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / xfs / 022
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 022
6 #
7 # Test out a level 0 dump/restore to a tape of a subdir
8 # i.e. it is testing out drive_scsitape.c
9 #
10 # Use fsstress to create a directory structure with a mix of files
11 #
12 seqfull=$0
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
16
17 here=`pwd`
18 tmp=/tmp/$$
19 status=0        # success is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
21
22 _cleanup()
23 {
24         _cleanup_dump
25         cd /
26         rm -f $tmp.*
27 }
28
29 . ./common/rc
30 . ./common/dump
31
32 # real QA test starts here
33 _supported_fs xfs
34
35 _require_tape $TAPE_DEV
36
37 # note: fsstress uses an endian dependent random number generator, running this
38 # will produce different output for big/little endian machines.
39 _create_dumpdir_stress
40 _erase_hard
41 _do_dump_sub
42 # filter out the file count, it changes as fsstress adds new operations
43 _do_restore | sed -e "/entries processed$/s/[0-9][0-9]*/NUM/g"
44 _ls_compare_sub
45
46 # success, all done
47 exit