From 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:49:25 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- tests/t_disable_meta_csum_and_seed/expect | 14 ++++++++++ tests/t_disable_meta_csum_and_seed/script | 44 +++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/t_disable_meta_csum_and_seed/expect create mode 100755 tests/t_disable_meta_csum_and_seed/script (limited to 'tests/t_disable_meta_csum_and_seed') diff --git a/tests/t_disable_meta_csum_and_seed/expect b/tests/t_disable_meta_csum_and_seed/expect new file mode 100644 index 0000000..a1c9cca --- /dev/null +++ b/tests/t_disable_meta_csum_and_seed/expect @@ -0,0 +1,14 @@ +create fs without csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +turn on csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +turn off metadata_csum +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +check filesystem +fsck returns 0 +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c diff --git a/tests/t_disable_meta_csum_and_seed/script b/tests/t_disable_meta_csum_and_seed/script new file mode 100755 index 0000000..52d7f62 --- /dev/null +++ b/tests/t_disable_meta_csum_and_seed/script @@ -0,0 +1,44 @@ +test_description="disable csum seed and csums via tune2fs" + +trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT +dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 +OUT=$test_name.log +EXP=$test_dir/expect +rm -f $OUT + +# Test command line option +echo "create fs without csum_seed" >> $OUT +$MKE2FS -o Linux -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn on csum_seed" >> $OUT +$TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT + +echo "turn off metadata_csum" >> $OUT +$TUNE2FS -O ^metadata_csum $TMPFILE > /dev/null 2>&1 +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | grep 'metadata_csum' >> $OUT + +echo "check filesystem" >> $OUT +$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 +echo "fsck returns $?" >> $OUT +$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $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 + -- cgit v1.2.3