t_grow.sh revision 1.5 1 1.5 riz # $NetBSD: t_grow.sh,v 1.5 2010/12/16 17:16:07 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.5 riz test_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28
39 1.5 riz test_case_xfail grow_16M_v1_4096_swapped "PR bin/44203" resize_ffs 4096 512 32768 131072 1 28 swap
40 1.5 riz test_case_xfail grow_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 32768 131072 2 28
41 1.5 riz test_case_xfail grow_16M_v2_4096_swapped "PR bin/44203, PR bin/44205" resize_ffs 4096 512 32768 131072 2 28 swap
42 1.5 riz test_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28
43 1.5 riz test_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29
44 1.5 riz test_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28
45 1.5 riz test_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26
46 1.1 riz # these grow_24M grow a smaller amount; sometimes there's different issues
47 1.5 riz test_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41
48 1.5 riz test_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42
49 1.5 riz test_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43
50 1.5 riz test_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42
51 1.5 riz test_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38
52 1.5 riz test_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55
53 1.5 riz test_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56
54 1.5 riz test_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58
55 1.5 riz test_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56
56 1.5 riz test_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51
57 1.5 riz test_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82
58 1.5 riz test_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84
59 1.5 riz test_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87
60 1.5 riz test_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83
61 1.5 riz test_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76
62 1.5 riz test_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109
63 1.5 riz test_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111
64 1.5 riz test_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115
65 1.5 riz test_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111
66 1.5 riz test_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101
67 1.5 riz test_case_xfail grow_64M_v1_65536_swapped "PR bin/44203" resize_ffs 65536 8192 131072 262144 1 101 swap
68 1.5 riz test_case_xfail grow_64M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 262144 2 101
69 1.5 riz test_case_xfail grow_64M_v2_65536_swapped "PR bin/44203, PR bin/44205" resize_ffs 65536 8192 131072 262144 2 101 swap
70 1.1 riz
71 1.1 riz atf_test_case grow_ffsv1_partial_cg
72 1.1 riz grow_ffsv1_partial_cg_head()
73 1.1 riz {
74 1.1 riz atf_set "descr" "Checks successful ffsv1 growth by less" \
75 1.1 riz "than a cylinder group"
76 1.1 riz }
77 1.1 riz grow_ffsv1_partial_cg_body()
78 1.1 riz {
79 1.1 riz echo "***resize_ffs grow test"
80 1.1 riz
81 1.1 riz # resize_ffs only supports ffsv1 at the moment
82 1.1 riz atf_check -o ignore -e ignore newfs -V1 -s 4000 -F ${IMG}
83 1.1 riz
84 1.1 riz # size to grow to is chosen to cause partial cg
85 1.1 riz atf_check -s exit:0 resize_ffs -y -s 5760 ${IMG}
86 1.1 riz atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
87 1.1 riz }
88 1.1 riz
89 1.1 riz atf_init_test_cases()
90 1.1 riz {
91 1.1 riz setupvars
92 1.1 riz atf_add_test_case grow_16M_v1_4096
93 1.2 riz atf_add_test_case grow_16M_v1_4096_swapped
94 1.2 riz atf_add_test_case grow_16M_v2_4096
95 1.2 riz atf_add_test_case grow_16M_v2_4096_swapped
96 1.1 riz atf_add_test_case grow_16M_v1_8192
97 1.1 riz atf_add_test_case grow_16M_v1_16384
98 1.1 riz atf_add_test_case grow_16M_v1_32768
99 1.1 riz atf_add_test_case grow_16M_v1_65536
100 1.1 riz atf_add_test_case grow_24M_v1_4096
101 1.1 riz atf_add_test_case grow_24M_v1_8192
102 1.1 riz atf_add_test_case grow_24M_v1_16384
103 1.1 riz atf_add_test_case grow_24M_v1_32768
104 1.1 riz atf_add_test_case grow_24M_v1_65536
105 1.1 riz atf_add_test_case grow_32M_v1_4096
106 1.1 riz atf_add_test_case grow_32M_v1_8192
107 1.1 riz atf_add_test_case grow_32M_v1_16384
108 1.1 riz atf_add_test_case grow_32M_v1_32768
109 1.1 riz atf_add_test_case grow_32M_v1_65536
110 1.2 riz if [ "X${RESIZE_FFS_BIG_TESTS}" != "X" ]; then
111 1.1 riz atf_add_test_case grow_48M_v1_4096
112 1.1 riz atf_add_test_case grow_48M_v1_8192
113 1.1 riz atf_add_test_case grow_48M_v1_16384
114 1.1 riz atf_add_test_case grow_48M_v1_32768
115 1.1 riz atf_add_test_case grow_48M_v1_65536
116 1.1 riz atf_add_test_case grow_64M_v1_4096
117 1.1 riz atf_add_test_case grow_64M_v1_8192
118 1.1 riz atf_add_test_case grow_64M_v1_16384
119 1.1 riz atf_add_test_case grow_64M_v1_32768
120 1.1 riz atf_add_test_case grow_64M_v1_65536
121 1.1 riz atf_add_test_case grow_64M_v1_65536_swapped
122 1.1 riz atf_add_test_case grow_64M_v2_65536
123 1.1 riz atf_add_test_case grow_64M_v2_65536_swapped
124 1.2 riz fi
125 1.1 riz atf_add_test_case grow_ffsv1_partial_cg
126 1.1 riz }
127