From: Darrick J. Wong Date: Sun, 3 Aug 2014 03:50:52 +0000 (-0400) Subject: tests: add regression tests for group descriptors with bad checksums X-Git-Tag: v1.43-WIP-2015-05-18~249 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=f093caf15eefdf9308b13ac2a076891b4bfc1eb9;p=tools%2Fe2fsprogs.git tests: add regression tests for group descriptors with bad checksums Add tests to examine how e2fsck deals with (a) the block bitmap being corrupt; (b) the inode bitmap being corrupt; (c) the bitmap checksums being incorrect (but the bitmaps are fine); and (d) the group descriptor checksum itself is incorrect. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- diff --git a/tests/f_bad_bbitmap/expect.1 b/tests/f_bad_bbitmap/expect.1 new file mode 100644 index 0000000..71ad1bb --- /dev/null +++ b/tests/f_bad_bbitmap/expect.1 @@ -0,0 +1,15 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x49ff, should be 0x4972. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Block bitmap differences: -(8--10) -(12--17) -(19--31) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bbitmap/expect.2 b/tests/f_bad_bbitmap/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bbitmap/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bbitmap/image.gz b/tests/f_bad_bbitmap/image.gz new file mode 100644 index 0000000..c488ecd Binary files /dev/null and b/tests/f_bad_bbitmap/image.gz differ diff --git a/tests/f_bad_bbitmap/name b/tests/f_bad_bbitmap/name new file mode 100644 index 0000000..923ddcb --- /dev/null +++ b/tests/f_bad_bbitmap/name @@ -0,0 +1 @@ +corrupt block bitmap (metadata_csum) diff --git a/tests/f_bad_bmap_csum/expect.1 b/tests/f_bad_bmap_csum/expect.1 new file mode 100644 index 0000000..ca8f77f --- /dev/null +++ b/tests/f_bad_bmap_csum/expect.1 @@ -0,0 +1,16 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x4972, should be 0x7074. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: Group 0 inode bitmap does not match checksum. +FIXED. +Block bitmap differences: Group 0 block bitmap does not match checksum. +FIXED. + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_bmap_csum/expect.2 b/tests/f_bad_bmap_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_bmap_csum/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_bmap_csum/image.gz b/tests/f_bad_bmap_csum/image.gz new file mode 100644 index 0000000..70a0d18 Binary files /dev/null and b/tests/f_bad_bmap_csum/image.gz differ diff --git a/tests/f_bad_bmap_csum/name b/tests/f_bad_bmap_csum/name new file mode 100644 index 0000000..df19fe3 --- /dev/null +++ b/tests/f_bad_bmap_csum/name @@ -0,0 +1 @@ +bad block/inode bitmap csum (metadata_csum) diff --git a/tests/f_bad_gdt_csum/expect.1 b/tests/f_bad_gdt_csum/expect.1 new file mode 100644 index 0000000..e14c897 --- /dev/null +++ b/tests/f_bad_gdt_csum/expect.1 @@ -0,0 +1,10 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xffff, should be 0x4972. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/expect.2 b/tests/f_bad_gdt_csum/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_gdt_csum/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_gdt_csum/image.gz b/tests/f_bad_gdt_csum/image.gz new file mode 100644 index 0000000..c3fdafe Binary files /dev/null and b/tests/f_bad_gdt_csum/image.gz differ diff --git a/tests/f_bad_gdt_csum/name b/tests/f_bad_gdt_csum/name new file mode 100644 index 0000000..fe2c601 --- /dev/null +++ b/tests/f_bad_gdt_csum/name @@ -0,0 +1 @@ +bad group descriptor csum (metadata_csum) diff --git a/tests/f_bad_ibitmap/expect.1 b/tests/f_bad_ibitmap/expect.1 new file mode 100644 index 0000000..ea17523 --- /dev/null +++ b/tests/f_bad_ibitmap/expect.1 @@ -0,0 +1,15 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xffff, should be 0x4972. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +Inode bitmap differences: -(12--32) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 1 diff --git a/tests/f_bad_ibitmap/expect.2 b/tests/f_bad_ibitmap/expect.2 new file mode 100644 index 0000000..411e656 --- /dev/null +++ b/tests/f_bad_ibitmap/expect.2 @@ -0,0 +1,7 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Pass 5: Checking group summary information +test_filesys: 11/128 files (0.0% non-contiguous), 18/512 blocks +Exit status is 0 diff --git a/tests/f_bad_ibitmap/image.gz b/tests/f_bad_ibitmap/image.gz new file mode 100644 index 0000000..3a52398 Binary files /dev/null and b/tests/f_bad_ibitmap/image.gz differ diff --git a/tests/f_bad_ibitmap/name b/tests/f_bad_ibitmap/name new file mode 100644 index 0000000..76ec12d --- /dev/null +++ b/tests/f_bad_ibitmap/name @@ -0,0 +1 @@ +corrupt inode bitmap (metadata_csum)