4 # Functions useful for xfsdump/xfsrestore tests
6 # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
8 # This program is free software; you can redistribute it and/or modify it
9 # under the terms of version 2 of the GNU General Public License as
10 # published by the Free Software Foundation.
12 # This program is distributed in the hope that it would be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 # Further, this software is distributed without any warranty that it is
17 # free of the rightful claim of any third person regarding infringement
18 # or the like. Any license provided herein, whether implied or
19 # otherwise, applies only to this software file. Patent licenses, if
20 # any, provided herein do not apply to combinations of this program with
21 # other software, or any other product whatsoever.
23 # You should have received a copy of the GNU General Public License along
24 # with this program; if not, write the Free Software Foundation, Inc., 59
25 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
27 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
28 # Mountain View, CA 94043, or:
32 # For further information regarding this notice, see:
34 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
37 # --- initializations ---
40 if [ -n "$DEBUGDUMP" ]; then
46 # Use dump/restore in qa directory for debugging
53 # status returned for not run tests
56 # name those directories
57 dump_file=$tmp.dumpfile
58 # dump_file=$here/dumpfile #TEMP OVERRIDE DUMP FILE
60 dump_dir=$SCRATCH_MNT/$dump_sdir
61 restore_sdir=restoredir
62 restore_dir=$SCRATCH_MNT/$restore_sdir
65 media_label="stress_tape_media"
66 session_label="stress_$seq"
68 nobody=4 # define this uid/gid as a number
69 do_quota_check=true # do quota check if quotas enabled
74 trap "_cleanup; exit \$status" 0 1 2 3 15
76 # start inventory from a known base - move it aside for test
77 for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
79 [ -d $dir.$seq ] && rm -rf $dir.$seq
84 # remove this when xfstests irix/linux port done
85 if [ "X$XFS_HOST_OS" = "Xirix" ]
96 # do a remote/local mt
103 _rmtdev=`echo $dumptape | $AWK_PROG -F: '{print $2}'`
105 if echo $dumptape | grep '@' >/dev/null; then
106 _spec=`echo $dumptape | $AWK_PROG -F: '{print $1}'`
107 _rmtuser=`echo $_spec | $AWK_PROG -F@ '{print $1}'`
108 _rmthost=`echo $_spec | $AWK_PROG -F@ '{print $2}'`
109 rsh -n -l $_rmtuser $_rmthost "mt -t $_rmtdev $op"
111 _rmthost=`echo $dumptape | $AWK_PROG -F: '{print $1}'`
112 rsh -n $_rmthost "mt -t $_rmtdev $op"
124 while [ $i -lt $_limit ]; do
125 echo "Checking online..." >>$seq.full
126 if _mt status >$tmp.status 2>&1; then
135 if [ $i -eq $_limit ]; then
136 echo "ERROR: mt -f $dumptape failed"
139 echo "mt -f $dumptape failed" >$seq.notrun
145 if egrep -i 'onl|ready' $tmp.status | grep -iv 'not ready' >/dev/null; then
148 echo "ERROR: $dumptape is not online"
151 echo "dumptape, $dumptape, is not online" >$seq.notrun
159 echo "Wait for tape, $dumptape, ..." >>$seq.full
162 while [ $i -lt 20 ]; do
163 echo "Checking status..." >>$seq.full
164 if _mt status 2>&1 | tee -a $seq.full | egrep -i "onl|ready" >/dev/null; then
174 # Keep trying so we know we really have rewound
178 echo "Initiate rewind..." >>$seq.full
180 _mt rewind >/dev/null
185 # Do a custom erase because:
186 # (i) some machines don't support it
187 # (ii) some machines take forever to do it
191 echo "Erasing tape" | tee -a $seq.full
199 echo "Erasing tape" | tee -a $seq.full
205 echo $dumptape | grep ':' >/dev/null
213 $have_mtvariable || return
219 echo "Put scsi tape driver into variable block size mode"
220 mt -f $dumptape setblk 0
228 if [ -z "$dumptape" ]; then
229 echo "This test requires a dump tape - none was specified"
230 echo "No dump tape specified" >$seq.notrun
241 echo "Error: $*" | tee -a $seq.full
242 echo "(see $seq.full for details)"
251 mkfs -t xfs $MKFS_OPTS $SCRATCH_DEV>>$seq.full ||\
254 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
255 _error "mount failed"
259 # Cleanup created dirs and files
267 if [ -n "$DEBUGDUMP" ]; then
268 # save it for inspection
269 for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
270 [ -d $dir ] || continue
271 tar -cvf $seq.inventory.tar $dir
272 ls -lR $dir >$seq.inventory.ls
276 # put inventory dir back
277 for dir in /var/xfsdump/inventory /var/lib/xfsdump/inventory; do
278 [ -d $dir.$seq ] || continue
279 rm -rf $dir # get rid of new one
283 if [ $status -ne $NOTRUNSTS ]; then
284 # Sleep added to stop _check_fs from complaining that the
285 # scratch_dev is still busy
288 _check_fs $SCRATCH_DEV
293 # ensure that bulkstat data will
294 # match with incore data
295 # by forcing disk data to be written out
299 umount $SCRATCH_MNT >>$seq.full ||\
300 _error "unmount failed"
301 mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full ||\
302 _error "mount failed"
306 # Run src/fsstress to create a mixture of
307 # files,dirs,links,symlinks
309 # Pinched from test 013.
311 _create_dumpdir_stress()
313 echo "Creating directory system to dump using src/fsstress."
317 _param="-f link=10 -f creat=10 -f mkdir=10 -f truncate=5 -f symlink=10"
320 if ! mkdir $dump_dir; then
321 echo " failed to mkdir $dump_dir"
326 echo "-----------------------------------------------"
327 echo "fsstress : $_param"
328 echo "-----------------------------------------------"
329 if ! $here/src/fsstress $_param -s 1 $FSSTRESS_AVOID -n $_count -d $dump_dir >$tmp.out 2>&1
331 echo " fsstress (count=$_count) returned $? - see $seq.full"
333 echo "--------------------------------------" >>$here/$seq.full
334 echo "output from fsstress:" >>$here/$seq.full
335 echo "--------------------------------------" >>$here/$seq.full
336 cat $tmp.out >>$here/$seq.full
345 cat <<End-of-File >$tmp.config
346 # pathname size in bytes owner group
348 small 10 $nobody $nobody
349 big 102400 daemon sys
351 sub/big 102400 $nobody sys
353 sub/a 1 $nobody $nobody
354 sub/b 2 $nobody $nobody
355 sub/c 4 $nobody $nobody
356 sub/d 8 $nobody $nobody
357 sub/e 16 $nobody $nobody
358 sub/f 32 $nobody $nobody
359 sub/g 64 $nobody $nobody
360 sub/h 128 $nobody $nobody
361 sub/i 256 $nobody $nobody
362 sub/j 512 $nobody $nobody
363 sub/k 1024 $nobody $nobody
364 sub/l 2048 $nobody $nobody
365 sub/m 4096 $nobody $nobody
366 sub/n 8192 $nobody $nobody
368 sub/a00 100 $nobody $nobody
369 sub/b00 200 $nobody $nobody
370 sub/c00 400 $nobody $nobody
371 sub/d00 800 $nobody $nobody
372 sub/e00 1600 $nobody $nobody
373 sub/f00 3200 $nobody $nobody
374 sub/g00 6400 $nobody $nobody
375 sub/h00 12800 $nobody $nobody
376 sub/i00 25600 $nobody $nobody
377 sub/j00 51200 $nobody $nobody
378 sub/k00 102400 $nobody $nobody
379 sub/l00 204800 $nobody $nobody
380 sub/m00 409600 $nobody $nobody
381 sub/n00 819200 $nobody $nobody
383 sub/a000 1000 $nobody $nobody
384 sub/e000 16000 $nobody $nobody
385 sub/h000 128000 $nobody $nobody
386 sub/k000 1024000 $nobody $nobody
392 cat <<End-of-File >$tmp.config
393 # pathname size in bytes
395 smalll 10 $nobody $nobody
396 biggg 102400 $nobody $nobody
397 sub/smalll 10 $nobody $nobody
398 sub/biggg 102400 $nobody $nobody
402 _mk_fillconfig_perm()
404 # dir_guid: ugo=rwx,g+s on dir is for IRIX chmod(1)
406 cat <<End-of-File >$tmp.config
407 # pathname size/dir user group mode
409 file_suid 10 $nobody $nobody 04777
410 file_guid 10 $nobody $nobody 02777
411 file_sticky 10 $nobody $nobody 01777
412 file_mix1 10 $nobody $nobody 761
413 file_mix2 10 $nobody $nobody 642
414 dir_suid d $nobody $nobody 04777
415 dir_guid d $nobody $nobody ugo=rwx,g+s
416 dir_sticky d $nobody $nobody 01777
417 dir_mix1 d $nobody $nobody 761
418 dir_mix2 d $nobody $nobody 642
424 cat <<End-of-File >$tmp.config
425 # pathname size user group perm name value
427 smalll 10 $nobody $nobody 777 attr1 some_text
428 biggg 102400 $nobody $nobody 777 attr2 some_text2
429 sub/smalll 10 $nobody $nobody 777 attr3 some_text3
430 sub/biggg 102400 $nobody $nobody 777 attr4 some_text4
431 dir d $nobody $nobody 777 attr5 dir_text
433 # Add more files so that there are more than the number
435 # There are bugs in dump/restore for # non-dir files < # streams
436 # It can be tested in another configuration.
437 # It is a pathalogical case.
439 sub/a 1 $nobody $nobody
440 sub/b 2 $nobody $nobody
441 sub/c 4 $nobody $nobody
442 sub/d 8 $nobody $nobody
443 sub/e 16 $nobody $nobody
444 sub/f 32 $nobody $nobody
445 sub/g 64 $nobody $nobody
446 sub/h 128 $nobody $nobody
447 sub/i 256 $nobody $nobody
448 sub/j 512 $nobody $nobody
449 sub/k 1024 $nobody $nobody
450 sub/l 2048 $nobody $nobody
451 sub/m 4096 $nobody $nobody
452 sub/n 8192 $nobody $nobody
457 # Create a bunch of directories/files of different sizes
460 # Pinched from test 001.
462 _do_create_dumpdir_fill()
464 echo "Creating directory system to dump using src/fill."
466 if mkdir -p $dump_dir
470 echo "Error: cannot mkdir \"$dump_dir\""
475 $verbose && echo -n "Setup "
476 sed -e '/^#/d' $tmp.config \
477 | while read file nbytes owner group perms ea_name ea_value
479 if [ $nbytes = "d" ]; then
489 echo "Error: cannot mkdir \"$dir\""
494 # create a directory/file
505 echo "Error: cannot mkdir \"$dir\""
511 if $here/src/fill $file $file $nbytes
516 echo "Error: cannot create \"$file\""
520 if [ -n "$owner" -a -n "$group" ]; then
521 chown $owner.$group $file
523 if [ -n "$perms" ]; then
526 if [ -n "$ea_name" -a -n "$ea_value" ]; then
527 attr -s $ea_name -V $ea_value $file
529 $verbose && echo -n "."
537 _create_dumpdir_fill()
541 _do_create_dumpdir_fill
545 _create_dumpdir_fill2()
549 _do_create_dumpdir_fill
553 _create_dumpdir_fill_perm()
557 _do_create_dumpdir_fill
561 _create_dumpdir_fill_ea()
565 _do_create_dumpdir_fill
571 # Append a subset of the fill'ed files
572 # So we can see if just these get dumped on an incremental
574 _append_dumpdir_fill()
577 cat <<End-of-File >$tmp.config
587 sed -e '/^#/d' $tmp.config \
590 echo 'Extra text' >>$file
597 _do_create_dump_symlinks()
599 echo "Creating directory system of symlinks to dump."
601 if mkdir -p $dump_dir
605 echo "Error: cannot mkdir \"$dump_dir\""
610 $verbose && echo -n "Setup "
611 sed -e '/^#/d' $tmp.config \
612 | while read file nbytes owner group owner2 group2 perms perms2
624 echo "Error: cannot mkdir \"$dir\""
632 # Do chmod on symlink using umask.
633 # This won't do the right thing as it subtracts permissions.
634 # However, I don't care, as long as I get some different perms
636 if [ -n "$perms2" ]; then
640 ln -s $file $file-link
641 if [ -n "$perms2" ]; then
645 if [ -n "$owner" -a -n "$group" ]; then
646 chown $owner.$group $file
648 if [ -n "$owner" -a -n "$group" ]; then
649 chown -h $owner.$group $file-link
651 if [ -n "$perms" ]; then
654 $verbose && echo -n "."
663 cat <<End-of-File >$tmp.config
664 # path size owner1 group1 owner2 group2 perm1 perm2
666 a 0 $nobody $nobody daemon sys 124 421
667 b 0 daemon sys bin bin 347 743
668 sub/a 0 bin bin $nobody sys 777 777
669 sub/b 0 $nobody sys $nobody $nobody 367 763
673 _create_dumpdir_symlinks()
677 _do_create_dump_symlinks
683 # Filter out dates on symlinks and char devices
688 /^l/ { date = $8; sub(date,"DATE"); print}
689 /^c/ { date = $9; sub(date,"DATE"); print}
691 | sed -e 's/total [0-9][0-9]*/total TOTAL/'
696 # Filter out the non-deterministic dump msgs from
697 # xfsdump and xfsrestore
702 -e "s/`hostname`/HOSTNAME/" \
703 -e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
704 -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
705 -e "s#$dumptape#TAPE_DEV#" \
706 -e "s#$SCRATCH_MNT#SCRATCH_MNT#" \
707 -e "s#$dump_file#DUMP_FILE#" \
708 -e 's/id:[ ]*[0-9a-f-]*/id: ID/' \
709 -e 's/time:[ ].*/time: TIME/' \
710 -e 's/date:[ ].*/date: DATE/' \
711 -e 's/dump begun .*/dump begun DATE/' \
712 -e 's/[0-9][0-9]* seconds/SECS seconds/' \
713 -e 's/restore.[0-9][0-9]*/restore.PID/' \
714 -e 's/ino [0-9][0-9]*/ino INO/' \
715 -e '/: dump size/s/[0-9][0-9]*/NUM/' \
716 -e '/dump size:/s/[0-9][0-9]*/NUM/' \
717 -e '/dump size per stream:/s/[0-9][0-9]*/NUM/' \
718 -e 's/\(media file size[ ]*\)[0-9][0-9]*/\1NUM/' \
719 -e 's/\(mfile size:[ ]*\)[0-9][0-9]*/\1NUM/' \
720 -e '/drive[ ]*[0-9][0-9]*:/d' \
722 -e '/inventory session uuid/d' \
723 -e '/ - Running single-threaded/d' \
724 -e '/^.*I\/O metrics: .*$/d' \
725 -e 's/1048576/BLOCKSZ/' \
726 -e 's/2097152/BLOCKSZ/' \
727 -e 's/(pid[ ]*[1-9][0-9]*)/\(pid PID\)/' \
729 if ($_ =~ /(?:Dump|Restore) Summary/) {
731 } elsif ($_ =~ /(?:Dump|Restore) Status/) {
741 _dump_filter_main | _check_quota_dumprestore
751 -e 's/UUID[ ]*:[ ][0-9a-f-]*/UUID : ID/' \
752 -e 's/TIME OF DUMP[ ]*:.*/TIME OF DUMP : TIME/' \
753 -e 's/HOSTNAME:SCRATCH_MNT.*/HOSTNAME:SCRATCH_MNT/' \
754 -e 's#inventory/[0-9a-f-]*#inventory/UUID#' \
762 -e "s#$dump_file#DUMP_FILE#" \
763 -e "s#$SCRATCH_DEV#SCRATCH_DEV#" \
764 -e "s#$SCRATCH_RAWDEV#SCRATCH_DEV#" \
765 -e "s#$dumptape#TAPE_DEV#" \
766 -e "s#$dump_dir#DUMP_DIR#g" \
767 -e "s#$restore_dir#RESTORE_DIR#g" \
768 -e "s#$SCRATCH_MNT#SCRATCH_MNT#g" \
769 -e "s#$dump_sdir#DUMP_SUBDIR#g" \
770 -e "s#$restore_sdir#RESTORE_SUBDIR#g" \
784 [ -z "$2" ] && _error "missing argument for -f"
789 [ -z "$2" ] && _error "missing argument for -L"
794 dump_args="$dump_args -o"
797 dump_args="$dump_args -F"
810 _error "invalid argument"
825 echo "Dumping to tape..."
826 opts="$_dump_debug$dump_args -s $dump_sdir -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
827 echo "xfsdump $opts" | _dir_filter
828 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
832 # Do full level 0 dump
838 echo "Dumping to tape..."
839 opts="$_dump_debug$dump_args -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
840 echo "xfsdump $opts" | _dir_filter
841 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
846 # Do full dump with -m
852 echo "Dumping to tape..."
854 opts="$_dump_debug$dump_args -m -b $onemeg -l0 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
855 echo "xfsdump $opts" | _dir_filter
856 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
860 # Do level 1 incremental dump
862 _do_dump_incremental()
866 echo "Dumping incrementally to tape..."
867 opts="$_dump_debug$dump_args -l1 -f $dumptape -M $media_label -L $session_label $SCRATCH_MNT"
868 echo "xfsdump $opts" | _dir_filter
869 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
873 # Do full dump to file
879 echo "Dumping to file..."
880 opts="$_dump_debug$dump_args -f $dump_file -M $media_label -L $session_label $SCRATCH_MNT"
881 echo "xfsdump $opts" | _dir_filter
882 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
886 # Do full dump to multiple files
888 _do_dump_multi_file()
895 while [ $i -lt $multi ]
897 multi_args="$multi_args -f $dump_file.$i -M $media_label.$i"
901 echo "Dumping to files..."
902 opts="$_dump_debug$dump_args $multi_args -L $session_label $SCRATCH_MNT"
903 echo "xfsdump $opts" | _dir_filter
904 xfsdump $opts 2>&1 | tee -a $seq.full | _dump_filter
908 _prepare_restore_dir()
911 if ! mkdir $restore_dir; then
912 echo " failed to mkdir $restore_dir"
920 # Get tape ready and restore dir
926 echo "Rewinding tape"
931 # Restore the tape into $restore_dir
939 echo "Restoring from tape..."
940 opts="$_restore_debug$dump_args -f $dumptape -L $session_label $restore_dir"
941 echo "xfsrestore $opts" | _dir_filter
942 xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
946 # Restore the tape into $restore_dir using -m
953 echo "Restoring from tape..."
955 opts="$_restore_debug$dump_args -m -b $onemeg -f $dumptape -L $session_label $restore_dir"
956 echo "xfsrestore $opts" | _dir_filter
957 xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
961 # Restore the tape from a dump file
968 echo "Restoring from file..."
969 opts="$_restore_debug$dump_args -f $dump_file -L $session_label $restore_dir"
970 echo "xfsrestore $opts" | _dir_filter
971 xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
975 # Restore the tape from multiple dump files
977 _do_restore_multi_file()
985 while [ $i -lt $multi ]
987 multi_args="$multi_args -f $dump_file.$i"
991 echo "Restoring from file..."
992 opts="$_restore_debug$dump_args $multi_args -L $session_label $restore_dir"
993 echo "xfsrestore $opts" | _dir_filter
994 xfsrestore $opts 2>&1 | tee -a $seq.full | _dump_filter
998 # Do xfsdump piped into xfsrestore - xfsdump | xfsrestore
1000 # Use -s as we want to dump and restore to the same xfs partition
1005 _prepare_restore_dir
1006 echo "xfsdump|xfsrestore ..."
1007 restore_opts="$_restore_debug - $restore_dir"
1008 dump_opts="$_dump_debug$dump_args -s $dump_sdir - $SCRATCH_MNT"
1009 echo "xfsdump $dump_opts | xfsrestore $restore_opts" | _dir_filter
1010 xfsdump $dump_opts 2>$tmp.dump.mlog | xfsrestore $restore_opts 2>&1 | tee -a $seq.full | _dump_filter
1011 _dump_filter <$tmp.dump.mlog
1015 # Compare dumped subdirectory with restored dir
1017 # Thus no contents are compared but permissions, sizes,
1018 # owners, etc... are.
1023 # verify we got back what we dumped
1025 echo "Comparing listing of dump directory with restore directory"
1026 ls -lR $dump_dir | tee -a $seq.full | _ls_filter >$tmp.dump_dir
1027 ls -lR $restore_dir/$dump_sdir | tee -a $seq.full | _ls_filter \
1028 | sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
1030 diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
1034 # filter out the date fields
1038 $AWK_PROG 'NF == 9 { print $1, $2, $3, $4, $9 }'
1042 # _ls_compare_sub but don't compare dates
1043 _ls_nodate_compare_sub()
1046 # verify we got back what we dumped
1048 echo "Comparing listing of dump directory with restore directory"
1049 ls -lR $dump_dir | tee -a $seq.full | _ls_filter | _ls_nodate_filter >$tmp.dump_dir
1050 ls -lR $restore_dir/$dump_sdir | tee -a $seq.full | _ls_filter \
1051 | _ls_nodate_filter | sed -e "s#$restore_sdir\/##" >$tmp.restore_dir
1053 diff -cs $tmp.dump_dir $tmp.restore_dir | sed -e "s#$tmp#TMP#g"
1057 # Compare using recursive diff the files of the dumped
1059 # This one will compare the contents.
1063 echo "Comparing dump directory with restore directory"
1064 diff -rs $dump_dir $restore_dir/$dump_sdir | _dir_filter
1071 find $_path -exec attr -l {} \; |\
1072 awk '{print $9, $2}' |\
1075 while read file ea_name; do
1076 attr -g $ea_name $file
1081 # Compare the extended attributes of the files/dirs
1082 # b/w the dumped and restore dirs.
1085 # Attribute "attr5" had a 8 byte value for /spare1/dump.5460/dir:
1086 # Attribute "attr5" had a 8 byte value for /spare1/restore.5460/dump.5460/dir:
1090 echo "Comparing dump directory with restore directory"
1091 echo "Looking at the extended attributes (EAs)"
1093 _get_eas_on_path $dump_dir | tee $seq.ea1 | _dir_filter
1094 echo "EAs on restore"
1095 _get_eas_on_path $restore_dir/$dump_sdir \
1096 | sed -e "s#$restore_sdir\/##" \
1099 diff -s $seq.ea1 $seq.ea2
1104 # Compare using recursive diff the files of the dumped
1109 echo "Comparing dump directory with restore directory"
1110 diff -rs $SCRATCH_MNT $restore_dir | _dir_filter | _check_quota_diff
1114 # Check out the dump inventory
1118 xfsdump $_dump_debug -I | tee -a $seq.full | _dump_filter_main
1122 # Do the xfsinvutil cmd with debug and filters
1123 # Need to set variable: "$middate" to the invutil date
1128 echo "xfsinvutil $_invutil_debug -M $host:$SCRATCH_MNT \"$middate\" $*" >$seq.full
1129 xfsinvutil $_invutil_debug $* -M $host:$SCRATCH_MNT "$middate" \
1130 | tee -a $seq.full | _invutil_filter
1135 # xfsdump: saving user quota information for: SCRATCH_MNT
1136 # xfsdump: saving group quota information for: SCRATCH_MNT
1137 # xfsrestore: user quota information written to ...'
1138 # xfsrestore: group quota information written to ...'
1140 _check_quota_dumprestore()
1144 src/feature -U $SCRATCH_DEV && uquota=1
1145 src/feature -G $SCRATCH_DEV && gquota=1
1147 $AWK_PROG -v uquota=$uquota -v gquota=$gquota -v full=$seq.full '
1148 /user quota information/ {
1149 print "Found user quota:", $0 >>full
1152 print "Found extra:", $0
1156 /group quota information/ {
1157 print "Found group quota:", $0 >>full
1160 print "Found extra:", $0
1166 if (uquota && !found_uquota) {
1167 print "Missing saving/restoring uquota msg"
1169 if (gquota && !found_gquota) {
1170 print "Missing saving/restoring gquota msg"
1178 # Only in RESTORE_DIR: xfsdump_quotas
1179 # Only in RESTORE_DIR: xfsdump_quotas_group
1186 src/feature -U $SCRATCH_DEV && uquota=1
1187 src/feature -G $SCRATCH_DEV && gquota=1
1189 $AWK_PROG -v uquota=$uquota -v gquota=$gquota '
1190 /Only in RESTORE_DIR: xfsdump_quotas_group/ {
1193 print "Found extra:", $0
1197 /Only in RESTORE_DIR: xfsdump_quotas/ {
1200 print "Found extra:", $0
1206 if (uquota && !found_uquota) {
1207 print "Missing xfsdump_quotas msg"
1209 if (gquota && !found_gquota) {
1210 print "Missing xfsdump_quotas_group msg"
1216 # make sure this script returns success