]>
Commit | Line | Data |
---|---|---|
6bb24f4d BB |
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. | |
a454868b | 29 | # Copyright (c) 2017 Lawrence Livermore National Security, LLC. |
6bb24f4d BB |
30 | # |
31 | ||
32 | . $STF_SUITE/include/commands.cfg | |
e6123796 JX |
33 | |
34 | # Common paths | |
35 | bindir=@bindir@ | |
36 | sbindir=@sbindir@ | |
37 | ||
38 | # ZFS Commands | |
39 | export ZDB=${ZDB:-${sbindir}/zdb} | |
40 | export ZFS=${ZFS:-${sbindir}/zfs} | |
41 | export ZHACK=${ZHACK:-${sbindir}/zhack} | |
42 | export ZINJECT=${ZINJECT:-${sbindir}/zinject} | |
43 | export ZPOOL=${ZPOOL:-${sbindir}/zpool} | |
44 | export ZTEST=${ZTEST:-${sbindir}/ztest} | |
45 | export ZPIOS=${ZPIOS:-${sbindir}/zpios} | |
ab9f4b0b | 46 | export RAIDZ_TEST=${RAIDZ_TEST:-${bindir}/raidz_test} |
70c7714d GDN |
47 | export ARC_SUMMARY=${ARC_SUMMARY:-${bindir}/arc_summary.py} |
48 | export ARCSTAT=${ARCSTAT:-${bindir}/arcstat.py} | |
49 | export DBUFSTAT=${DBUFSTAT:-${bindir}/dbufstat.py} | |
e6123796 | 50 | |
6bb24f4d BB |
51 | . $STF_SUITE/include/libtest.shlib |
52 | ||
53 | # Optionally override the installed ZFS commands to run in-tree | |
9911a9c4 LH |
54 | if [[ -f "$SRCDIR/zfs-script-config.sh" ]]; then |
55 | . $SRCDIR/zfs-script-config.sh | |
6bb24f4d BB |
56 | fi |
57 | ||
58 | # Define run length constants | |
59 | export RT_LONG="3" | |
60 | export RT_MEDIUM="2" | |
61 | export RT_SHORT="1" | |
62 | ||
63 | # Define macro for zone test | |
64 | export ZONE_POOL="zonepool" | |
65 | export ZONE_CTR="zonectr" | |
66 | ||
6bb24f4d | 67 | # Test Suite Specific Commands |
e6123796 | 68 | helperdir=@datarootdir@/@PACKAGE@/zfs-tests/bin |
6bb24f4d BB |
69 | export CHG_USR_EXEC=${CHG_USR_EXEC:-${helperdir}/chg_usr_exec} |
70 | export DEVNAME2DEVID=${DEVNAME2DEVID:-${helperdir}/devname2devid} | |
71 | export DIR_RD_UPDATE=${DIR_RD_UPDATE:-${helperdir}/dir_rd_update} | |
72 | export FILE_CHECK=${FILE_CHECK:-${helperdir}/file_check} | |
73 | export FILE_TRUNC=${FILE_TRUNC:-${helperdir}/file_trunc} | |
74 | export FILE_WRITE=${FILE_WRITE:-${helperdir}/file_write} | |
75 | export LARGEST_FILE=${LARGEST_FILE:-${helperdir}/largest_file} | |
76 | export MKBUSY=${MKBUSY:-${helperdir}/mkbusy} | |
77 | export MKFILE=${MKFILE:-${helperdir}/mkfile} | |
78 | export MKFILES=${MKFILES:-${helperdir}/mkfiles} | |
79 | export MKTREE=${MKTREE:-${helperdir}/mktree} | |
80 | export MMAP_EXEC=${MMAP_EXEC:-${helperdir}/mmap_exec} | |
81 | export MMAPWRITE=${MMAPWRITE:-${helperdir}/mmapwrite} | |
82 | export RANDFREE_FILE=${RANDFREE_FILE:-${helperdir}/randfree_file} | |
83 | export READMMAP=${READMMAP:-${helperdir}/readmmap} | |
84 | export RENAME_DIR=${RENAME_DIR:-${helperdir}/rename_dir} | |
85 | export RM_LNKCNT_ZERO_FILE=${RM_LNKCNT_ZERO_FILE:-${helperdir}/rm_lnkcnt_zero_file} | |
86 | export THREADSAPPEND=${THREADSAPPEND:-${helperdir}/threadsappend} | |
50c957f7 | 87 | export XATTRTEST=${XATTRTEST:-${helperdir}/xattrtest} |
6bb24f4d BB |
88 | |
89 | # ensure we're running in the C locale, since | |
90 | # localised messages may result in test failures | |
91 | export LC_ALL="C" | |
92 | export LANG="C" | |
93 | ||
94 | # | |
95 | # pattern to ignore from 'zpool list'. | |
96 | # | |
97 | export NO_POOLS="no pools available" | |
98 | ||
99 | # pattern to ignore from 'zfs list'. | |
100 | export NO_DATASETS="no datasets available" | |
101 | ||
102 | export TEST_BASE_DIR="/var/tmp" | |
103 | ||
104 | # Default to compression ON | |
105 | export COMPRESSION_PROP=on | |
106 | ||
107 | # Default to using the checksum | |
108 | export CHECKSUM_PROP=on | |
109 | ||
110 | # some common variables used by test scripts : | |
679d73e9 JWK |
111 | export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio |
112 | export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts | |
6bb24f4d BB |
113 | |
114 | # some test pool names | |
115 | export TESTPOOL=testpool.$$ | |
116 | export TESTPOOL1=testpool1.$$ | |
117 | export TESTPOOL2=testpool2.$$ | |
118 | export TESTPOOL3=testpool3.$$ | |
679d73e9 | 119 | export PERFPOOL=perfpool |
6bb24f4d BB |
120 | |
121 | # some test file system names | |
122 | export TESTFS=testfs.$$ | |
123 | export TESTFS1=testfs1.$$ | |
124 | export TESTFS2=testfs2.$$ | |
125 | export TESTFS3=testfs3.$$ | |
126 | ||
127 | # some test directory names | |
128 | export TESTDIR=${TEST_BASE_DIR%%/}/testdir$$ | |
129 | export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$ | |
130 | export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$ | |
131 | export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$ | |
132 | ||
a454868b OF |
133 | # some temp files |
134 | export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$ | |
135 | export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$ | |
136 | export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$ | |
137 | export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$ | |
138 | ||
6bb24f4d BB |
139 | export ZFSROOT= |
140 | ||
141 | export TESTSNAP=testsnap$$ | |
142 | export TESTSNAP1=testsnap1$$ | |
143 | export TESTSNAP2=testsnap2$$ | |
144 | export TESTCLONE=testclone$$ | |
145 | export TESTCLONE1=testclone1$$ | |
146 | export TESTCLONE2=testclone2$$ | |
147 | export TESTCLCT=testclct$$ | |
148 | export TESTCTR=testctr$$ | |
149 | export TESTCTR1=testctr1$$ | |
150 | export TESTCTR2=testctr2$$ | |
151 | export TESTVOL=testvol$$ | |
152 | export TESTVOL1=testvol1$$ | |
153 | export TESTVOL2=testvol2$$ | |
154 | export TESTFILE0=testfile0.$$ | |
155 | export TESTFILE1=testfile1.$$ | |
156 | export TESTFILE2=testfile2.$$ | |
aeacdefe | 157 | export TESTBKMARK=testbkmark$$ |
6bb24f4d BB |
158 | |
159 | export LONGPNAME="poolname50charslong_012345678901234567890123456789" | |
160 | export LONGFSNAME="fsysname50charslong_012345678901234567890123456789" | |
161 | export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP" | |
162 | export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP" | |
163 | ||
164 | export VOLSIZE=150m | |
165 | export BIGVOLSIZE=1eb | |
166 | ||
167 | # Default to limit disks to be checked | |
168 | export MAX_FINDDISKSNUM=6 | |
169 | ||
d7958b4c MA |
170 | # Default minimum size for file based vdevs in the test suite |
171 | export MINVDEVSIZE=$((256 * 1024 * 1024)) | |
172 | ||
173 | # Minimum vdev size possible as defined in the OS | |
174 | export SPA_MINDEVSIZE=$((64 * 1024 * 1024)) | |
175 | ||
6bb24f4d BB |
176 | # For iscsi target support |
177 | export ISCSITGTFILE=/tmp/iscsitgt_file | |
178 | export ISCSITGT_FMRI=svc:/system/iscsitgt:default | |
179 | ||
180 | # | |
181 | # finally, if we're running in a local zone | |
182 | # we take some additional actions | |
183 | if ! is_global_zone; then | |
184 | reexport_pool | |
185 | fi | |
186 | ||
187 | export ZFS_VERSION=5 | |
188 | export ZFS_ALL_VERSIONS="1 2 3 4 5" | |
189 | ||
190 | for i in $ZFS_ALL_VERSIONS; do | |
191 | eval 'export ZFS_VERSION_$i="v${i}-fs"' | |
192 | done | |
193 | ||
7050a65d SV |
194 | export MAX_PARTITIONS=8 |
195 | ||
6bb24f4d BB |
196 | if is_linux; then |
197 | unpack_opts="--sparse -xf" | |
198 | pack_opts="--sparse -cf" | |
199 | verbose=" -v" | |
200 | unpack_preserve=" -xpf" | |
201 | pack_preserve=" -cpf" | |
202 | ||
203 | ZVOL_DEVDIR="/dev/zvol" | |
204 | ZVOL_RDEVDIR="/dev/zvol" | |
6bb24f4d | 205 | DEV_RDSKDIR="/dev" |
7050a65d | 206 | DEV_MPATHDIR="/dev/mapper" |
6bb24f4d BB |
207 | |
208 | NEWFS_DEFAULT_FS="ext2" | |
209 | else | |
210 | unpack_opts="xv" | |
211 | pack_opts="cf" | |
212 | verbose="v" | |
213 | unpack_preserve="xpf" | |
214 | pack_preserve="cpf" | |
215 | ||
216 | ZVOL_DEVDIR="/dev/zvol/dsk" | |
217 | ZVOL_RDEVDIR="/dev/zvol/rdsk" | |
218 | DEV_DSKDIR="/dev/dsk" | |
219 | DEV_RDSKDIR="/dev/rdsk" | |
220 | ||
221 | NEWFS_DEFAULT_FS="ufs" | |
222 | fi | |
223 | export unpack_opts pack_opts verbose unpack_preserve pack_preserve \ | |
7050a65d | 224 | ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR |