summaryrefslogtreecommitdiffstats
path: root/tests/i_bad_csum/script
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/i_bad_csum/script26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/i_bad_csum/script b/tests/i_bad_csum/script
new file mode 100644
index 0000000..8b5bef9
--- /dev/null
+++ b/tests/i_bad_csum/script
@@ -0,0 +1,26 @@
+test_description="e2image corrupt fs"
+
+IMAGE=$test_dir/image.gz
+OUT=$test_name.log
+EXP=$test_dir/expect
+
+gzip -d < $IMAGE > $TMPFILE
+$E2IMAGE -r $TMPFILE $TMPFILE.bin > $OUT 2>&1
+$FSCK -fn $TMPFILE.bin >> $OUT 2>&1
+
+sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test_filesys;" $OUT > $OUT.new
+mv $OUT.new $OUT
+
+cmp -s $OUT $EXP
+status=$?
+if [ "$status" = 0 ] ; then
+ echo "$test_name: $test_description: ok"
+ touch $test_name.ok
+else
+ echo "$test_name: $test_description: failed"
+ diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+ rm -f $test_name.tmp
+fi
+
+rm -f $OUT $TMPFILE $TMPFILE.bin $TMPFILE.test
+unset IMAGE FSCK_OPT OUT EXP