]> git.proxmox.com Git - mirror_zfs.git/blob - tests/zfs-tests/include/default.cfg.in
tests: standardise on no-arg uname with *) case for illumos
[mirror_zfs.git] / tests / zfs-tests / include / default.cfg.in
1 #!/bin/sh
2
3 #
4 # CDDL HEADER START
5 #
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.
9 #
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
14 #
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]
20 #
21 # CDDL HEADER END
22 #
23
24 #
25 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
26 # Use is subject to license terms.
27 #
28
29 #
30 # Copyright (c) 2016 by Delphix. All rights reserved.
31 # Copyright (c) 2017 Lawrence Livermore National Security, LLC.
32 #
33
34 . $STF_SUITE/include/commands.cfg
35
36 # ZFS Directories
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}
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 # 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}/.)"
67
68 # Default to compression ON
69 export COMPRESSION_PROP=on
70
71 # Default to using the checksum
72 export CHECKSUM_PROP=on
73
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
77
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
84
85 # some test file system names
86 export TESTFS=testfs
87 export TESTFS1=testfs1
88 export TESTFS2=testfs2
89 export TESTFS3=testfs3
90
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
96
97 # some test sub file system names
98 export TESTSUBFS=subfs
99 export TESTSUBFS1=subfs1
100 export TESTSUBFS2=subfs2
101
102 # some temp files
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$$
107
108 export ZFSROOT=
109
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
127
128 export LONGPNAME="poolname50charslong_012345678901234567890123456789"
129 export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
130 export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
131 export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
132
133 export VOLSIZE=150m
134 export BIGVOLSIZE=1eb
135
136 # Default to limit disks to be checked
137 export MAX_FINDDISKSNUM=6
138
139 # Default minimum size for file based vdevs in the test suite
140 export MINVDEVSIZE=$((256 * 1024 * 1024))
141
142 # Minimum vdev size possible as defined in the OS
143 export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
144
145 # For iscsi target support
146 export ISCSITGTFILE=/tmp/iscsitgt_file
147 export ISCSITGT_FMRI=svc:/system/iscsitgt:default
148
149 export ZFS_VERSION=5
150 export ZFS_ALL_VERSIONS="1 2 3 4 5"
151
152 for i in $ZFS_ALL_VERSIONS; do
153 eval 'export ZFS_VERSION_$i="v${i}-fs"'
154 done
155
156 export MAX_PARTITIONS=8
157
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
160
161 # TODO
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"
166 fi
167
168 if [ "@UBSAN_ENABLED@" = "yes" ]; then
169 export UBSAN_OPTIONS=abort_on_error=true:halt_on_error=true:print_stacktrace=true
170 fi
171
172
173 case $(uname) in
174 Linux)
175 unpack_opts="--sparse -xf"
176 pack_opts="--sparse -cf"
177 verbose=" -v"
178 unpack_preserve=" -xpf"
179 pack_preserve=" -cpf"
180
181 ZVOL_DEVDIR="/dev/zvol"
182 ZVOL_RDEVDIR="/dev/zvol"
183 DEV_DSKDIR="/dev"
184 DEV_RDSKDIR="/dev"
185 DEV_MPATHDIR="/dev/mapper"
186
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"
192
193 NEWFS_DEFAULT_FS="ext2"
194 SLICE_PREFIX=""
195 ;;
196 FreeBSD)
197 unpack_opts="xv"
198 pack_opts="cf"
199 verbose="v"
200 unpack_preserve="xpf"
201 pack_preserve="cpf"
202
203 ZVOL_DEVDIR="/dev/zvol"
204 ZVOL_RDEVDIR="/dev/zvol"
205 DEV_DSKDIR="/dev"
206 DEV_RDSKDIR="/dev"
207 DEV_MPATHDIR="/dev/multipath"
208
209 NEWFS_DEFAULT_FS="ufs"
210 SLICE_PREFIX="p"
211 ;;
212 *)
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
218 reexport_pool
219 fi
220
221 unpack_opts="xv"
222 pack_opts="cf"
223 verbose="v"
224 unpack_preserve="xpf"
225 pack_preserve="cpf"
226
227 ZVOL_DEVDIR="/dev/zvol/dsk"
228 ZVOL_RDEVDIR="/dev/zvol/rdsk"
229 DEV_DSKDIR="/dev/dsk"
230 DEV_RDSKDIR="/dev/rdsk"
231
232 NEWFS_DEFAULT_FS="ufs"
233 SLICE_PREFIX="s"
234 ;;
235 esac
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