6 # The contents of this file are subject to the terms of the
7 # Common Development and Distribution License (the "License").
8 # You may not use this file except in compliance with the License.
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or https://opensource.org/licenses/CDDL-1.0.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
25 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 # Use is subject to license terms.
30 # Copyright (c) 2016 by Delphix. All rights reserved.
31 # Copyright (c) 2017 Lawrence Livermore National Security, LLC.
34 .
$STF_SUITE/include
/commands.cfg
37 export ZEDLET_ETC_DIR
=${ZEDLET_ETC_DIR:-@sysconfdir@/zfs/zed.d}
38 export ZEDLET_LIBEXEC_DIR
=${ZEDLET_LIBEXEC_DIR:-@zfsexecdir@/zed.d}
39 export ZPOOL_SCRIPT_DIR
=${ZPOOL_SCRIPT_DIR:-@sysconfdir@/zfs/zpool.d}
40 export ZPOOL_COMPAT_DIR
=${ZPOOL_COMPAT_DIR:-@datadir@/zfs/compatibility.d}
42 # Define run length constants
47 # Define macro for zone test
48 export ZONE_POOL
="zonepool"
49 export ZONE_CTR
="zonectr"
51 # ensure we're running in the C locale, since
52 # localised messages may result in test failures
57 # pattern to ignore from 'zpool list'.
59 export NO_POOLS
="no pools available"
61 # pattern to ignore from 'zfs list'.
62 export NO_DATASETS
="no datasets available"
64 # Default directory used for test files
65 # NOTE: remove trailing "/", some functions rely on this to do pattern matching
66 export TEST_BASE_DIR
="$(dirname ${FILEDIR:-/var/tmp}/.)"
68 # Default to compression ON
69 export COMPRESSION_PROP
=on
71 # Default to using the checksum
72 export CHECKSUM_PROP
=on
74 # some common variables used by test scripts :
75 export FIO_SCRIPTS
=$STF_SUITE/tests
/perf
/fio
76 export PERF_SCRIPTS
=$STF_SUITE/tests
/perf
/scripts
78 # some test pool names
79 export TESTPOOL
=testpool
80 export TESTPOOL1
=testpool1
81 export TESTPOOL2
=testpool2
82 export TESTPOOL3
=testpool3
83 export PERFPOOL
=${PERFPOOL:-perfpool}
85 # some test file system names
87 export TESTFS1
=testfs1
88 export TESTFS2
=testfs2
89 export TESTFS3
=testfs3
91 # some test directory names
92 export TESTDIR
=${TEST_BASE_DIR%%/}/testdir
93 export TESTDIR0
=${TEST_BASE_DIR%%/}/testdir0
94 export TESTDIR1
=${TEST_BASE_DIR%%/}/testdir1
95 export TESTDIR2
=${TEST_BASE_DIR%%/}/testdir2
97 # some test sub file system names
98 export TESTSUBFS
=subfs
99 export TESTSUBFS1
=subfs1
100 export TESTSUBFS2
=subfs2
103 export TEMPFILE
=${TEST_BASE_DIR%%/}/tempfile$$
104 export TEMPFILE0
=${TEST_BASE_DIR%%/}/tempfile0$$
105 export TEMPFILE1
=${TEST_BASE_DIR%%/}/tempfile1$$
106 export TEMPFILE2
=${TEST_BASE_DIR%%/}/tempfile2$$
110 export TESTSNAP
=testsnap
111 export TESTSNAP1
=testsnap1
112 export TESTSNAP2
=testsnap2
113 export TESTCLONE
=testclone
114 export TESTCLONE1
=testclone1
115 export TESTCLONE2
=testclone2
116 export TESTCLCT
=testclct
117 export TESTCTR
=testctr
118 export TESTCTR1
=testctr1
119 export TESTCTR2
=testctr2
120 export TESTVOL
=testvol
121 export TESTVOL1
=testvol1
122 export TESTVOL2
=testvol2
123 export TESTFILE0
=testfile0
124 export TESTFILE1
=testfile1
125 export TESTFILE2
=testfile2
126 export TESTBKMARK
=testbkmark
128 export LONGPNAME
="poolname50charslong_012345678901234567890123456789"
129 export LONGFSNAME
="fsysname50charslong_012345678901234567890123456789"
130 export SNAPFS
="$TESTPOOL/$TESTFS@$TESTSNAP"
131 export SNAPFS1
="$TESTPOOL/$TESTVOL@$TESTSNAP"
134 export BIGVOLSIZE
=1eb
136 # Default to limit disks to be checked
137 export MAX_FINDDISKSNUM
=6
139 # Default minimum size for file based vdevs in the test suite
140 export MINVDEVSIZE
=$
((256 * 1024 * 1024))
142 # Minimum vdev size possible as defined in the OS
143 export SPA_MINDEVSIZE
=$
((64 * 1024 * 1024))
145 # For iscsi target support
146 export ISCSITGTFILE
=/tmp
/iscsitgt_file
147 export ISCSITGT_FMRI
=svc
:/system
/iscsitgt
:default
150 export ZFS_ALL_VERSIONS
="1 2 3 4 5"
152 for i
in $ZFS_ALL_VERSIONS; do
153 eval 'export ZFS_VERSION_$i="v${i}-fs"'
156 export MAX_PARTITIONS
=8
158 if [ "@ASAN_ENABLED@" = "yes" ]; then
159 export ASAN_OPTIONS
=abort_on_error
=true
:halt_on_error
=true
:allocator_may_return_null
=true
:disable_coredump
=false
:detect_stack_use_after_return
=true
:detect_odr_violation
=1
162 # disable memory leaks detection
163 # there are quite many of them and they are not as
164 # destructive to CLI programs as they are to daemons
165 export ASAN_OPTIONS
="$ASAN_OPTIONS:detect_leaks=false"
168 if [ "@UBSAN_ENABLED@" = "yes" ]; then
169 export UBSAN_OPTIONS
=abort_on_error
=true
:halt_on_error
=true
:print_stacktrace
=true
175 unpack_opts
="--sparse -xf"
176 pack_opts
="--sparse -cf"
178 unpack_preserve
=" -xpf"
179 pack_preserve
=" -cpf"
181 ZVOL_DEVDIR
="/dev/zvol"
182 ZVOL_RDEVDIR
="/dev/zvol"
185 DEV_MPATHDIR
="/dev/mapper"
187 ZEDLET_DIR
="/var/tmp/zed"
188 ZED_LOG
="$ZEDLET_DIR/zed.log"
189 ZED_DEBUG_LOG
="$ZEDLET_DIR/zed.debug.log"
190 VDEVID_CONF
="$ZEDLET_DIR/vdev_id.conf"
191 VDEVID_CONF_ETC
="/etc/zfs/vdev_id.conf"
193 NEWFS_DEFAULT_FS
="ext2"
200 unpack_preserve
="xpf"
203 ZVOL_DEVDIR
="/dev/zvol"
204 ZVOL_RDEVDIR
="/dev/zvol"
207 DEV_MPATHDIR
="/dev/multipath"
209 NEWFS_DEFAULT_FS
="ufs"
213 export AUTO_SNAP
=$
(svcs
-a | \
214 awk '/auto-snapshot/ && /online/ { print $3 }')
215 # finally, if we're running in a local zone
216 # we take some additional actions
217 if [ "$(zonename 2>/dev/null)" != "global" ]; then
224 unpack_preserve
="xpf"
227 ZVOL_DEVDIR
="/dev/zvol/dsk"
228 ZVOL_RDEVDIR
="/dev/zvol/rdsk"
229 DEV_DSKDIR
="/dev/dsk"
230 DEV_RDSKDIR
="/dev/rdsk"
232 NEWFS_DEFAULT_FS
="ufs"
236 export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
237 ZVOL_DEVDIR ZVOL_RDEVDIR DEV_DSKDIR DEV_RDSKDIR DEV_MPATHDIR \
238 ZEDLET_DIR ZED_LOG ZED_DEBUG_LOG VDEVID_CONF VDEVID_CONF_ETC \
239 NEWFS_DEFAULT_FS SLICE_PREFIX