• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1test_description="change meta-csum uuid with mcsum-seed"
2
3trap "rm -f $TMPFILE $TMPFILE.conf" EXIT INT QUIT
4dd if=/dev/zero of=$TMPFILE bs=1k count=512 > /dev/null 2>&1
5OUT=$test_name.log
6EXP=$test_dir/expect
7rm -f $OUT
8
9# Test command line option
10echo "create fs with metadata_csum" >> $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
14echo "change UUID" >> $OUT
15EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
16$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
17
18echo "check filesystem" >> $OUT
19$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
20echo "fsck returns $?" >> $OUT
21$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
22
23echo "turn on csum seed" >> $OUT
24EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -O metadata_csuM_seed $TMPFILE > /dev/null 2>&1
25$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
26
27echo "check filesystem" >> $OUT
28$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
29echo "fsck returns $?" >> $OUT
30$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
31
32echo "change UUID" >> $OUT
33EXT2FS_PRETEND_RW_MOUNT=1 $TUNE2FS -U a61be2e0-b3b8-4fbc-b2cd-d84b306b9731 $TMPFILE > /dev/null 2>&1
34$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
35
36echo "check filesystem" >> $OUT
37$FSCK $FSCK_OPT -fy $TMPFILE > /dev/null 2>&1
38echo "fsck returns $?" >> $OUT
39$DUMPE2FS $TMPFILE 2>&1 | egrep '(Checksum seed:|UUID)' >> $OUT
40
41cmp -s $OUT $EXP
42status=$?
43
44if [ "$status" = 0 ] ; then
45	echo "$test_name: $test_description: ok"
46	touch $test_name.ok
47else
48	echo "$test_name: $test_description: failed"
49	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
50	rm -f $test_name.tmp
51fi
52
53