xfstests: Assume yes when test device is not partitioned
[xfstests-dev.git] / 268
1 #! /bin/bash
2 # FS QA Test No. 268
3 #
4 # Test xfsdump with multiple media files where a file ends
5 # at the end of the first media file (i.e., no file is split
6 # across media files).
7 #
8 #-----------------------------------------------------------------------
9 # Copyright (c) 2011 SGI.  All Rights Reserved.
10 #
11 # This program is free software; you can redistribute it and/or
12 # modify it under the terms of the GNU General Public License as
13 # published by the Free Software Foundation.
14 #
15 # This program is distributed in the hope that it would be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 # GNU General Public License for more details.
19 #
20 # You should have received a copy of the GNU General Public License
21 # along with this program; if not, write the Free Software Foundation,
22 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23 #-----------------------------------------------------------------------
24 #
25 # creator
26 owner=wkendall@sgi.com
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=0        # success is the default!
34 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
35
36 #
37 # create two 12 MiB files with extended attrs.
38 # xfsdump writes file data in "extent groups", currently 16 MiB in size. After
39 # writing an extent group or finishing a file, xfsdump will start a new media
40 # file if it is over the suggested size. A media file size of 8 MiB is used
41 # below, so after dumping a 12 MiB file xfsdump will start a new media file and
42 # no file will be split across a media file.
43 #
44 _create_files()
45 {
46     cat <<End-of-File >$tmp.config
47 # pathname      size            user    group    perm   name value namespace
48 bigg1           12582912        $nobody $nobody  777    attr1 some_text1  root
49 bigg2           12582912        $nobody $nobody  777    attr2 some_text2  user
50 End-of-File
51
52     _wipe_fs
53     _do_create_dumpdir_fill
54     _stable_fs
55 }
56
57 # get standard environment, filters and checks
58 . ./common.rc
59 . ./common.dump
60 . ./common.attr
61
62 # real QA test starts here
63 _supported_fs xfs
64 _supported_os Linux
65
66 _require_tape $TAPE_DEV
67 _require_attrs
68
69 _create_files
70 _erase_hard
71 _do_dump -d 8
72 _do_restore
73 _ls_compare_sub
74 _diff_compare
75 _diff_compare_eas
76
77 # success, all done
78 exit