_require_tape $TAPE_DEV
_create_dumpdir_fill
+src/bstat $SCRATCH_MNT >>$here/$seq.full
_erase_hard
_do_dump
_append_dumpdir_fill
+src/bstat $SCRATCH_MNT >>$here/$seq.full
_erase_hard
_do_dump_incremental
_do_restore
--- /dev/null
+#! /bin/sh
+# XFS QA Test No. 061
+# $Id: 1.1 $
+#
+# Test restoring a dump created in IRIX/XFS
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 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.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+# Mountain View, CA 94043, or:
+#
+# http://www.sgi.com
+#
+# For further information regarding this notice, see:
+#
+# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+#-----------------------------------------------------------------------
+#
+# creator
+owner=tes@bruce.melbourne.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
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.dump
+
+# real QA test starts here
+
+# src/dumpfile based on dumping from
+# _create_dumpdir_fill_perm (small dump)
+
+_create_dumpdir_fill_perm
+dump_file=src/dumpfile # override dump_file to checked-in dump_file
+session_label="stress_056"
+_do_restore_file
+_diff_compare_sub
+_ls_nodate_compare_sub
+
+# success, all done
+exit
--- /dev/null
+QA output created by 061
+Creating directory system to dump using src/fill.
+Setup ..........
+Restoring from file...
+xfsrestore -f DUMP_FILE -L stress_056 RESTORE_DIR
+xfsrestore: version 3.0 - Running single-threaded
+xfsrestore: searching media for dump
+xfsrestore: examining media file 0
+xfsrestore: found dump matching specified label:
+xfsrestore: hostname: crackle.melbourne.sgi.com
+xfsrestore: mount point: /spare1
+xfsrestore: volume: /hw/node/io/gio/hpc/scsi_ctlr/0/target/2/lun/0/disk/partition/1/char
+xfsrestore: session time: TIME
+xfsrestore: level: 0
+xfsrestore: session label: "stress_056"
+xfsrestore: media label: "stress_tape_media"
+xfsrestore: file system id: ID
+xfsrestore: session id: ID
+xfsrestore: media id: ID
+xfsrestore: searching media for directory dump
+xfsrestore: reading directories
+xfsrestore: directory post-processing
+xfsrestore: restoring non-directory files
+xfsrestore: restore complete: SECS seconds elapsed
+xfsrestore: Restore Status: SUCCESS
+Comparing dump directory with restore directory
+Files DUMP_DIR/file_guid and RESTORE_DIR/DUMP_SUBDIR/file_guid are identical
+Files DUMP_DIR/file_mix1 and RESTORE_DIR/DUMP_SUBDIR/file_mix1 are identical
+Files DUMP_DIR/file_mix2 and RESTORE_DIR/DUMP_SUBDIR/file_mix2 are identical
+Files DUMP_DIR/file_sticky and RESTORE_DIR/DUMP_SUBDIR/file_sticky are identical
+Files DUMP_DIR/file_suid and RESTORE_DIR/DUMP_SUBDIR/file_suid are identical
+Comparing listing of dump directory with restore directory
+Files TMP.dump_dir and TMP.restore_dir are identical
esac
+ # get rid of leading 0s as can be interpreted as octal
+ start=`echo $start | sed 's/^0*//'`
+ end=`echo $end | sed 's/^0*//'`
+
if $xpand
then
have_test_arg=true
SCRATCH_MNT=/mnt/xfs1
SCRATCH_LOGDEV=/dev/sda9
;;
+ surly)
+ TEST_DEV=/dev/hda9
+ TEST_DIR=/mnt/xfs1
+ SCRATCH_DEV=/dev/hda8
+ SCRATCH_MNT=/mnt/xfs0
+ SCRATCH_LOGDEV=/dev/hda10
+ TAPE_DEV=/dev/st0
+ RMT_TAPE_DEV=fuzzy:/dev/st0
+ RMT_IRIXTAPE_DEV=blub:/dev/tape
+ RMT_TAPE_USER=guest
+ ;;
*)
echo "common.config: Error: need to define parameters for host `hostname -s`"
NOTRUNSTS=2
# name those directories
-dump_dir=$SCRATCH_MNT/dump.$$
dump_file=$tmp.dumpfile
-dump_sdir=dump.$$
-restore_dir=$SCRATCH_MNT/restore.$$
-restore_sdir=restore.$$
+dump_sdir=dumpdir
+dump_dir=$SCRATCH_MNT/$dump_sdir
+restore_sdir=restoredir
+restore_dir=$SCRATCH_MNT/$restore_sdir
dumptape=$TAPE_DEV
media_label="stress_tape_media"
op=$1
if _isrmt; then
# REMOTE
- _rmtdev=`echo $dumptape | awk -F: '{print $2}'`
+ _rmtdev=`echo $dumptape | $AWK_PROG -F: '{print $2}'`
if echo $dumptape | grep '@' >/dev/null; then
- _spec=`echo $dumptape | awk -F: '{print $1}'`
- _rmtuser=`echo $_spec | awk -F@ '{print $1}'`
- _rmthost=`echo $_spec | awk -F@ '{print $2}'`
+ _spec=`echo $dumptape | $AWK_PROG -F: '{print $1}'`
+ _rmtuser=`echo $_spec | $AWK_PROG -F@ '{print $1}'`
+ _rmthost=`echo $_spec | $AWK_PROG -F@ '{print $2}'`
rsh -n -l $_rmtuser $_rmthost "mt -t $_rmtdev $op"
else
- _rmthost=`echo $dumptape | awk -F: '{print $1}'`
+ _rmthost=`echo $dumptape | $AWK_PROG -F: '{print $1}'`
rsh -n $_rmthost "mt -t $_rmtdev $op"
fi
else
mkfs -t xfs -f $SCRATCH_DEV >>$seq.full ||\
_error "mkfs failed"
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
+ mount -t xfs -o sync $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
_error "mount failed"
}
_stable_fs()
{
- umount $SCRATCH_MNT >>$seq.full ||\
- _error "unmount failed"
- mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
- _error "mount failed"
+sync; sync; sleep 30
+# This can cause xfs recovery on ia64 which will die on ia64
+# umount $SCRATCH_MNT >>$seq.full ||\
+# _error "unmount failed"
+# mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
+# _error "mount failed"
}
#
_mk_fillconfig_perm()
{
+ # dir_guid: ugo=rwx,g+s on dir is for IRIX chmod(1)
+
cat <<End-of-File >$tmp.config
# pathname size/dir user group mode
#
file_mix1 10 $nobody $nobody 761
file_mix2 10 $nobody $nobody 642
dir_suid d $nobody $nobody 04777
-dir_guid d $nobody $nobody 02777
+dir_guid d $nobody $nobody ugo=rwx,g+s
dir_sticky d $nobody $nobody 01777
dir_mix1 d $nobody $nobody 761
dir_mix2 d $nobody $nobody 642
_prepare_restore_dir
echo "Restoring from file..."
- opts="$_restore_debug$dumpargs -f $dump_file -L $session_label $restore_dir"
+ opts="$_restore_debug$dump_args -f $dump_file -L $session_label $restore_dir"
echo "xfsrestore $opts" | _dir_filter
xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
}
diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
}
+#
+# filter out the date fields
+#
+_ls_nodate_filter()
+{
+ $AWK_PROG 'NF == 9 { print $1, $2, $3, $4, $9 }'
+}
+
+#
+# _ls_compare_sub but don't compare dates
+_ls_nodate_compare_sub()
+{
+ #
+ # verify we got back what we dumped
+ #
+ echo "Comparing listing of dump directory with restore directory"
+ ls -lR $dump_dir | tee -a $seq.full | _ls_filter | _ls_nodate_filter >$tmp.dump_dir
+ ls -lR $restore_dir/$dump_sdir | tee -a $seq.full | _ls_filter \
+ | _ls_nodate_filter | sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
+
+ diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
+}
+
#
# Compare using recursive diff the files of the dumped
058 acl auto
059 xfsdump
060 xfsdump
+061 xfsdump auto
fi
last=`grep '^[0-9][0-9]* ' group | sort | tail -1 | sed -e 's/[ ].*//'`
+# get rid of leading 0s as can be interpreted as octal
+last=`echo $last | sed 's/^0*//'`
id=`$AWK_PROG </dev/null 'BEGIN{printf "%03d\n",'$last'+1}'`
echo "Next test is $id"