common/fuzzy: if the fuzz verb is random, keep fuzzing until we get a new value
[xfstests-dev.git] / common / dump
index 7fe50f68de955a7b94711d989fd7223fe2733674..898aaa40b31ea6facade3f95a3a86740a4ac5f13 100644 (file)
@@ -60,8 +60,6 @@ session_label="stress_$seq"
 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
 
@@ -288,7 +286,7 @@ _cleanup()
 _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
 }
@@ -298,15 +296,16 @@ _stable_fs()
 # 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"
@@ -331,6 +330,10 @@ _create_dumpdir_stress()
     _stable_fs
 }
 
+_create_dumpdir_stress() {
+       _create_dumpdir_stress_num 240
+}
+
 _mk_fillconfig1()
 {
     cat <<End-of-File >$tmp.config
@@ -392,8 +395,6 @@ End-of-File
 
 _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
 #
@@ -403,7 +404,7 @@ file_sticky 10      $nobody $nobody 01777
 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
@@ -1188,7 +1189,7 @@ _do_restore_toc()
     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 |\
@@ -1481,25 +1482,14 @@ _check_quota_entries()
 # 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"
 }
 
 #