]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / netbsd-tests / sbin / resize_ffs / t_shrink_swapped.sh
1 # $NetBSD: t_shrink_swapped.sh,v 1.1 2011/01/05 02:25:27 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 shrink_24M_16M_v0_4096 resize_ffs 4096 512 49152 32768 0 41 swap
39 test_case shrink_24M_16M_v0_8192 resize_ffs 8192 1024 49152 32768 0 42 swap
40 test_case shrink_24M_16M_v0_16384 resize_ffs 16384 2048 49152 32768 0 43 swap
41 test_case shrink_24M_16M_v0_32768 resize_ffs 32768 4096 49152 32768 0 42 swap
42 test_case shrink_24M_16M_v0_65536 resize_ffs 65536 8192 49152 32768 0 38 swap
43 test_case shrink_32M_24M_v0_4096 resize_ffs 4096 512 65536 49152 0 55 swap
44 test_case shrink_32M_24M_v0_8192 resize_ffs 8192 1024 65536 49152 0 56 swap
45 test_case shrink_32M_24M_v0_16384 resize_ffs 16384 2048 65536 49152 0 58 swap
46 test_case shrink_32M_24M_v0_32768 resize_ffs 32768 4096 65536 49152 0 56 swap
47 test_case_xfail shrink_32M_24M_v0_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 0 51 swap
48 test_case shrink_48M_16M_v0_4096 resize_ffs 4096 512 98304 32768 0 82 swap
49 test_case shrink_48M_16M_v0_8192 resize_ffs 8192 1024 98304 32768 0 84 swap
50 test_case shrink_48M_16M_v0_16384 resize_ffs 16384 2048 98304 32768 0 87 swap
51 test_case shrink_48M_16M_v0_32768 resize_ffs 32768 4096 98304 32768 0 83 swap
52 test_case shrink_48M_16M_v0_65536 resize_ffs 65536 8192 98304 32768 0 76 swap
53 test_case shrink_64M_48M_v0_4096 resize_ffs 4096 512 131072 98304 0 109 swap
54 test_case shrink_64M_48M_v0_8192 resize_ffs 8192 1024 131072 98304 0 111 swap
55 test_case shrink_64M_48M_v0_16384 resize_ffs 16384 2048 131072 98304 0 115 swap
56 test_case shrink_64M_48M_v0_32768 resize_ffs 32768 4096 131072 98304 0 111 swap
57 test_case shrink_64M_48M_v0_65536 resize_ffs 65536 8192 131072 98304 0 101 swap
58
59 test_case shrink_24M_16M_v1_4096 resize_ffs 4096 512 49152 32768 1 41 swap
60 test_case shrink_24M_16M_v1_8192 resize_ffs 8192 1024 49152 32768 1 42 swap
61 test_case shrink_24M_16M_v1_16384 resize_ffs 16384 2048 49152 32768 1 43 swap
62 test_case shrink_24M_16M_v1_32768 resize_ffs 32768 4096 49152 32768 1 42 swap
63 test_case shrink_24M_16M_v1_65536 resize_ffs 65536 8192 49152 32768 1 38 swap
64 test_case shrink_32M_24M_v1_4096 resize_ffs 4096 512 65536 49152 1 55 swap
65 test_case shrink_32M_24M_v1_8192 resize_ffs 8192 1024 65536 49152 1 56 swap
66 test_case shrink_32M_24M_v1_16384 resize_ffs 16384 2048 65536 49152 1 58 swap
67 test_case shrink_32M_24M_v1_32768 resize_ffs 32768 4096 65536 49152 1 56 swap
68 test_case_xfail shrink_32M_24M_v1_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 1 51 swap
69 test_case shrink_48M_16M_v1_4096 resize_ffs 4096 512 98304 32768 1 82 swap
70 test_case shrink_48M_16M_v1_8192 resize_ffs 8192 1024 98304 32768 1 84 swap
71 test_case shrink_48M_16M_v1_16384 resize_ffs 16384 2048 98304 32768 1 87 swap
72 test_case shrink_48M_16M_v1_32768 resize_ffs 32768 4096 98304 32768 1 83 swap
73 test_case shrink_48M_16M_v1_65536 resize_ffs 65536 8192 98304 32768 1 76 swap
74 test_case shrink_64M_48M_v1_4096 resize_ffs 4096 512 131072 98304 1 109 swap
75 test_case shrink_64M_48M_v1_8192 resize_ffs 8192 1024 131072 98304 1 111 swap
76 test_case shrink_64M_48M_v1_16384 resize_ffs 16384 2048 131072 98304 1 115 swap
77 test_case shrink_64M_48M_v1_32768 resize_ffs 32768 4096 131072 98304 1 111 swap
78 test_case shrink_64M_48M_v1_65536 resize_ffs 65536 8192 131072 98304 1 101 swap
79
80 test_case_xfail shrink_24M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 49152 32768 2 41 swap
81 test_case_xfail shrink_24M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 49152 32768 2 42 swap
82 test_case_xfail shrink_24M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 49152 32768 2 43 swap
83 test_case_xfail shrink_24M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 49152 32768 2 42 swap
84 test_case_xfail shrink_24M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 49152 32768 2 38 swap
85 test_case_xfail shrink_32M_24M_v2_4096 "PR bin/44205" resize_ffs 4096 512 65536 49152 2 55 swap
86 test_case_xfail shrink_32M_24M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 65536 49152 2 56 swap
87 test_case_xfail shrink_32M_24M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 65536 49152 2 58 swap
88 test_case_xfail shrink_32M_24M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 65536 49152 2 56 swap
89 test_case_xfail shrink_32M_24M_v2_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 2 51 swap
90 test_case_xfail shrink_48M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 98304 32768 2 82 swap
91 test_case_xfail shrink_48M_16M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 98304 32768 2 84 swap
92 test_case_xfail shrink_48M_16M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 98304 32768 2 87 swap
93 test_case_xfail shrink_48M_16M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 98304 32768 2 83 swap
94 test_case_xfail shrink_48M_16M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 98304 32768 2 76 swap
95 test_case_xfail shrink_64M_48M_v2_4096 "PR bin/44205" resize_ffs 4096 512 131072 98304 2 109 swap
96 test_case_xfail shrink_64M_48M_v2_8192 "PR bin/44205" resize_ffs 8192 1024 131072 98304 2 111 swap
97 test_case_xfail shrink_64M_48M_v2_16384 "PR bin/44205" resize_ffs 16384 2048 131072 98304 2 115 swap
98 test_case_xfail shrink_64M_48M_v2_32768 "PR bin/44205" resize_ffs 32768 4096 131072 98304 2 111 swap
99 test_case_xfail shrink_64M_48M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 98304 2 101 swap
100
101
102 atf_test_case shrink_ffsv1_partial_cg
103 shrink_ffsv1_partial_cg_head()
104 {
105         atf_set "descr" "Checks successful shrinkage of ffsv1 by" \
106                         "less than a cylinder group"
107 }
108 shrink_ffsv1_partial_cg_body()
109 {
110         echo "*** resize_ffs shrinkage partial cg test"
111
112         atf_check -o ignore -e ignore newfs -V1 -F -s 5760 ${IMG}
113
114         # shrink so there's a partial cg at the end
115         atf_check -s exit:0 resize_ffs -s 4000 -y ${IMG}
116         atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
117 }
118
119 atf_init_test_cases()
120 {
121         setupvars
122         atf_add_test_case shrink_24M_16M_v0_4096
123         atf_add_test_case shrink_24M_16M_v1_8192
124         atf_add_test_case shrink_24M_16M_v2_16384
125 if [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
126         atf_add_test_case shrink_24M_16M_v0_8192
127         atf_add_test_case shrink_24M_16M_v0_16384
128         atf_add_test_case shrink_24M_16M_v0_32768
129         atf_add_test_case shrink_24M_16M_v0_65536
130         atf_add_test_case shrink_24M_16M_v1_4096
131         atf_add_test_case shrink_24M_16M_v1_16384
132         atf_add_test_case shrink_24M_16M_v1_32768
133         atf_add_test_case shrink_24M_16M_v1_65536
134         atf_add_test_case shrink_24M_16M_v2_4096
135         atf_add_test_case shrink_24M_16M_v2_8192
136         atf_add_test_case shrink_24M_16M_v2_32768
137         atf_add_test_case shrink_24M_16M_v2_65536
138         atf_add_test_case shrink_32M_24M_v0_4096
139         atf_add_test_case shrink_32M_24M_v0_8192
140         atf_add_test_case shrink_32M_24M_v0_16384
141         atf_add_test_case shrink_32M_24M_v0_32768
142         atf_add_test_case shrink_32M_24M_v0_65536
143         atf_add_test_case shrink_48M_16M_v0_4096
144         atf_add_test_case shrink_48M_16M_v0_8192
145         atf_add_test_case shrink_48M_16M_v0_16384
146         atf_add_test_case shrink_48M_16M_v0_32768
147         atf_add_test_case shrink_48M_16M_v0_65536
148         atf_add_test_case shrink_64M_48M_v0_4096
149         atf_add_test_case shrink_64M_48M_v0_8192
150         atf_add_test_case shrink_64M_48M_v0_16384
151         atf_add_test_case shrink_64M_48M_v0_32768
152         atf_add_test_case shrink_64M_48M_v0_65536
153         atf_add_test_case shrink_32M_24M_v1_4096
154         atf_add_test_case shrink_32M_24M_v1_8192
155         atf_add_test_case shrink_32M_24M_v1_16384
156         atf_add_test_case shrink_32M_24M_v1_32768
157         atf_add_test_case shrink_32M_24M_v1_65536
158         atf_add_test_case shrink_48M_16M_v1_4096
159         atf_add_test_case shrink_48M_16M_v1_8192
160         atf_add_test_case shrink_48M_16M_v1_16384
161         atf_add_test_case shrink_48M_16M_v1_32768
162         atf_add_test_case shrink_48M_16M_v1_65536
163         atf_add_test_case shrink_64M_48M_v1_4096
164         atf_add_test_case shrink_64M_48M_v1_8192
165         atf_add_test_case shrink_64M_48M_v1_16384
166         atf_add_test_case shrink_64M_48M_v1_32768
167         atf_add_test_case shrink_64M_48M_v1_65536
168         atf_add_test_case shrink_32M_24M_v2_4096
169         atf_add_test_case shrink_32M_24M_v2_8192
170         atf_add_test_case shrink_32M_24M_v2_16384
171         atf_add_test_case shrink_32M_24M_v2_32768
172         atf_add_test_case shrink_32M_24M_v2_65536
173         atf_add_test_case shrink_48M_16M_v2_4096
174         atf_add_test_case shrink_48M_16M_v2_8192
175         atf_add_test_case shrink_48M_16M_v2_16384
176         atf_add_test_case shrink_48M_16M_v2_32768
177         atf_add_test_case shrink_48M_16M_v2_65536
178         atf_add_test_case shrink_64M_48M_v2_4096
179         atf_add_test_case shrink_64M_48M_v2_8192
180         atf_add_test_case shrink_64M_48M_v2_16384
181         atf_add_test_case shrink_64M_48M_v2_32768
182         atf_add_test_case shrink_64M_48M_v2_65536
183 fi
184         atf_add_test_case shrink_ffsv1_partial_cg
185 }