From: Andreas Dilger Date: Thu, 12 Apr 2012 23:52:44 +0000 (-0600) Subject: tests: add tests for uninitialized bitmaps X-Git-Tag: v1.46.0~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da801dfe03413e37dbbd02d69de986a8b13cd4ad;p=thirdparty%2Fe2fsprogs.git tests: add tests for uninitialized bitmaps Various tests for handing uninitialized block and inode bitmaps, and inodes beyond the in-use high watermark. Signed-off-by: Andreas Dilger Signed-off-by: Theodore Ts'o --- diff --git a/tests/f_uninit_bad_free_inodes/expect.1 b/tests/f_uninit_bad_free_inodes/expect.1 new file mode 100644 index 000000000..23d7b1f6e --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/expect.1 @@ -0,0 +1,25 @@ +Group descriptor 1 has invalid unused inodes count 2048. Fix? yes + +Group descriptor 2 has invalid unused inodes count 1344. Fix? yes + +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 +Free inodes count wrong for group #1 (490, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (250, counted=1344). +Fix? yes + +Free inodes count wrong for group #3 (1967, counted=1969). +Fix? yes + +Free inodes count wrong (4744, counted=7398). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_bad_free_inodes/expect.2 b/tests/f_uninit_bad_free_inodes/expect.2 new file mode 100644 index 000000000..431227b28 --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/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: 794/8192 files (0.4% non-contiguous), 8473/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_bad_free_inodes/image.gz b/tests/f_uninit_bad_free_inodes/image.gz new file mode 100644 index 000000000..3e6218b52 Binary files /dev/null and b/tests/f_uninit_bad_free_inodes/image.gz differ diff --git a/tests/f_uninit_bad_free_inodes/name b/tests/f_uninit_bad_free_inodes/name new file mode 100644 index 000000000..8bd318008 --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/name @@ -0,0 +1 @@ +bad free inode count, but good checksum diff --git a/tests/f_uninit_blk_used_not_set/expect.1 b/tests/f_uninit_blk_used_not_set/expect.1 new file mode 100644 index 000000000..9e473f870 --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/expect.1 @@ -0,0 +1,34 @@ +Group descriptor 1 has invalid unused inodes count 2048. Fix? yes + +Group descriptor 2 has invalid unused inodes count 2048. Fix? yes + +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 +Group 1 block(s) in use but group is marked BLOCK_UNINIT +Fix? yes + +Block bitmap differences: +(8585--8777) +Fix? yes + +Free blocks count wrong for group #2 (0, counted=7934). +Fix? yes + +Free blocks count wrong (19530, counted=27464). +Fix? yes + +Free inodes count wrong for group #1 (0, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=2048). +Fix? yes + +Free inodes count wrong (4084, counted=8180). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 12/8192 files (8.3% non-contiguous), 5304/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_blk_used_not_set/expect.2 b/tests/f_uninit_blk_used_not_set/expect.2 new file mode 100644 index 000000000..17d0cfa0e --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/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: 12/8192 files (8.3% non-contiguous), 5304/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_blk_used_not_set/image.gz b/tests/f_uninit_blk_used_not_set/image.gz new file mode 100644 index 000000000..631628597 Binary files /dev/null and b/tests/f_uninit_blk_used_not_set/image.gz differ diff --git a/tests/f_uninit_blk_used_not_set/name b/tests/f_uninit_blk_used_not_set/name new file mode 100644 index 000000000..e6ee718a1 --- /dev/null +++ b/tests/f_uninit_blk_used_not_set/name @@ -0,0 +1 @@ +blocks used but block uninit set diff --git a/tests/f_uninit_checksum_bad/expect.1 b/tests/f_uninit_checksum_bad/expect.1 new file mode 100644 index 000000000..4ff8a8bf6 --- /dev/null +++ b/tests/f_uninit_checksum_bad/expect.1 @@ -0,0 +1,29 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 1 checksum is 0xbbaa, should be 0xff0b. FIXED. +Group descriptor 2 has invalid unused inodes count 2048. Fix? yes + +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 +Free blocks count wrong for group #2 (0, counted=7934). +Fix? yes + +Free blocks count wrong (19286, counted=27220). +Fix? yes + +Free inodes count wrong for group #1 (0, counted=2048). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=2048). +Fix? yes + +Free inodes count wrong (4085, counted=8181). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 5548/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_checksum_bad/expect.2 b/tests/f_uninit_checksum_bad/expect.2 new file mode 100644 index 000000000..38f233472 --- /dev/null +++ b/tests/f_uninit_checksum_bad/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/8192 files (0.0% non-contiguous), 5548/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_checksum_bad/image.gz b/tests/f_uninit_checksum_bad/image.gz new file mode 100644 index 000000000..8e91e0142 Binary files /dev/null and b/tests/f_uninit_checksum_bad/image.gz differ diff --git a/tests/f_uninit_checksum_bad/name b/tests/f_uninit_checksum_bad/name new file mode 100644 index 000000000..b9e4a31ee --- /dev/null +++ b/tests/f_uninit_checksum_bad/name @@ -0,0 +1 @@ +invalid group descriptor checksum diff --git a/tests/f_uninit_disable/expect.1 b/tests/f_uninit_disable/expect.1 new file mode 100644 index 000000000..f568bec40 --- /dev/null +++ b/tests/f_uninit_disable/expect.1 @@ -0,0 +1,10 @@ +Group descriptor 0 marked uninitialized without feature set. +Fix? yes + +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/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_disable/expect.2 b/tests/f_uninit_disable/expect.2 new file mode 100644 index 000000000..4cd9aa981 --- /dev/null +++ b/tests/f_uninit_disable/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/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_disable/image.gz b/tests/f_uninit_disable/image.gz new file mode 100644 index 000000000..38c745562 Binary files /dev/null and b/tests/f_uninit_disable/image.gz differ diff --git a/tests/f_uninit_disable/name b/tests/f_uninit_disable/name new file mode 100644 index 000000000..494b4720d --- /dev/null +++ b/tests/f_uninit_disable/name @@ -0,0 +1 @@ +disable uninit_bg feature diff --git a/tests/f_uninit_enable/expect.1 b/tests/f_uninit_enable/expect.1 new file mode 100644 index 000000000..02801bf90 --- /dev/null +++ b/tests/f_uninit_enable/expect.1 @@ -0,0 +1,10 @@ +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x0000, should be 0x13f6. 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/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_enable/expect.2 b/tests/f_uninit_enable/expect.2 new file mode 100644 index 000000000..4cd9aa981 --- /dev/null +++ b/tests/f_uninit_enable/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/2048 files (0.0% non-contiguous), 306/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_enable/image.gz b/tests/f_uninit_enable/image.gz new file mode 100644 index 000000000..4da79c966 Binary files /dev/null and b/tests/f_uninit_enable/image.gz differ diff --git a/tests/f_uninit_enable/name b/tests/f_uninit_enable/name new file mode 100644 index 000000000..a818f5c07 --- /dev/null +++ b/tests/f_uninit_enable/name @@ -0,0 +1 @@ +enable uninit_bg feature diff --git a/tests/f_uninit_inode_past_unused/expect.1 b/tests/f_uninit_inode_past_unused/expect.1 new file mode 100644 index 000000000..1cf5c85cb --- /dev/null +++ b/tests/f_uninit_inode_past_unused/expect.1 @@ -0,0 +1,27 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo' in / (2) references inode 14 found in group 0's unused inodes area. +Fix? yes + +Restarting e2fsck from the beginning... +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0x4c72, should be 0xde74. 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 +Fix? yes + +Free inodes count wrong for group #0 (2037, counted=2035). +Fix? yes + +Free inodes count wrong (4073, counted=2035). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks +Exit status is 1 diff --git a/tests/f_uninit_inode_past_unused/expect.2 b/tests/f_uninit_inode_past_unused/expect.2 new file mode 100644 index 000000000..bdb029eec --- /dev/null +++ b/tests/f_uninit_inode_past_unused/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: 13/2048 files (0.0% non-contiguous), 1336/8192 blocks +Exit status is 0 diff --git a/tests/f_uninit_inode_past_unused/image.gz b/tests/f_uninit_inode_past_unused/image.gz new file mode 100644 index 000000000..9104a70ca Binary files /dev/null and b/tests/f_uninit_inode_past_unused/image.gz differ diff --git a/tests/f_uninit_inode_past_unused/name b/tests/f_uninit_inode_past_unused/name new file mode 100644 index 000000000..95d07f19f --- /dev/null +++ b/tests/f_uninit_inode_past_unused/name @@ -0,0 +1 @@ +inode in use beyond bg_itable_unused diff --git a/tests/f_uninit_restart_fsck/expect.1 b/tests/f_uninit_restart_fsck/expect.1 new file mode 100644 index 000000000..d396beb30 --- /dev/null +++ b/tests/f_uninit_restart_fsck/expect.1 @@ -0,0 +1,36 @@ +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo2' in /d1 (1881) references inode 500 found in group 0's unused inodes area. +Fix? yes + +Entry 'foo2' in /d1 (1881) has an incorrect filetype (was 1, should be 0). +Fix? yes + +Entry 'bar2' in /d2 (3761) references inode 2100 found in group 1's unused inodes area. +Fix? yes + +Entry 'bar2' in /d2 (3761) has an incorrect filetype (was 1, should be 0). +Fix? yes + +Restarting e2fsck from the beginning... +One or more block group descriptor checksums are invalid. Fix? yes + +Group descriptor 0 checksum is 0xb92b, should be 0x2b5f. FIXED. +Group descriptor 1 checksum is 0x2f53, should be 0x8d2f. FIXED. +Pass 1: Checking inodes, blocks, and sizes +Pass 2: Checking directory structure +Entry 'foo2' in /d1 (1881) has deleted/unused inode 500. Clear? yes + +Entry 'bar2' in /d2 (3761) has deleted/unused inode 2100. Clear? yes + +Pass 3: Checking directory connectivity +Pass 4: Checking reference counts +Unattached zero-length inode 1883. Clear? yes + +Unattached zero-length inode 3763. Clear? yes + +Pass 5: Checking group summary information + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks +Exit status is 1 diff --git a/tests/f_uninit_restart_fsck/expect.2 b/tests/f_uninit_restart_fsck/expect.2 new file mode 100644 index 000000000..156eb07f7 --- /dev/null +++ b/tests/f_uninit_restart_fsck/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: 21/7520 files (0.0% non-contiguous), 2352/30000 blocks +Exit status is 0 diff --git a/tests/f_uninit_restart_fsck/image.gz b/tests/f_uninit_restart_fsck/image.gz new file mode 100644 index 000000000..f073186ee Binary files /dev/null and b/tests/f_uninit_restart_fsck/image.gz differ diff --git a/tests/f_uninit_restart_fsck/name b/tests/f_uninit_restart_fsck/name new file mode 100644 index 000000000..def2234fb --- /dev/null +++ b/tests/f_uninit_restart_fsck/name @@ -0,0 +1 @@ +re-start e2fsck only once for inodes in uninit space diff --git a/tests/f_uninit_set_inode_not_set/expect.1 b/tests/f_uninit_set_inode_not_set/expect.1 new file mode 100644 index 000000000..4ea3f10ab --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/expect.1 @@ -0,0 +1,25 @@ +Group descriptor 1 has invalid unused inodes count 1464. Fix? yes + +Group descriptor 2 has invalid unused inodes count 1849. Fix? yes + +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 +Group 1 block(s) in use but group is marked BLOCK_UNINIT +Fix? yes + +Block bitmap differences: +(9729--14621) +Fix? yes + +Free inodes count wrong for group #1 (0, counted=1464). +Fix? yes + +Free inodes count wrong for group #2 (0, counted=1849). +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks +Exit status is 1 diff --git a/tests/f_uninit_set_inode_not_set/expect.2 b/tests/f_uninit_set_inode_not_set/expect.2 new file mode 100644 index 000000000..846c55825 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/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: 794/8192 files (0.3% non-contiguous), 8473/32768 blocks +Exit status is 0 diff --git a/tests/f_uninit_set_inode_not_set/image.gz b/tests/f_uninit_set_inode_not_set/image.gz new file mode 100644 index 000000000..cd38e279b Binary files /dev/null and b/tests/f_uninit_set_inode_not_set/image.gz differ diff --git a/tests/f_uninit_set_inode_not_set/name b/tests/f_uninit_set_inode_not_set/name new file mode 100644 index 000000000..42b9c5349 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/name @@ -0,0 +1 @@ +block uninit set but inode uninit not set