]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import.cfg
017874ec07038d1f5e37b9094f83312ed0494a12
[mirror_zfs.git] / tests / zfs-tests / tests / functional / cli_root / zpool_import / zpool_import.cfg
1 #
2 # CDDL HEADER START
3 #
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
7 #
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
12 #
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26
27 #
28 # Copyright (c) 2012 by Delphix. All rights reserved.
29 #
30
31 . $STF_SUITE/include/libtest.shlib
32
33 export DISKSARRAY=$DISKS
34 export DISK_ARRAY_NUM=$($ECHO ${DISKS} | $NAWK '{print NF}')
35 typeset -a disk_array=($(find_disks $DISKS))
36 case "${#disk_array[*]}" in
37 0)
38 #
39 # on stf_configure, disk_freelist returns empty.
40 #
41 DISK_COUNT=0
42 ;;
43 1)
44 # We need to repartition the single disk to two slices.
45 if is_linux; then
46 DISK_COUNT=1
47 ZFS_DISK1=${disk_array[0]}
48 ZFS_DISK2=${disk_array[0]}
49 if is_mpath_device $ZFS_DISK1; then
50 export DEV_DSKDIR=$DEV_MPATHDIR
51 else
52 export DEV_DSKDIR=$DEV_RDSKDIR
53 fi
54 if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
55 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
56 ZFSSIDE_DISK1=${ZFS_DISK1}1
57 ZFSSIDE_DISK2=${ZFS_DISK2}2
58 elif ( is_mpath_device $ZFS_DISK1 || is_loop_device $ZFS_DISK1 ); then
59 ZFSSIDE_DISK1=${ZFS_DISK1}p1
60 ZFSSIDE_DISK2=${ZFS_DISK2}p2
61 else
62 log_fail "$ZFS_DISK1 not supported for partitioning."
63 fi
64 else
65 export DEV_DSKDIR="/dev"
66 DISK_COUNT=1
67 ZFS_DISK1=${disk_array[0]}
68 ZFSSIDE_DISK1=${ZFS_DISK1}s0
69 ZFS_DISK2=${disk_array[0]}
70 ZFSSIDE_DISK2=${ZFS_DISK2}s1
71 fi
72 ;;
73 *)
74 # We need to repartition the single disk to two slices.
75 if is_linux; then
76 DISK_COUNT=2
77 ZFS_DISK1=${disk_array[0]}
78 if is_mpath_device $ZFS_DISK1; then
79 export DEV_DSKDIR=$DEV_MPATHDIR
80 else
81 export DEV_DSKDIR=$DEV_RDSKDIR
82 fi
83 if ( is_mpath_device $ZFS_DISK1 ) && [[ -z $($ECHO $ZFS_DISK1 | awk 'substr($1,18,1)\
84 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK1 ); then
85 ZFSSIDE_DISK1=${ZFS_DISK1}1
86 elif ( is_mpath_device $ZFS_DISK1 || is_loop_device $ZFS_DISK1 ); then
87 ZFSSIDE_DISK1=${ZFS_DISK1}p1
88 else
89 log_fail "$ZFS_DISK1 not supported for partitioning."
90 fi
91 ZFS_DISK2=${disk_array[1]}
92 if ( is_mpath_device $ZFS_DISK2 ) && [[ -z $($ECHO $ZFS_DISK2 | awk 'substr($1,18,1)\
93 ~ /^[[:digit:]]+$/') ]] || ( is_real_device $ZFS_DISK2 ); then
94 ZFSSIDE_DISK2=${ZFS_DISK2}1
95 elif ( is_mpath_device $ZFS_DISK2 || is_loop_device $ZFS_DISK2 ); then
96 ZFSSIDE_DISK2=${ZFS_DISK2}p1
97 else
98 log_fail "$ZFS_DISK2 not supported for partitioning."
99 fi
100 else
101 export DEV_DSKDIR="/dev"
102 DISK_COUNT=2
103 ZFS_DISK1=${disk_array[0]}
104 ZFSSIDE_DISK1=${ZFS_DISK1}s0
105 ZFS_DISK2=${disk_array[1]}
106 ZFSSIDE_DISK2=${ZFS_DISK2}s0
107 fi
108 ;;
109 esac
110
111 export DISK_COUNT ZFS_DISK1 ZFSSIDE_DISK1 ZFS_DISK2 ZFSSIDE_DISK2
112
113 export FS_SIZE=1g
114 export FILE_SIZE=64m
115 export SLICE_SIZE=128m
116 export MAX_NUM=5
117 export GROUP_NUM=3
118 export DEVICE_DIR=$TEST_BASE_DIR/dev_import-test
119 export BACKUP_DEVICE_DIR=$TEST_BASE_DIR/bakdev_import-test
120 export DEVICE_FILE=disk
121 export DEVICE_ARCHIVE=archive_import-test
122 export MYTESTFILE=$STF_SUITE/include/libtest.shlib
123
124 typeset -i num=0
125 while (( num < $GROUP_NUM )); do
126 DEVICE_FILES="$DEVICE_FILES ${DEVICE_DIR}/${DEVICE_FILE}$num"
127 (( num = num + 1 ))
128 done
129 export DEVICE_FILES
130
131 export VDEV0=$DEVICE_DIR/${DEVICE_FILE}0
132 export VDEV1=$DEVICE_DIR/${DEVICE_FILE}1
133 export VDEV2=$DEVICE_DIR/${DEVICE_FILE}2
134 export VDEV3=$DEVICE_DIR/${DEVICE_FILE}3
135 export VDEV4=$DEVICE_DIR/${DEVICE_FILE}4
136
137 export ALTER_ROOT=/alter_import-test