From 5dced3d1b3deca80e01415a2e35dc7972dcbfae7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 11:25:10 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- tests/i_bad_csum/expect | 11 +++++++++++ tests/i_bad_csum/image.gz | Bin 0 -> 2606 bytes tests/i_bad_csum/name | 1 + tests/i_bad_csum/script | 26 ++++++++++++++++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 tests/i_bad_csum/expect create mode 100644 tests/i_bad_csum/image.gz create mode 100644 tests/i_bad_csum/name create mode 100644 tests/i_bad_csum/script (limited to 'tests/i_bad_csum') diff --git a/tests/i_bad_csum/expect b/tests/i_bad_csum/expect new file mode 100644 index 0000000..eeb967f --- /dev/null +++ b/tests/i_bad_csum/expect @@ -0,0 +1,11 @@ +Pass 1: Checking inodes, blocks, and sizes +Inode 12 passes checks, but checksum does not match inode. Fix? no + +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information + +test_filesys.bin: ********** WARNING: Filesystem still has errors ********** + +test_filesys.bin: 12/128 files (0.0% non-contiguous), 19/512 blocks diff --git a/tests/i_bad_csum/image.gz b/tests/i_bad_csum/image.gz new file mode 100644 index 0000000..e17e921 Binary files /dev/null and b/tests/i_bad_csum/image.gz differ diff --git a/tests/i_bad_csum/name b/tests/i_bad_csum/name new file mode 100644 index 0000000..f7197f0 --- /dev/null +++ b/tests/i_bad_csum/name @@ -0,0 +1 @@ +run e2image on a file system with bad checksums 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 -- cgit v1.2.3