e2fsprogs/tests/run_e2fsck
Theodore Ts'o da1a022670 ChangeLog, hold_inode.c, random_exercise.c:
random_exercise.c: New file which feeds a lot of file creations and
  	deletions (while leaving the file descriptor open, and then closing
  	the file descriptor later).  This generates lots of fodder for the
  	orphan list code, as well as for the ext3 journal.
  hold_inode.c: New file which holds an inode or a directory open (for
  	testing orphan list code).
ChangeLog, run_e2fsck, expect.1, expect.2, image.gz, name, expect:
  run_e2fsck: Filter out JFS DEBUG messages when comparing e2fsck output.
  f_journal: New test case which checks out running the ext3 journal.
  f_orphan: New test case which checks clearing the list of orphan
  	inodes (files and directories).
  f_swapfs/expect: Update to reflect new debugfs format for dumping the
  	blocks of an inode.
2000-08-20 21:48:45 +00:00

76 lines
1.4 KiB
Plaintext

if [ "$IMAGE"x = x ]; then
IMAGE=$test_dir/image.gz
fi
if [ "$FSCK_OPT"x = x ]; then
FSCK_OPT=-yf
fi
if [ "$SECOND_FSCK_OPT"x = x ]; then
SECOND_FSCK_OPT=-yf
fi
if [ "$OUT1"x = x ]; then
OUT1=$test_name.1.log
fi
if [ "$OUT2"x = x ]; then
OUT2=$test_name.2.log
fi
if [ "$EXP1"x = x ]; then
EXP1=$test_dir/expect.1
fi
if [ "$EXP2"x = x ]; then
EXP2=$test_dir/expect.2
fi
gunzip < $IMAGE > $TMPFILE
eval $PREP_CMD
$FSCK $FSCK_OPT -N test_filesys $TMPFILE > $OUT1.new 2>&1
status=$?
echo Exit status is $status >> $OUT1.new
sed -e '1d' -e '/^JFS DEBUG:/d' $OUT1.new > $OUT1
rm -f $OUT1.new
if [ "$ONE_PASS_ONLY" != "true" ]; then
$FSCK $SECOND_FSCK_OPT -N test_filesys $TMPFILE > $OUT2.new 2>&1
status=$?
echo Exit status is $status >> $OUT2.new
sed -e '1d' $OUT2.new -e '/^JFS DEBUG:/d' > $OUT2
rm -f $OUT2.new
fi
rm $TMPFILE
if [ "$SKIP_VERIFY" != "true" ] ; then
rm -f $test_name.ok $test_name.failed
cmp -s $OUT1 $EXP1
status1=$?
if [ "$ONE_PASS_ONLY" != "true" ]; then
cmp -s $OUT2 $EXP2
status2=$?
else
status2=0
fi
if [ "$status1" = 0 -a "$status2" = 0 ] ; then
echo "ok"
touch $test_name.ok
else
echo "failed"
diff -c $EXP1 $OUT1 > $test_name.failed
if [ "$ONE_PASS_ONLY" != "true" ]; then
diff -c $EXP2 $OUT2 >> $test_name.failed
fi
fi
fi
if [ "$SKIP_CLEANUP" != "true" ] ; then
unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2 ONE_PASS_ONLY PREP_CMD
fi