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# $FreeBSD$
24
25
26# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
27# Use is subject to license terms.
28#
29# ident	"@(#)zpool_import.cfg	1.6	08/11/03 SMI"
30#
31
32. $STF_SUITE/tests/cli_root/cli.cfg
33. $STF_SUITE/include/libtest.kshlib
34
35set_disks
36
37export FS_SIZE=2gb
38export FILE_SIZE=64m
39export PART_SIZE=128m
40export MAX_NUM=5
41export GROUP_NUM=3
42export DEVICE_DIR=$(pwd)/dev
43export BACKUP_DEVICE_DIR=$(pwd)/bakdev
44export DEVICE_FILE=disk
45export DEVICE_ARCHIVE=$(pwd)/archive${TESTCASE_ID}.tar
46# MYTESTFILE can be any file that exists and we have r access to
47export MYTESTFILE=$STF_SUITE/include/default.cfg
48
49# NB: It's easier just to repeat the expansion patterns than to reuse.
50for (( num=0 ; $num < $GROUP_NUM ; num += 1 )); do
51	eval export VDEV\${num}F="${DEVICE_FILE}${num}"
52	eval export VDEV\${num}="${DEVICE_DIR}/${DEVICE_FILE}${num}"
53	DEVICE_FILES="$DEVICE_FILES ${DEVICE_DIR}/${DEVICE_FILE}${num}"
54done
55export DEVICE_FILES
56for (( num = GROUP_NUM ; $num < $MAX_NUM ; num += 1 )); do
57	eval export VDEV\${num}F="${DEVICE_FILE}${num}"
58	eval export VDEV\${num}="${DEVICE_DIR}/${DEVICE_FILE}${num}"
59done
60
61export ALTER_ROOT=/alter${TESTCASE_ID}
62export STF_TIMEOUT=2400
63
64export ZPOOL_VERSION=$(get_zpool_version)
65
66# Version 1 pools
67export ZPOOL_VERSION_1_FILES="zfs-pool-v1.dat"
68export ZPOOL_VERSION_1_NAME="v1-pool"
69
70# Version 2 pools
71export ZPOOL_VERSION_2_FILES="zfs-pool-v2.dat"
72export ZPOOL_VERSION_2_NAME="v2-pool"
73
74# This is a v3 pool
75export ZPOOL_VERSION_3_FILES="zfs-pool-v3.dat"
76export ZPOOL_VERSION_3_NAME="v3-pool"
77
78# This is a v6 pool
79export ZPOOL_VERSION_6_FILES="zfs-pool-v6.dat"
80export ZPOOL_VERSION_6_NAME="v6-pool"
81
82# This is a v7 pool
83export ZPOOL_VERSION_7_FILES="zfs-pool-v7.dat"
84export ZPOOL_VERSION_7_NAME="v7-pool"
85
86# This is a v8 pool
87export ZPOOL_VERSION_8_FILES="zfs-pool-v8.dat"
88export ZPOOL_VERSION_8_NAME="v8-pool"
89
90# This statement builds up a list of configurations we should be able to
91# upgrade, for each pool version. Once we've built this variable, we'll
92# call the functions above for each value.
93case $ZPOOL_VERSION in
946)
95	CONFIGS="6"
96	;;
977)
98	CONFIGS="6 7"
99	;;
1008)
101	CONFIGS="6 7 8"
102	;;
103*)
104	# we should be able to upgrade pools of version 1, 2 & 3
105	# but we should also log a note about the unknown pool version
106	CONFIGS="6 7 8"
107	;;
108esac
109export CONFIGS
110