t_shrink.sh revision 1.5 1 1.5 riz # $NetBSD: t_shrink.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 shrink_24M_16M_v1_4096 resize_ffs 4096 512 49152 32768 1 41
39 1.5 riz test_case_xfail shrink_24M_16M_v1_4096_swapped "PR bin/44203" resize_ffs 4096 512 49152 32768 1 41 swap
40 1.5 riz test_case_xfail shrink_24M_16M_v2_4096 "PR bin/44205" resize_ffs 4096 512 49152 32768 2 41 swap
41 1.5 riz test_case_xfail shrink_24M_16M_v2_4096_swapped "PR bin/44203, PR bin/44205" resize_ffs 4096 512 49152 32768 2 41 swap
42 1.5 riz test_case shrink_24M_16M_v1_8192 resize_ffs 8192 1024 49152 32768 1 42
43 1.5 riz test_case shrink_24M_16M_v1_16384 resize_ffs 16384 2048 49152 32768 1 43
44 1.5 riz test_case shrink_24M_16M_v1_32768 resize_ffs 32768 4096 49152 32768 1 42
45 1.5 riz test_case shrink_24M_16M_v1_65536 resize_ffs 65536 8192 49152 32768 1 38
46 1.5 riz test_case shrink_32M_24M_v1_4096 resize_ffs 4096 512 65536 49152 1 55
47 1.5 riz test_case shrink_32M_24M_v1_8192 resize_ffs 8192 1024 65536 49152 1 56
48 1.5 riz test_case shrink_32M_24M_v1_16384 resize_ffs 16384 2048 65536 49152 1 58
49 1.5 riz test_case shrink_32M_24M_v1_32768 resize_ffs 32768 4096 65536 49152 1 56
50 1.5 riz test_case_xfail shrink_32M_24M_v1_65536 "PR bin/44204" resize_ffs 65536 8192 65536 49152 1 51
51 1.1 riz # 48M -> 16M is a bigger shrink, relatively
52 1.5 riz test_case shrink_48M_16M_v1_4096 resize_ffs 4096 512 98304 32768 1 82
53 1.5 riz test_case shrink_48M_16M_v1_8192 resize_ffs 8192 1024 98304 32768 1 84
54 1.5 riz test_case shrink_48M_16M_v1_16384 resize_ffs 16384 2048 98304 32768 1 87
55 1.5 riz test_case shrink_48M_16M_v1_32768 resize_ffs 32768 4096 98304 32768 1 83
56 1.5 riz test_case shrink_48M_16M_v1_65536 resize_ffs 65536 8192 98304 32768 1 76
57 1.5 riz test_case shrink_64M_48M_v1_4096 resize_ffs 4096 512 131072 98304 1 109
58 1.5 riz test_case shrink_64M_48M_v1_8192 resize_ffs 8192 1024 131072 98304 1 111
59 1.5 riz test_case shrink_64M_48M_v1_16384 resize_ffs 16384 2048 131072 98304 1 115
60 1.5 riz test_case shrink_64M_48M_v1_32768 resize_ffs 32768 4096 131072 98304 1 111
61 1.5 riz test_case shrink_64M_48M_v1_65536 resize_ffs 65536 8192 131072 98304 1 101
62 1.5 riz test_case_xfail shrink_64M_48M_v1_65536_swapped "PR bin/44203" resize_ffs 65536 8192 131072 98304 1 101 swap
63 1.5 riz test_case_xfail shrink_64M_48M_v2_65536 "PR bin/44205" resize_ffs 65536 8192 131072 98304 2 101
64 1.5 riz test_case_xfail shrink_64M_48M_v2_65536_swapped "PR bin/44203, PR bin/44205" resize_ffs 65536 8192 131072 98304 2 101 swap
65 1.1 riz
66 1.1 riz atf_test_case shrink_ffsv1_partial_cg
67 1.1 riz shrink_ffsv1_partial_cg_head()
68 1.1 riz {
69 1.1 riz atf_set "descr" "Checks successful shrinkage of ffsv1 by" \
70 1.1 riz "less than a cylinder group"
71 1.1 riz }
72 1.1 riz shrink_ffsv1_partial_cg_body()
73 1.1 riz {
74 1.1 riz echo "*** resize_ffs shrinkage partial cg test"
75 1.1 riz
76 1.1 riz atf_check -o ignore -e ignore newfs -V1 -F -s 5760 ${IMG}
77 1.1 riz
78 1.1 riz # shrink so there's a partial cg at the end
79 1.1 riz atf_check -s exit:0 resize_ffs -s 4000 -y ${IMG}
80 1.1 riz atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
81 1.1 riz }
82 1.1 riz
83 1.1 riz atf_init_test_cases()
84 1.1 riz {
85 1.1 riz setupvars
86 1.1 riz atf_add_test_case shrink_24M_16M_v1_4096
87 1.2 riz atf_add_test_case shrink_24M_16M_v1_4096_swapped
88 1.2 riz atf_add_test_case shrink_24M_16M_v2_4096
89 1.2 riz atf_add_test_case shrink_24M_16M_v2_4096_swapped
90 1.1 riz atf_add_test_case shrink_24M_16M_v1_8192
91 1.1 riz atf_add_test_case shrink_24M_16M_v1_16384
92 1.1 riz atf_add_test_case shrink_24M_16M_v1_32768
93 1.1 riz atf_add_test_case shrink_24M_16M_v1_65536
94 1.1 riz atf_add_test_case shrink_32M_24M_v1_4096
95 1.1 riz atf_add_test_case shrink_32M_24M_v1_8192
96 1.1 riz atf_add_test_case shrink_32M_24M_v1_16384
97 1.1 riz atf_add_test_case shrink_32M_24M_v1_32768
98 1.1 riz atf_add_test_case shrink_32M_24M_v1_65536
99 1.2 riz if [ "X${RESIZE_FFS_BIG_TESTS}" != "X" ]; then
100 1.1 riz atf_add_test_case shrink_48M_16M_v1_4096
101 1.1 riz atf_add_test_case shrink_48M_16M_v1_8192
102 1.1 riz atf_add_test_case shrink_48M_16M_v1_16384
103 1.1 riz atf_add_test_case shrink_48M_16M_v1_32768
104 1.1 riz atf_add_test_case shrink_48M_16M_v1_65536
105 1.1 riz atf_add_test_case shrink_64M_48M_v1_4096
106 1.1 riz atf_add_test_case shrink_64M_48M_v1_8192
107 1.1 riz atf_add_test_case shrink_64M_48M_v1_16384
108 1.1 riz atf_add_test_case shrink_64M_48M_v1_32768
109 1.1 riz atf_add_test_case shrink_64M_48M_v1_65536
110 1.1 riz atf_add_test_case shrink_64M_48M_v1_65536_swapped
111 1.1 riz atf_add_test_case shrink_64M_48M_v2_65536
112 1.1 riz atf_add_test_case shrink_64M_48M_v2_65536_swapped
113 1.2 riz fi
114 1.1 riz atf_add_test_case shrink_ffsv1_partial_cg
115 1.1 riz }
116