xfstests: add 267 and 268 for multiple media files

This patch adds a couple of tests for xfsdump when multiple media files
are used. 267 tests the case where a file is split across multiple media
files, and 268 tests the case where a file ends on one media file and
the next media file starts on another file. These tests use a small
media file size (xfsdump -d) so that they don't rely on having to hit
end-of-tape.

Signed-off-by: Bill Kendall <wkendall@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Bill Kendall
2011-11-03 10:10:21 +00:00
committed by Christoph Hellwig
parent c9a6f22b9d
commit a2a325756f
6 changed files with 332 additions and 3 deletions
+75
View File
@@ -0,0 +1,75 @@
#! /bin/bash
# FS QA Test No. 267
#
# Test xfsdump with a file spanning multiple media files.
#
#-----------------------------------------------------------------------
# Copyright (c) 2011 SGI. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#-----------------------------------------------------------------------
#
# creator
owner=wkendall@sgi.com
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
#
# create a 40 MiB file with an extended attr.
# xfsdump writes file data in "extent groups", currently 16 MiB in size. After
# writing an extent group or finishing a file, xfsdump will start a new media
# file if it is over the suggested size. With a single 40 MiB file and using a
# suggested media file size of 12 MiB below, this dump will be contained in 3
# media files.
#
_create_files()
{
cat <<End-of-File >$tmp.config
# pathname size user group perm name value namespace
biggg 41943040 $nobody $nobody 777 attr1 some_text1 root
End-of-File
_wipe_fs
_do_create_dumpdir_fill
_stable_fs
}
# get standard environment, filters and checks
. ./common.rc
. ./common.dump
. ./common.attr
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_tape $TAPE_DEV
_require_attrs
_create_files
_erase_hard
_do_dump -d 12
_do_restore
_ls_compare_sub
_diff_compare
_diff_compare_eas
# success, all done
exit
+88
View File
@@ -0,0 +1,88 @@
QA output created by 267
Put scsi tape driver into variable block size mode
Creating directory system to dump using src/fill.
Setup Attribute "attr1" set to a 10 byte value for biggg:
some_text1
.
Erasing tape
Dumping to tape...
xfsdump -d12 -f TAPE_DEV -M stress_tape_media -L stress_267 SCRATCH_MNT
xfsdump: using scsi tape (drive_scsitape) strategy
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: session label: "stress_267"
xfsdump: ino map <PHASES>
xfsdump: ino map construction complete
xfsdump: estimated dump size: NUM bytes
xfsdump: /var/xfsdump/inventory created
xfsdump: preparing drive
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size NUM bytes
xfsdump: creating dump session media file 1 (media 0, file 1)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size NUM bytes
xfsdump: creating dump session media file 2 (media 0, file 2)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size NUM bytes
xfsdump: dumping session inventory
xfsdump: beginning inventory media file
xfsdump: media file 3 (media 0, file 3)
xfsdump: ending inventory media file
xfsdump: inventory media file size NUM bytes
xfsdump: writing stream terminator
xfsdump: beginning media stream terminator
xfsdump: media file 4 (media 0, file 4)
xfsdump: ending media stream terminator
xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_267 RESTORE_DIR
xfsrestore: using scsi tape (drive_scsitape) strategy
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
xfsrestore: examining media file 0
xfsrestore: reading directories
xfsrestore: 2 directories and 2 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: examining media file 1
xfsrestore: seeking past media file directory dump
xfsrestore: restoring non-directory files
xfsrestore: examining media file 2
xfsrestore: seeking past media file directory dump
xfsrestore: restoring non-directory files
xfsrestore: restore complete: SECS seconds elapsed
xfsrestore: Restore Status: SUCCESS
Comparing listing of dump directory with restore directory
Files TMP.dump_dir and TMP.restore_dir are identical
Comparing dump directory with restore directory
Files DUMP_DIR/biggg and RESTORE_DIR/DUMP_SUBDIR/biggg are identical
Only in SCRATCH_MNT: RESTORE_SUBDIR
Comparing dump directory with restore directory
Looking at the extended attributes (EAs)
EAs on dump
User names
Root names
Attribute "attr1" had a 10 byte value for DUMP_DIR/biggg:
some_text1
EAs on restore
User names
Root names
Attribute "attr1" had a 10 byte value for DUMP_DIR/biggg:
some_text1
Files 267.ea1 and 267.ea2 are identical
+78
View File
@@ -0,0 +1,78 @@
#! /bin/bash
# FS QA Test No. 268
#
# Test xfsdump with multiple media files where a file ends
# at the end of the first media file (i.e., no file is split
# across media files).
#
#-----------------------------------------------------------------------
# Copyright (c) 2011 SGI. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#-----------------------------------------------------------------------
#
# creator
owner=wkendall@sgi.com
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=0 # success is the default!
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
#
# create two 12 MiB files with extended attrs.
# xfsdump writes file data in "extent groups", currently 16 MiB in size. After
# writing an extent group or finishing a file, xfsdump will start a new media
# file if it is over the suggested size. A media file size of 8 MiB is used
# below, so after dumping a 12 MiB file xfsdump will start a new media file and
# no file will be split across a media file.
#
_create_files()
{
cat <<End-of-File >$tmp.config
# pathname size user group perm name value namespace
bigg1 12582912 $nobody $nobody 777 attr1 some_text1 root
bigg2 12582912 $nobody $nobody 777 attr2 some_text2 user
End-of-File
_wipe_fs
_do_create_dumpdir_fill
_stable_fs
}
# get standard environment, filters and checks
. ./common.rc
. ./common.dump
. ./common.attr
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_tape $TAPE_DEV
_require_attrs
_create_files
_erase_hard
_do_dump -d 8
_do_restore
_ls_compare_sub
_diff_compare
_diff_compare_eas
# success, all done
exit
+86
View File
@@ -0,0 +1,86 @@
QA output created by 268
Put scsi tape driver into variable block size mode
Creating directory system to dump using src/fill.
Setup Attribute "attr1" set to a 10 byte value for bigg1:
some_text1
.Attribute "attr2" set to a 10 byte value for bigg2:
some_text2
.
Erasing tape
Dumping to tape...
xfsdump -d8 -f TAPE_DEV -M stress_tape_media -L stress_268 SCRATCH_MNT
xfsdump: using scsi tape (drive_scsitape) strategy
xfsdump: level 0 dump of HOSTNAME:SCRATCH_MNT
xfsdump: dump date: DATE
xfsdump: session id: ID
xfsdump: session label: "stress_268"
xfsdump: ino map <PHASES>
xfsdump: ino map construction complete
xfsdump: estimated dump size: NUM bytes
xfsdump: /var/xfsdump/inventory created
xfsdump: preparing drive
xfsdump: creating dump session media file 0 (media 0, file 0)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size NUM bytes
xfsdump: creating dump session media file 1 (media 0, file 1)
xfsdump: dumping ino map
xfsdump: dumping directories
xfsdump: dumping non-directory files
xfsdump: ending media file
xfsdump: media file size NUM bytes
xfsdump: dumping session inventory
xfsdump: beginning inventory media file
xfsdump: media file 2 (media 0, file 2)
xfsdump: ending inventory media file
xfsdump: inventory media file size NUM bytes
xfsdump: writing stream terminator
xfsdump: beginning media stream terminator
xfsdump: media file 3 (media 0, file 3)
xfsdump: ending media stream terminator
xfsdump: media stream terminator size BLOCKSZ bytes
xfsdump: dump size (non-dir files) : NUM bytes
xfsdump: dump complete: SECS seconds elapsed
xfsdump: Dump Status: SUCCESS
Rewinding tape
Restoring from tape...
xfsrestore -f TAPE_DEV -L stress_268 RESTORE_DIR
xfsrestore: using scsi tape (drive_scsitape) strategy
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
xfsrestore: examining media file 0
xfsrestore: reading directories
xfsrestore: 2 directories and 3 entries processed
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
xfsrestore: examining media file 1
xfsrestore: seeking past media file directory dump
xfsrestore: restoring non-directory files
xfsrestore: restore complete: SECS seconds elapsed
xfsrestore: Restore Status: SUCCESS
Comparing listing of dump directory with restore directory
Files TMP.dump_dir and TMP.restore_dir are identical
Comparing dump directory with restore directory
Files DUMP_DIR/bigg1 and RESTORE_DIR/DUMP_SUBDIR/bigg1 are identical
Files DUMP_DIR/bigg2 and RESTORE_DIR/DUMP_SUBDIR/bigg2 are identical
Only in SCRATCH_MNT: RESTORE_SUBDIR
Comparing dump directory with restore directory
Looking at the extended attributes (EAs)
EAs on dump
User names
Attribute "attr2" had a 10 byte value for DUMP_DIR/bigg2:
some_text2
Root names
Attribute "attr1" had a 10 byte value for DUMP_DIR/bigg1:
some_text1
EAs on restore
User names
Attribute "attr2" had a 10 byte value for DUMP_DIR/bigg2:
some_text2
Root names
Attribute "attr1" had a 10 byte value for DUMP_DIR/bigg1:
some_text1
Files 268.ea1 and 268.ea2 are identical
+3 -3
View File
@@ -909,9 +909,9 @@ _parse_args()
-Q)
do_quota_check=false
;;
-l)
[ -z "$2" ] && _fail "missing argument for -l"
dump_args="$dump_args -l$2"
-l|-d)
[ -z "$2" ] && _fail "missing argument for $1"
dump_args="$dump_args $1$2"
shift
;;
*)
+2
View File
@@ -380,3 +380,5 @@ deprecated
264 auto
265 auto
266 dump ioctl auto quick
267 dump ioctl tape
268 dump ioctl tape