t_grow.sh revision 1.8 1 1.8 riz # $NetBSD: t_grow.sh,v 1.8 2011/01/11 00:50:02 riz Exp $
2 1.1 riz #
3 1.1 riz # Copyright (c) 2010 The NetBSD Foundation, Inc.
4 1.1 riz # All rights reserved.
5 1.1 riz #
6 1.1 riz # This code is derived from software contributed to The NetBSD Foundation
7 1.1 riz # by Jeffrey C. Rizzo.
8 1.1 riz #
9 1.1 riz # Redistribution and use in source and binary forms, with or without
10 1.1 riz # modification, are permitted provided that the following conditions
11 1.1 riz # are met:
12 1.1 riz # 1. Redistributions of source code must retain the above copyright
13 1.1 riz # notice, this list of conditions and the following disclaimer.
14 1.1 riz # 2. Redistributions in binary form must reproduce the above copyright
15 1.1 riz # notice, this list of conditions and the following disclaimer in the
16 1.1 riz # documentation and/or other materials provided with the distribution.
17 1.1 riz #
18 1.1 riz # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 1.1 riz # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 1.1 riz # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 1.1 riz # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 1.1 riz # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 1.1 riz # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 1.1 riz # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 1.1 riz # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 1.1 riz # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 1.1 riz # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 1.1 riz # POSSIBILITY OF SUCH DAMAGE.
29 1.1 riz #
30 1.1 riz
31 1.1 riz
32 1.5 riz # resize_ffs params as follows:
33 1.5 riz # resize_ffs blocksize fragsize fssize newfssize level numdata swap
34 1.1 riz # where 'numdata' is the number of data directories to copy - this is
35 1.1 riz # determined manually based on the maximum number that will fit in the
36 1.1 riz # created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs.
37 1.1 riz # If 'swap' is included, byteswap the fs
38 1.7 riz
39 1.7 riz # v0 == newfs -O0 (4.3BSD layout, ffsv1 superblock)
40 1.7 riz test_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28
41 1.7 riz test_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28
42 1.7 riz test_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29
43 1.7 riz test_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28
44 1.7 riz test_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26
45 1.7 riz # these grow_24M grow a smaller amount; sometimes there's different issues
46 1.7 riz test_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41
47 1.7 riz test_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42
48 1.7 riz test_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43
49 1.7 riz test_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42
50 1.7 riz test_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38
51 1.7 riz test_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55
52 1.7 riz test_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56
53 1.7 riz test_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58
54 1.7 riz test_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56
55 1.7 riz test_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51
56 1.7 riz test_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82
57 1.7 riz test_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84
58 1.7 riz test_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87
59 1.7 riz test_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83
60 1.7 riz test_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76
61 1.7 riz test_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109
62 1.7 riz test_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111
63 1.7 riz test_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115
64 1.7 riz test_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111
65 1.7 riz test_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101
66 1.7 riz
67 1.7 riz # v1 == newfs -O1 (FFSv1, v2 superblock layout)
68 1.5 riz test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28
69 1.5 riz test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28
70 1.5 riz test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29
71 1.5 riz test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28
72 1.5 riz test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26
73 1.1 riz # these grow_24M grow a smaller amount; sometimes there's different issues
74 1.5 riz test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41
75 1.5 riz test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42
76 1.5 riz test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43
77 1.5 riz test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42
78 1.5 riz test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38
79 1.5 riz test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55
80 1.5 riz test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56
81 1.5 riz test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58
82 1.5 riz test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56
83 1.5 riz test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51
84 1.5 riz test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82
85 1.5 riz test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84
86 1.5 riz test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87
87 1.5 riz test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83
88 1.5 riz test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76
89 1.5 riz test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109
90 1.5 riz test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111
91 1.5 riz test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115
92 1.5 riz test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111
93 1.5 riz test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101
94 1.7 riz test_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26
95 1.7 riz test_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28
96 1.7 riz test_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29
97 1.7 riz test_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28
98 1.7 riz test_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25
99 1.8 riz test_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40
100 1.7 riz test_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42
101 1.7 riz test_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43
102 1.7 riz test_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42
103 1.7 riz test_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38
104 1.8 riz test_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53
105 1.7 riz test_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56
106 1.7 riz test_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58
107 1.7 riz test_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56
108 1.7 riz test_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51
109 1.8 riz test_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80
110 1.7 riz test_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84
111 1.7 riz test_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87
112 1.7 riz test_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83
113 1.7 riz test_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76
114 1.8 riz test_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107
115 1.7 riz test_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111
116 1.7 riz test_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115
117 1.7 riz test_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111
118 1.7 riz test_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101
119 1.1 riz
120 1.1 riz atf_test_case grow_ffsv1_partial_cg
121 1.1 riz grow_ffsv1_partial_cg_head()
122 1.1 riz {
123 1.1 riz atf_set "descr" "Checks successful ffsv1 growth by less" \
124 1.1 riz "than a cylinder group"
125 1.1 riz }
126 1.1 riz grow_ffsv1_partial_cg_body()
127 1.1 riz {
128 1.1 riz echo "***resize_ffs grow test"
129 1.1 riz
130 1.1 riz # resize_ffs only supports ffsv1 at the moment
131 1.1 riz atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG}
132 1.1 riz
133 1.1 riz # size to grow to is chosen to cause partial cg
134 1.7 riz atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG}
135 1.1 riz atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
136 1.1 riz }
137 1.1 riz
138 1.1 riz atf_init_test_cases()
139 1.1 riz {
140 1.1 riz setupvars
141 1.7 riz atf_add_test_case grow_16M_v0_8192
142 1.7 riz atf_add_test_case grow_16M_v1_16384
143 1.7 riz atf_add_test_case grow_16M_v2_32768
144 1.7 riz if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
145 1.7 riz atf_add_test_case grow_16M_v0_4096
146 1.7 riz atf_add_test_case grow_16M_v0_16384
147 1.7 riz atf_add_test_case grow_16M_v0_32768
148 1.7 riz atf_add_test_case grow_16M_v0_65536
149 1.1 riz atf_add_test_case grow_16M_v1_4096
150 1.1 riz atf_add_test_case grow_16M_v1_8192
151 1.1 riz atf_add_test_case grow_16M_v1_32768
152 1.1 riz atf_add_test_case grow_16M_v1_65536
153 1.7 riz atf_add_test_case grow_16M_v2_4096
154 1.7 riz atf_add_test_case grow_16M_v2_8192
155 1.7 riz atf_add_test_case grow_16M_v2_16384
156 1.7 riz atf_add_test_case grow_16M_v2_65536
157 1.7 riz atf_add_test_case grow_24M_v0_4096
158 1.7 riz atf_add_test_case grow_24M_v0_8192
159 1.7 riz atf_add_test_case grow_24M_v0_16384
160 1.7 riz atf_add_test_case grow_24M_v0_32768
161 1.7 riz atf_add_test_case grow_24M_v0_65536
162 1.7 riz atf_add_test_case grow_32M_v0_4096
163 1.7 riz atf_add_test_case grow_32M_v0_8192
164 1.7 riz atf_add_test_case grow_32M_v0_16384
165 1.7 riz atf_add_test_case grow_32M_v0_32768
166 1.7 riz atf_add_test_case grow_32M_v0_65536
167 1.7 riz atf_add_test_case grow_48M_v0_4096
168 1.7 riz atf_add_test_case grow_48M_v0_8192
169 1.7 riz atf_add_test_case grow_48M_v0_16384
170 1.7 riz atf_add_test_case grow_48M_v0_32768
171 1.7 riz atf_add_test_case grow_48M_v0_65536
172 1.7 riz atf_add_test_case grow_64M_v0_4096
173 1.7 riz atf_add_test_case grow_64M_v0_8192
174 1.7 riz atf_add_test_case grow_64M_v0_16384
175 1.7 riz atf_add_test_case grow_64M_v0_32768
176 1.7 riz atf_add_test_case grow_64M_v0_65536
177 1.7 riz
178 1.1 riz atf_add_test_case grow_24M_v1_4096
179 1.1 riz atf_add_test_case grow_24M_v1_8192
180 1.1 riz atf_add_test_case grow_24M_v1_16384
181 1.1 riz atf_add_test_case grow_24M_v1_32768
182 1.1 riz atf_add_test_case grow_24M_v1_65536
183 1.1 riz atf_add_test_case grow_32M_v1_4096
184 1.1 riz atf_add_test_case grow_32M_v1_8192
185 1.1 riz atf_add_test_case grow_32M_v1_16384
186 1.1 riz atf_add_test_case grow_32M_v1_32768
187 1.1 riz atf_add_test_case grow_32M_v1_65536
188 1.1 riz atf_add_test_case grow_48M_v1_4096
189 1.1 riz atf_add_test_case grow_48M_v1_8192
190 1.1 riz atf_add_test_case grow_48M_v1_16384
191 1.1 riz atf_add_test_case grow_48M_v1_32768
192 1.1 riz atf_add_test_case grow_48M_v1_65536
193 1.1 riz atf_add_test_case grow_64M_v1_4096
194 1.1 riz atf_add_test_case grow_64M_v1_8192
195 1.1 riz atf_add_test_case grow_64M_v1_16384
196 1.1 riz atf_add_test_case grow_64M_v1_32768
197 1.1 riz atf_add_test_case grow_64M_v1_65536
198 1.7 riz
199 1.7 riz atf_add_test_case grow_24M_v2_4096
200 1.7 riz atf_add_test_case grow_24M_v2_8192
201 1.7 riz atf_add_test_case grow_24M_v2_16384
202 1.7 riz atf_add_test_case grow_24M_v2_32768
203 1.7 riz atf_add_test_case grow_24M_v2_65536
204 1.7 riz atf_add_test_case grow_32M_v2_4096
205 1.7 riz atf_add_test_case grow_32M_v2_8192
206 1.7 riz atf_add_test_case grow_32M_v2_16384
207 1.7 riz atf_add_test_case grow_32M_v2_32768
208 1.7 riz atf_add_test_case grow_32M_v2_65536
209 1.7 riz atf_add_test_case grow_48M_v2_4096
210 1.7 riz atf_add_test_case grow_48M_v2_8192
211 1.7 riz atf_add_test_case grow_48M_v2_16384
212 1.7 riz atf_add_test_case grow_48M_v2_32768
213 1.7 riz atf_add_test_case grow_48M_v2_65536
214 1.7 riz atf_add_test_case grow_64M_v2_4096
215 1.7 riz atf_add_test_case grow_64M_v2_8192
216 1.7 riz atf_add_test_case grow_64M_v2_16384
217 1.7 riz atf_add_test_case grow_64M_v2_32768
218 1.1 riz atf_add_test_case grow_64M_v2_65536
219 1.2 riz fi
220 1.1 riz atf_add_test_case grow_ffsv1_partial_cg
221 1.1 riz }
222