xref: /minix3/tests/sbin/resize_ffs/t_grow_swapped.sh (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc# $NetBSD: t_grow_swapped.sh,v 1.3 2015/03/29 19:37:02 chopps Exp $
211be35a1SLionel Sambuc#
311be35a1SLionel Sambuc# Copyright (c) 2010 The NetBSD Foundation, Inc.
411be35a1SLionel Sambuc# All rights reserved.
511be35a1SLionel Sambuc#
611be35a1SLionel Sambuc# This code is derived from software contributed to The NetBSD Foundation
711be35a1SLionel Sambuc# by Jeffrey C. Rizzo.
811be35a1SLionel Sambuc#
911be35a1SLionel Sambuc# Redistribution and use in source and binary forms, with or without
1011be35a1SLionel Sambuc# modification, are permitted provided that the following conditions
1111be35a1SLionel Sambuc# are met:
1211be35a1SLionel Sambuc# 1. Redistributions of source code must retain the above copyright
1311be35a1SLionel Sambuc#    notice, this list of conditions and the following disclaimer.
1411be35a1SLionel Sambuc# 2. Redistributions in binary form must reproduce the above copyright
1511be35a1SLionel Sambuc#    notice, this list of conditions and the following disclaimer in the
1611be35a1SLionel Sambuc#    documentation and/or other materials provided with the distribution.
1711be35a1SLionel Sambuc#
1811be35a1SLionel Sambuc# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1911be35a1SLionel Sambuc# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2011be35a1SLionel Sambuc# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2111be35a1SLionel Sambuc# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2211be35a1SLionel Sambuc# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2311be35a1SLionel Sambuc# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2411be35a1SLionel Sambuc# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2511be35a1SLionel Sambuc# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2611be35a1SLionel Sambuc# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2711be35a1SLionel Sambuc# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2811be35a1SLionel Sambuc# POSSIBILITY OF SUCH DAMAGE.
2911be35a1SLionel Sambuc#
3011be35a1SLionel Sambuc
3111be35a1SLionel Sambuc
3211be35a1SLionel Sambuc# resize_ffs params as follows:
3311be35a1SLionel Sambuc# resize_ffs blocksize fragsize fssize newfssize level numdata swap
3411be35a1SLionel Sambuc# where 'numdata' is the number of data directories to copy - this is
3511be35a1SLionel Sambuc# determined manually based on the maximum number that will fit in the
3611be35a1SLionel Sambuc# created fs.  'level' is the fs-level (-O 0,1,2) passed to newfs.
3711be35a1SLionel Sambuc# If 'swap' is included, byteswap the fs
3811be35a1SLionel Sambuc
3911be35a1SLionel Sambuc# v0 == newfs -O0  (4.3BSD layout, ffsv1 superblock)
4011be35a1SLionel Sambuctest_case grow_16M_v0_4096 resize_ffs 4096 512 32768 131072 0 28 swap
4111be35a1SLionel Sambuctest_case grow_16M_v0_8192 resize_ffs 8192 1024 32768 131072 0 28 swap
4211be35a1SLionel Sambuctest_case grow_16M_v0_16384 resize_ffs 16384 2048 32768 131072 0 29 swap
4311be35a1SLionel Sambuctest_case grow_16M_v0_32768 resize_ffs 32768 4096 32768 131072 0 28 swap
4411be35a1SLionel Sambuctest_case grow_16M_v0_65536 resize_ffs 65536 8192 32768 131072 0 26 swap
4511be35a1SLionel Sambuc# these grow_24M grow a smaller amount; sometimes there's different issues
4611be35a1SLionel Sambuctest_case grow_24M_v0_4096 resize_ffs 4096 512 49152 65536 0 41 swap
4711be35a1SLionel Sambuctest_case grow_24M_v0_8192 resize_ffs 8192 1024 49152 65536 0 42 swap
4811be35a1SLionel Sambuctest_case grow_24M_v0_16384 resize_ffs 16384 2048 49152 65536 0 43 swap
4911be35a1SLionel Sambuctest_case grow_24M_v0_32768 resize_ffs 32768 4096 49152 65536 0 42 swap
5011be35a1SLionel Sambuctest_case grow_24M_v0_65536 resize_ffs 65536 8192 49152 65536 0 38 swap
5111be35a1SLionel Sambuctest_case grow_32M_v0_4096 resize_ffs 4096 512 65536 131072 0 55 swap
5211be35a1SLionel Sambuctest_case grow_32M_v0_8192 resize_ffs 8192 1024 65536 131072 0 56 swap
5311be35a1SLionel Sambuctest_case grow_32M_v0_16384 resize_ffs 16384 2048 65536 131072 0 58 swap
5411be35a1SLionel Sambuctest_case grow_32M_v0_32768 resize_ffs 32768 4096 65536 131072 0 56 swap
5511be35a1SLionel Sambuctest_case grow_32M_v0_65536 resize_ffs 65536 8192 65536 131072 0 51 swap
5611be35a1SLionel Sambuctest_case grow_48M_v0_4096 resize_ffs 4096 512 98304 131072 0 82 swap
5711be35a1SLionel Sambuctest_case grow_48M_v0_8192 resize_ffs 8192 1024 98304 131072 0 84 swap
5811be35a1SLionel Sambuctest_case grow_48M_v0_16384 resize_ffs 16384 2048 98304 131072 0 87 swap
5911be35a1SLionel Sambuctest_case grow_48M_v0_32768 resize_ffs 32768 4096 98304 131072 0 83 swap
6011be35a1SLionel Sambuctest_case grow_48M_v0_65536 resize_ffs 65536 8192 98304 131072 0 76 swap
6111be35a1SLionel Sambuctest_case grow_64M_v0_4096 resize_ffs 4096 512 131072 262144 0 109 swap
6211be35a1SLionel Sambuctest_case grow_64M_v0_8192 resize_ffs 8192 1024 131072 262144 0 111 swap
6311be35a1SLionel Sambuctest_case grow_64M_v0_16384 resize_ffs 16384 2048 131072 262144 0 115 swap
6411be35a1SLionel Sambuctest_case grow_64M_v0_32768 resize_ffs 32768 4096 131072 262144 0 111 swap
6511be35a1SLionel Sambuctest_case grow_64M_v0_65536 resize_ffs 65536 8192 131072 262144 0 101 swap
6611be35a1SLionel Sambuc
6711be35a1SLionel Sambuc# v1 == newfs -O1 (FFSv1, v2 superblock layout)
6811be35a1SLionel Sambuctest_case grow_16M_v1_4096 resize_ffs 4096 512 32768 131072 1 28 swap
6911be35a1SLionel Sambuctest_case grow_16M_v1_8192 resize_ffs 8192 1024 32768 131072 1 28 swap
7011be35a1SLionel Sambuctest_case grow_16M_v1_16384 resize_ffs 16384 2048 32768 131072 1 29 swap
7111be35a1SLionel Sambuctest_case grow_16M_v1_32768 resize_ffs 32768 4096 32768 131072 1 28 swap
7211be35a1SLionel Sambuctest_case grow_16M_v1_65536 resize_ffs 65536 8192 32768 131072 1 26 swap
7311be35a1SLionel Sambuc# these grow_24M grow a smaller amount; sometimes there's different issues
7411be35a1SLionel Sambuctest_case grow_24M_v1_4096 resize_ffs 4096 512 49152 65536 1 41 swap
7511be35a1SLionel Sambuctest_case grow_24M_v1_8192 resize_ffs 8192 1024 49152 65536 1 42 swap
7611be35a1SLionel Sambuctest_case grow_24M_v1_16384 resize_ffs 16384 2048 49152 65536 1 43 swap
7711be35a1SLionel Sambuctest_case grow_24M_v1_32768 resize_ffs 32768 4096 49152 65536 1 42 swap
7811be35a1SLionel Sambuctest_case grow_24M_v1_65536 resize_ffs 65536 8192 49152 65536 1 38 swap
7911be35a1SLionel Sambuctest_case grow_32M_v1_4096 resize_ffs 4096 512 65536 131072 1 55 swap
8011be35a1SLionel Sambuctest_case grow_32M_v1_8192 resize_ffs 8192 1024 65536 131072 1 56 swap
8111be35a1SLionel Sambuctest_case grow_32M_v1_16384 resize_ffs 16384 2048 65536 131072 1 58 swap
8211be35a1SLionel Sambuctest_case grow_32M_v1_32768 resize_ffs 32768 4096 65536 131072 1 56 swap
8311be35a1SLionel Sambuctest_case grow_32M_v1_65536 resize_ffs 65536 8192 65536 131072 1 51 swap
8411be35a1SLionel Sambuctest_case grow_48M_v1_4096 resize_ffs 4096 512 98304 131072 1 82 swap
8511be35a1SLionel Sambuctest_case grow_48M_v1_8192 resize_ffs 8192 1024 98304 131072 1 84 swap
8611be35a1SLionel Sambuctest_case grow_48M_v1_16384 resize_ffs 16384 2048 98304 131072 1 87 swap
8711be35a1SLionel Sambuctest_case grow_48M_v1_32768 resize_ffs 32768 4096 98304 131072 1 83 swap
8811be35a1SLionel Sambuctest_case grow_48M_v1_65536 resize_ffs 65536 8192 98304 131072 1 76 swap
8911be35a1SLionel Sambuctest_case grow_64M_v1_4096 resize_ffs 4096 512 131072 262144 1 109 swap
9011be35a1SLionel Sambuctest_case grow_64M_v1_8192 resize_ffs 8192 1024 131072 262144 1 111 swap
9111be35a1SLionel Sambuctest_case grow_64M_v1_16384 resize_ffs 16384 2048 131072 262144 1 115 swap
9211be35a1SLionel Sambuctest_case grow_64M_v1_32768 resize_ffs 32768 4096 131072 262144 1 111 swap
9311be35a1SLionel Sambuctest_case grow_64M_v1_65536 resize_ffs 65536 8192 131072 262144 1 101 swap
9411be35a1SLionel Sambuctest_case grow_16M_v2_4096 resize_ffs 4096 512 32768 131072 2 26 swap
9511be35a1SLionel Sambuctest_case grow_16M_v2_8192 resize_ffs 8192 1024 32768 131072 2 28 swap
9611be35a1SLionel Sambuctest_case grow_16M_v2_16384 resize_ffs 16384 2048 32768 131072 2 29 swap
9711be35a1SLionel Sambuctest_case grow_16M_v2_32768 resize_ffs 32768 4096 32768 131072 2 28 swap
9811be35a1SLionel Sambuctest_case grow_16M_v2_65536 resize_ffs 65536 8192 32768 131072 2 25 swap
9911be35a1SLionel Sambuctest_case grow_24M_v2_4096 resize_ffs 4096 512 49152 65536 2 40 swap
10011be35a1SLionel Sambuctest_case grow_24M_v2_8192 resize_ffs 8192 1024 49152 65536 2 42 swap
10111be35a1SLionel Sambuctest_case grow_24M_v2_16384 resize_ffs 16384 2048 49152 65536 2 43 swap
10211be35a1SLionel Sambuctest_case grow_24M_v2_32768 resize_ffs 32768 4096 49152 65536 2 42 swap
10311be35a1SLionel Sambuctest_case grow_24M_v2_65536 resize_ffs 65536 8192 49152 65536 2 38 swap
10411be35a1SLionel Sambuctest_case grow_32M_v2_4096 resize_ffs 4096 512 65536 131072 2 53 swap
10511be35a1SLionel Sambuctest_case grow_32M_v2_8192 resize_ffs 8192 1024 65536 131072 2 56 swap
10611be35a1SLionel Sambuctest_case grow_32M_v2_16384 resize_ffs 16384 2048 65536 131072 2 58 swap
10711be35a1SLionel Sambuctest_case grow_32M_v2_32768 resize_ffs 32768 4096 65536 131072 2 56 swap
10811be35a1SLionel Sambuctest_case grow_32M_v2_65536 resize_ffs 65536 8192 65536 131072 2 51 swap
10911be35a1SLionel Sambuctest_case grow_48M_v2_4096 resize_ffs 4096 512 98304 131072 2 80 swap
11011be35a1SLionel Sambuctest_case grow_48M_v2_8192 resize_ffs 8192 1024 98304 131072 2 84 swap
11111be35a1SLionel Sambuctest_case grow_48M_v2_16384 resize_ffs 16384 2048 98304 131072 2 87 swap
11211be35a1SLionel Sambuctest_case grow_48M_v2_32768 resize_ffs 32768 4096 98304 131072 2 83 swap
11311be35a1SLionel Sambuctest_case grow_48M_v2_65536 resize_ffs 65536 8192 98304 131072 2 76 swap
11411be35a1SLionel Sambuctest_case grow_64M_v2_4096 resize_ffs 4096 512 131072 262144 2 107 swap
11511be35a1SLionel Sambuctest_case grow_64M_v2_8192 resize_ffs 8192 1024 131072 262144 2 111 swap
11611be35a1SLionel Sambuctest_case grow_64M_v2_16384 resize_ffs 16384 2048 131072 262144 2 115 swap
11711be35a1SLionel Sambuctest_case grow_64M_v2_32768 resize_ffs 32768 4096 131072 262144 2 111 swap
11811be35a1SLionel Sambuctest_case grow_64M_v2_65536 resize_ffs 65536 8192 131072 262144 2 101 swap
11911be35a1SLionel Sambuc
12011be35a1SLionel Sambucatf_test_case grow_ffsv1_partial_cg
12111be35a1SLionel Sambucgrow_ffsv1_partial_cg_head()
12211be35a1SLionel Sambuc{
12311be35a1SLionel Sambuc	atf_set "descr" "Checks successful ffsv1 growth by less" \
12411be35a1SLionel Sambuc			"than a cylinder group"
12511be35a1SLionel Sambuc}
12611be35a1SLionel Sambucgrow_ffsv1_partial_cg_body()
12711be35a1SLionel Sambuc{
12811be35a1SLionel Sambuc	echo "***resize_ffs grow test"
12911be35a1SLionel Sambuc
13011be35a1SLionel Sambuc	atf_check -o ignore -e ignore newfs -B be -V1 -s 4000 -F ${IMG}
13111be35a1SLionel Sambuc
13211be35a1SLionel Sambuc	# size to grow to is chosen to cause partial cg
133*0a6a1f1dSLionel Sambuc	atf_check -s exit:0 -o ignore resize_ffs -c -y -s 5760 ${IMG}
13411be35a1SLionel Sambuc	atf_check -s exit:0 -o ignore resize_ffs -y -s 5760 ${IMG}
13511be35a1SLionel Sambuc	atf_check -s exit:0 -o ignore fsck_ffs -f -n -F ${IMG}
136*0a6a1f1dSLionel Sambuc	atf_check -s exit:1 -o ignore resize_ffs -c -y -s 5760 ${IMG}
13711be35a1SLionel Sambuc}
13811be35a1SLionel Sambuc
13911be35a1SLionel Sambucatf_init_test_cases()
14011be35a1SLionel Sambuc{
14111be35a1SLionel Sambuc	setupvars
14211be35a1SLionel Sambuc	atf_add_test_case grow_16M_v0_65536
14311be35a1SLionel Sambuc	atf_add_test_case grow_16M_v1_4096
14411be35a1SLionel Sambuc	atf_add_test_case grow_16M_v2_8192
14511be35a1SLionel Sambucif [ "${RESIZE_FFS_ALL_TESTS-X}" != "X" ]; then
14611be35a1SLionel Sambuc	atf_add_test_case grow_16M_v0_4096
14711be35a1SLionel Sambuc	atf_add_test_case grow_16M_v0_8192
14811be35a1SLionel Sambuc	atf_add_test_case grow_16M_v0_16384
14911be35a1SLionel Sambuc	atf_add_test_case grow_16M_v0_32768
15011be35a1SLionel Sambuc	atf_add_test_case grow_16M_v1_8192
15111be35a1SLionel Sambuc	atf_add_test_case grow_16M_v1_16384
15211be35a1SLionel Sambuc	atf_add_test_case grow_16M_v1_32768
15311be35a1SLionel Sambuc	atf_add_test_case grow_16M_v1_65536
15411be35a1SLionel Sambuc	atf_add_test_case grow_16M_v2_4096
15511be35a1SLionel Sambuc	atf_add_test_case grow_16M_v2_16384
15611be35a1SLionel Sambuc	atf_add_test_case grow_16M_v2_32768
15711be35a1SLionel Sambuc	atf_add_test_case grow_16M_v2_65536
15811be35a1SLionel Sambuc	atf_add_test_case grow_24M_v0_4096
15911be35a1SLionel Sambuc	atf_add_test_case grow_24M_v0_8192
16011be35a1SLionel Sambuc	atf_add_test_case grow_24M_v0_16384
16111be35a1SLionel Sambuc	atf_add_test_case grow_24M_v0_32768
16211be35a1SLionel Sambuc	atf_add_test_case grow_24M_v0_65536
16311be35a1SLionel Sambuc	atf_add_test_case grow_32M_v0_4096
16411be35a1SLionel Sambuc	atf_add_test_case grow_32M_v0_8192
16511be35a1SLionel Sambuc	atf_add_test_case grow_32M_v0_16384
16611be35a1SLionel Sambuc	atf_add_test_case grow_32M_v0_32768
16711be35a1SLionel Sambuc	atf_add_test_case grow_32M_v0_65536
16811be35a1SLionel Sambuc	atf_add_test_case grow_48M_v0_4096
16911be35a1SLionel Sambuc	atf_add_test_case grow_48M_v0_8192
17011be35a1SLionel Sambuc	atf_add_test_case grow_48M_v0_16384
17111be35a1SLionel Sambuc	atf_add_test_case grow_48M_v0_32768
17211be35a1SLionel Sambuc	atf_add_test_case grow_48M_v0_65536
17311be35a1SLionel Sambuc	atf_add_test_case grow_64M_v0_4096
17411be35a1SLionel Sambuc	atf_add_test_case grow_64M_v0_8192
17511be35a1SLionel Sambuc	atf_add_test_case grow_64M_v0_16384
17611be35a1SLionel Sambuc	atf_add_test_case grow_64M_v0_32768
17711be35a1SLionel Sambuc	atf_add_test_case grow_64M_v0_65536
17811be35a1SLionel Sambuc
17911be35a1SLionel Sambuc	atf_add_test_case grow_24M_v1_4096
18011be35a1SLionel Sambuc	atf_add_test_case grow_24M_v1_8192
18111be35a1SLionel Sambuc	atf_add_test_case grow_24M_v1_16384
18211be35a1SLionel Sambuc	atf_add_test_case grow_24M_v1_32768
18311be35a1SLionel Sambuc	atf_add_test_case grow_24M_v1_65536
18411be35a1SLionel Sambuc	atf_add_test_case grow_32M_v1_4096
18511be35a1SLionel Sambuc	atf_add_test_case grow_32M_v1_8192
18611be35a1SLionel Sambuc	atf_add_test_case grow_32M_v1_16384
18711be35a1SLionel Sambuc	atf_add_test_case grow_32M_v1_32768
18811be35a1SLionel Sambuc	atf_add_test_case grow_32M_v1_65536
18911be35a1SLionel Sambuc	atf_add_test_case grow_48M_v1_4096
19011be35a1SLionel Sambuc	atf_add_test_case grow_48M_v1_8192
19111be35a1SLionel Sambuc	atf_add_test_case grow_48M_v1_16384
19211be35a1SLionel Sambuc	atf_add_test_case grow_48M_v1_32768
19311be35a1SLionel Sambuc	atf_add_test_case grow_48M_v1_65536
19411be35a1SLionel Sambuc	atf_add_test_case grow_64M_v1_4096
19511be35a1SLionel Sambuc	atf_add_test_case grow_64M_v1_8192
19611be35a1SLionel Sambuc	atf_add_test_case grow_64M_v1_16384
19711be35a1SLionel Sambuc	atf_add_test_case grow_64M_v1_32768
19811be35a1SLionel Sambuc	atf_add_test_case grow_64M_v1_65536
19911be35a1SLionel Sambuc
20011be35a1SLionel Sambuc	atf_add_test_case grow_24M_v2_4096
20111be35a1SLionel Sambuc	atf_add_test_case grow_24M_v2_8192
20211be35a1SLionel Sambuc	atf_add_test_case grow_24M_v2_16384
20311be35a1SLionel Sambuc	atf_add_test_case grow_24M_v2_32768
20411be35a1SLionel Sambuc	atf_add_test_case grow_24M_v2_65536
20511be35a1SLionel Sambuc	atf_add_test_case grow_32M_v2_4096
20611be35a1SLionel Sambuc	atf_add_test_case grow_32M_v2_8192
20711be35a1SLionel Sambuc	atf_add_test_case grow_32M_v2_16384
20811be35a1SLionel Sambuc	atf_add_test_case grow_32M_v2_32768
20911be35a1SLionel Sambuc	atf_add_test_case grow_32M_v2_65536
21011be35a1SLionel Sambuc	atf_add_test_case grow_48M_v2_4096
21111be35a1SLionel Sambuc	atf_add_test_case grow_48M_v2_8192
21211be35a1SLionel Sambuc	atf_add_test_case grow_48M_v2_16384
21311be35a1SLionel Sambuc	atf_add_test_case grow_48M_v2_32768
21411be35a1SLionel Sambuc	atf_add_test_case grow_48M_v2_65536
21511be35a1SLionel Sambuc	atf_add_test_case grow_64M_v2_4096
21611be35a1SLionel Sambuc	atf_add_test_case grow_64M_v2_8192
21711be35a1SLionel Sambuc	atf_add_test_case grow_64M_v2_16384
21811be35a1SLionel Sambuc	atf_add_test_case grow_64M_v2_32768
21911be35a1SLionel Sambuc	atf_add_test_case grow_64M_v2_65536
22011be35a1SLionel Sambucfi
22111be35a1SLionel Sambuc	atf_add_test_case grow_ffsv1_partial_cg
22211be35a1SLionel Sambuc}
223