t_grow_swapped.sh revision 272343
1272343Sngie# $NetBSD: t_grow_swapped.sh,v 1.2 2011/01/11 00:50:02 riz Exp $ 2272343Sngie# 3272343Sngie# Copyright (c) 2010 The NetBSD Foundation, Inc. 4272343Sngie# All rights reserved. 5272343Sngie# 6272343Sngie# This code is derived from software contributed to The NetBSD Foundation 7272343Sngie# by Jeffrey C. Rizzo. 8272343Sngie# 9272343Sngie# Redistribution and use in source and binary forms, with or without 10272343Sngie# modification, are permitted provided that the following conditions 11272343Sngie# are met: 12272343Sngie# 1. Redistributions of source code must retain the above copyright 13272343Sngie# notice, this list of conditions and the following disclaimer. 14272343Sngie# 2. Redistributions in binary form must reproduce the above copyright 15272343Sngie# notice, this list of conditions and the following disclaimer in the 16272343Sngie# documentation and/or other materials provided with the distribution. 17272343Sngie# 18272343Sngie# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19272343Sngie# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20272343Sngie# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21272343Sngie# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22272343Sngie# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23272343Sngie# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24272343Sngie# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25272343Sngie# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26272343Sngie# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27272343Sngie# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28272343Sngie# POSSIBILITY OF SUCH DAMAGE. 29272343Sngie# 30272343Sngie 31272343Sngie 32272343Sngie# resize_ffs params as follows: 33272343Sngie# resize_ffs blocksize fragsize fssize newfssize level numdata swap 34272343Sngie# where 'numdata' is the number of data directories to copy - this is 35272343Sngie# determined manually based on the maximum number that will fit in the 36272343Sngie# created fs. 'level' is the fs-level (-O 0,1,2) passed to newfs. 37272343Sngie# If 'swap' is included, byteswap the fs 38272343Sngie 39272343Sngie# v0 == newfs -O0 (4.3BSD layout, ffsv1 superblock) 40272343Sngietest_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28 swap 41272343Sngietest_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28 swap 42272343Sngietest_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29 swap 43272343Sngietest_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28 swap 44272343Sngietest_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26 swap 45272343Sngie# these grow_24M grow a smaller amount; sometimes there's different issues 46272343Sngietest_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41 swap 47272343Sngietest_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42 swap 48272343Sngietest_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43 swap 49272343Sngietest_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42 swap 50272343Sngietest_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38 swap 51272343Sngietest_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55 swap 52272343Sngietest_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56 swap 53272343Sngietest_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58 swap 54272343Sngietest_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56 swap 55272343Sngietest_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51 swap 56272343Sngietest_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82 swap 57272343Sngietest_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84 swap 58272343Sngietest_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87 swap 59272343Sngietest_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83 swap 60272343Sngietest_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76 swap 61272343Sngietest_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109 swap 62272343Sngietest_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111 swap 63272343Sngietest_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115 swap 64272343Sngietest_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111 swap 65272343Sngietest_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101 swap 66272343Sngie 67272343Sngie# v1 == newfs -O1 (FFSv1, v2 superblock layout) 68272343Sngietest_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28 swap 69272343Sngietest_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28 swap 70272343Sngietest_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29 swap 71272343Sngietest_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28 swap 72272343Sngietest_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26 swap 73272343Sngie# these grow_24M grow a smaller amount; sometimes there's different issues 74272343Sngietest_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41 swap 75272343Sngietest_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42 swap 76272343Sngietest_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43 swap 77272343Sngietest_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42 swap 78272343Sngietest_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38 swap 79272343Sngietest_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55 swap 80272343Sngietest_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56 swap 81272343Sngietest_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58 swap 82272343Sngietest_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56 swap 83272343Sngietest_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51 swap 84272343Sngietest_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82 swap 85272343Sngietest_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84 swap 86272343Sngietest_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87 swap 87272343Sngietest_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83 swap 88272343Sngietest_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76 swap 89272343Sngietest_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109 swap 90272343Sngietest_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111 swap 91272343Sngietest_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115 swap 92272343Sngietest_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111 swap 93272343Sngietest_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101 swap 94272343Sngietest_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26 swap 95272343Sngietest_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28 swap 96272343Sngietest_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29 swap 97272343Sngietest_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28 swap 98272343Sngietest_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25 swap 99272343Sngietest_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40 swap 100272343Sngietest_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42 swap 101272343Sngietest_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43 swap 102272343Sngietest_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42 swap 103272343Sngietest_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38 swap 104272343Sngietest_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53 swap 105272343Sngietest_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56 swap 106272343Sngietest_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58 swap 107272343Sngietest_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56 swap 108272343Sngietest_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51 swap 109272343Sngietest_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80 swap 110272343Sngietest_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84 swap 111272343Sngietest_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87 swap 112272343Sngietest_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83 swap 113272343Sngietest_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76 swap 114272343Sngietest_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107 swap 115272343Sngietest_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111 swap 116272343Sngietest_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115 swap 117272343Sngietest_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111 swap 118272343Sngietest_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101 swap 119272343Sngie 120272343Sngieatf_test_case grow_ffsv1_partial_cg 121272343Sngiegrow_ffsv1_partial_cg_head() 122272343Sngie{ 123272343Sngie atf_set "descr" "Checks successful ffsv1 growth by less" \ 124272343Sngie "than a cylinder group" 125272343Sngie} 126272343Sngiegrow_ffsv1_partial_cg_body() 127272343Sngie{ 128272343Sngie echo "***resize_ffs grow test" 129272343Sngie 130272343Sngie atf_check -o ignore -e ignore newfs -B be -V1 -s 4000 -F ${IMG} 131272343Sngie 132272343Sngie # size to grow to is chosen to cause partial cg 133272343Sngie atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG} 134272343Sngie atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG} 135272343Sngie} 136272343Sngie 137272343Sngieatf_init_test_cases() 138272343Sngie{ 139272343Sngie setupvars 140272343Sngie atf_add_test_case grow_16M_v0_65536 141272343Sngie atf_add_test_case grow_16M_v1_4096 142272343Sngie atf_add_test_case grow_16M_v2_8192 143272343Sngieif [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then 144272343Sngie atf_add_test_case grow_16M_v0_4096 145272343Sngie atf_add_test_case grow_16M_v0_8192 146272343Sngie atf_add_test_case grow_16M_v0_16384 147272343Sngie atf_add_test_case grow_16M_v0_32768 148272343Sngie atf_add_test_case grow_16M_v1_8192 149272343Sngie atf_add_test_case grow_16M_v1_16384 150272343Sngie atf_add_test_case grow_16M_v1_32768 151272343Sngie atf_add_test_case grow_16M_v1_65536 152272343Sngie atf_add_test_case grow_16M_v2_4096 153272343Sngie atf_add_test_case grow_16M_v2_16384 154272343Sngie atf_add_test_case grow_16M_v2_32768 155272343Sngie atf_add_test_case grow_16M_v2_65536 156272343Sngie atf_add_test_case grow_24M_v0_4096 157272343Sngie atf_add_test_case grow_24M_v0_8192 158272343Sngie atf_add_test_case grow_24M_v0_16384 159272343Sngie atf_add_test_case grow_24M_v0_32768 160272343Sngie atf_add_test_case grow_24M_v0_65536 161272343Sngie atf_add_test_case grow_32M_v0_4096 162272343Sngie atf_add_test_case grow_32M_v0_8192 163272343Sngie atf_add_test_case grow_32M_v0_16384 164272343Sngie atf_add_test_case grow_32M_v0_32768 165272343Sngie atf_add_test_case grow_32M_v0_65536 166272343Sngie atf_add_test_case grow_48M_v0_4096 167272343Sngie atf_add_test_case grow_48M_v0_8192 168272343Sngie atf_add_test_case grow_48M_v0_16384 169272343Sngie atf_add_test_case grow_48M_v0_32768 170272343Sngie atf_add_test_case grow_48M_v0_65536 171272343Sngie atf_add_test_case grow_64M_v0_4096 172272343Sngie atf_add_test_case grow_64M_v0_8192 173272343Sngie atf_add_test_case grow_64M_v0_16384 174272343Sngie atf_add_test_case grow_64M_v0_32768 175272343Sngie atf_add_test_case grow_64M_v0_65536 176272343Sngie 177272343Sngie atf_add_test_case grow_24M_v1_4096 178272343Sngie atf_add_test_case grow_24M_v1_8192 179272343Sngie atf_add_test_case grow_24M_v1_16384 180272343Sngie atf_add_test_case grow_24M_v1_32768 181272343Sngie atf_add_test_case grow_24M_v1_65536 182272343Sngie atf_add_test_case grow_32M_v1_4096 183272343Sngie atf_add_test_case grow_32M_v1_8192 184272343Sngie atf_add_test_case grow_32M_v1_16384 185272343Sngie atf_add_test_case grow_32M_v1_32768 186272343Sngie atf_add_test_case grow_32M_v1_65536 187272343Sngie atf_add_test_case grow_48M_v1_4096 188272343Sngie atf_add_test_case grow_48M_v1_8192 189272343Sngie atf_add_test_case grow_48M_v1_16384 190272343Sngie atf_add_test_case grow_48M_v1_32768 191272343Sngie atf_add_test_case grow_48M_v1_65536 192272343Sngie atf_add_test_case grow_64M_v1_4096 193272343Sngie atf_add_test_case grow_64M_v1_8192 194272343Sngie atf_add_test_case grow_64M_v1_16384 195272343Sngie atf_add_test_case grow_64M_v1_32768 196272343Sngie atf_add_test_case grow_64M_v1_65536 197272343Sngie 198272343Sngie atf_add_test_case grow_24M_v2_4096 199272343Sngie atf_add_test_case grow_24M_v2_8192 200272343Sngie atf_add_test_case grow_24M_v2_16384 201272343Sngie atf_add_test_case grow_24M_v2_32768 202272343Sngie atf_add_test_case grow_24M_v2_65536 203272343Sngie atf_add_test_case grow_32M_v2_4096 204272343Sngie atf_add_test_case grow_32M_v2_8192 205272343Sngie atf_add_test_case grow_32M_v2_16384 206272343Sngie atf_add_test_case grow_32M_v2_32768 207272343Sngie atf_add_test_case grow_32M_v2_65536 208272343Sngie atf_add_test_case grow_48M_v2_4096 209272343Sngie atf_add_test_case grow_48M_v2_8192 210272343Sngie atf_add_test_case grow_48M_v2_16384 211272343Sngie atf_add_test_case grow_48M_v2_32768 212272343Sngie atf_add_test_case grow_48M_v2_65536 213272343Sngie atf_add_test_case grow_64M_v2_4096 214272343Sngie atf_add_test_case grow_64M_v2_8192 215272343Sngie atf_add_test_case grow_64M_v2_16384 216272343Sngie atf_add_test_case grow_64M_v2_32768 217272343Sngie atf_add_test_case grow_64M_v2_65536 218272343Sngiefi 219272343Sngie atf_add_test_case grow_ffsv1_partial_cg 220272343Sngie} 221