]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: exclude largefs fill files from dump tests
authorDave Chinner <dchinner@redhat.com>
Fri, 15 Mar 2013 11:53:29 +0000 (11:53 +0000)
committerRich Johnston <rjohnston@sgi.com>
Tue, 19 Mar 2013 20:16:13 +0000 (15:16 -0500)
The xfsdump/restore tests will see the space filling files and may
try to back them up and restore them, consuming huge amounts of time
to do (especially when diffing the results). Exclude the space
filling files by setting the no dump attributes on them and ensure
that xfsdump runs with the -e flag to exclude such files.

This also needs a dump filter addition to remove the output that
files were skipped, and to decrement the count of files processed by
xfsrestore because the inventory still includes excluded files.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common.config
common.dump
common.filter
common.rc

index 5ac58bf16f69a65b813fc6b6e0622aadd0b00939..ab19772b0aa1a0a1f1412b3ba90fb26834a4120d 100644 (file)
@@ -160,7 +160,8 @@ export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
 export XFS_IO_PROG="`set_prog_path xfs_io`"
 export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
 export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
-export XFSDUMP_PROG="`set_prog_path xfsdump`"
+export __XFSDUMP_PROG="`set_prog_path xfsdump`"
+export XFSDUMP_PROG="$__XFSDUMP_PROG -e"
 export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
 export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
 export DBENCH_PROG="`set_prog_path dbench`"
index e89dedcfe77d2d17fd36aad8bd58655ae61c10e7..be55249aec910e926efdd84551e20a55d053e9de 100644 (file)
@@ -29,7 +29,8 @@ if [ -n "$DEBUGDUMP" ]; then
 
        # Use dump/restore in qa directory (copy them here) for debugging
        export PATH="$here:$PATH"
-       export XFSDUMP_PROG="`set_prog_path xfsdump`"
+       export __XFSDUMP_PROG="`set_prog_path xfsdump`"
+       export XFSDUMP_PROG="$__XFSDUMP_PROG -e"
        export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
        export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
        [ -x $here/xfsdump ]    && echo "Using xfstests' xfsdump for debug"
@@ -829,7 +830,7 @@ _dump_filter_main()
 {
   _filter_devchar |\
   sed \
-      -e "s#$XFSDUMP_PROG#xfsdump#"                    \
+      -e "s#$__XFSDUMP_PROG#xfsdump#"                  \
       -e "s#$XFSRESTORE_PROG#xfsrestore#"              \
       -e "s#$XFSINVUTIL_PROG#xfsinvutil#"              \
       -e "s/`hostname`/HOSTNAME/"                      \
@@ -872,13 +873,29 @@ _dump_filter_main()
       -e '/xfsdump: ino map phase [5]/,1d'             \
       -e 's/id:[[:space:]]*[0-9a-f]\{8\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{4\}-[0-9a-f]\{12\}/ID: ID/'                                             \
       -e 's/\[y\/n\][- ]----------------------*/\[y\/n\]/'             \
+      -e '/skip attribute set/d'                               \
   | perl -ne '
-      if ($_ =~ /(?:Dump|Restore) Summary/) {
-        $skip = 1;
-      } elsif ($_ =~ /(?:Dump|Restore) Status/) {
-        $skip = 0;
-      }
-      print if (! $skip);'
+       # filter out all the output between the lines "Dump Summary:"
+       # and "Dump Status:"
+       if ($_ =~ /(?:Dump|Restore) Summary/) {
+               $skip = 1;
+       } elsif ($_ =~ /(?:Dump|Restore) Status/) {
+               $skip = 0;
+       }
+       print if (! $skip);' \
+  | perl -ne '
+       # correct the file count if large scratch devices are being used
+       $skip = 0;
+       if ($_ =~ /(\S+) directories and (\S+) entries/) {
+               $foo = $2;
+               if ($ENV{'LARGE_SCRATCH_DEV'} && $foo > 0) {
+                       $foo -= 1;
+               }
+               printf("xfsrestore: %u directories and %u entries processed\n",
+                                               $1, $foo);
+               $skip = 1;
+       }
+       print if (! $skip);'
 }
 
 _dump_filter()
@@ -916,6 +933,7 @@ _dir_filter()
     -e "s#$dump_sdir#DUMP_SUBDIR#g"   \
     -e "s#$restore_sdir#RESTORE_SUBDIR#g" \
     -e "s#$$#PID#g" \
+    -e "/Only in SCRATCH_MNT: .use_space/d" \
 
 }
 
index c34809f8451d28ee97f55f91ebddc48447c3fbf6..da5675f1e3bfb6f06f5a6d271d0bc9288af48ae5 100644 (file)
@@ -223,7 +223,9 @@ _filter_test_dir()
 
 _filter_scratch()
 {
-       sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
+       sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" \
+           -e "s,$SCRATCH_MNT,SCRATCH_MNT,g" \
+           -e "/.use_space/d"
 }
 
 # Turn any device in the scratch pool into SCRATCH_DEV
index 690c6a301986aecc3cf5c100e4419d20994f26cc..96d5077d3a39b6ac42e62e3cffa5a810b0b1660d 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -306,6 +306,7 @@ _setup_large_xfs_fs()
        xfs_io -F -f \
                -c "truncate $file_size" \
                -c "falloc -k 0 $file_size" \
+               -c "chattr +d" \
                $SCRATCH_MNT/.use_space 2>&1 > /dev/null
        status=$?
        umount $SCRATCH_MNT