• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1if test -x $DEBUGFS_EXE; then
2
3IMAGE=$test_dir/image.gz
4FSCK_OPT=-fy
5OUT=$test_name.log
6if [ -f $test_dir/expect.gz ]; then
7	EXP=$test_name.tmp
8	gunzip < $test_dir/expect.gz > $EXP1
9else
10	EXP=$test_dir/expect
11fi
12
13cp /dev/null $OUT
14
15gzip -d < $IMAGE > $TMPFILE
16
17$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
18status=$?
19echo Exit status is $status >> $OUT.new
20sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
21rm -f $OUT.new
22
23$FSCK -fy -N test_filesys $TMPFILE > $OUT.new 2>&1
24status=$?
25echo Exit status is $status >> $OUT.new
26sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" $OUT.new >> $OUT
27rm -f $OUT.new
28
29echo "cat /a" > $TMPFILE.cmd
30echo >> $TMPFILE.cmd
31$DEBUGFS_EXE -f $TMPFILE.cmd $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed >> $OUT
32rm -f $TMPFILE.cmd
33
34rm -f $TMPFILE
35
36cmp -s $OUT $EXP
37status=$?
38
39if [ "$status" = 0 ] ; then
40	echo "$test_name: $test_description: ok"
41	touch $test_name.ok
42else
43	echo "$test_name: $test_description: failed"
44	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
45	rm -f $test_name.tmp
46fi
47
48unset IMAGE FSCK_OPT OUT EXP
49
50else #if test -x $DEBUGFS_EXE; then
51	echo "$test_name: $test_description: skipped"
52fi
53