From 1d1d92fa4663666eb1363cad8a8b32e8e4dc3f3e Mon Sep 17 00:00:00 2001 From: fsgqa Date: Wed, 14 May 2003 05:25:31 +0000 Subject: [PATCH] Several QA test updates to fix failures on v2 logs and redhat 9. Fix some log offset calculations when version 2 logs are in use. --- 016 | 24 +++++++++++------------- 021 | 26 +++++++++++++++++++------- 029 | 1 + 029.out | 2 +- 032 | 12 +++++++----- common.bonnie | 2 +- 6 files changed, 40 insertions(+), 27 deletions(-) diff --git a/016 b/016 index 1a503aa5..4645cd04 100755 --- a/016 +++ b/016 @@ -78,15 +78,10 @@ _init() echo "*** reset partition" $here/src/devzero -b 2048 -n 50 -v 198 $SCRATCH_DEV echo "*** mkfs" - lsize=2097152 - dsize=50m - echo mkfs_xfs -dsize=$dsize -lsize=$lsize $SCRATCH_DEV >>$seq.full - if ! mkfs_xfs -dsize=$dsize -lsize=$lsize $SCRATCH_DEV >>$seq.full 2>&1 - then - echo "failed to mkfs $SCRATCH_DEV" >>$seq.full - _notrun "mkfs cannot create scratch fs, probably too small log" - exit 1 - fi + force_opts="-dsize=50m -lsize=2097152" + echo mkfs_xfs $force_opts $SCRATCH_DEV >>$seq.full + mkfs_xfs $force_opts $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs + source $tmp.mkfs } _log_traffic() @@ -140,12 +135,15 @@ _log_head() } # Get log stripe unit for v2 logs; if none specified, -# (or v1 log) just return "1" +# (or v1 log) just return "1" block _log_sunit() { - echo $MKFS_OPTIONS | (grep sunit || echo "sunit=1") \ - | sed "s/.*sunit=\(.*\).*/\1/" + if [ $lsunit -eq 0 ]; then + echo $dbsize + else + expr $lsunit \* $dbsize + fi } _after_log() @@ -194,7 +192,7 @@ echo "log sunit = $lsunit" >>$seq.full [ $size -eq 4096 ] || \ _fail "!!! unexpected log size $size" [ $head -eq 2 -o $head -eq $((lsunit/512)) ] || \ - _fail "!!! unexpected initial log position $head" + _fail "!!! unexpected initial log position $head vs. $((lsunit/512))" echo " lots of traffic" >>$seq.full _log_traffic 850 diff --git a/021 b/021 index bb4c1c7b..42a97fb7 100755 --- a/021 +++ b/021 @@ -61,9 +61,13 @@ _attr() { attr $* 2>$tmp.err >$tmp.out exit=$? - sed -e "s#$SCRATCH_MNT[^ .:]*##g; s#$tmp[^ :]*##g;"\ + sed \ + -e "s#$SCRATCH_MNT[^ .:]*##g" \ + -e "s#$tmp[^ :]*##g;" \ $tmp.out - sed -e "s#$SCRATCH_MNT[^ .:]*##g; s#$tmp[^ :]*##g;"\ + sed \ + -e "s#$SCRATCH_MNT[^ .:]*##g" \ + -e "s#$tmp[^ :]*##g;" \ $tmp.err 1>&2 return $exit } @@ -72,9 +76,13 @@ _getfattr() { getfattr $* 2>$tmp.err >$tmp.out exit=$? - sed -e "s#$SCRATCH_MNT[^ .:]*##g; s#$tmp[^ :]*##g;"\ + sed \ + -e "s#$SCRATCH_MNT[^ .:]*##g" \ + -e "s#$tmp[^ :]*##g;" \ $tmp.out - sed -e "s#$SCRATCH_MNT[^ .:]*##g; s#$tmp[^ :]*##g;"\ + sed \ + -e "s#$SCRATCH_MNT[^ .:]*##g" \ + -e "s#$tmp[^ :]*##g;" \ $tmp.err 1>&2 return $exit } @@ -88,11 +96,11 @@ umount $SCRATCH_DEV >/dev/null 2>&1 echo "*** mkfs" mkfs_xfs $SCRATCH_DEV >/dev/null \ || _fail "mkfs failed" - + echo "*** mount FS" mount -t xfs $SCRATCH_DEV $SCRATCH_MNT >/dev/null \ || _fail "mount failed" - + testfile=$SCRATCH_MNT/testfile echo "*** make test file 1" @@ -112,7 +120,11 @@ echo "value_2" | _attr -s "a2-----" $testfile.2 >/dev/null _getfattr --absolute-names $testfile.2 # print name and size from 1st line of output -_attr -g "a3" $testfile.2 | head -1 +_attr -g "a3" $testfile.2 > $tmp.hahahahaplonk +head -1 $tmp.hahahahaplonk +# NOTE: +# Above goo works around some truly bizzaro sh/sed/head interaction +# for some versions of these tools (fails on Redhat 7+, 6.2 worked) # print out the rest of the data apart from the header # the size is +1 for an extra \n at the end diff --git a/029 b/029 index e81b7774..17b903c5 100755 --- a/029 +++ b/029 @@ -68,6 +68,7 @@ _filter_logprint() s/log file: "([\w|\/.-]+)" daddr: (\d+) length: (\d+)/log device: LDEV daddr: XXX length: XXX/; s/skipped (\w+) zeroed blocks/skipped XXX zeroed blocks/; s/^uuid: *[0-9a-f-][0-9a-f-]* *format: *.*$/uuid: format: /; + s/(length of Log Record:) \d+/$1 /; s/version: \d/version: /; print; ' diff --git a/029.out b/029.out index 63fdd43b..7c595f31 100644 --- a/029.out +++ b/029.out @@ -12,7 +12,7 @@ xfs_logprint: log device: LDEV daddr: XXX length: XXX cycle: 1 version: lsn: 1,0 tail_lsn: 1,0 -length of Log Record: 20 prev offset: -1 num ops: 1 +length of Log Record: prev offset: -1 num ops: 1 uuid: format: ---------------------------------------------------------------------------- Oper (0): tid: b0c0d0d0 len: 8 clientid: LOG flags: UNMOUNT diff --git a/032 b/032 index f885f5ad..84349605 100755 --- a/032 +++ b/032 @@ -64,11 +64,13 @@ do postargs="" # for any special post-device options # minix and msdos mkfs fails for large devices, restrict to 2000 blocks - [ $fs = "minix" ] && postargs=2000 - [ $fs = "msdos" ] && postargs=2000 - # these folk prompt before writing - [ $fs = "jfs" ] && preop="echo Y |" - [ $fs = "reiserfs" ] && preop="echo y |" + [ $fs = minix ] && postargs=2000 + [ $fs = msdos ] && postargs=2000 + # these folks prompt before writing + [ $fs = jfs ] && preop="echo Y |" + [ $fs = reiserfs ] && preop="echo y |" + # cramfs mkfs requires a directory argument + [ $fs = cramfs ] && preargs=/proc/fs/xfs # overwite the first few Kb - should blow away superblocks src/devzero -n 20 $SCRATCH_DEV >/dev/null diff --git a/common.bonnie b/common.bonnie index 73c91e6f..f3b7ccfb 100644 --- a/common.bonnie +++ b/common.bonnie @@ -7,7 +7,7 @@ run_bonnie() mkdir ./bonnie || exit 1 defaults="-d ./bonnie -q -f -r 0" - defaults="$default -u "`id -u`" -g "`id -g` + defaults="$defaults -u "`id -u`" -g "`id -g` bonnie++ -m '' $defaults $@ >$tmp/bonnie.stdout 2>$tmp/bonnie.stderr status=$? rm -fr ./bonnie -- 2.30.2