diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:49:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:49:25 +0000 |
commit | 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a (patch) | |
tree | 6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /tests/f_super_bad_csum | |
parent | Initial commit. (diff) | |
download | e2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.tar.xz e2fsprogs-464df1d5e5ab1322e2dd0a7796939fff1aeefa9a.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/f_super_bad_csum')
-rw-r--r-- | tests/f_super_bad_csum/expect.1 | 13 | ||||
-rw-r--r-- | tests/f_super_bad_csum/expect.2 | 7 | ||||
-rw-r--r-- | tests/f_super_bad_csum/image.bz2 | bin | 0 -> 1181 bytes | |||
-rw-r--r-- | tests/f_super_bad_csum/name | 1 | ||||
-rwxr-xr-x | tests/f_super_bad_csum/script | 33 |
5 files changed, 54 insertions, 0 deletions
diff --git a/tests/f_super_bad_csum/expect.1 b/tests/f_super_bad_csum/expect.1 new file mode 100644 index 0000000..12adee9 --- /dev/null +++ b/tests/f_super_bad_csum/expect.1 @@ -0,0 +1,13 @@ +ext2fs_open2: Superblock checksum does not match superblock +../e2fsck/e2fsck: Superblock invalid, trying backup blocks... +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Padding at end of inode bitmap is not set. Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/1024 files (0.0% non-contiguous), 1557/16384 blocks +Exit status is 0 diff --git a/tests/f_super_bad_csum/expect.2 b/tests/f_super_bad_csum/expect.2 new file mode 100644 index 0000000..dd20919 --- /dev/null +++ b/tests/f_super_bad_csum/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/1024 files (0.0% non-contiguous), 1557/16384 blocks +Exit status is 0 diff --git a/tests/f_super_bad_csum/image.bz2 b/tests/f_super_bad_csum/image.bz2 Binary files differnew file mode 100644 index 0000000..cd80d4b --- /dev/null +++ b/tests/f_super_bad_csum/image.bz2 diff --git a/tests/f_super_bad_csum/name b/tests/f_super_bad_csum/name new file mode 100644 index 0000000..745562f --- /dev/null +++ b/tests/f_super_bad_csum/name @@ -0,0 +1 @@ +bad csum in superblock (metadata_csum) diff --git a/tests/f_super_bad_csum/script b/tests/f_super_bad_csum/script new file mode 100755 index 0000000..5c89962 --- /dev/null +++ b/tests/f_super_bad_csum/script @@ -0,0 +1,33 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE +#e2label $TMPFILE test_filesys + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log +rm -f $test_name.failed $test_name.ok + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi +unset EXP1 OUT1 EXP2 OUT2 FSCK_OPT IMAGE |