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/m_mmp_bad_magic | |
parent | Initial commit. (diff) | |
download | e2fsprogs-upstream/1.47.0.tar.xz e2fsprogs-upstream/1.47.0.zip |
Adding upstream version 1.47.0.upstream/1.47.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | tests/m_mmp_bad_magic/.log | 9 | ||||
-rw-r--r-- | tests/m_mmp_bad_magic/expect | 22 | ||||
-rw-r--r-- | tests/m_mmp_bad_magic/image.gz | bin | 0 -> 2597 bytes | |||
-rw-r--r-- | tests/m_mmp_bad_magic/name | 1 | ||||
-rw-r--r-- | tests/m_mmp_bad_magic/script | 27 |
5 files changed, 59 insertions, 0 deletions
diff --git a/tests/m_mmp_bad_magic/.log b/tests/m_mmp_bad_magic/.log new file mode 100644 index 0000000..b5dfb89 --- /dev/null +++ b/tests/m_mmp_bad_magic/.log @@ -0,0 +1,9 @@ +Superblock has invalid MMP magic. Fix? yes + +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/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 diff --git a/tests/m_mmp_bad_magic/expect b/tests/m_mmp_bad_magic/expect new file mode 100644 index 0000000..d5fa98c --- /dev/null +++ b/tests/m_mmp_bad_magic/expect @@ -0,0 +1,22 @@ +dumpe2fs: MMP: invalid magic number while trying to open test.img +Exit status is 2 +Superblock has invalid MMP magic. Fix? yes + +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/128 files (0.0% non-contiguous), 19/512 blocks +Exit status is 0 +dumpe2fs: it is safe to mount 'test.img', MMP is clean +Exit status is 0 +MMP_block: + mmp_magic: 0x4d4d50 + mmp_check_interval: 5 + mmp_sequence: 0xff4d4d50 + mmp_update_date: test date + mmp_update_time: test_time + mmp_node_name: test_node + mmp_device_name: test.img + mmp_block_number: 8 diff --git a/tests/m_mmp_bad_magic/image.gz b/tests/m_mmp_bad_magic/image.gz Binary files differnew file mode 100644 index 0000000..2d57fbf --- /dev/null +++ b/tests/m_mmp_bad_magic/image.gz diff --git a/tests/m_mmp_bad_magic/name b/tests/m_mmp_bad_magic/name new file mode 100644 index 0000000..15a2d4d --- /dev/null +++ b/tests/m_mmp_bad_magic/name @@ -0,0 +1 @@ +mmp with bad magic (metadata_csum) diff --git a/tests/m_mmp_bad_magic/script b/tests/m_mmp_bad_magic/script new file mode 100644 index 0000000..a5e222e --- /dev/null +++ b/tests/m_mmp_bad_magic/script @@ -0,0 +1,27 @@ +gzip -dc < $test_dir/image.gz > $TMPFILE + +OUT=$test_name.log +EXP=$test_dir/expect +$E2MMPSTATUS $TMPFILE > $OUT 2>&1 +echo Exit status is $? >> $OUT +$FSCK -fy $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS $TMPFILE >> $OUT 2>&1 +echo Exit status is $? >> $OUT +$E2MMPSTATUS -i $TMPFILE >> $OUT 2>&1 +sed -f $cmd_dir/filter.sed $OUT > $OUT.new +mv $OUT.new $OUT + +rm -f $TMPFILE +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 +unset OUT EXP |