diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-03-05 14:01:11 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2016-03-06 20:08:53 -0500 |
commit | 2b8772f522be1c82c92e7e0401126808431d06a2 (patch) | |
tree | 09ea085b607f66c18073ea097cfab7111aecb96e /tests/t_format_csum_seed | |
parent | 1b7623b82251774f5e21a2671033993a74371af5 (diff) | |
download | e2fsprogs-2b8772f522be1c82c92e7e0401126808431d06a2.tar.gz |
tests: check proper operation of metadata_csum_seed
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'tests/t_format_csum_seed')
-rw-r--r-- | tests/t_format_csum_seed/expect | 10 | ||||
-rwxr-xr-x | tests/t_format_csum_seed/script | 34 |
2 files changed, 44 insertions, 0 deletions
diff --git a/tests/t_format_csum_seed/expect b/tests/t_format_csum_seed/expect new file mode 100644 index 00000000..39e6d6a7 --- /dev/null +++ b/tests/t_format_csum_seed/expect @@ -0,0 +1,10 @@ +create fs with csum_seed +Filesystem UUID: 6b33f586-a183-4383-921d-30da3fef2e5c +Checksum seed: 0x3ba62721 +change uuid +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 +check filesystem +fsck returns 0 +Filesystem UUID: 1dd136c6-e47a-4833-9bf5-519f8aacabe4 +Checksum seed: 0x3ba62721 diff --git a/tests/t_format_csum_seed/script b/tests/t_format_csum_seed/script new file mode 100755 index 00000000..1829514c --- /dev/null +++ b/tests/t_format_csum_seed/script @@ -0,0 +1,34 @@ +test_description="format with csum_seed" + +trap "rm -rf $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 -rf $OUT + +# Test command line option +echo "create fs with csum_seed" >> $OUT +$MKE2FS -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 "change uuid" >> $OUT +$TUNE2FS -U 1dd136c6-e47a-4833-9bf5-519f8aacabe4 $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 + +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 + |