2003-03-06 19:09:18 +03:00
|
|
|
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
|
1997-04-29 18:53:37 +04:00
|
|
|
|
|
|
|
else
|
2003-03-06 19:09:18 +03:00
|
|
|
rm -f $test_name.ok $test_name.failed
|
|
|
|
echo "skipped"
|
2002-11-08 22:55:38 +03:00
|
|
|
fi
|