From 0b60dbaf5b06877c09889b11b672a71e7cf565f2 Mon Sep 17 00:00:00 2001 From: Andrew Gildfind Date: Mon, 2 Apr 2001 05:21:15 +0000 Subject: [PATCH] use _do from common.rc --- 041 | 26 +++++--------------------- 042 | 15 +++------------ common.rc | 2 +- 3 files changed, 9 insertions(+), 34 deletions(-) diff --git a/041 b/041 index 176922aa..85e8d00f 100755 --- a/041 +++ b/041 @@ -51,7 +51,7 @@ status=1 # failure is the default! _cleanup() { umount $SCRATCH_MNT - rm -f $tmp.* +# rm -f $tmp.* } trap "_cleanup ; exit \$status" 0 1 2 3 15 @@ -63,21 +63,14 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15 _require_scratch -_do() -{ - if [ $# -ne 1 ]; then echo "Usage: _do \"cmd\"" 1>&2 ; exit 1; fi - echo "*** $1" >>$seq.full - eval "$1 2>&1 | _fix_malloc >>$seq.full" -} - _fill() { if [ $# -ne 1 ]; then echo "Usage: _fill \"path\"" 1>&2 ; exit 1; fi - echo -n "Fill filesystem... " - _do "(src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest)" - echo "done" + _do "Fill filesystem" \ + "src/fill2fs --verbose --dir=$1 --seed=0 --filesize=65536 --stddev=32768 --list=- >>$tmp.manifest" } +_do_die_on_error=y rm -f $seq.full #agsize=16 agsize=32 @@ -101,16 +94,7 @@ do _do "umount $SCRATCH_MNT" _do "mount -t xfs $SCRATCH_DEV $SCRATCH_MNT" echo "done" - echo -n "Check files... " - if ! _do "src/fill2fs_check $tmp.manifest"; then - echo "fail" - echo "Files corrupt/missing after growfs. Test failed see $seq.full" - status=1; exit - fi - echo "done" -# echo -n "Checking filesystem... " -# _check_fs $SCRATCH_DEV -# echo "done" + _do "Check files" "src/fill2fs_check $tmp.manifest" done # success, all done diff --git a/042 b/042 index 572a0a88..11b58de9 100755 --- a/042 +++ b/042 @@ -87,14 +87,6 @@ _cull_files() close MANIFEST;' } -_do() -{ - if [ $# -ne 1 ]; then echo "Usage: _do \"cmd\"" 1>&2 ; exit 1; fi - echo "*** $1" >>$seq.full - eval "$1 2>&1 | _fix_malloc >>$seq.full" -} - - # create a large contiguous file using dd # use fill2fs to fill the filesystem up with 4k sized files # fill any remaining space using dd @@ -103,7 +95,6 @@ _do() # delete the dd-generated file # run xfs_fsr on the filesystem # check checksums for remaining files - # create 3 minimum sized (16Mb) allocation groups # xfs_repair is going to need three to verify the superblock rm -f $seq.full @@ -120,7 +111,7 @@ do done echo "done" echo -n "Fill filesystem with 4k files, generate manifest... " -_do "(src/fill2fs --verbose --dir=$SCRATCH_MNT/fill --seed=0 --filesize=4096 --stddev=0 --list=$tmp.manifest)" +_do "src/fill2fs --verbose --dir=$SCRATCH_MNT/fill --seed=0 --filesize=4096 --stddev=0 --list=$tmp.manifest" echo "done" echo -n "Use up any further available space using dd... " _do "dd if=/dev/zero of=$SCRATCH_MNT/pad bs=4096" @@ -136,7 +127,7 @@ echo -n "Create one very large file... " _do "src/fill2 -d nbytes=16000000,file=$SCRATCH_MNT/fragmented" echo "done" _do "xfs_bmap $SCRATCH_MNT/fragmented" -_do "(sum $SCRATCH_MNT/fragmented >$tmp.sum1)" +_do "sum $SCRATCH_MNT/fragmented >$tmp.sum1" echo -n "Remove other files... " _do "rm -rf $SCRATCH_MNT/{pad,hole*}" echo "done" @@ -158,7 +149,7 @@ if ! _do "src/fill2fs_check $tmp.manifest"; then fi echo "done" echo -n "Check large file... " -_do "(sum $SCRATCH_MNT/fragmented >$tmp.sum2)" +_do "sum $SCRATCH_MNT/fragmented >$tmp.sum2" if ! diff $tmp.sum1 $tmp.sum2; then echo "fail" echo "File is corrupt/missing after fsr. Test failed see $seq.full" diff --git a/common.rc b/common.rc index 1cb02a5e..3e53e53e 100644 --- a/common.rc +++ b/common.rc @@ -278,7 +278,7 @@ _do() status=1; exit fi - (eval "echo '---' $_cmd") >>$seq.full + (eval "echo '---' \"$_cmd\"") >>$seq.full (eval "$_cmd") >$tmp._out 2>&1; ret=$? cat $tmp._out | _fix_malloc >>$seq.full if [ $# -eq 2 ]; then -- 2.30.2