• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1test_description="e2image corrupt fs"
2
3IMAGE=$test_dir/image.gz
4OUT=$test_name.log
5EXP=$test_dir/expect
6
7gzip -d < $IMAGE > $TMPFILE
8$E2IMAGE -r $TMPFILE $TMPFILE.bin > $OUT 2>&1
9$FSCK -fn $TMPFILE.bin >> $OUT 2>&1
10
11sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test_filesys;" $OUT > $OUT.new
12mv $OUT.new $OUT
13
14cmp -s $OUT $EXP
15status=$?
16if [ "$status" = 0 ] ; then
17        echo "$test_name: $test_description: ok"
18        touch $test_name.ok
19else
20        echo "$test_name: $test_description: failed"
21        diff $DIFF_OPTS $EXP $OUT > $test_name.failed
22        rm -f $test_name.tmp
23fi
24
25rm -f $OUT $TMPFILE $TMPFILE.bin $TMPFILE.test
26unset IMAGE FSCK_OPT OUT EXP
27