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