From: "Darrick J. Wong" Subject: [PATCH 17/25] tests: test recovery of 32 and 64-bit journals with checksum v2 Date: Mon, 08 Sep 2014 16:13:28 -0700 Message-ID: <20140908231328.25904.94901.stgit@birch.djwong.org> References: <20140908231135.25904.66591.stgit@birch.djwong.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: linux-ext4@vger.kernel.org To: tytso@mit.edu, darrick.wong@oracle.com Return-path: Received: from aserp1040.oracle.com ([141.146.126.69]:49455 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755295AbaIHXNd (ORCPT ); Mon, 8 Sep 2014 19:13:33 -0400 In-Reply-To: <20140908231135.25904.66591.stgit@birch.djwong.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: Add tests to ensure that we know how to recover journals with the csum_v2 feature set. Signed-off-by: Darrick J. Wong --- tests/j_recover_csum2_32bit/expect.1 | 16 ++++++++++++++++ tests/j_recover_csum2_32bit/expect.2 | 7 +++++++ tests/j_recover_csum2_32bit/image.bz2 | Bin tests/j_recover_csum2_32bit/name | 1 + tests/j_recover_csum2_32bit/script | 31 +++++++++++++++++++++++++++++++ tests/j_recover_csum2_64bit/expect.1 | 16 ++++++++++++++++ tests/j_recover_csum2_64bit/expect.2 | 7 +++++++ tests/j_recover_csum2_64bit/image.bz2 | Bin tests/j_recover_csum2_64bit/name | 1 + tests/j_recover_csum2_64bit/script | 31 +++++++++++++++++++++++++++++++ 10 files changed, 110 insertions(+) create mode 100644 tests/j_recover_csum2_32bit/expect.1 create mode 100644 tests/j_recover_csum2_32bit/expect.2 create mode 100644 tests/j_recover_csum2_32bit/image.bz2 create mode 100644 tests/j_recover_csum2_32bit/name create mode 100755 tests/j_recover_csum2_32bit/script create mode 100644 tests/j_recover_csum2_64bit/expect.1 create mode 100644 tests/j_recover_csum2_64bit/expect.2 create mode 100644 tests/j_recover_csum2_64bit/image.bz2 create mode 100644 tests/j_recover_csum2_64bit/name create mode 100755 tests/j_recover_csum2_64bit/script diff --git a/tests/j_recover_csum2_32bit/expect.1 b/tests/j_recover_csum2_32bit/expect.1 new file mode 100644 index 0000000..491784a --- /dev/null +++ b/tests/j_recover_csum2_32bit/expect.1 @@ -0,0 +1,16 @@ +test_filesys: recovering journal +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: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_32bit/expect.2 b/tests/j_recover_csum2_32bit/expect.2 new file mode 100644 index 0000000..d223026 --- /dev/null +++ b/tests/j_recover_csum2_32bit/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), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_32bit/image.bz2 b/tests/j_recover_csum2_32bit/image.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..2212edd9ab3c825914a98a21deb10007d5c035d9 GIT binary patch literal 3371 zcmbtXdpwj|_upeQBPB)1xa8ENsG&4OE-B4q7`e=hdm8t9xh6UoVTv)BAu^l@gXA_5 zZ*E6N?vvY4q9TryB1a*i@;*-Q`<~D5_s{#syFQ<1ueH8w@BOUx?6vn^&l!6!onxo% zlu34x;fZrVD0$<*(!`Ejcy3_Blo9~j0jwENMU<2bV_<`BEdYSiF?#@lwqJ59Z5NBS zYX-mxG+=}!0w7S@8jCN^6MjlGD{;;PU@NVpBoDz+EQ&STo+XQ*Avjt^TjL^<1VbEI zu&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uVJlzC!=l0hJ+8G-qi&6O z-&Po_OC)s5xBlGEQ%P zzwV+3xj#~|cdh@Sh3L6?VW`mA3H`tT7@cZHA{vsp5S-q4p=Gls!8|JeCY<|obb literal 0 HcmV?d00001 diff --git a/tests/j_recover_csum2_32bit/name b/tests/j_recover_csum2_32bit/name new file mode 100644 index 0000000..6fd378c --- /dev/null +++ b/tests/j_recover_csum2_32bit/name @@ -0,0 +1 @@ +recover 32-bit journal checksum v2 diff --git a/tests/j_recover_csum2_32bit/script b/tests/j_recover_csum2_32bit/script new file mode 100755 index 0000000..4b0ec48 --- /dev/null +++ b/tests/j_recover_csum2_32bit/script @@ -0,0 +1,31 @@ +#!/bin/bash + +FSCK_OPT=-fy +IMAGE=$test_dir/image.bz2 + +bzip2 -d < $IMAGE > $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log +rm -rf $test_name.failed $test_name.ok + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi diff --git a/tests/j_recover_csum2_64bit/expect.1 b/tests/j_recover_csum2_64bit/expect.1 new file mode 100644 index 0000000..491784a --- /dev/null +++ b/tests/j_recover_csum2_64bit/expect.1 @@ -0,0 +1,16 @@ +test_filesys: recovering journal +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: +(1--259) +265 +(274--275) +281 +(290--418) +(1059--1186) +(2211--2352) +Fix? yes + +Inode bitmap differences: +(1--11) +Fix? yes + + +test_filesys: ***** FILE SYSTEM WAS MODIFIED ***** +test_filesys: 11/8192 files (0.0% non-contiguous), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_64bit/expect.2 b/tests/j_recover_csum2_64bit/expect.2 new file mode 100644 index 0000000..d223026 --- /dev/null +++ b/tests/j_recover_csum2_64bit/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), 7739/131072 blocks +Exit status is 0 diff --git a/tests/j_recover_csum2_64bit/image.bz2 b/tests/j_recover_csum2_64bit/image.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..acf1daed92e6805adee12a099ebff4dd22507a83 GIT binary patch literal 3486 zcmbtWdpwi<`~S?CoE4!Vr&;OQ97aTsj3~>gtQB)8+F}klRYTDvIyl58Hm3-~Qcpvn z1CuO=NT%h`VUkB8Dx^HcZ=Rmt_x1Zd|NQ>=U4MM8>w4eUec#vny06cDeH@6v)@JtJ zNWAx2`GgiA!9BC`e~CzO#YSbuYDXXdfCn^1Fo=YNq~sdKWXC`fg~n6?lDu?)bOmB9 z0Y8ETGWAGOx`hne0`x(#K*bfvXIL;*ATS{1w$B+xTY!`R7&dr=1rQ9_?FY747zF^* zMuvShJ2eBq>`R~?&XAJM5=sf|d==b6hob<8+wNRhA>daQ2n0zEvT~V|{Q&@5WIu$R zJP;fh42Qa2<%pB}w^+dJ*)*spZe^)rPuar1ul~!&u$imK--`@QB3_(2kYOMprhmsF z|6Z9u<}4*?pOJ;L3cl~cf-UU1?WReY?D|dR3gwg!@ow_=lNbw<#k?C_0c?OUJRB_9 zD#3kv?9^Quu;MZ|$OVjiI<}9r04ct<0iK9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2&F-PCX*=*eDl(~A!C}&W<{=J8!I(>nS8Tc^t&8! z^4ze*<|9)s7_lM#!l)-{XLhgx1=A*R0)0W(Asx08H}q95IW163DlJg(SZg_6n;G*t z`g;iZ_es~A0jpIA*}u3@k(OZQS~p8Nuv!(5z*Y6TESi023trr0MKfRH17=-v(J?MR zZue_qV%o`R?$*)MMpwGnsVud-iBar)mcVtw6*l!0I~gDxX*dW@hzTjo-KI$=DJesE zKsp`TmBjl*gFf3987bOUVtYL;>Tpzvm^84)f5Hg1{4Cl&PHB8$vnn*AJ)0aL9e&vn46;rk|-ts zuX<*|+r`W`JrjDiiCoh=_<)zA{n3|HtgBIPItesbOW)5 zc<#->cgSGiho4!pi}4|W@yrafa;R&vZm_(4)}!DK!K30zcA1qS@A%6n)_G4-9dc1` zYE@*vO4Zc6)UA)t4}oruL?~!CEAFCwvs6$1+_gESRkzXRan^9{+N{F#5|)F{{AGI= z4x(^r4OTJ35kW^}(yt-1pq^#PEzR7YC%r7E!p;YbdHLWBjQ1x)&pnOWpdfWa|2u|& zJY-KwLg4hRy9%~2(yJI7oO3QZH4uka+uI+i-`+n=J(CqC>evkv4TE+U*Td8Qav zxZ&p>Pq-l&LrfKkr=1^cD|w4@%Ox(%&|b4>`#S$pll}B{j&uXFU7o2S!qCpZ@WG)T zEA~4xYh!#@(1YEag+k%??hy0BMe8a-%uCoQ+o=cVjmARmDw@Z&9Y}Tx@nuihUk~ls zPc}l#Vg`lvggu`7a7HfE0f%E_W=z^h!Q&r`4j`eam5r zpU6n)W?%7r+aNF1t{viSuF6e$=ym!!a}p{2h5I}db#-LU>*PT6euZ*8Z6(*DX?V&f z1*iB2ul8uskE`>`+UT^Uxu)T`%)%D|Cq^bd_>3Ibl#opM`yd@4+?v~` $TMPFILE + +# Run fsck to fix things? +EXP1=$test_dir/expect.1 +OUT1=$test_name.1.log +rm -rf $test_name.failed $test_name.ok + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT1 +echo "Exit status is $?" >> $OUT1 + +# Run a second time +EXP2=$test_dir/expect.2 +OUT2=$test_name.2.log + +$FSCK $FSCK_OPT -N test_filesys $TMPFILE 2>&1 | head -n 1000 | tail -n +2 > $OUT2 +echo "Exit status is $?" >> $OUT2 + +# Figure out what happened +if cmp -s $EXP1 $OUT1 && cmp -s $EXP2 $OUT2; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff -u $EXP1 $OUT1 >> $test_name.failed + diff -u $EXP2 $OUT2 >> $test_name.failed +fi