nobody=4 # define this uid/gid as a number
do_quota_check=true # do quota check if quotas enabled
-_need_to_be_root
-
# install our cleaner
trap "_cleanup; exit \$status" 0 1 2 3 15
_stable_fs()
{
_saveddir=`pwd`; cd /
- umount $SCRATCH_MNT >>$seqres.full || _fail "unmount failed"
+ _scratch_unmount >>$seqres.full || _fail "unmount failed"
_scratch_mount >>$seqres.full || _fail "mount failed"
cd $_saveddir
}
# files,dirs,links,symlinks
#
# Pinched from test 013.
+# Takes one argument, the number of ops to perform
#
-_create_dumpdir_stress()
+_create_dumpdir_stress_num()
{
echo "Creating directory system to dump using fsstress."
+ _count=$1
_wipe_fs
_param="-f link=10 -f creat=10 -f mkdir=10 -f truncate=5 -f symlink=10"
- _count=240
rm -rf $dump_dir
if ! mkdir $dump_dir; then
echo " failed to mkdir $dump_dir"
_stable_fs
}
+_create_dumpdir_stress() {
+ _create_dumpdir_stress_num 240
+}
+
_mk_fillconfig1()
{
cat <<End-of-File >$tmp.config
_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 ugo=rwx,g+s
+dir_guid d $nobody $nobody 02777
dir_sticky d $nobody $nobody 01777
dir_mix1 d $nobody $nobody 761
dir_mix2 d $nobody $nobody 642
-e "s#$restore_sdir#RESTORE_SUBDIR#g" \
-e "s#$$#PID#g" \
-e "/Only in SCRATCH_MNT: .use_space/d" \
+ -e "s#$RESULT_DIR/##g" \
}
shift
;;
*)
- _fail "invalid argument to common.dump function: $1"
+ _fail "invalid argument to common/dump function: $1"
;;
esac
shift
restore_args="$restore_args $1"
;;
*)
- _fail "invalid argument to common.dump function: $1"
+ _fail "invalid argument to common/dump function: $1"
;;
esac
shift
echo "Contents of dump ..."
opts="$_restore_debug$restore_args -f $dump_file -t"
echo "xfsrestore $opts" | _dir_filter
- cd $SCRATCH_MNT # for IRIX which needs xfs cwd
+ cd $SCRATCH_MNT
$XFSRESTORE_PROG $opts 2>&1 | tee -a $seqres.full | _dump_filter_main |\
_check_quota_file |\
_check_quota_entries |\
| sed -e "s#$restore_sdir\/##" \
| tee $seqres.ea2 \
| _dir_filter
- diff -s $seqres.ea1 $seqres.ea2
+ diff -s $seqres.ea1 $seqres.ea2 | _dir_filter
}
# xfsrestore: user quota information written to ...'
# xfsrestore: group quota information written to ...'
# xfsrestore: project quota information written to ...'
-#
-# If on IRIX then look for:
-# xfsrestore: use 'edquota' to restore quotas
-# Else look for:
# xfsrestore: use 'xfs_quota' to restore quotas
#
_check_quota_dumprestore()
{
- if [ "$HOSTOS" == "IRIX" ]; then
_check_quota 'user quota information' \
'group quota information' \
'project quota information' | \
- sed "/xfsrestore:.*use 'edquota' to restore quotas/d"
- else
- _check_quota 'user quota information' \
- 'group quota information' \
- 'project quota information' | \
- sed "/xfsrestore:.*use 'xfs_quota' to restore quotas/d"
- fi
+ sed "/xfsrestore:.*use 'xfs_quota' to restore quotas/d"
}
#