Skip to contentSkip to conversation

xfstests: add 059 and 060 for multi-stream xfsdump

PATCH In review Bill Kendall 2 participants 2 messages Nov 7, 2011 – Nov 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 xfstests: add 059 and 060 for multi-stream xfsdump

Implement the multi-stream placeholder tests 059 and 060. The comments imply that these tests existed on IRIX, but I was unable to find them.

Test 059 does a simple 4-way dump and restore. Test 060 does a 4-way dump, then restores each dump file individually (in a cumulative fashion).

The tests are skipped if the installed xfsdump does not support multi-stream output.

---
Changed for v2:
- Included the expected-output files.

 059         |   23 +++++++----
 059.out     |   76 +++++++++++++++++++++++++++++++++++++
 060         |   29 ++++++++++----
 060.out     |  120 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 common.dump |   40 +++++++++++++++++++-
 group       |    4 +-
 6 files changed, 270 insertions(+), 22 deletions(-)
 create mode 100644 059.out
 create mode 100644 060.out
059 +14 -9
index 6348f0e..1f3f8e3 100755
@@ -1,10 +1,10 @@
 #! /bin/bash
 # FS QA Test No. 059
 #
-# place holder for IRIX 059 test for xfsdump/xfsrestore multi streams
+# Test multi-stream xfsdump/xfsrestore.
 #
 #-----------------------------------------------------------------------
-# Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2000-2001, 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
@@ -22,26 +22,31 @@
 #-----------------------------------------------------------------------
 #
 # creator
[email protected]
[email protected]
 
 seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
-status=1	# failure is the default!
+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.filter
-
-_notrun "Place holder for IRIX test 059"
+. ./common.dump
 
 # real QA test starts here
 _supported_fs xfs
-_supported_os IRIX
+_supported_os Linux
+
+_require_multi_stream
+
+_create_dumpdir_fill_multi
+_do_dump_multi_file --multi 4
+_do_restore_multi_file --multi 4
+_ls_compare_sub
+_diff_compare
 
 # success, all done
-status=0
 exit
059.out new file +76 -0

76 lines not on this page · raw message

060 +20 -9
index 6e58e5b..4adc00f 100755
@@ -1,10 +1,10 @@
 #! /bin/bash
 # FS QA Test No. 060
 #
-# place holder for IRIX 060 test for xfsdump/xfsrestore multi streams
+# Test multi-stream xfsdump and restoring one stream at a time.
 #
 #-----------------------------------------------------------------------
-# Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
+# Copyright (c) 2000-2001, 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
@@ -22,26 +22,37 @@
 #-----------------------------------------------------------------------
 #
 # creator
[email protected]
[email protected]
 
 seq=`basename $0`
 echo "QA output created by $seq"
 
 here=`pwd`
 tmp=/tmp/$$
-status=1	# failure is the default!
+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.filter
-
-_notrun "Place holder for IRIX test 060"
+. ./common.dump
 
 # real QA test starts here
 _supported_fs xfs
-_supported_os IRIX
+_supported_os Linux
+
+_require_multi_stream
+
+_create_dumpdir_fill_multi
+_do_dump_multi_file --multi 4
+_prepare_restore_dir
+base=$dump_file
+opts=""
+for x in 0 1 2 3; do
+    _do_restore_file_cum -f $base.$x $opts
+    opts=-R
+done
+_ls_compare_sub
+_diff_compare
 
 # success, all done
-status=0
 exit
060.out new file +120 -0

120 lines not on this page · raw message

common.dump +38 -2
index 076517d..31a75c5 100644
@@ -75,6 +75,14 @@ done
 have_mtvariable=false
 [ `uname` = "Linux" ] && have_mtvariable=true
 
+
+_require_multi_stream()
+{
+    $XFSDUMP_PROG -JF -f /dev/null -f /dev/null 2> /dev/null |
+    grep -q "too many -f arguments" &&
+    _notrun "xfsdump multi-stream support required"
+}
+
 #
 # do a remote/local mt
 #
@@ -536,6 +544,18 @@ _do_create_dumpdir_fill()
     cd $here
 }
 
+_mk_fillconfig_multi()
+{
+    _mk_fillconfig1
+    cat <<End-of-File >>$tmp.config
+# pathname	size in bytes
+#
+large000	8874368	$nobody	$nobody
+large111	2582912	$nobody	$nobody
+large222	7825792	$nobody	$nobody
+End-of-File
+}
+
 _create_dumpdir_largefile()
 {
     _wipe_fs
@@ -580,6 +600,17 @@ _create_dumpdir_fill_ea()
     _stable_fs
 }
 
+#
+# Create enough files, and a few large enough files, so that
+# some files are likely to be split across streams.
+#
+_create_dumpdir_fill_multi()
+{
+    _wipe_fs
+    _mk_fillconfig_multi
+    _do_create_dumpdir_fill
+    _stable_fs
+}
 
 #
 # Append a subset of the fill'ed files
@@ -802,9 +833,11 @@ _dump_filter_main()
       -e 's/time:[ 	].*/time: TIME/'		\
       -e 's/date:[ 	].*/date: DATE/'		\
       -e 's/dump begun .*/dump begun DATE/'		\
+      -e 's/previously begun .*/previously begun DATE/'	\
       -e 's/[0-9][0-9]* seconds/SECS seconds/'		\
       -e 's/restore.[0-9][0-9]*/restore.PID/'		\
-      -e 's/ino [0-9][0-9]*/ino INO/'			\
+      -e 's/ino [0-9][0-9]*/ino INO/g'			\
+      -e '/stream [0-9]:/s/offset [0-9][0-9]*/offset NUM/g'	\
       -e '/: dump size/s/[0-9][0-9]*/NUM/'		\
       -e '/dump size:/s/[0-9][0-9]*/NUM/'		\
       -e '/dump size per stream:/s/[0-9][0-9]*/NUM/'	\
@@ -862,7 +895,7 @@ _invutil_filter()
 _dir_filter()
 {
   sed \
-    -e "s#$dump_file#DUMP_FILE#"      \
+    -e "s#$dump_file#DUMP_FILE#g"      \
     -e "s#$SCRATCH_DEV#SCRATCH_DEV#"        \
     -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#"    \
     -e "s#$dumptape#TAPE_DEV#"         \
@@ -959,6 +992,9 @@ _parse_restore_args()
         --no-check-quota)
             do_quota_check=false
             ;;
+	-R)
+	    restore_args="$restore_args $1"
+            ;;
 	*)
             _fail "invalid argument to common.dump function: $1"
             ;;
group +2 -2
index 616cbdd..79b8c8c 100644
@@ -169,8 +169,8 @@ deprecated
 056 dump ioctl auto quick
 057 acl auto
 058 acl auto
-059 dump ioctl
-060 dump ioctl
+059 dump ioctl auto quick
+060 dump ioctl auto quick
 061 dump ioctl auto quick
 062 attr udf auto quick
 063 dump attr auto quick
Signature · 6 lines
1.7.0.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Bill Kendall

Implement the multi-stream placeholder tests 059 and 060. The comments imply that these tests existed on IRIX, but I was unable to find them.

Test 059 does a simple 4-way dump and restore. Test 060 does a 4-way dump, then restores each dump file individually (in a cumulative fashion).

The tests are skipped if the installed xfsdump does not support multi-stream output.

I haven't run these yet, but this looks good.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs