]>
Commit | Line | Data |
---|---|---|
cae5b340 AX |
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) 2016 by Delphix. All rights reserved. | |
29 | # Copyright (c) 2017 Lawrence Livermore National Security, LLC. | |
30 | # | |
31 | ||
32 | . $STF_SUITE/include/commands.cfg | |
33 | . $STF_SUITE/include/libtest.shlib | |
34 | ||
35 | # ZFS Directories | |
36 | export prefix=/usr/local | |
37 | export exec_prefix=${prefix} | |
38 | export ZEDLET_ETC_DIR=${ZEDLET_ETC_DIR:-${prefix}/etc/zfs/zed.d} | |
39 | export ZEDLET_LIBEXEC_DIR=${ZEDLET_LIBEXEC_DIR:-${exec_prefix}/libexec/zfs/zed.d} | |
40 | export ZPOOL_SCRIPT_DIR=${ZPOOL_SCRIPT_DIR:-${prefix}/etc/zfs/zpool.d} | |
41 | ||
42 | # Define run length constants | |
43 | export RT_LONG="3" | |
44 | export RT_MEDIUM="2" | |
45 | export RT_SHORT="1" | |
46 | ||
47 | # Define macro for zone test | |
48 | export ZONE_POOL="zonepool" | |
49 | export ZONE_CTR="zonectr" | |
50 | ||
51 | # ensure we're running in the C locale, since | |
52 | # localised messages may result in test failures | |
53 | export LC_ALL="C" | |
54 | export LANG="C" | |
55 | ||
56 | # | |
57 | # pattern to ignore from 'zpool list'. | |
58 | # | |
59 | export NO_POOLS="no pools available" | |
60 | ||
61 | # pattern to ignore from 'zfs list'. | |
62 | export NO_DATASETS="no datasets available" | |
63 | ||
64 | export TEST_BASE_DIR="/var/tmp" | |
65 | ||
66 | # Default to compression ON | |
67 | export COMPRESSION_PROP=on | |
68 | ||
69 | # Default to using the checksum | |
70 | export CHECKSUM_PROP=on | |
71 | ||
72 | # some common variables used by test scripts : | |
73 | export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio | |
74 | export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts | |
75 | ||
76 | # some test pool names | |
77 | export TESTPOOL=testpool | |
78 | export TESTPOOL1=testpool1 | |
79 | export TESTPOOL2=testpool2 | |
80 | export TESTPOOL3=testpool3 | |
81 | export PERFPOOL=perfpool | |
82 | ||
83 | # some test file system names | |
84 | export TESTFS=testfs | |
85 | export TESTFS1=testfs1 | |
86 | export TESTFS2=testfs2 | |
87 | export TESTFS3=testfs3 | |
88 | ||
89 | # some test directory names | |
90 | export TESTDIR=${TEST_BASE_DIR%%/}/testdir | |
91 | export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0 | |
92 | export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1 | |
93 | export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2 | |
94 | ||
95 | # some test sub file system names | |
96 | export TESTSUBFS=subfs | |
97 | export TESTSUBFS1=subfs1 | |
98 | export TESTSUBFS2=subfs2 | |
99 | ||
100 | # some temp files | |
101 | export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$ | |
102 | export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$ | |
103 | export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$ | |
104 | export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$ | |
105 | ||
106 | export ZFSROOT= | |
107 | ||
108 | export TESTSNAP=testsnap | |
109 | export TESTSNAP1=testsnap1 | |
110 | export TESTSNAP2=testsnap2 | |
111 | export TESTCLONE=testclone | |
112 | export TESTCLONE1=testclone1 | |
113 | export TESTCLONE2=testclone2 | |
114 | export TESTCLCT=testclct | |
115 | export TESTCTR=testctr | |
116 | export TESTCTR1=testctr1 | |
117 | export TESTCTR2=testctr2 | |
118 | export TESTVOL=testvol | |
119 | export TESTVOL1=testvol1 | |
120 | export TESTVOL2=testvol2 | |
121 | export TESTFILE0=testfile0 | |
122 | export TESTFILE1=testfile1 | |
123 | export TESTFILE2=testfile2 | |
124 | export TESTBKMARK=testbkmark | |
125 | ||
126 | export LONGPNAME="poolname50charslong_012345678901234567890123456789" | |
127 | export LONGFSNAME="fsysname50charslong_012345678901234567890123456789" | |
128 | export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP" | |
129 | export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP" | |
130 | ||
131 | export VOLSIZE=150m | |
132 | export BIGVOLSIZE=1eb | |
133 | ||
134 | # Default to limit disks to be checked | |
135 | export MAX_FINDDISKSNUM=6 | |
136 | ||
137 | # Default minimum size for file based vdevs in the test suite | |
138 | export MINVDEVSIZE=$((256 * 1024 * 1024)) | |
139 | ||
140 | # Minimum vdev size possible as defined in the OS | |
141 | export SPA_MINDEVSIZE=$((64 * 1024 * 1024)) | |
142 | ||
143 | # For iscsi target support | |
144 | export ISCSITGTFILE=/tmp/iscsitgt_file | |
145 | export ISCSITGT_FMRI=svc:/system/iscsitgt:default | |
146 | if ! is_linux; then | |
147 | export AUTO_SNAP=$(svcs -a | grep auto-snapshot | grep online | awk \ | |
148 | '{print $3}') | |
149 | fi | |
150 | ||
151 | # | |
152 | # finally, if we're running in a local zone | |
153 | # we take some additional actions | |
154 | if ! is_global_zone; then | |
155 | reexport_pool | |
156 | fi | |
157 | ||
158 | export ZFS_VERSION=5 | |
159 | export ZFS_ALL_VERSIONS="1 2 3 4 5" | |
160 | ||
161 | for i in $ZFS_ALL_VERSIONS; do | |
162 | eval 'export ZFS_VERSION_$i="v${i}-fs"' | |
163 | done | |
164 | ||
165 | export MAX_PARTITIONS=8 | |
166 | ||
167 | if is_linux; then | |
168 | unpack_opts="--sparse -xf" | |
169 | pack_opts="--sparse -cf" | |
170 | verbose=" -v" | |
171 | unpack_preserve=" -xpf" | |
172 | pack_preserve=" -cpf" | |
173 | ||
174 | ZVOL_DEVDIR="/dev/zvol" | |
175 | ZVOL_RDEVDIR="/dev/zvol" | |
176 | DEV_RDSKDIR="/dev" | |
177 | DEV_MPATHDIR="/dev/mapper" | |
178 | ||
179 | ZEDLET_DIR="/var/tmp/zed" | |
41d74433 AX |
180 | ZED_LOG="$ZEDLET_DIR/zed.log" |
181 | ZED_DEBUG_LOG="$ZEDLET_DIR/zed.debug.log" | |
cae5b340 AX |
182 | VDEVID_CONF="$ZEDLET_DIR/vdev_id.conf" |
183 | VDEVID_CONF_ETC="/etc/zfs/vdev_id.conf" | |
184 | ||
185 | ||
186 | NEWFS_DEFAULT_FS="ext2" | |
187 | else | |
188 | unpack_opts="xv" | |
189 | pack_opts="cf" | |
190 | verbose="v" | |
191 | unpack_preserve="xpf" | |
192 | pack_preserve="cpf" | |
193 | ||
194 | ZVOL_DEVDIR="/dev/zvol/dsk" | |
195 | ZVOL_RDEVDIR="/dev/zvol/rdsk" | |
196 | DEV_DSKDIR="/dev/dsk" | |
197 | DEV_RDSKDIR="/dev/rdsk" | |
198 | ||
199 | NEWFS_DEFAULT_FS="ufs" | |
200 | fi | |
201 | export unpack_opts pack_opts verbose unpack_preserve pack_preserve \ | |
202 | ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR \ | |
41d74433 | 203 | ZEDLET_DIR ZED_LOG ZED_DEBUG_LOG VDEVID_CONF VDEVID_CONF_ETC |