From: fsgqa Date: Thu, 22 May 2003 04:16:45 +0000 (+0000) Subject: Numerous changes to QA scripts allowing tests to run with external log/rt devices... X-Git-Tag: v1.1.0~983 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=8050efd492d11f3751f673ef1eede0434cf50647;p=xfstests-dev.git Numerous changes to QA scripts allowing tests to run with external log/rt devices; also allow multiple mkfs/mount options at once now. --- diff --git a/004 b/004 index c1332b14..22c392f2 100755 --- a/004 +++ b/004 @@ -57,15 +57,15 @@ trap "_cleanup" 0 1 2 3 15 _populate_scratch() { echo "=== mkfs output ===" >>$seq.full - mkfs_xfs $SCRATCH_DEV | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs + _scratch_mkfs_xfs | tee -a $seq.full | _filter_mkfs 2>$tmp.mkfs source $tmp.mkfs - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT + _scratch_mount dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 & dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 & dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 & wait umount $SCRATCH_MNT # flush everything - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT # and then remount + _scratch_mount # and then remount } diff --git a/009 b/009 index d133f2c8..aa5da5b8 100755 --- a/009 +++ b/009 @@ -66,7 +66,7 @@ _block_filter() _init() { echo "*** mkfs" - if ! mkfs_xfs $SCRATCH_DEV >$tmp.out 2>&1 + if ! _scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "failed to mkfs $SCRATCH_DEV" @@ -74,7 +74,7 @@ _init() fi echo "*** mount" - if ! mount $SCRATCH_DEV $SCRATCH_MNT -t xfs + if ! _scratch_mount then echo "failed to mount $SCRATCH_DEV" exit 1 diff --git a/013 b/013 index ceb25bb3..7a9de2d1 100755 --- a/013 +++ b/013 @@ -98,7 +98,7 @@ _do_test() status=1 fi - _check_fs $TEST_DEV + _check_test_fs } @@ -109,7 +109,7 @@ echo "brevity is wit..." count=1000 -_check_fs $TEST_DEV +_check_test_fs # the default diff --git a/015 b/015 index 17eb4662..31db887a 100755 --- a/015 +++ b/015 @@ -76,8 +76,8 @@ _filter_dd() # real QA test starts here _require_scratch -mkfs_xfs -d size=50m $SCRATCH_DEV >/dev/null -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT +_scratch_mkfs_xfs -d size=50m >/dev/null +_scratch_mount out=$SCRATCH_MNT/fillup.$$ rm -f $seq.full diff --git a/016 b/016 index 49546041..164bae07 100755 --- a/016 +++ b/016 @@ -80,7 +80,7 @@ _init() echo "*** mkfs" force_opts="-dsize=50m -lsize=2097152" echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full - mkfs_xfs $force_opts $SCRATCH_DEV | _filter_mkfs >/dev/null 2>$tmp.mkfs + _scratch_mkfs_xfs $force_opts | _filter_mkfs >/dev/null 2>$tmp.mkfs source $tmp.mkfs } @@ -92,7 +92,7 @@ _log_traffic() out=$SCRATCH_MNT/$$.tmp echo " *** mount" - if ! mount -t xfs $SCRATCH_DEV $SCRATCH_MNT + if ! _scratch_mount then echo "failed to mount $SCRATCH_DEV" exit 1 @@ -122,14 +122,14 @@ _log_traffic() _log_size() { - xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG ' - /log device/ { print $7} + _scratch_xfs_logprint -tb | $AWK_PROG ' + /log file: / || /log device: / { print $7} ' } _log_head() { - xfs_logprint -tb $SCRATCH_DEV | $AWK_PROG ' + _scratch_xfs_logprint -tb | $AWK_PROG ' /head:/ { print $5 } ' } diff --git a/017 b/017 index 0ccfe58c..fbcdee94 100755 --- a/017 +++ b/017 @@ -53,15 +53,6 @@ _cleanup() } trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 -_clean_log() -{ - echo "" >>$seq.full - echo "*** xfs_logprint ***" >>$seq.full - echo "" >>$seq.full - xfs_logprint -tb $1 | tee -a $seq.full \ - | head | grep -q "" || _fail "DIRTY LOG" -} - # get standard environment, filters and checks . ./common.rc . ./common.filter @@ -76,9 +67,9 @@ rm -f $seq.full umount $SCRATCH_DEV >/dev/null 2>&1 echo "*** MKFS ***" >>$seq.full echo "" >>$seq.full -mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1 \ +_scratch_mkfs_xfs >>$seq.full 2>&1 \ || _fail "mkfs failed" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \ +_scratch_mount >>$seq.full 2>&1 \ || _fail "mount failed" echo "*** test" @@ -88,17 +79,21 @@ do echo " *** test $l" src/fsstress -d $SCRATCH_MNT -n 1000 $FSSTRESS_AVOID >>$seq.full - mount -o remount,ro $SCRATCH_DEV \ + _scratch_mount -o remount,ro \ || _fail "remount ro failed" - _clean_log $SCRATCH_DEV - + echo "" >>$seq.full + echo "*** xfs_logprint ***" >>$seq.full + echo "" >>$seq.full + _scratch_xfs_logprint -tb | tee -a $seq.full \ + | head | grep -q "" || _fail "DIRTY LOG" + echo "" >>$seq.full echo "*** XFS_CHECK ***" >>$seq.full echo "" >>$seq.full xfs_check $SCRATCH_DEV >>$seq.full 2>&1 \ || _fail "xfs_check failed" - mount -o remount,rw $SCRATCH_DEV \ + _scratch_mount -o remount,rw \ || _fail "remount rw failed" done diff --git a/018 b/018 index 17516815..eebe25c1 100755 --- a/018 +++ b/018 @@ -65,18 +65,12 @@ _full() echo "" >>$seq.full } -_clean_log() -{ - _full "clean_log : xfs_logprint" - xfs_logprint -t $1 | tee -a $seq.full \ - | head | grep -q "" || _fail "DIRTY LOG" -} - _filter_logprint() { sed ' s/data device: 0x[0-9a-f][0-9a-f]*/data device: /; s/log device: 0x[0-9a-f][0-9a-f]*/log device: /; + s/log file: \".*\"/log device: /; s/daddr: [0-9][0-9]*/daddr: /; s/length: [0-9][0-9]*/length: /; s/length: [0-9][0-9]*/length: /; @@ -103,13 +97,15 @@ _filter_logprint() _check_log() { - _clean_log $SCRATCH_DEV + _full "clean_log : xfs_logprint" + _scratch_xfs_logprint -t | tee -a $seq.full \ + | head | grep -q "" || _fail "DIRTY LOG" echo "### xfs_logprint output ###" - xfs_logprint $SCRATCH_DEV 2>&1 | _filter_logprint + _scratch_xfs_logprint 2>&1 | _filter_logprint echo "### xfs_logprint -t -i -s 0 output ###" - xfs_logprint -t -i -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint + _scratch_xfs_logprint -t -i -s 0 2>&1 | _filter_logprint echo "### xfs_logprint -t -b -s 0 output ###" - xfs_logprint -t -b -s 0 $SCRATCH_DEV 2>&1 | _filter_logprint + _scratch_xfs_logprint -t -b -s 0 2>&1 | _filter_logprint } # real QA test starts here @@ -122,7 +118,7 @@ touch $seq.out umount $SCRATCH_DEV >/dev/null 2>&1 _full "mkfs" -mkfs_xfs -lsize=2000b $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs -lsize=2000b | _filter_mkfs 2>$tmp.mkfs source $tmp.mkfs [ $dbsize -eq 4096 ] \ || _notrun "Logprint test, tailored to 4K blocks ($dbsize in use)" @@ -134,7 +130,7 @@ source $tmp.mkfs rm -f $seq.out $seq.full _full " mount" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \ +_scratch_mount >>$seq.full 2>&1 \ || _fail "mount failed" _setup_seq_out diff --git a/019 b/019 index cafb9345..5ce5cecb 100755 --- a/019 +++ b/019 @@ -130,15 +130,15 @@ _verify_fs() umount $SCRATCH_DEV >/dev/null 2>&1 _full "mkfs" - mkfs_xfs $VERSION -p $protofile $SCRATCH_DEV >>$seqfull 2>&1 \ + _scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \ || _fail "mount failed" echo "*** check FS" - _check_fs $SCRATCH_DEV + _check_scratch_fs echo "*** mount FS" _full " mount" - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seqfull 2>&1 \ + _scratch_mount >>$seqfull 2>&1 \ || _fail "mount failed" echo "*** verify FS" @@ -153,7 +153,7 @@ _verify_fs() || _fail "umount failed" echo "*** check FS" - _check_fs $SCRATCH_DEV + _check_scratch_fs } _verify_fs 1 diff --git a/021 b/021 index 42a97fb7..5afd7eb3 100755 --- a/021 +++ b/021 @@ -94,11 +94,11 @@ rm -f $seq.full umount $SCRATCH_DEV >/dev/null 2>&1 echo "*** mkfs" -mkfs_xfs $SCRATCH_DEV >/dev/null \ +_scratch_mkfs_xfs >/dev/null \ || _fail "mkfs failed" echo "*** mount FS" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \ +_scratch_mount >/dev/null \ || _fail "mount failed" testfile=$SCRATCH_MNT/testfile diff --git a/029 b/029 index 17b903c5..d0f26330 100755 --- a/029 +++ b/029 @@ -51,15 +51,6 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter -mkfs_args="" -logp_args="" -if [ ! -z "$SCRATCH_LOGDEV" ] # test external log if possible -then - _require_logdev - mkfs_args="-l logdev=$SCRATCH_LOGDEV,size=1200b" - logp_args="-l $SCRATCH_LOGDEV" -fi - _filter_logprint() { perl -ne ' @@ -78,10 +69,10 @@ _filter_logprint() _require_scratch echo -mkfs_xfs $mkfs_args $SCRATCH_DEV | _filter_mkfs 2>/dev/null +_scratch_mkfs_xfs | _filter_mkfs 2>/dev/null echo -xfs_logprint $logp_args $SCRATCH_DEV | _filter_logprint +_scratch_xfs_logprint | _filter_logprint status=0 exit diff --git a/030 b/030 index 3beed491..daab1b98 100755 --- a/030 +++ b/030 @@ -80,12 +80,12 @@ DSIZE="-dsize=100m" # superblock (hanging around from earlier tests)... # -mkfs_xfs $DSIZE $SCRATCH_DEV >/dev/null 2>&1 +_scratch_mkfs_xfs $DSIZE >/dev/null 2>&1 if [ $? -ne 0 ] # probably don't have a big enough scratch then _notrun "SCRATCH_DEV too small, results would be non-deterministic" else - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT + _scratch_mount src/feature -U $SCRATCH_DEV && \ _notrun "Quota are enabled, test needs controlled sb recovery" src/feature -G $SCRATCH_DEV && \ @@ -102,7 +102,7 @@ src/devzero -v -1 -n "$clear" $SCRATCH_DEV >/dev/null # now kick off the real repair test... # -mkfs_xfs $DSIZE $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs $DSIZE | _filter_mkfs 2>$tmp.mkfs source $tmp.mkfs _check_ag 0 _check_ag -1 diff --git a/030.out b/030.out index a1d1b6a1..48fdedd8 100644 --- a/030.out +++ b/030.out @@ -20,7 +20,7 @@ sb realtime bitmap inode INO inconsistent with calculated value INO resetting superblock realtime bitmap ino pointer to INO sb realtime summary inode INO inconsistent with calculated value INO resetting superblock realtime summary ino pointer to INO -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -49,7 +49,7 @@ done Corrupting agf 0 - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... bad magic # 0x0 for agf 0 @@ -84,7 +84,7 @@ done Corrupting agi 0 - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... bad magic # 0x0 for agi 0 @@ -120,7 +120,7 @@ done Corrupting agfl 0 - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -161,7 +161,7 @@ sb realtime bitmap inode INO inconsistent with calculated value INO resetting superblock realtime bitmap ino pointer to INO sb realtime summary inode INO inconsistent with calculated value INO resetting superblock realtime summary ino pointer to INO -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -192,7 +192,7 @@ done Corrupting agf 0 - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... bad magic # 0xffffffff for agf 0 @@ -231,7 +231,7 @@ done Corrupting agi 0 - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... bad magic # 0xffffffff for agi 0 @@ -267,7 +267,7 @@ done Corrupting agfl 0 - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk diff --git a/031 b/031 index 38fe5757..acd8c9c4 100755 --- a/031 +++ b/031 @@ -54,11 +54,11 @@ rm -f $seq.full _check_repair() { - xfs_repair $SCRATCH_DEV >$tmp.0 2>&1 + _scratch_xfs_repair >$tmp.0 2>&1 for i in 1 2 3 4 do echo "Repairing, iteration $i" | tee -a $seq.full - xfs_repair $SCRATCH_DEV 2>&1 | tee -a $seq.full >$tmp.$i + _scratch_xfs_repair 2>&1 | tee -a $seq.full >$tmp.$i diff $tmp.0 $tmp.$i >> $seq.full if [ $? -ne 0 ]; then echo "ERROR: repair round $i differs (see $seq.full)" @@ -67,6 +67,8 @@ _check_repair() # echo all interesting stuff... perl -ne ' s/(rebuilding directory inode) (\d+)/\1 INO/g; + s/internal log/ log/g; + s/external log on \S+/ log/g; /^\S+/ && print; ' $tmp.$i done @@ -102,34 +104,34 @@ EOF # _require_scratch -MKFSV1="-p $tmp.proto -n version=1 $SCRATCH_DEV" -MKFSV2="-p $tmp.proto -n version=2 $SCRATCH_DEV" +MKFSV1="-p $tmp.proto -n version=1" +MKFSV2="-p $tmp.proto -n version=2" # sanity test - default + one root directory entry _create_proto 0 echo "=== version 1, one entry" -mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 _check_repair echo "=== version 2, one entry (shortform)" -mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 _check_repair # block-form root directory & repeat _create_proto 20 echo "=== version 1, twenty entries" -mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 _check_repair echo "=== version 2, twenty entries (block form)" -mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 _check_repair # leaf-form root directory & repeat _create_proto 1000 echo "=== version 1, thousand entries" -mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV1 | _filter_mkfs >/dev/null 2>&1 _check_repair echo "=== version 2, thousand entries (leaf form)" -mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 +_scratch_mkfs_xfs $MKFSV2 | _filter_mkfs >/dev/null 2>&1 _check_repair # success, all done diff --git a/031.out b/031.out index 949df356..baebe639 100644 --- a/031.out +++ b/031.out @@ -2,7 +2,7 @@ QA output created by 031 === version 1, one entry Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -11,7 +11,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -20,7 +20,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -29,7 +29,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -40,7 +40,7 @@ done === version 2, one entry (shortform) Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -49,7 +49,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -58,7 +58,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -67,7 +67,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -78,7 +78,7 @@ done === version 1, twenty entries Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -87,7 +87,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -96,7 +96,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -105,7 +105,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -116,7 +116,7 @@ done === version 2, twenty entries (block form) Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -126,7 +126,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -136,7 +136,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -146,7 +146,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -158,7 +158,7 @@ done === version 1, thousand entries Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -167,7 +167,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -176,7 +176,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -185,7 +185,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -196,7 +196,7 @@ done === version 2, thousand entries (leaf form) Repairing, iteration 1 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -206,7 +206,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 2 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -216,7 +216,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 3 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... @@ -226,7 +226,7 @@ Phase 7 - verify and correct link counts... done Repairing, iteration 4 Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log Phase 3 - for each AG... Phase 4 - check for duplicate blocks... Phase 5 - rebuild AG headers and trees... diff --git a/033 b/033 index ec6276a0..dd27aada 100755 --- a/033 +++ b/033 @@ -75,16 +75,16 @@ _check_root_inos() _require_scratch # devzero blows away 512byte blocks, so make 512byte inodes (at least) -mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs source $tmp.mkfs [ $isize -lt 512 ] && \ - mkfs_xfs -isize=512 $SCRATCH_DEV | _filter_mkfs >/dev/null 2>&1 + _scratch_mkfs_xfs -isize=512 | _filter_mkfs >/dev/null 2>&1 `xfs_db -r -c sb -c p $SCRATCH_DEV | grep 'ino = ' | \ sed -e 's/ //g' -e 's/^/export /'` # check we won't get any quota inodes setup on mount -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT +_scratch_mount src/feature -U $SCRATCH_DEV && \ _notrun "Quota are enabled, test needs controlled sb recovery" src/feature -G $SCRATCH_DEV && \ diff --git a/033.out b/033.out index 93fb00c5..50f273d6 100644 --- a/033.out +++ b/033.out @@ -8,7 +8,7 @@ realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX Corrupting root inode - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -44,7 +44,7 @@ done Corrupting rt bitmap inode - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -80,7 +80,7 @@ done Corrupting rt summary inode - setting bits to 0 Wrote X.XXKb (value 0x0) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -116,7 +116,7 @@ done Corrupting root inode - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -154,7 +154,7 @@ done Corrupting rt bitmap inode - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk @@ -192,7 +192,7 @@ done Corrupting rt summary inode - setting bits to -1 Wrote X.XXKb (value 0xffffffff) Phase 1 - find and verify superblock... -Phase 2 - using internal log +Phase 2 - using log - zero log... - scan filesystem freespace and inode maps... - found root inode chunk diff --git a/034 b/034 index 36fcd020..c9d23b7c 100755 --- a/034 +++ b/034 @@ -67,14 +67,14 @@ rm -f $seq.full umount $SCRATCH_DEV >/dev/null 2>&1 echo "*** MKFS ***" >>$seq.full echo "" >>$seq.full -mkfs_xfs $SCRATCH_DEV >>$seq.full 2>&1 \ +_scratch_mkfs_xfs >>$seq.full 2>&1 \ || _fail "mkfs failed" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$seq.full 2>&1 \ +_scratch_mount >>$seq.full 2>&1 \ || _fail "mount failed" echo "*** test" -_check_fs $SCRATCH_DEV +_check_scratch_fs if ! touch $SCRATCH_MNT/fish then @@ -95,7 +95,7 @@ then fi # pv 801241 causes corruption here (inode left in agi_unlinked list) -_check_fs $SCRATCH_DEV +_check_scratch_fs echo "*** done" # happy exit diff --git a/041 b/041 index 5b7af3fd..3589ad2a 100755 --- a/041 +++ b/041 @@ -75,8 +75,8 @@ rm -f $seq.full #agsize=16 agsize=32 echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... " -_do "mkfs_xfs -dsize=${agsize}m,agcount=1 $SCRATCH_DEV" -_do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT" +_do "_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1" +_do "_scratch_mount" echo "done" # full allocation group -> partial; partial -> expand partial + new partial; @@ -90,7 +90,7 @@ do _do "Grow filesystem to $size blocks" "xfs_growfs -D ${size} $SCRATCH_MNT" echo -n "Flush filesystem... " _do "umount $SCRATCH_MNT" - _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT" + _do "_scratch_mount" echo "done" echo -n "Check files... " if ! _do "src/fill2fs_check $tmp.manifest"; then diff --git a/042 b/042 index 44a382d2..4ff3064a 100755 --- a/042 +++ b/042 @@ -100,13 +100,11 @@ _cull_files() # xfs_repair is going to need three to verify the superblock rm -f $seq.full -bmap_cmd="xfs_bmap -v" -mnt_cmd="mount -t xfs $SCRATCH_DEV $SCRATCH_MNT" _do_die_on_error=message_only echo -n "Make a 48 megabyte filesystem on SCRATCH_DEV and mount... " -_do "mkfs_xfs -dsize=48m,agcount=3 $SCRATCH_DEV" -_do "$mnt_cmd" +_do "_scratch_mkfs_xfs -dsize=48m,agcount=3" +_do "_scratch_mount" echo "done" echo -n "Reserve 16 1Mb unfragmented regions... " @@ -114,7 +112,7 @@ for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 do _do "dd if=/dev/zero of=$SCRATCH_MNT/hole$i bs=4096 count=256" _do "dd if=/dev/zero of=$SCRATCH_MNT/space$i bs=4096 count=1" - _do "$bmap_cmd $SCRATCH_MNT/hole$i" + _do "xfs_bmap -v $SCRATCH_MNT/hole$i" done echo "done" @@ -125,7 +123,7 @@ _do "src/fill2fs $fill_options --dir=$SCRATCH_MNT/fill --list=- > $tmp.manifest" echo "done" # flush the filesystem - make sure there is no space "lost" to pre-allocation _do "umount $SCRATCH_MNT" -_do "$mnt_cmd" +_do "_scratch_mount" echo -n "Use up any further available space using dd... " _do "dd if=/dev/zero of=$SCRATCH_MNT/pad bs=4096" echo "done" @@ -135,13 +133,13 @@ _do "Delete every second file" "_cull_files" echo -n "Create one very large file... " _do "src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented" echo "done" -_do "$bmap_cmd $SCRATCH_MNT/fragmented" +_do "xfs_bmap -v $SCRATCH_MNT/fragmented" _do "sum $SCRATCH_MNT/fragmented >$tmp.sum1" _do "Remove other files" "rm -rf $SCRATCH_MNT/{pad,hole*}" # defragment _do "Run xfs_fsr on filesystem" "xfs_fsr -v $SCRATCH_DEV" -_do "$bmap_cmd $SCRATCH_MNT/fragmented" +_do "xfs_bmap -v $SCRATCH_MNT/fragmented" _do "Check 4k files" "src/fill2fs_check $tmp.manifest" # check @@ -153,7 +151,7 @@ if ! _do "diff $tmp.sum1 $tmp.sum2"; then status=1; exit fi echo "done" -_do "Checking filesystem" "_check_fs $SCRATCH_DEV" +_do "Checking filesystem" "_check_scratch_fs" # success, all done echo "xfs_fsr tests passed." diff --git a/044 b/044 index 5ab547ac..bb4191f5 100755 --- a/044 +++ b/044 @@ -70,7 +70,7 @@ _filter_logprint() _check_mount() { echo " *** mount (expect success)" - if ! mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT + if ! _scratch_mount then echo " !!! mount failed (expecting success)" status=1 @@ -89,7 +89,7 @@ _check_mount() _check_no_mount() { echo " *** mount (expect failure)" - if mount -t xfs -o logdev=$SCRATCH_LOGDEV $SCRATCH_DEV $SCRATCH_MNT >$tmp.err 2>&1 + if _scratch_mount >$tmp.err 2>&1 then cat $tmp.err echo " !!! mount succeeded (expecting failure)" @@ -128,10 +128,7 @@ echo "*** mkfs" lversion=1 lsize=16777216 -ldev=$SCRATCH_LOGDEV -MKFS_OPTIONS="-llogdev=$ldev,size=$lsize,version=$lversion"; export MKFS_OPTIONS - -mkfs_xfs $logopts $SCRATCH_DEV | _filter_mkfs 2>/dev/null +_scratch_mkfs_xfs -lsize=$lsize,version=$lversion | _filter_mkfs 2>/dev/null _check_mount _check_require_logdev diff --git a/045 b/045 index 7191a2ae..4f559989 100755 --- a/045 +++ b/045 @@ -51,9 +51,9 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 . ./common.rc . ./common.filter -_get_uuid() +_get_existing_uuid() { - xfs_db -r $1 -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }' + xfs_db -r $TEST_DEV -c "uuid" | $AWK_PROG '/^UUID/ { print $3 }' } # real QA test starts here @@ -61,9 +61,9 @@ _get_uuid() _require_scratch echo "*** get uuid" -uuid=`_get_uuid $TEST_DEV` +uuid=`_get_existing_uuid` echo "*** mkfs" -if ! mkfs_xfs $SCRATCH_DEV >$tmp.out 2>&1 +if ! _scratch_mkfs_xfs >$tmp.out 2>&1 then cat $tmp.out echo "!!! failed to mkfs on $SCRATCH_DEV" @@ -71,7 +71,7 @@ then fi echo "*** mount fs with bad mount option (expect failure)" -if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT -o foobar >$tmp.out 2>&1 +if _scratch_mount -o foobar >$tmp.out 2>&1 then cat $tmp.out echo "!!! mount succeeded (expecting failure)" @@ -79,10 +79,10 @@ then fi echo "*** duplicate uuid" -xfs_db -x $SCRATCH_DEV -c "uuid $uuid" >/dev/null +xfs_db -x -c "uuid $uuid" `_scratch_xfs_db_options` >/dev/null echo "*** mount fs with duplicate uuid (expect failure)" -if mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >$tmp.out 2>&1 +if _scratch_mount >$tmp.out 2>&1 then cat $tmp.out echo "!!! mount succeeded (expecting failure)" diff --git a/049 b/049 index 8e4443f3..c4f0a5f3 100755 --- a/049 +++ b/049 @@ -92,7 +92,8 @@ mount -t ext2 $SCRATCH_DEV $SCRATCH_MNT >> $seq.full 2>&1 \ || _fail "!!! failed to mount" _log "Create xfs fs in file on scratch" -mkfs_xfs -dfile,name=$SCRATCH_MNT/test.xfs,size=20m >> $seq.full 2>&1 \ +/sbin/mkfs.xfs -f $MKFS_OPTIONS -dfile,name=$SCRATCH_MNT/test.xfs,size=20m \ + >> $seq.full 2>&1 \ || _fail "!!! failed to mkfs xfs" _log "Make mount points" diff --git a/050 b/050 index ad2a59a5..eac9423b 100755 --- a/050 +++ b/050 @@ -75,7 +75,7 @@ inohard=10 # The actual point at which limit enforcement takes place for the # hard block limit is variable depending on filesystem blocksize, # and iosize. What we want to test is that the limit is enforced -# (ie. blksize less than limit but not unduly less - ~85% is kind, +# (ie. blksize less than limit but not unduly less - ~85% is kind) # nowadays we actually get much closer to the limit before EDQUOT. # _filter_and_check_blocks() @@ -94,7 +94,7 @@ _filter_and_check_blocks() } # real QA test starts here -mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seq.full # keep the blocksize and data size for dd later @@ -149,7 +149,7 @@ _qmount repquota -$type $SCRATCH_DEV | _filter_repquota 7 echo -echo "*** push past the hard inode limit (expect EDQUOT)" | tee -a $seq.full +echo "*** push past the hard inode limit (EDQUOT if enfd)" | tee -a $seq.full for i in 1 2 3 4 5 6 7 8 9 10 11 12 do _file_as_id $SCRATCH_MNT/hard$i $id $type 1024 0 @@ -158,7 +158,7 @@ _qmount repquota -$type $SCRATCH_DEV | _filter_repquota 7 echo -echo "*** push past the hard block limit (expect EDQUOT)" | tee -a $seq.full +echo "*** push past the hard block limit (EDQUOT is enfd)" | tee -a $seq.full _file_as_id $SCRATCH_MNT/softie $id $type 1024 540 _qmount repquota -$type $SCRATCH_DEV | _filter_and_check_blocks 7 diff --git a/052 b/052 index 8330118b..7d369de4 100755 --- a/052 +++ b/052 @@ -71,7 +71,7 @@ if [ -z "$MOUNT_OPTIONS" ]; then fi # real QA test starts here -mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs +_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs cat $tmp.mkfs >>$seq.full chmod a+w $seq.full # arbitrary users will write here diff --git a/053 b/053 index 2f0e6ffd..c0068b0c 100755 --- a/053 +++ b/053 @@ -61,10 +61,8 @@ _do_die_on_error=y test=$SCRATCH_MNT/test # make filesystem on scratch using the defaults -_do 'make filesystem on $SCRATCH_DEV' \ - 'mkfs_xfs $SCRATCH_DEV' -_do 'mount filesytem' \ - 'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT' +_do 'make filesystem on $SCRATCH_DEV' '_scratch_mkfs_xfs' +_do 'mount filesytem' '_scratch_mount' # create test files and set acls acls=" @@ -98,8 +96,8 @@ list_acls() echo "acls before repair:" list_acls _do 'unmount $SCRATCH_DEV' 'umount $SCRATCH_DEV' -_do 'repair filesystem' 'xfs_repair $SCRATCH_DEV' -_do 'mount filesytem' 'mount -t xfs $SCRATCH_DEV $SCRATCH_MNT' +_do 'repair filesystem' '_scratch_xfs_repair' +_do 'mount filesytem' '_scratch_mount' echo "acls after repair: " list_acls diff --git a/054 b/054 index c0edf9af..b436f3d4 100755 --- a/054 +++ b/054 @@ -77,7 +77,7 @@ _filter_stat() _exercise() { - mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1 + _scratch_mkfs_xfs >/dev/null 2>&1 _qmount umask 022 @@ -110,8 +110,8 @@ _exercise() } # real QA test starts here -mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1 -MOUNT_OPTIONS="-o usrquota,grpquota"; export MOUNT_OPTIONS +_scratch_mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1 +MOUNT_OPTIONS="$MOUNT_OPTIONS -ousrquota,grpquota"; export MOUNT_OPTIONS _qmount if src/feature -G $SCRATCH_DEV ; then : diff --git a/062 b/062 index 1b7e885d..5b976ad1 100755 --- a/062 +++ b/062 @@ -92,8 +92,8 @@ _require_scratch rm -f $tmp.backup1 $tmp.backup2 $seq.full # real QA test starts here -mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "mount failed" +_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs +_scratch_mount || _fail "mount failed" _create_test_bed for nsp in user trusted; do diff --git a/065 b/065 index bfd0c809..6e376eff 100755 --- a/065 +++ b/065 @@ -82,7 +82,7 @@ _my_ls_filter() # so don't run it # umount $SCRATCH_DEV 2>/dev/null -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT +_scratch_mount $here/src/feature -U $SCRATCH_DEV && \ _notrun "Quota enabled, test needs controlled xfsdump output" $here/src/feature -G $SCRATCH_DEV && \ diff --git a/067 b/067 index e8d4da5b..e1943cc0 100755 --- a/067 +++ b/067 @@ -1,6 +1,6 @@ #! /bin/sh # XFS QA Test No. 067 -# $Id: 067,v 1.6 2002/06/05 20:14:16 sandeen Exp $ +# $Id: 067,v 1.7 2003/05/22 04:16:45 fsgqa Exp $ # # Test out acl/dacls which fit in shortform in the inode # @@ -61,10 +61,8 @@ _require_scratch # set up fs for 1K inodes export MKFS_OPTIONS="-i size=1024" -mkfs_xfs $SCRATCH_DEV>>$here/$seq.full ||\ - _error "mkfs failed" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\ - _error "mount failed" +_scratch_mkfs_xfs >>$here/$seq.full || _error "mkfs failed" +_scratch_mount >>$here/$seq.full || _error "mount failed" cd $SCRATCH_MNT # xfs_growfs -n $SCRATCH_MNT diff --git a/069 b/069 index 03918430..adf2deae 100755 --- a/069 +++ b/069 @@ -1,6 +1,6 @@ #! /bin/sh # XFS QA Test No. 069 -# $Id: 069,v 1.2 2002/09/04 11:14:37 fsgqa Exp $ +# $Id: 069,v 1.3 2003/05/22 04:16:45 fsgqa Exp $ # # Test out writes with O_APPEND flag sets. # @@ -59,12 +59,10 @@ rm -f $seq.full umount $SCRATCH_DEV >/dev/null 2>&1 echo "*** mkfs" -mkfs_xfs $SCRATCH_DEV >/dev/null \ - || _fail "mkfs failed" +_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed" echo "*** mount FS" -mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \ - || _fail "mount failed" +_scratch_mount >/dev/null || _fail "mount failed" cd $SCRATCH_MNT diff --git a/README b/README index 27fefc88..b5266deb 100644 --- a/README +++ b/README @@ -25,9 +25,14 @@ Preparing system for tests: - setenv TAPE_DEV "tape device for testing xfsdump" - setenv RMT_TAPE_DEV "remote tape device for testing xfsdump" - setenv RMT_IRIXTAPE_DEV "remote IRIX tape device for testing xfsdump" - - optionally: - - setenv SCRATCH_LOGDEV "device for external log" - - setenv SCRATCH_RTDEV "device for realtime data" + - optionally: + - setenv SCRATCH_LOGDEV "device for scratch-fs external log" + - setenv SCRATCH_RTDEV "device for scratch-fs realtime data" + - setenv TEST_LOGDEV "device for test-fs external log" + - setenv TEST_RTDEV "device for test-fs realtime data" + - if TEST_LOGDEV and/or TEST_RTDEV, these will always be used. + - if SCRATCH_LOGDEV and/or SCRATCH_RTDEV, the USE_EXTERNAL + environment variable set to "yes" will enable their use. - or add a case to the switch in common.config assigning these variables based on the hostname of your test machine diff --git a/bench b/bench index f1acdc2b..9ec09929 100755 --- a/bench +++ b/bench @@ -15,7 +15,7 @@ # generation purposes). # #----------------------------------------------------------------------- -# Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as @@ -88,16 +88,6 @@ _fail() exit 1 } -bench_mkfs_xfs() -{ - mkfs_xfs -f $extra_mkfs_options $@ -} - -bench_mount_xfs() -{ - mount -t xfs $extra_mount_options $@ -} - _run_benchmark() { pass=1 @@ -107,12 +97,9 @@ _run_benchmark() while [ $pass -le $passes -o $passes -lt 0 ] do _log " *** clean scratch device [$bench starting, pass $pass]" - bench_mkfs_xfs $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL \ - || _fail " !!! mkfs SCRATCH_DEV failed" - + _scratch_mkfs_xfs 2>&1 | _fix_malloc >>$FULL _log " *** mounting scratch device" - bench_mount_xfs $SCRATCH_DEV $SCRATCH_MNT \ - || _fail " !!! failed to mount" + _scratch_mount || _fail " !!! failed to mount" _log " *** mkdir" mkdir $SCRATCH_MNT/bench \ @@ -136,7 +123,7 @@ _run_benchmark() || _fail " !!! failed to umount" _log " *** post-umount filesystem check" - _check_fs $SCRATCH_DEV + _check_scratch_fs let "pass = pass + 1" done @@ -175,17 +162,13 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _require_scratch rm -f bench.* results.* -if [ ! -z "$SCRATCH_LOGDEV" -a ! -z "$USE_SCRATCH_LOGDEV" ] -then - extra_log_options="-l $SCRATCH_LOGDEV" - extra_mkfs_options="-llogdev=$SCRATCH_LOGDEV" - extra_mount_options="-ologdev=$SCRATCH_LOGDEV" -fi +FULL_MKFS_OPTIONS=`_scratch_mkfs_options` +FULL_MOUNT_OPTIONS=`_scratch_mount_options` # $OUT is the report which will ultimately be sent, keep it tidy. cat >$OUT <$LOG _log "*** benchmark started [passes=$passes, benchmark=$bench]" _log "*** (`date`)" - _log "*** MKFS_OPTIONS=$MKFS_OPTIONS" - _log "*** MOUNT_OPTIONS=$MOUNT_OPTIONS" + _log "MKFS_OPTIONS -- $FULL_MKFS_OPTIONS" + _log "MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS" _log " *** unmounting scratch device" umount $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL diff --git a/check b/check index 3b55ebc6..fd299cdf 100755 --- a/check +++ b/check @@ -150,41 +150,33 @@ timestamp=${TIMESTAMP:=false} [ -f check.time ] || touch check.time -if [ ! -z "$MKFS_OPTIONS" ] +FULL_MKFS_OPTIONS=`_scratch_mkfs_options` +echo check: MKFS_OPTIONS -- $FULL_MKFS_OPTIONS +umount $SCRATCH_DEV 2>/dev/null +# call the overridden mkfs.xfs - make sure the FS is built +# the same as we'll create it later. +if ! _scratch_mkfs_xfs -f >$tmp.err 2>&1 then - echo "check: \$MKFS_OPTIONS specified -- \"$MKFS_OPTIONS\"" - umount $SCRATCH_DEV 2>/dev/null - # call the overridden mkfs.xfs - make sure the FS is built - # the same as we'll create it later. - if ! mkfs_xfs -f $SCRATCH_DEV >$tmp.err 2>&1 - then - echo "our local mkfs_xfs routine ..." - cat $tmp.err - echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options" - exit 1 - fi + echo "our local _scratch_mkfs_xfs routine ..." + cat $tmp.err + echo "check: failed to mkfs.xfs \$SCRATCH_DEV using specified options" + exit 1 fi -if [ ! -z "$MOUNT_OPTIONS" ] +FULL_MOUNT_OPTIONS=`_scratch_mount_options` +echo check: MOUNT_OPTIONS -- $FULL_MOUNT_OPTIONS +# call the overridden mount - make sure the FS mounts with +# the same options that we'll mount with later. +if ! _scratch_mount >$tmp.err 2>&1 then - echo "check: \$MOUNT_OPTIONS specified -- \"$MOUNT_OPTIONS\"" - umount $TEST_DEV - # call the overridden mount - make sure the FS starts as - # the same as we'll set it later. - if ! mount -t xfs $TEST_DEV $TEST_DIR >$tmp.err 2>&1 - then - echo "our local mount routine ..." - cat $tmp.err - # call the normal mount - echo "normal mount ..." - /bin/mount -t xfs $TEST_DEV $TEST_DIR - echo "check: failed to mount \$TEST_DEV using specified mount options" - exit 1 - fi + echo "our local mount routine ..." + cat $tmp.err + echo "check: failed to mount \$SCRATCH_DEV using specified options" + exit 1 fi seq="check" -_check_fs $TEST_DEV +_check_test_fs for seq in $list do @@ -283,7 +275,7 @@ do [ -f $seq.notrun ] || try=`expr $try + 1` seq="after_$seq" - _check_fs $TEST_DEV + _check_test_fs done diff --git a/common.config b/common.config index 71001a4b..b5b6255f 100644 --- a/common.config +++ b/common.config @@ -1,7 +1,7 @@ ##/bin/sh # -# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as @@ -44,7 +44,9 @@ # # and optionally: # SCRATCH_LOGDEV - scratch log device for external log testing -# SCRATCH_RTDEV - scratch rt dev (only for testing cmds currently) +# SCRATCH_RTDEV - scratch rt dev +# TEST_LOGDEV - test log device for external log testing +# TEST_RTDEV - test rt dev # TAPE_DEV - the tape device for the xfsdump tests # RMT_TAPE_DEV - the remote tape device for the xfsdump tests # RMT_IRIXTAPE_DEV - the IRIX remote tape device for the xfsdump tests @@ -85,7 +87,7 @@ in EMAIL="nathans@larry" SCRATCH_MNT=/mnt/xfs0 SCRATCH_DEV=/dev/sdb5 - SCRATCH_RTDEV=/dev/sda9 + #SCRATCH_RTDEV=/dev/sda9 SCRATCH_LOGDEV=/dev/sda11 TEST_DIR=/mnt/xfs1 TEST_DEV=/dev/sda10 diff --git a/common.dump b/common.dump index 59d0afbd..f4075d14 100644 --- a/common.dump +++ b/common.dump @@ -240,11 +240,8 @@ _wipe_fs() { _require_scratch - mkfs_xfs $SCRATCH_DEV>>$here/$seq.full ||\ - _error "mkfs failed" - - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\ - _error "mount failed" + _scratch_mkfs_xfs >>$here/$seq.full || _error "mkfs failed" + _scratch_mount >>$here/$seq.full || _error "mount failed" } # @@ -273,11 +270,11 @@ _cleanup() done if [ $status -ne $NOTRUNSTS ]; then - # Sleep added to stop _check_fs from complaining that the + # Sleep added to stop _check_scratch_fs from complaining that the # scratch_dev is still busy sleep 10 - _check_fs $SCRATCH_DEV + _check_scratch_fs fi } @@ -289,10 +286,8 @@ _cleanup() _stable_fs() { _saveddir=`pwd`; cd / - umount $SCRATCH_MNT >>$here/$seq.full ||\ - _error "unmount failed" - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >>$here/$seq.full ||\ - _error "mount failed" + umount $SCRATCH_MNT >>$here/$seq.full || _error "unmount failed" + _scratch_mount >>$here/$seq.full || _error "mount failed" cd $_saveddir } diff --git a/common.quota b/common.quota index 822672f7..5d691613 100644 --- a/common.quota +++ b/common.quota @@ -97,7 +97,7 @@ _filter_repquota() _qmount() { umount $SCRATCH_DEV >/dev/null 2>&1 - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT || _fail "qmount failed" + _scratch_mount || _fail "qmount failed" chmod ugo+rwx $SCRATCH_MNT [ -x /usr/sbin/quot ] && quot $SCRATCH_MNT >>$seq.full 2>&1 } diff --git a/common.rc b/common.rc index f6283212..3d2cd32f 100644 --- a/common.rc +++ b/common.rc @@ -1,7 +1,7 @@ ##/bin/sh # -# Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved. +# Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of version 2 of the GNU General Public License as @@ -45,23 +45,10 @@ umask 022 # awk AWK_PROG=awk -# ps -PS_HAVE_BSD=false -PS_ALL_FLAGS=-efw - -# host os -PLATFORM=linux - # extra parameters for fsstress -FSSTRESS_AVOID= - -# env variables for mem checking -#EF_PROTECT_FREE=1 # efence -#export EF_PROTECT_FREE -# Not used because we get weird errors of form: -# ElectricFence Exiting: mmap() failed: Cannot allocate memory +FSSTRESS_AVOID="-f resvsp=0 -f unresvsp=0" -export AWK_PROG PS_HAVE_BSD PS_ALL_FLAGS PLATFORM +export AWK_PROG FSSTRESS_AVOID # we override mount and mkfs.xfs so we can specify extra options @@ -84,9 +71,76 @@ mount() esac } -mkfs_xfs() +_test_mount() +{ + TEST_OPTIONS="" + [ -z "$TEST_RTDEV" ] || TEST_OPTIONS="$TEST_OPTIONS -ortdev=$TEST_RTDEV" + [ -z "$TEST_LOGDEV" ] || TEST_OPTIONS="$TEST_OPTIONS -ologdev=$TEST_LOGDEV" + mount -t xfs $TEST_OPTIONS $* $TEST_DEV $TEST_DIR +} + +_scratch_mount_options() { - /sbin/mkfs.xfs -f $* $MKFS_OPTIONS + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ortdev=$SCRATCH_RTDEV" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ologdev=$SCRATCH_LOGDEV" + echo $SCRATCH_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT +} + +_scratch_mount() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ortdev=$SCRATCH_RTDEV" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -ologdev=$SCRATCH_LOGDEV" + mount -t xfs $SCRATCH_OPTIONS $* $SCRATCH_DEV $SCRATCH_MNT +} + +_scratch_mkfs_options() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -rrtdev=$SCRATCH_RTDEV" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -llogdev=$SCRATCH_LOGDEV" + echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV +} + +_scratch_mkfs_xfs() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -rrtdev=$SCRATCH_RTDEV" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="$SCRATCH_OPTIONS -llogdev=$SCRATCH_LOGDEV" + /sbin/mkfs.xfs -f $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV +} + +_scratch_xfs_db_options() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV" + echo $SCRATCH_OPTIONS $* $SCRATCH_DEV +} + +_scratch_xfs_logprint() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV" + /usr/sbin/xfs_logprint $SCRATCH_OPTIONS $* $SCRATCH_DEV +} + +_scratch_xfs_repair() +{ + SCRATCH_OPTIONS="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_OPTIONS="-l$SCRATCH_LOGDEV" + /sbin/xfs_repair $SCRATCH_OPTIONS $* $SCRATCH_DEV } _get_pids_by_name() @@ -375,10 +429,11 @@ _require_scratch() # _require_logdev() { - if [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ] - then + [ -z "$SCRATCH_LOGDEV" -o ! -b "$SCRATCH_LOGDEV" ] && \ _notrun "This test requires a valid \$SCRATCH_LOGDEV" - fi + [ "$USE_EXTERNAL" != yes ] && \ + _notrun "This test requires USE_EXTERNAL to be enabled" + # ensure its not mounted umount $SCRATCH_LOGDEV 2>/dev/null } @@ -470,7 +525,7 @@ _remount() } -# run xfs_check on a FS. +# run xfs_check and friends on a FS. # # if the filesystem is mounted, it's either remounted ro before being # checked or it's unmounted and then remounted @@ -478,15 +533,19 @@ _remount() USE_REMOUNT=0 -_check_fs() +_check_filesystem() { - if [ $# -ne 1 ] + if [ $# -ne 1 -a $# -ne 2 ] then - echo "Usage: _check_fs device" 1>&2 + echo "Usage: _check_fs device [logdevice]" 1>&2 exit 1 fi device=$1 + if [ $# -eq 2 -a "$2" != "" ]; then + extra_log_options="-l$2" + extra_mount_options="-ologdev=$2" + fi type=`_fs_type $device` ok=1 @@ -503,7 +562,7 @@ _check_fs() fi fi - xfs_logprint -t $device $extra_log_options 2>&1 \ + /usr/sbin/xfs_logprint -t $device $extra_log_options 2>&1 \ | tee $tmp.fs_check | grep -q "" if [ $? -ne 0 ] then @@ -516,8 +575,8 @@ _check_fs() ok=0 fi - - xfs_check $device 2>&1 | _fix_malloc >$tmp.fs_check + + /usr/sbin/xfs_check $device 2>&1 | _fix_malloc >$tmp.fs_check if [ -s $tmp.fs_check ] then echo "_check_fs: filesystem on $device is inconsistent (c) (see $seq.full)" @@ -530,7 +589,7 @@ _check_fs() ok=0 fi - if ! xfs_repair -n $device $extra_log_options >$tmp.fs_check 2>&1 + if ! /sbin/xfs_repair -n $device $extra_log_options >$tmp.fs_check 2>&1 then echo "_check_fs: filesystem on $device is inconsistent (r) (see $seq.full)" @@ -555,7 +614,7 @@ _check_fs() # mounted... if [ $USE_REMOUNT -eq 0 ] then - if ! mount -t xfs $device $mountpoint + if ! mount -t xfs $extra_mount_options $device $mountpoint then echo "!!! failed to remount $device on $mountpoint" ok=0 @@ -569,6 +628,19 @@ _check_fs() return 0 } +_check_test_fs() +{ + _check_filesystem $TEST_DEV $TEST_LOGDEV +} + +_check_scratch_fs() +{ + SCRATCH_LOG="" + [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ + SCRATCH_LOG="$SCRATCH_LOGDEV" + _check_filesystem $SCRATCH_DEV $SCRATCH_LOG +} + ################################################################################ [ -d /usr/bsd ] && PATH=$PATH:/usr/bsd @@ -589,7 +661,7 @@ then if [ -z "`_fs_type $TEST_DEV`" ] then # $TEST_DEV is not mounted - if ! mount -t xfs $TEST_DEV $TEST_DIR + if ! _test_mount then echo "common.rc: could not mount $TEST_DEV on $TEST_DIR" exit 1 diff --git a/common.repair b/common.repair index 1e9a22a7..0f24a1fa 100644 --- a/common.repair +++ b/common.repair @@ -76,6 +76,9 @@ s/(imap claims in-use inode) (\d+)/\1 INO/; s/(cleared root inode) (\d+)/\1 INO/; s/(resetting inode) (\d+)/\1 INO/; s/(disconnected dir inode) (\d+)/\1 INO/; +# for log +s/internal log/ log/g; +s/external log on \S+/ log/g; print;' } @@ -91,10 +94,10 @@ _check_repair() value=$1 structure="$2" _zero_position $value "$structure" - xfs_repair $SCRATCH_DEV 2>&1 | _filter_repair + _scratch_xfs_repair 2>&1 | _filter_repair # some basic sanity checks... - _check_fs $SCRATCH_DEV - mount -t xfs $SCRATCH_DEV $SCRATCH_MNT #mount + _check_scratch_fs + _scratch_mount #mount dd if=/bin/sh of=$SCRATCH_MNT/sh 2>&1 |_filter_dd #open,write dd if=$SCRATCH_MNT/sh of=/dev/null 2>&1 |_filter_dd #read rm -f $SCRATCH_MNT/sh #unlink diff --git a/group b/group index 1c13b8b0..d9140e39 100644 --- a/group +++ b/group @@ -53,6 +53,9 @@ auto dxm@sgi.com # ioctl - tests which use ioctl commands (directly/indirectly) ioctl nathans@sgi.com +# testing large sector support, excluded tests +sectors nathans@sgi.com + # test-group association ... one line per test # 001 rw dir auto @@ -67,7 +70,7 @@ ioctl nathans@sgi.com 010 other auto 011 dir auto 012 rw auto -013 other ioctl auto +013 other ioctl auto sectors 014 rw auto 015 other auto 016 rw auto diff --git a/soak b/soak index 7831320f..79bf9795 100755 --- a/soak +++ b/soak @@ -115,11 +115,11 @@ do _log " *** pass $pass (`date`)" _log " *** check" - _check_fs $SCRATCH_DEV + _check_scratch_fs _log " *** mounting scratch device" - if ! mount -t xfs $SCRATCH_DEV $SCRATCH_MNT 2>&1 | _logp + if ! _scratch_mount 2>&1 | _logp then _fail " !!! failed to mount" fi @@ -131,7 +131,7 @@ do || _fail " !!! couldn't delete old dir" _log " *** check" - _check_fs $SCRATCH_DEV + _check_scratch_fs fi _log " *** mkdir"