1# vim: filetype=sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22
23
24# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
25# Use is subject to license terms.
26
27. $STF_SUITE/tests/cli_root/cli.cfg
28. $STF_SUITE/include/libtest.kshlib
29
30set_disks
31
32export FS_SIZE=2gb
33export FILE_SIZE=64m
34export PART_SIZE=128m
35export MAX_NUM=5
36export GROUP_NUM=3
37export DEVICE_DIR=$(pwd)/dev
38export BACKUP_DEVICE_DIR=$(pwd)/bakdev
39export DEVICE_FILE=disk
40export DEVICE_ARCHIVE=$(pwd)/archive${TESTCASE_ID}.tar
41# MYTESTFILE can be any file that exists and we have r access to
42export MYTESTFILE=$STF_SUITE/include/default.cfg
43
44# NB: It's easier just to repeat the expansion patterns than to reuse.
45for (( num=0 ; $num < $GROUP_NUM ; num += 1 )); do
46	eval export VDEV\${num}F="${DEVICE_FILE}${num}"
47	eval export VDEV\${num}="${DEVICE_DIR}/${DEVICE_FILE}${num}"
48	DEVICE_FILES="$DEVICE_FILES ${DEVICE_DIR}/${DEVICE_FILE}${num}"
49done
50export DEVICE_FILES
51for (( num = GROUP_NUM ; $num < $MAX_NUM ; num += 1 )); do
52	eval export VDEV\${num}F="${DEVICE_FILE}${num}"
53	eval export VDEV\${num}="${DEVICE_DIR}/${DEVICE_FILE}${num}"
54done
55
56export ALTER_ROOT=/alter${TESTCASE_ID}
57export STF_TIMEOUT=2400
58
59export ZPOOL_VERSION=$(get_zpool_version)
60
61# Version 1 pools
62export ZPOOL_VERSION_1_FILES="zfs-pool-v1.dat"
63export ZPOOL_VERSION_1_NAME="v1-pool"
64
65# Version 2 pools
66export ZPOOL_VERSION_2_FILES="zfs-pool-v2.dat"
67export ZPOOL_VERSION_2_NAME="v2-pool"
68
69# This is a v3 pool
70export ZPOOL_VERSION_3_FILES="zfs-pool-v3.dat"
71export ZPOOL_VERSION_3_NAME="v3-pool"
72
73# This is a v6 pool
74export ZPOOL_VERSION_6_FILES="zfs-pool-v6.dat"
75export ZPOOL_VERSION_6_NAME="v6-pool"
76
77# This is a v7 pool
78export ZPOOL_VERSION_7_FILES="zfs-pool-v7.dat"
79export ZPOOL_VERSION_7_NAME="v7-pool"
80
81# This is a v8 pool
82export ZPOOL_VERSION_8_FILES="zfs-pool-v8.dat"
83export ZPOOL_VERSION_8_NAME="v8-pool"
84
85# This statement builds up a list of configurations we should be able to
86# upgrade, for each pool version. Once we've built this variable, we'll
87# call the functions above for each value.
88case $ZPOOL_VERSION in
896)
90	CONFIGS="6"
91	;;
927)
93	CONFIGS="6 7"
94	;;
958)
96	CONFIGS="6 7 8"
97	;;
98*)
99	# we should be able to upgrade pools of version 1, 2 & 3
100	# but we should also log a note about the unknown pool version
101	CONFIGS="6 7 8"
102	;;
103esac
104export CONFIGS
105