From f093caf15eefdf9308b13ac2a076891b4bfc1eb9 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Sat, 2 Aug 2014 23:50:52 -0400 Subject: [PATCH] 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 --- tests/f_bad_bbitmap/expect.1 | 15 +++++++++++++++ tests/f_bad_bbitmap/expect.2 | 7 +++++++ tests/f_bad_bbitmap/image.gz | Bin 0 -> 2546 bytes tests/f_bad_bbitmap/name | 1 + tests/f_bad_bmap_csum/expect.1 | 16 ++++++++++++++++ tests/f_bad_bmap_csum/expect.2 | 7 +++++++ tests/f_bad_bmap_csum/image.gz | Bin 0 -> 2546 bytes tests/f_bad_bmap_csum/name | 1 + tests/f_bad_gdt_csum/expect.1 | 10 ++++++++++ tests/f_bad_gdt_csum/expect.2 | 7 +++++++ tests/f_bad_gdt_csum/image.gz | Bin 0 -> 2548 bytes tests/f_bad_gdt_csum/name | 1 + tests/f_bad_ibitmap/expect.1 | 15 +++++++++++++++ tests/f_bad_ibitmap/expect.2 | 7 +++++++ tests/f_bad_ibitmap/image.gz | Bin 0 -> 2548 bytes tests/f_bad_ibitmap/name | 1 + 16 files changed, 88 insertions(+) create mode 100644 tests/f_bad_bbitmap/expect.1 create mode 100644 tests/f_bad_bbitmap/expect.2 create mode 100644 tests/f_bad_bbitmap/image.gz create mode 100644 tests/f_bad_bbitmap/name create mode 100644 tests/f_bad_bmap_csum/expect.1 create mode 100644 tests/f_bad_bmap_csum/expect.2 create mode 100644 tests/f_bad_bmap_csum/image.gz create mode 100644 tests/f_bad_bmap_csum/name create mode 100644 tests/f_bad_gdt_csum/expect.1 create mode 100644 tests/f_bad_gdt_csum/expect.2 create mode 100644 tests/f_bad_gdt_csum/image.gz create mode 100644 tests/f_bad_gdt_csum/name create mode 100644 tests/f_bad_ibitmap/expect.1 create mode 100644 tests/f_bad_ibitmap/expect.2 create mode 100644 tests/f_bad_ibitmap/image.gz create mode 100644 tests/f_bad_ibitmap/name 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 0000000000000000000000000000000000000000..c488ecd365b99c51a304597c0944444e0552c57d GIT binary patch literal 2546 zcmb2|=3tPuydKQN{Pvb@MzEs{!-wijhs@@wyEMdfSk)E#woVp}J#uhiFnj4n-m6LN zCJUln-|8s!@wvWG>gZ_Vi<)y}mqv!`QAfeuKh{1_|M=8-q5x}dX3o9$;_vjz_e|gO z|McF+@1C|Ys9dek^lsgtrWfa?D6;D9$}FvXgSfkTW|xg`%R6nn@n4JU;`u7q5Z&9W zrur5Z+WwpH_oYCT-Tj%fX5aW#_UUI==y|?%wsvMSQpAx?&qTj}L>h3+2 zw|B0re*JxJ<%dKCu3E*(zf9M)UX|Rx$m;FO9fiBsxi{P9+%3Hq$v|w(156D+kV6dcjxCJzl?AHIuzJ@(j0PNP zKA5LfrTwm7a`e}^KH1*>-$$oeL`UlXo3>$3OxUMu<$)gmH^qnCOR8)0Z@VC=mY!YT zzU0f!#;YgyJ=2TvF8g!8Pu2QguW_$^+sDI&W_QEW|8%cXzP~?v^-6csufNT`9>>26 z4m!SH-+l7k|N3#hWq)>F2daH}>Cf`@_x`Ah?)qo&-!uGjP0g99>;CVaKB?+2D4<8d iXb6mkz-S1JhQMeDjD`R$LSVy(eath088aCe6c_+dh#I*7 literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..70a0d1812b9c030959651bd068f1331e36330578 GIT binary patch literal 2546 zcmb2|=3pqYxE{>J{Pvc0hKQpC!-Jb=8x<{WI(w522y75al3d%9p)4l0GH6BbNkLvV zAEsNbSFR`}WeT>KG<9fXEIjDdGj)NWD7UN6V`ljWlZ)RkY7MXy-e*eAe`^cS__D9l>C5UkvCvc3 zyi$vU?s(ZfNlg3`r57h+OPLpf6qH<37J>&mR6fWHpz2AH;?FhcU_?+DKH#?u`FgW}YS-wBl^Oero z|Hmg)ExQuu@#N6M`+mXiV=T7czRAqM(C~EOg*lw}XNhgFXJBCXa9{i1|M|RucSKK} zXG(FFDKDKm|6%QdGdW**xLWki=KW3>AoQG z`v1AF%h!wFuRmca4-#1M`v30ed1oX4gKUDSsRzms10vpWX|H+(ROxWIke!7X9oW@0 z>^Hn@d;7Ps?$z>bZ&%gdS-(y7=BlWV=B>|yBF{zNb5}IZ-@jtZ(L+4*I2YRboD2KU zm-(`|Hv3ZT+1PzE-~HG>->3Y~?6g<)Jdcl0%GtI2*bnhgw|({3qeA;vz2eUoKfeFZ z^DTY#@%~G8|Bv4}@!gNl`LFAFE+75r@4xn^zl_yCga0Q(E;-el5?}xSclhP1zre5< k1*0J_8UmvsFd71*Aut*OGzozXKk671F0Px-z@WeY0F<&6$N&HU literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..c3fdafe6627561f7de16ea09a6f02d52f6265b00 GIT binary patch literal 2548 zcmb2|=3uC|xE{>J{Pvb@MzEs{!-wk31DC|KO9OQxxcr=CvemVBbu>FK=X;eTz3M1m zro;BGTahj@vRxNk1q4}Tw^($R243juYE~-y7=6(H(dqUeCy^~nH&*VC-?977$GA`b z^uPD*o-WQbA>{E<9nnL#c2tPAPFTNXxz@@p2P;x{-|#t~Q_s=r^#8Sn%l=oXflG7N zhL{~c+WW(qZ;5lpucGp-yrkQ^Pl{`Y+uLt>cjQJwUe5aqA5J8^E67`!Wc%w)$+uI} z-acRcF8@aTw};0YHNLcNyYgp;Sa|xMuB>Kxm-~i10|Ud4_oDy*=W_>Y z37Dy90Y z6^PJ)OUa+!ne%S`o1eLI-{$1>zmMy7nw|^0+O=QPWcsP1d!OvMURM5gU8*aV_9KL2 zZer24U*#TN^Q9vuzsY|0=xfUH|9>ksJ-%-e{6AU3UMT%?t?9A-D~vw<-FXXu@)|CM#NK4{@<{?GGERCSLm&-wUkf4Sw# o>-M4uzZ3heLcj9= z^y=exPjfSRtm+J!#+B$Bv!};NBjk4Q)sTA$i+084Y%9-GXh|x35Gt~0{@1P*QQN|` zXFqyW^+)mdWyLKu`;2YvcYb|)<+JGOd9pFpH8mRc`_d~?N;K*<_J?egtE|#0ul&5N z`11E_@2x*SIGiBz%USJfc1-tb?K;=eTbBzTm&Nw8Ro~e5de3GChLgdw{*@hDx!mTz z{*kXGJNN2W|Mpd!_xyj}{@LmN?@PWhFfb%kYHV9}`1&-~H~c`}pYLA(|ED`mIn{P* zGsDaYUa6a>rdP<9ZdvMf{L^FUw&Psv-*$yF0TrJ1Rckpu`R>lUZ%tqS|Jirympo7~ zqwj0|`CY={UhnUhTYv;Eta<%Ey4L^M+W(9U3(= zL(K>CwCd+(zxz^6~xYi%-7$FTP&Q`rn<`K(#)Z|1QVp|C`Kpw|>U|C95+P?VfpE|9{upbMHT3 mSd4