diff options
Diffstat (limited to 'tests/f_swapfs/script')
-rw-r--r-- | tests/f_swapfs/script | 153 |
1 files changed, 76 insertions, 77 deletions
diff --git a/tests/f_swapfs/script b/tests/f_swapfs/script index 9d3033da..c41bec7e 100644 --- a/tests/f_swapfs/script +++ b/tests/f_swapfs/script @@ -1,80 +1,79 @@ -if ! $FSCK -SV > /dev/null 2>&1 ; then - rm -f $test_name.ok $test_name.failed - echo "skipped" -else - -IMAGE=$test_dir/image.gz -VERIFY_FSCK_OPT=-yf -SWAP_FSCK_OPT=-Sy -NATIVE_FSCK_OPT=-sy -OUT=$test_name.log -EXP=$test_dir/expect - -gunzip < $IMAGE > $TMPFILE - -echo "Swapfs test" > $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo Running debugfs.... >> $OUT -$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '1d' $OUT.new >> $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT - -echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT +if $FSCK -SV > /dev/null 2>&1 ; then + IMAGE=$test_dir/image.gz + VERIFY_FSCK_OPT=-yf + SWAP_FSCK_OPT=-Sy + NATIVE_FSCK_OPT=-sy + OUT=$test_name.log + EXP=$test_dir/expect + + gunzip < $IMAGE > $TMPFILE + + echo "Swapfs test" > $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo e2fsck $SWAP_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $SWAP_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo Running debugfs.... >> $OUT + $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '1d' $OUT.new >> $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo e2fsck $NATIVE_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $NATIVE_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + + echo Running debugfs.... >> $OUT + $DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '1d' $OUT.new >> $OUT + + echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new + $FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 + status=$? + echo Exit status is $status >> $OUT.new + sed -e '2d' $OUT.new >> $OUT + rm -f $OUT.new + + rm $TMPFILE + + # + # Do the verification + # + + rm -f $test_name.ok $test_name.failed + cmp -s $OUT $EXP + status=$? + + if [ "$status" = 0 ] ; then + echo "ok" + touch $test_name.ok + else + echo "failed" + diff -c $EXP $OUT > $test_name.failed + fi + + unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP -echo Running debugfs.... >> $OUT -$DEBUGFS -f $test_dir/debugfs.cmd $TMPFILE > $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '1d' $OUT.new >> $OUT - -echo e2fsck $VERIFY_FSCK_OPT -N test_filesys > $OUT.new -$FSCK $VERIFY_FSCK_OPT -N test_filesys $TMPFILE >> $OUT.new 2>&1 -status=$? -echo Exit status is $status >> $OUT.new -sed -e '2d' $OUT.new >> $OUT -rm -f $OUT.new - -rm $TMPFILE - -# -# Do the verification -# - -rm -f $test_name.ok $test_name.failed -cmp -s $OUT $EXP -status=$? - -if [ "$status" = 0 ] ; then - echo "ok" - touch $test_name.ok else - echo "failed" - diff -c $EXP $OUT > $test_name.failed -fi - -unset IMAGE VERIFY_FSCK_OPT SWAP_FSCK_OPT NATIVE_FSCK_OPT OUT EXP - + rm -f $test_name.ok $test_name.failed + echo "skipped" fi |