Home | History | Annotate | Download | only in t_disable_changed_csum_seed_mounted
      1 test_description="disable csum seed on mounted fs via tune2fs after changing uuid"
      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 "change UUID" >> $OUT
     19 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
     20 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
     21 
     22 echo "check filesystem" >> $OUT
     23 $FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
     24 echo "fsck returns $?" >> $OUT
     25 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
     26 
     27 echo "turn off csum_seed" >> $OUT
     28 EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O ^metadata_csum_seed $TMPFILE > /dev/null 2>&1
     29 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
     30 
     31 echo "check filesystem" >> $OUT
     32 $FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
     33 echo "fsck returns $?" >> $OUT
     34 $DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
     35 
     36 cmp -s $OUT $EXP
     37 status=$?
     38 
     39 if [ "$status" = 0 ] ; then
     40 	echo "$test_name: $test_description: ok"
     41 	touch $test_name.ok
     42 else
     43 	echo "$test_name: $test_description: failed"
     44 	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
     45 	rm -f $test_name.tmp
     46 fi
     47 
     48