From: Andreas Dilger Date: Thu, 12 Apr 2012 23:52:44 +0000 (-0600) Subject: tests: add tests for uninitialized bitmaps X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=03730aadb838c774ed26105ec77efb7dd375915a;p=tools%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 --- 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 0000000..e9c5760 --- /dev/null +++ b/tests/f_uninit_bad_free_inodes/expect.1 @@ -0,0 +1,22 @@ +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 + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 794/8192 files (0.4% non-contiguous), 12587/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 0000000..fec5ac8 --- /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), 12587/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 0000000..24b681d 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 0000000..8bd3180 --- /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 0000000..475fa1a --- /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 (15416, counted=23350). +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), 9418/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 0000000..831371a --- /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), 9418/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 0000000..baff4e5 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 0000000..e6ee718 --- /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 0000000..4ff8a8b --- /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 0000000..38f2334 --- /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 0000000..8e91e01 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 0000000..b9e4a31 --- /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 0000000..f568bec --- /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 0000000..4cd9aa9 --- /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 0000000..38c7455 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 0000000..494b472 --- /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 0000000..02801bf --- /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 0000000..4cd9aa9 --- /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 0000000..4da79c9 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 0000000..a818f5c --- /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 0000000..1cf5c85 --- /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 0000000..bdb029e --- /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 0000000..9104a70 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 0000000..95d07f1 --- /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 0000000..d396beb --- /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 0000000..156eb07 --- /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 0000000..f073186 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 0000000..def2234 --- /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 0000000..a950f8f --- /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), 12587/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 0000000..6d2a0b7 --- /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), 12587/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 0000000..cba16a3 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 0000000..42b9c53 --- /dev/null +++ b/tests/f_uninit_set_inode_not_set/name @@ -0,0 +1 @@ +block uninit set but inode uninit not set