summaryrefslogtreecommitdiffstats
path: root/tests/i_bad_csum
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 15:49:25 +0000
commit464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/i_bad_csum
parentInitial commit. (diff)
downloade2fsprogs-upstream.tar.xz
e2fsprogs-upstream.zip
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/i_bad_csum')
-rw-r--r--tests/i_bad_csum/expect11
-rw-r--r--tests/i_bad_csum/image.gzbin0 -> 2606 bytes
-rw-r--r--tests/i_bad_csum/name1
-rw-r--r--tests/i_bad_csum/script26
4 files changed, 38 insertions, 0 deletions
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
--- /dev/null
+++ b/tests/i_bad_csum/image.gz
Binary files 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