1 test_description="disable csum seed and csums via tune2fs" 2 3 trap "rm -rf $TMPFILE $TMPFILE.conf" EXIT INT QUIT 4 dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1 5 OUT=$test_name.log 6 EXP=$test_dir/expect 7 rm -rf $OUT 8 9 # Test command line option 10 echo "create fs without csum_seed" >> $OUT 11 $MKE2FS -O metadata_csum,^metadata_csum_seed -U 6b33f586-a183-4383-921d-30da3fef2e5c -F $TMPFILE > /dev/null 2>&1 12 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT 13 14 echo "turn on csum_seed" >> $OUT 15 $TUNE2FS -O metadata_csum_seed $TMPFILE > /dev/null 2>&1 16 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT 17 18 echo "check filesystem" >> $OUT 19 $FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 20 echo "fsck returns $?" >> $OUT 21 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT 22 23 echo "turn off metadata_csum" >> $OUT 24 $TUNE2FS -O ^metadata_csum $TMPFILE > /dev/null 2>&1 25 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT 26 $DUMPE2FS $TMPFILE 2>&1 | grep 'metadata_csum' >> $OUT 27 28 echo "check filesystem" >> $OUT 29 $FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1 30 echo "fsck returns $?" >> $OUT 31 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT 32 33 cmp -s $OUT $EXP 34 status=$? 35 36 if [ "$status" = 0 ] ; then 37 echo "$test_name: $test_description: ok" 38 touch $test_name.ok 39 else 40 echo "$test_name: $test_description: failed" 41 diff $DIFF_OPTS $EXP $OUT > $test_name.failed 42 rm -f $test_name.tmp 43 fi 44 45