Module Name: src Committed By: riz Date: Fri Dec 3 05:23:46 UTC 2010
Modified Files: src/tests/sbin/resize_ffs: t_resize_ffs.sh Log Message: Cause the tests to use plain files instead of vnd; for the kinds of tests being done, vnd isn't needed and adds a potential resource conflict issue on the system running the test. As a bonus, the tests run faster because less data is being shuffled around. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/sbin/resize_ffs/t_resize_ffs.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/sbin/resize_ffs/t_resize_ffs.sh diff -u src/tests/sbin/resize_ffs/t_resize_ffs.sh:1.3 src/tests/sbin/resize_ffs/t_resize_ffs.sh:1.4 --- src/tests/sbin/resize_ffs/t_resize_ffs.sh:1.3 Fri Dec 3 04:10:36 2010 +++ src/tests/sbin/resize_ffs/t_resize_ffs.sh Fri Dec 3 05:23:46 2010 @@ -1,4 +1,4 @@ -# $NetBSD: t_resize_ffs.sh,v 1.3 2010/12/03 04:10:36 riz Exp $ +# $NetBSD: t_resize_ffs.sh,v 1.4 2010/12/03 05:23:46 riz Exp $ # # Copyright (c) 2010 The NetBSD Foundation, Inc. # All rights reserved. @@ -33,139 +33,75 @@ # misc routines -atf_test_case grow_ffsv1_partial_cg cleanup +atf_test_case grow_ffsv1_partial_cg grow_ffsv1_partial_cg_head() { atf_set "descr" "Checks successful ffsv1 growth by less" \ "than a cylinder group" - atf_set "require.user" "root" } grow_ffsv1_partial_cg_body() { - cat >disktab <<EOF -floppy288|2.88MB 3.5in Extra High Density Floppy:\ - :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ - :pa#5760:oa#0:ba#4096:fa#512:ta=4.2BSD:\ - :pb#5760:ob#0:\ - :pc#5760:oc#0: -EOF - echo "***resize_ffs grow test" - atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} count=5860 - atf_check -o ignore -e ignore vnconfig -v ${VND} ${IMG} - atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} floppy288 # resize_ffs only supports ffsv1 at the moment - atf_check -o ignore -e ignore newfs -V1 -s 4000 /dev/r${VND}a + atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG} - # grow the fs to the full partition size (5760) - atf_check -s exit:0 resize_ffs -y /dev/r${VND}a - atf_check -s exit:0 -o ignore fsck -f -n /dev/r${VND}a -} -grow_ffsv1_partial_cg_cleanup() -{ - vnconfig -u ${VND} + # size to grow to is chosen to cause partial cg + atf_check -s exit:0 resize_ffs -y -s 5760 ${IMG} + atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG} } -atf_test_case grow_ffsv1_64k cleanup +atf_test_case grow_ffsv1_64k grow_ffsv1_64k_head() { atf_set "descr" "Checks successful ffsv1 growth with 64k blocksize" - atf_set "require.user" "root" } grow_ffsv1_64k_body() { - cat >disktab <<EOF -disk64M|64MB test disk:\ - :ty=test:se#512:nt#64:ns#32:nc#64:\ - :pa#131072:oa#0:ba#65536:fa#8192:ta=4.2BSD:\ - :pc#131072:oc#0:\ - :pd#131072:od#0: -EOF - echo "***resize_ffs grow 64k block test" - atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} count=131072 - atf_check -o ignore -e ignore vnconfig -v ${VND} ${IMG} - atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} disk64M atf_check -o ignore -e ignore newfs -V1 -b 65536 -f 8192 \ - -s 32768 /dev/r${VND}a + -s 32768 -F ${IMG} # grow the fs to the full partition size (131072) - atf_check -s exit:0 resize_ffs -y /dev/r${VND}a - atf_check -s exit:0 -o ignore fsck -f -n /dev/r${VND}a - atf_check -o match:'size[[:space:]]*8192' dumpfs /dev/r${VND}a -} -grow_ffsv1_64k_cleanup() -{ - vnconfig -u ${VND} + atf_check -s exit:0 resize_ffs -y -s 131072 ${IMG} + atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG} + atf_check -o match:'size[[:space:]]*8192' dumpfs ${IMG} } -atf_test_case shrink_ffsv1_64k cleanup +atf_test_case shrink_ffsv1_64k shrink_ffsv1_64k_head() { atf_set "descr" "Checks successful ffsv1 shrinkage with 64k blocksize" - atf_set "require.user" "root" } shrink_ffsv1_64k_body() { - cat >disktab <<EOF -disk64M|64MB test disk:\ - :ty=test:se#512:nt#64:ns#32:nc#64:\ - :pa#131072:oa#0:ba#65536:fa#8192:ta=4.2BSD:\ - :pc#131072:oc#0:\ - :pd#131072:od#0: -EOF - echo "***resize_ffs shrink 64k block test" - atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} count=131072 - atf_check -o ignore -e ignore vnconfig -v ${VND} ${IMG} - atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} disk64M - atf_check -o ignore -e ignore newfs -V1 -b 65536 -f 8192 /dev/r${VND}a + atf_check -o ignore -e ignore newfs -V1 -b 65536 -f 8192 -s 131072 \ + -F ${IMG} # shrink it to half size - atf_check -s exit:0 resize_ffs -y -s 65536 /dev/r${VND}a - atf_check -s exit:0 -o ignore fsck -f -n /dev/r${VND}a - atf_check -o match:'size[[:space:]]*4096' dumpfs /dev/r${VND}a -} -shrink_ffsv1_64k_cleanup() -{ - vnconfig -u ${VND} + atf_check -s exit:0 resize_ffs -y -s 65536 ${IMG} + atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG} + atf_check -o match:'size[[:space:]]*4096' dumpfs ${IMG} } -atf_test_case shrink_ffsv1_partial_cg cleanup +atf_test_case shrink_ffsv1_partial_cg shrink_ffsv1_partial_cg_head() { atf_set "descr" "Checks successful shrinkage of ffsv1 by" \ "less than a cylinder group" - atf_set "require.user" "root" } shrink_ffsv1_partial_cg_body() { - cat >disktab <<EOF -floppy288|2.88MB 3.5in Extra High Density Floppy:\ - :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ - :pa#5760:oa#0:ba#4096:fa#512:ta=4.2BSD:\ - :pb#5760:ob#0:\ - :pc#5760:oc#0: -EOF - echo "*** resize_ffs shrinkage partial cg test" - atf_check -o ignore -e ignore dd if=/dev/zero of=${IMG} count=5860 - atf_check -o ignore -e ignore vnconfig -v ${VND} ${IMG} - atf_check -o ignore -e ignore disklabel -f disktab -rw ${VND} floppy288 - atf_check -o ignore -e ignore newfs -V1 /dev/r${VND}a - - # shrink the fs to something smaller. Would be better to have - # data in there, but one step at a time - atf_check -s exit:0 resize_ffs -s 4000 -y /dev/r${VND}a - atf_check -s exit:0 -o ignore fsck -f -n /dev/r${VND}a -} -shrink_ffsv1_partial_cg_cleanup() -{ - vnconfig -u ${VND} + atf_check -o ignore -e ignore newfs -V1 -F -s 5760 ${IMG} + + # shrink so there's a partial cg at the end + atf_check -s exit:0 resize_ffs -s 4000 -y ${IMG} + atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG} } atf_init_test_cases()