Home | History | Annotate | Line # | Download | only in resize_ffs
t_grow.sh revision 1.5
      1 # $NetBSD: t_grow.sh,v 1.5 2010/12/16 17:16:07 riz Exp $
      2 #
      3 # Copyright (c) 2010 The NetBSD Foundation, Inc.
      4 # All rights reserved.
      5 #
      6 # This code is derived from software contributed to The NetBSD Foundation
      7 # by Jeffrey C. Rizzo.
      8 #
      9 # Redistribution and use in source and binary forms, with or without
     10 # modification, are permitted provided that the following conditions
     11 # are met:
     12 # 1. Redistributions of source code must retain the above copyright
     13 #    notice, this list of conditions and the following disclaimer.
     14 # 2. Redistributions in binary form must reproduce the above copyright
     15 #    notice, this list of conditions and the following disclaimer in the
     16 #    documentation and/or other materials provided with the distribution.
     17 #
     18 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     19 # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     20 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     21 # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     22 # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     23 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     24 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     26 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     27 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     28 # POSSIBILITY OF SUCH DAMAGE.
     29 #
     30 
     31 
     32 # resize_ffs params as follows:
     33 # resize_ffs blocksize fragsize fssize newfssize level numdata swap
     34 # where 'numdata' is the number of data directories to copy - this is
     35 # determined manually based on the maximum number that will fit in the
     36 # created fs.  'level' is the fs-level (-O 0,1,2) passed to newfs.
     37 # If 'swap' is included, byteswap the fs
     38 test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28
     39 test_case_xfail grow_16M_v1_4096_swapped "PR bin/44203" resize_ffs 4096 512 32768 131072 1 28 swap
     40 test_case_xfail grow_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 32768 131072 2 28
     41 test_case_xfail grow_16M_v2_4096_swapped "PR bin/44203, PR bin/44205" resize_ffs 4096 512 32768 131072 2 28 swap
     42 test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28
     43 test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29
     44 test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28
     45 test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26
     46 # these grow_24M grow a smaller amount; sometimes there's different issues
     47 test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41
     48 test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42
     49 test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43
     50 test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42
     51 test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38
     52 test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55
     53 test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56
     54 test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58
     55 test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56
     56 test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51
     57 test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82
     58 test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84
     59 test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87
     60 test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83
     61 test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76
     62 test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109
     63 test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111
     64 test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115
     65 test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111
     66 test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101
     67 test_case_xfail grow_64M_v1_65536_swapped "PR bin/44203" resize_ffs 65536 8192 131072 262144 1 101 swap
     68 test_case_xfail grow_64M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 262144 2 101
     69 test_case_xfail grow_64M_v2_65536_swapped "PR bin/44203, PR bin/44205" resize_ffs 65536 8192 131072 262144 2 101 swap
     70 
     71 atf_test_case grow_ffsv1_partial_cg
     72 grow_ffsv1_partial_cg_head()
     73 {
     74 	atf_set "descr" "Checks successful ffsv1 growth by less" \
     75 			"than a cylinder group"
     76 }
     77 grow_ffsv1_partial_cg_body()
     78 {
     79 	echo "***resize_ffs grow test"
     80 
     81 	# resize_ffs only supports ffsv1 at the moment
     82 	atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG}
     83 
     84 	# size to grow to is chosen to cause partial cg
     85 	atf_check -s exit:0 resize_ffs -y -s 5760 ${IMG}
     86 	atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
     87 }
     88 
     89 atf_init_test_cases()
     90 {
     91 	setupvars
     92 	atf_add_test_case grow_16M_v1_4096
     93 	atf_add_test_case grow_16M_v1_4096_swapped
     94 	atf_add_test_case grow_16M_v2_4096
     95 	atf_add_test_case grow_16M_v2_4096_swapped
     96 	atf_add_test_case grow_16M_v1_8192
     97 	atf_add_test_case grow_16M_v1_16384
     98 	atf_add_test_case grow_16M_v1_32768
     99 	atf_add_test_case grow_16M_v1_65536
    100 	atf_add_test_case grow_24M_v1_4096
    101 	atf_add_test_case grow_24M_v1_8192
    102 	atf_add_test_case grow_24M_v1_16384
    103 	atf_add_test_case grow_24M_v1_32768
    104 	atf_add_test_case grow_24M_v1_65536
    105 	atf_add_test_case grow_32M_v1_4096
    106 	atf_add_test_case grow_32M_v1_8192
    107 	atf_add_test_case grow_32M_v1_16384
    108 	atf_add_test_case grow_32M_v1_32768
    109 	atf_add_test_case grow_32M_v1_65536
    110 if [ "X${RESIZE_FFS_BIG_TESTS}" != "X" ]; then
    111 	atf_add_test_case grow_48M_v1_4096
    112 	atf_add_test_case grow_48M_v1_8192
    113 	atf_add_test_case grow_48M_v1_16384
    114 	atf_add_test_case grow_48M_v1_32768
    115 	atf_add_test_case grow_48M_v1_65536
    116 	atf_add_test_case grow_64M_v1_4096
    117 	atf_add_test_case grow_64M_v1_8192
    118 	atf_add_test_case grow_64M_v1_16384
    119 	atf_add_test_case grow_64M_v1_32768
    120 	atf_add_test_case grow_64M_v1_65536
    121 	atf_add_test_case grow_64M_v1_65536_swapped
    122 	atf_add_test_case grow_64M_v2_65536
    123 	atf_add_test_case grow_64M_v2_65536_swapped
    124 fi
    125 	atf_add_test_case grow_ffsv1_partial_cg
    126 }
    127