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