From: "Darrick J. Wong" Subject: [PATCH 21/34] tests: test resize2fs 32->64 and 64->32bit conversion code Date: Sat, 13 Sep 2014 15:13:31 -0700 Message-ID: <20140913221331.13646.71600.stgit@birch.djwong.org> References: <20140913221112.13646.3873.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]:24493 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbaIMWNg (ORCPT ); Sat, 13 Sep 2014 18:13:36 -0400 In-Reply-To: <20140913221112.13646.3873.stgit@birch.djwong.org> Sender: linux-ext4-owner@vger.kernel.org List-ID: Add some simple tests to check that flex_bg and meta_bg filesystems can be converted between 32 and 64bit layouts. Signed-off-by: Darrick J. Wong --- tests/r_32to64bit/expect.gz | Bin tests/r_32to64bit/name | 1 + tests/r_32to64bit/script | 75 ++++++++++++++++++++++++++++++++++++++ tests/r_32to64bit_meta/expect.gz | Bin tests/r_32to64bit_meta/name | 1 + tests/r_32to64bit_meta/script | 75 ++++++++++++++++++++++++++++++++++++++ tests/r_64to32bit/expect.gz | Bin tests/r_64to32bit/name | 1 + tests/r_64to32bit/script | 75 ++++++++++++++++++++++++++++++++++++++ tests/r_64to32bit_meta/expect.gz | Bin tests/r_64to32bit_meta/name | 1 + tests/r_64to32bit_meta/script | 75 ++++++++++++++++++++++++++++++++++++++ 12 files changed, 304 insertions(+) create mode 100644 tests/r_32to64bit/expect.gz create mode 100644 tests/r_32to64bit/name create mode 100644 tests/r_32to64bit/script create mode 100644 tests/r_32to64bit_meta/expect.gz create mode 100644 tests/r_32to64bit_meta/name create mode 100644 tests/r_32to64bit_meta/script create mode 100644 tests/r_64to32bit/expect.gz create mode 100644 tests/r_64to32bit/name create mode 100644 tests/r_64to32bit/script create mode 100644 tests/r_64to32bit_meta/expect.gz create mode 100644 tests/r_64to32bit_meta/name create mode 100644 tests/r_64to32bit_meta/script diff --git a/tests/r_32to64bit/expect.gz b/tests/r_32to64bit/expect.gz new file mode 100644 index 0000000000000000000000000000000000000000..c0ba3b77f70ea2cf5d32c91f95edf1d40da5b35c GIT binary patch literal 3143 zcmaJ>c{CIbyN(~pUXcn}ho71*CcCkWKKls6kSxibM7Hd^kc?qWVeCfK$i5rR zU>cI7!4O$uEZ6tl``10^-v8e7zVGuq=e+N89^uqW7sOo7Y#INem6&G;3|vX9XN~Q< z(6NEn1jWYwlaMD5XOC5D9FjIQ1Yg!E9P}Qw&vkFQAcPWolX`=~Nhj@hx~Ujt=>&^znv2fH z=7Lb?-hOv55l%w1;^<2aN52Wn4VKR+BYPAwYQXTZ#^!!+bQ`%$XBTt-M18O(@U9o; z;P$I4Q$r==5r_@*)fR`W{sh+eQ*>_b#~py_Z~MAM-AO}GCy7oWcs~AD4`9&S`RI`I z?8{cG;o~LmJ<^G!wusW140oa6ZU%)AgNyn3u8Q!nl%p$#xXtqe+E3pcBdm)a{$6{i zeb<&P^wj7!W^18TCp1yhtW1!?5!u*{BWoipCA;Qni&M%t+5jKMKDJPIC&j94Kc^^= zm_$~g|2hrF=?EQAbc{dJe&*4~%1%RdyDZs-b+x#(f@Xzq4&1$Taskty_66ZY@~5Iv z+)5FJ5Y|Kye8Q;fL2sDrUa{OHwF$%=uUYoG&z|WqY>zoCT3*SD$qlX3EvwM^hAgj> zn+th=B#Gz@Cpt$f9f9_F&DJ75hc41?ZxQL-UpoS#H>48#C#=F3Xty(X(^*b&YiiNe zdcDu89n`0PUH1e8zT6^aPz^0Y9LlF=_skEp4q5xVmX!jFRt^Q7d}YxK{1eO8W$Bqs zS1?IBeUqUFZL131Cu{5Ep04oIZ-)o5-Y)=E8KeByAkArs9GZPZ+8b*Ui>KEVXwG?R z|HLAsyz!&4t+v_rJGVx)*W3mZgu&ycCAP2(|5j~brgyNziAmndAu%UCRaZTB{I1Qc z#)S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(7~vlS$7pc9cJ|`4$XTd*8*EPKmO2gRY`o)@b@9OycuWA`amW?_Ijx=AK&nO;&dKq zZpYX@9_9s=QA9T=s_{YpTAZLdT?uKzVhPCn1}*veVb)X;sMEiA#btP_FDl!|1ALif zAWh9yU$OaEEl`U*3ezZ6Ez|R<0gsqw};sZk@3%5f2X^AfYrpk9qg$?WhV!|vToV5 z{`@xiN(iQi0HW4*d^C3ZTF} zrMkTvc8(01qYfOkkup)dZ-=Mns5bW;FBUkgB&^t^!oIHwKwmS4Wj0=|qRHi@G}<}w zGt2t{N8BLmkB0f{wtk{+*DRmE=2jJkiAtZ@*}M<63xkvXod$Q#4R!y^TvCoL^D*V< z;nyEa3X2?%15rBry<@ePyG&`{zW7DoKuH%y^vrQThSmo&g1TwHIY!Cc^@%49?*%$%GGd&@@oA05XTNsk)gBl&9l`hZ=wn$T!~v9H+no@P zmWfjy{A$VLdfcf*TWVm;w|{Oea?JkKLmnr*#Qi=qYtIg>w+#3bwHJND)BH8;z;nr# z(i=cO`prm*tu9!&$(A15_U3e1z;K? $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -b" >> $OUT +$RESIZE2FS $TMPFILE -b -f 2>&1 >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' -i $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $EXP + +unset IMAGE FSCK_OPT OUT EXP CONF + +else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped" +fi + diff --git a/tests/r_32to64bit_meta/expect.gz b/tests/r_32to64bit_meta/expect.gz new file mode 100644 index 0000000000000000000000000000000000000000..dc1e284e195e56235b166faaedf2e0337018ab08 GIT binary patch literal 2955 zcmb7^X*d)L`^IHwELp}nw$Vu;3S(=r3|`yFObkPbp_rm+vP+g|2*sqaZ^MvfG>mOnTVP4<8G3yu?(wUGg6oyo?yUGsvHhiA^=mk}TZ*_E%|!uOKl<+if4 zANJ5|(?qz5?PZwQw(%*Xt&MH6+=8E=c7(AKzHbcjff$>-xTE*cJx7W+-z9iQ=ZftN z-`f_%{S^>8cY^O@b;!iryo5)%>%zSYoyabei9H^ngBu$hdlBE;4lI^0;=VJR?=#KF zYi#1l1;s{fcCRn(9Qrapf7-TOV#k=*FF_Js>2CAKstf#0y(9ZT6Wztn&pJEBHg}+f zCN2VK_lHTei+Ei+^dwR8&gL7DK^*R&@0 zxP}3lYS&GDj4%Bez~us-o4^q!85v6t%!1YLhznbXe-hMn`H`b_(S<7$41j@Th*?YB z#Ul9`gm@LSNB5!--kJmz^%r

gRLc=M*=tQ%OloC&xivqTodt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P?2G~NaCh)dyzffbY zeMn=o!3EaG1}-%3@HcL=Pms%gtvs*sw!XgUYom#_G!-d0OuhDb7UDKH%q-{^5_Tg; z{OkV}MGpW}^mqkh@z$17A}ln-U;Nm9xFN}wahV@DjSkU&I-YVyeRdA~`uM`P1-w4o z&f$grb(Q7y-oiv)y<7`lD<@*0gLLd=7qkM7JjzcKbjZGqdVAR#a=blQVw^yG0GEpW z2QPDsN5#&uZ=;_4|CR`61=QBGh_lOGRD9&-0&;?#^Ugu)XvYzte&%(nMUu2e@4W7d zK!tqt^B1-?g8-6;-I?pdt>}mXAVm~)qX=%PQCqMNG|w5Qr}~XErLL*Zw2-fwA zLEazsNoO@G`XUxxWv7BgXk*jr=b${V?_}J#Mmc&dSX0PQ%rQds;L3RYlUv& z2VQ&(g9WIx8cy8>oShAW#sQ1AYRpnZ#)-4ocY~@S*P{++u?1yO^Gjnbm>;K``qADj z9H^2$*|tGi=tf*gUb=4>P%|F{@|iWuJ-o+v^!~T^#Yn|Ll+KsQh24axCYI%ww#!#n zhZ1XnKf@yEmn+Fq-|rhIZNP_^B)`U}wnyP7=LeZe+t=EeTeA$0g~NM_ z`s>;Xvo4=m`|ZM5mjxy@Mj-UpW_DHIPSoyJ2I&`dSLh)CzFin1a&*Rgn=!h)F@Yf9RS(Vqu5UtZrQXI^2IUX5U- Wd;GU73@H3&a^fbKU_x}`;P^N2d#Bt0 literal 0 HcmV?d00001 diff --git a/tests/r_32to64bit_meta/name b/tests/r_32to64bit_meta/name new file mode 100644 index 0000000..d83492e --- /dev/null +++ b/tests/r_32to64bit_meta/name @@ -0,0 +1 @@ +convert meta_bg 32bit fs to 64bit fs diff --git a/tests/r_32to64bit_meta/script b/tests/r_32to64bit_meta/script new file mode 100644 index 0000000..5d02114 --- /dev/null +++ b/tests/r_32to64bit_meta/script @@ -0,0 +1,75 @@ +if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,meta_bg,^resize_inode + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -b" >> $OUT +$RESIZE2FS $TMPFILE -b -f 2>&1 >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' -i $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $EXP + +unset IMAGE FSCK_OPT OUT EXP CONF + +else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped" +fi + diff --git a/tests/r_64to32bit/expect.gz b/tests/r_64to32bit/expect.gz new file mode 100644 index 0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?d00001 diff --git a/tests/r_64to32bit/name b/tests/r_64to32bit/name new file mode 100644 index 0000000..4c82371 --- /dev/null +++ b/tests/r_64to32bit/name @@ -0,0 +1 @@ +convert flex_bg 64bit fs to 32bit fs diff --git a/tests/r_64to32bit/script b/tests/r_64to32bit/script new file mode 100644 index 0000000..83a37bd --- /dev/null +++ b/tests/r_64to32bit/script @@ -0,0 +1,75 @@ +if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + +FSCK_OPT=-fn +OUT=$test_name.log +EXP=$test_dir/expect +CONF=$TMPFILE.conf + +gzip -d < $EXP.gz > $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -s" >> $OUT +$RESIZE2FS $TMPFILE -s -f 2>&1 >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' -i $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $EXP + +unset IMAGE FSCK_OPT OUT EXP CONF + +else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped" +fi + diff --git a/tests/r_64to32bit_meta/expect.gz b/tests/r_64to32bit_meta/expect.gz new file mode 100644 index 0000000000000000000000000000000000000000..178d7bf3e0f6db3deb759ee39bd37567a7945dd0 GIT binary patch literal 2920 zcmb7^X*d*&7RQk-W`vr-NDNZhm$7DV2$5}wA=$>h8>RAEs&~8?S;BiUXeN8c%-9W4 zO_nis`AcW;bI5ufIddIj71>38Y7@bb ztd9h^+Naz?pMTA2N9h)O$NWRNp`#zlk3HkjaRX~9moH^Vtlpl9Z z1?4PUs`Z*sx+%5qvoqxN9_afyHF|T9^8R7R&u48jMq9KhpU-7I_8s5M^upt?=0@o! z>{E;T%))kBUtSFCoMN45{Ylb-(k(zm`X(lXjpIf(Z78A+Sd2a9bC-Tv1{bl?)t-ad1y?Y(iD;G$hq)p4&bP<(1dKG52*bAIQxks5{( ztdT#qe1`CT-Vk@Ego(L*whE;%UrioP&O{rg&&++h)7s54S)%mXt38YV(#P6Ly&E?A^)i!{I(Pm{>0Z{4MRtRc z(9byD!Of1|#D%!-nXi^%$-1*9tnI9+qqb-BK6&AX+0v5SjKSy~E((-A^LmlBly$Cp zD4rQhN!7nzdWX@vu&^E+j^KMyuBL0AaBJ2mGOMhAAdPii29u~Gn?S_VCY^C#dY4&( ziGiCp4!{kN-zw&p?bNu;>UW&PSW07>!e9n z($3-Bi6q*KMnmKKCFmF5UV<1h9?_hFKP4}8iDICWG41uDTAU?_<+>Zl7w9)yZ~b$8 zMAcn}pDtH!NaT4$1nQr+z&rxvHR3az)QHJ!018~)`3KsPPg?SE|7j^c3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#)Zsrs=!Y}Hnt%C|qRg!v3bN*Pl$5|7S2FW?wUY_} z*+LbIxN;v0ASo^nBx8n@Q6E(%`rfTU)%~_BC&R<>SrwUS%w~BM%4*mZ?bI5=VE8K4 zQTBXm;wL^hdUz>9T*uhRqDEoSrhKd`(Kvd|xtRYt)P)g*_x`8_dCl?Xa-7KS@0Pbw zym-d=86r4ljrOxNOU$>2y z6cG!aA(K;gdloQK#355lhx{G7&eL?8i{lQ#ri~GLT7+6$Y-RR`UuF8eLJ@xuPIIt9 zal&-MErV$^w03%Jz``A_^XqbXD&RPkD+6B~XE9C;u^t@Bo=Av^b;Of9zt_j}XGq?J z4MP2kLQ?;g5Y1tz4CZbaPjHbvBug{kL$_NRnC-F4I?$cP6jtJGfw%~2pi{8K{nUex1LK#6H zKV!OQgpL(tC2kJCH+-{2r;XQG{ZRay(~t65U3ED?w@x$4OM8xgD1AmsDC(QpB%kn zD7C#4DNa4Qo%ub $EXP + +cat > $CONF << ENDL +[fs_types] + ext4h = { + features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,sparse_super,filetype,dir_index,ext_attr,meta_bg,^resize_inode,64bit + blocksize = 1024 + inode_size = 256 + make_hugefiles = true + hugefiles_dir = / + hugefiles_slack = 0 + hugefiles_name = aaaaa + hugefiles_digits = 4 + hugefiles_size = 1M + zero_hugefiles = false + } +ENDL + +echo "resize2fs test" > $OUT + +MKE2FS_CONFIG=$CONF $MKE2FS -F -T ext4h $TMPFILE 524288 >> $OUT 2>&1 +rm -rf $CONF + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# resize it +echo "resize2fs test.img -s" >> $OUT +$RESIZE2FS $TMPFILE -s -f 2>&1 >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +# dump and check +$DUMPE2FS $TMPFILE 2>&1 | egrep "(GDT|bitmap|descriptor|^Group|Inode table|features)" >> $OUT +$FSCK $FSCK_OPT -N test_filesys $TMPFILE >> $OUT 2>&1 +status=$? +echo Exit status is $status >> $OUT + +rm $TMPFILE + +# +# Do the verification +# + +sed -f $cmd_dir/filter.sed -e "s;$TMPFILE;test.img;" -e 's/test_filesys:.*//g' -i $OUT + +cmp -s $OUT $EXP +status=$? + +if [ "$status" = 0 ] ; then + echo "$test_name: $test_description: ok" + touch $test_name.ok +else + echo "$test_name: $test_description: failed" + diff $DIFF_OPTS $EXP $OUT > $test_name.failed +fi + +rm $EXP + +unset IMAGE FSCK_OPT OUT EXP CONF + +else #if test -x $RESIZE2FS_EXE -a -x $DEBUGFS_EXE; then + echo "$test_name: $test_description: skipped" +fi +