From: Theodore Ts'o Date: Tue, 20 Mar 2018 15:01:49 +0000 (-0400) Subject: tests: add new test i_bitmaps X-Git-Tag: v1.44.1~9 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fe2fsprogs.git;a=commitdiff_plain;h=2b118575f59880ada77a81ea1bb3c34fe77cff52 tests: add new test i_bitmaps This is a test to make sure e2image and its associated library routines can correctly read the inode and block allocation bitmaps. Signed-off-by: Theodore Ts'o --- diff --git a/tests/i_bitmaps/expect b/tests/i_bitmaps/expect new file mode 100644 index 000000000..fb9d8f1f6 --- /dev/null +++ b/tests/i_bitmaps/expect @@ -0,0 +1,6 @@ +46,50d45 +< Journal features: (none) +< Journal size: 1024k +< Journal length: 1024 +< Journal sequence: 0x00000001 +< Journal start: 0 diff --git a/tests/i_bitmaps/image.bz2 b/tests/i_bitmaps/image.bz2 new file mode 100644 index 000000000..cc33565a2 Binary files /dev/null and b/tests/i_bitmaps/image.bz2 differ diff --git a/tests/i_bitmaps/script b/tests/i_bitmaps/script new file mode 100644 index 000000000..b8e3bd236 --- /dev/null +++ b/tests/i_bitmaps/script @@ -0,0 +1,28 @@ +test_description="e2image bitmap read/write test" + +IMAGE=$test_dir/image.bz2 +OUT=$test_name.log +EXP=$test_dir/expect + +bzip2 -d < $IMAGE > $TMPFILE +$E2IMAGE $TMPFILE $TMPFILE.e2i > $OUT 2>&1 +$DUMPE2FS $TMPFILE > $TMPFILE.1 2>&1 +$DUMPE2FS -i $TMPFILE.e2i > $TMPFILE.2 2>&1 +diff $TMPFILE.1 $TMPFILE.2 >> $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 -rf $TMPFILE $TMPFILE.bin $TMPFILE.1 +unset IMAGE FSCK_OPT OUT EXP