Home | History | Annotate | Line # | Download | only in resize_ffs
      1 # $NetBSD: t_grow.sh,v 1.9 2015/03/29 19:37:02 chopps 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 
     39 # v0 == newfs -O0  (4.3BSD layout, ffsv1 superblock)
     40 test_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28
     41 test_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28
     42 test_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29
     43 test_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28
     44 test_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26
     45 # these grow_24M grow a smaller amount; sometimes there's different issues
     46 test_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41
     47 test_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42
     48 test_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43
     49 test_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42
     50 test_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38
     51 test_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55
     52 test_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56
     53 test_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58
     54 test_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56
     55 test_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51
     56 test_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82
     57 test_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84
     58 test_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87
     59 test_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83
     60 test_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76
     61 test_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109
     62 test_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111
     63 test_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115
     64 test_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111
     65 test_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101
     66 
     67 # v1 == newfs -O1 (FFSv1, v2 superblock layout)
     68 test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28
     69 test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28
     70 test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29
     71 test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28
     72 test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26
     73 # these grow_24M grow a smaller amount; sometimes there's different issues
     74 test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41
     75 test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42
     76 test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43
     77 test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42
     78 test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38
     79 test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55
     80 test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56
     81 test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58
     82 test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56
     83 test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51
     84 test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82
     85 test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84
     86 test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87
     87 test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83
     88 test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76
     89 test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109
     90 test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111
     91 test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115
     92 test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111
     93 test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101
     94 test_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26
     95 test_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28
     96 test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29
     97 test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28
     98 test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25
     99 test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40
    100 test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42
    101 test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43
    102 test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42
    103 test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38
    104 test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53
    105 test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56
    106 test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58
    107 test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56
    108 test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51
    109 test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80
    110 test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84
    111 test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87
    112 test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83
    113 test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76
    114 test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107
    115 test_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111
    116 test_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115
    117 test_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111
    118 test_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101
    119 
    120 atf_test_case grow_ffsv1_partial_cg
    121 grow_ffsv1_partial_cg_head()
    122 {
    123 	atf_set "descr" "Checks successful ffsv1 growth by less" \
    124 			"than a cylinder group"
    125 }
    126 grow_ffsv1_partial_cg_body()
    127 {
    128 	echo "***resize_ffs grow test"
    129 
    130 	# resize_ffs only supports ffsv1 at the moment
    131 	atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG}
    132 
    133 	# size to grow to is chosen to cause partial cg
    134 	atf_check -s exit:0 -o ignore resize_ffs -c -y -s 5760 ${IMG}
    135 	atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG}
    136 	atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
    137 	atf_check -s exit:1 -o ignore resize_ffs -c -y -s 5760 ${IMG}
    138 }
    139 
    140 atf_init_test_cases()
    141 {
    142 	setupvars
    143 	atf_add_test_case grow_16M_v0_8192
    144 	atf_add_test_case grow_16M_v1_16384
    145 	atf_add_test_case grow_16M_v2_32768
    146 if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
    147 	atf_add_test_case grow_16M_v0_4096
    148 	atf_add_test_case grow_16M_v0_16384
    149 	atf_add_test_case grow_16M_v0_32768
    150 	atf_add_test_case grow_16M_v0_65536
    151 	atf_add_test_case grow_16M_v1_4096
    152 	atf_add_test_case grow_16M_v1_8192
    153 	atf_add_test_case grow_16M_v1_32768
    154 	atf_add_test_case grow_16M_v1_65536
    155 	atf_add_test_case grow_16M_v2_4096
    156 	atf_add_test_case grow_16M_v2_8192
    157 	atf_add_test_case grow_16M_v2_16384
    158 	atf_add_test_case grow_16M_v2_65536
    159 	atf_add_test_case grow_24M_v0_4096
    160 	atf_add_test_case grow_24M_v0_8192
    161 	atf_add_test_case grow_24M_v0_16384
    162 	atf_add_test_case grow_24M_v0_32768
    163 	atf_add_test_case grow_24M_v0_65536
    164 	atf_add_test_case grow_32M_v0_4096
    165 	atf_add_test_case grow_32M_v0_8192
    166 	atf_add_test_case grow_32M_v0_16384
    167 	atf_add_test_case grow_32M_v0_32768
    168 	atf_add_test_case grow_32M_v0_65536
    169 	atf_add_test_case grow_48M_v0_4096
    170 	atf_add_test_case grow_48M_v0_8192
    171 	atf_add_test_case grow_48M_v0_16384
    172 	atf_add_test_case grow_48M_v0_32768
    173 	atf_add_test_case grow_48M_v0_65536
    174 	atf_add_test_case grow_64M_v0_4096
    175 	atf_add_test_case grow_64M_v0_8192
    176 	atf_add_test_case grow_64M_v0_16384
    177 	atf_add_test_case grow_64M_v0_32768
    178 	atf_add_test_case grow_64M_v0_65536
    179 
    180 	atf_add_test_case grow_24M_v1_4096
    181 	atf_add_test_case grow_24M_v1_8192
    182 	atf_add_test_case grow_24M_v1_16384
    183 	atf_add_test_case grow_24M_v1_32768
    184 	atf_add_test_case grow_24M_v1_65536
    185 	atf_add_test_case grow_32M_v1_4096
    186 	atf_add_test_case grow_32M_v1_8192
    187 	atf_add_test_case grow_32M_v1_16384
    188 	atf_add_test_case grow_32M_v1_32768
    189 	atf_add_test_case grow_32M_v1_65536
    190 	atf_add_test_case grow_48M_v1_4096
    191 	atf_add_test_case grow_48M_v1_8192
    192 	atf_add_test_case grow_48M_v1_16384
    193 	atf_add_test_case grow_48M_v1_32768
    194 	atf_add_test_case grow_48M_v1_65536
    195 	atf_add_test_case grow_64M_v1_4096
    196 	atf_add_test_case grow_64M_v1_8192
    197 	atf_add_test_case grow_64M_v1_16384
    198 	atf_add_test_case grow_64M_v1_32768
    199 	atf_add_test_case grow_64M_v1_65536
    200 
    201 	atf_add_test_case grow_24M_v2_4096
    202 	atf_add_test_case grow_24M_v2_8192
    203 	atf_add_test_case grow_24M_v2_16384
    204 	atf_add_test_case grow_24M_v2_32768
    205 	atf_add_test_case grow_24M_v2_65536
    206 	atf_add_test_case grow_32M_v2_4096
    207 	atf_add_test_case grow_32M_v2_8192
    208 	atf_add_test_case grow_32M_v2_16384
    209 	atf_add_test_case grow_32M_v2_32768
    210 	atf_add_test_case grow_32M_v2_65536
    211 	atf_add_test_case grow_48M_v2_4096
    212 	atf_add_test_case grow_48M_v2_8192
    213 	atf_add_test_case grow_48M_v2_16384
    214 	atf_add_test_case grow_48M_v2_32768
    215 	atf_add_test_case grow_48M_v2_65536
    216 	atf_add_test_case grow_64M_v2_4096
    217 	atf_add_test_case grow_64M_v2_8192
    218 	atf_add_test_case grow_64M_v2_16384
    219 	atf_add_test_case grow_64M_v2_32768
    220 	atf_add_test_case grow_64M_v2_65536
    221 fi
    222 	atf_add_test_case grow_ffsv1_partial_cg
    223 }
    224