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.
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.
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]
23 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
28 # Copyright (c) 2016 by Delphix. All rights reserved.
31 . $STF_SUITE/include/commands.cfg
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}
45 export RAIDZ_TEST=${RAIDZ_TEST:-${bindir}/raidz_test}
46 export ARC_SUMMARY=${ARC_SUMMARY:-${bindir}/arc_summary.py}
47 export ARCSTAT=${ARCSTAT:-${bindir}/arcstat.py}
48 export DBUFSTAT=${DBUFSTAT:-${bindir}/dbufstat.py}
50 . $STF_SUITE/include/libtest.shlib
52 # Optionally override the installed ZFS commands to run in-tree
53 if [[ -f "$SRCDIR/zfs-script-config.sh" ]]; then
54 . $SRCDIR/zfs-script-config.sh
57 # Define run length constants
62 # Define macro for zone test
63 export ZONE_POOL="zonepool"
64 export ZONE_CTR="zonectr"
66 # Test Suite Specific Commands
67 helperdir=@datarootdir@/@PACKAGE@/zfs-tests/bin
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}
86 export XATTRTEST=${XATTRTEST:-${helperdir}/xattrtest}
88 # ensure we're running in the C locale, since
89 # localised messages may result in test failures
94 # pattern to ignore from 'zpool list'.
96 export NO_POOLS="no pools available"
98 # pattern to ignore from 'zfs list'.
99 export NO_DATASETS="no datasets available"
101 export TEST_BASE_DIR="/var/tmp"
103 # Default to compression ON
104 export COMPRESSION_PROP=on
106 # Default to using the checksum
107 export CHECKSUM_PROP=on
109 # some common variables used by test scripts :
110 export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio
111 export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts
113 # some test pool names
114 export TESTPOOL=testpool.$$
115 export TESTPOOL1=testpool1.$$
116 export TESTPOOL2=testpool2.$$
117 export TESTPOOL3=testpool3.$$
118 export PERFPOOL=perfpool
120 # some test file system names
121 export TESTFS=testfs.$$
122 export TESTFS1=testfs1.$$
123 export TESTFS2=testfs2.$$
124 export TESTFS3=testfs3.$$
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$$
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.$$
150 export TESTBKMARK=testbkmark$$
152 export LONGPNAME="poolname50charslong_012345678901234567890123456789"
153 export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
154 export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
155 export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
158 export BIGVOLSIZE=1eb
160 # Default to limit disks to be checked
161 export MAX_FINDDISKSNUM=6
163 # For iscsi target support
164 export ISCSITGTFILE=/tmp/iscsitgt_file
165 export ISCSITGT_FMRI=svc:/system/iscsitgt:default
168 # finally, if we're running in a local zone
169 # we take some additional actions
170 if ! is_global_zone; then
175 export ZFS_ALL_VERSIONS="1 2 3 4 5"
177 for i in $ZFS_ALL_VERSIONS; do
178 eval 'export ZFS_VERSION_$i="v${i}-fs"'
181 export MAX_PARTITIONS=8
184 unpack_opts="--sparse -xf"
185 pack_opts="--sparse -cf"
187 unpack_preserve=" -xpf"
188 pack_preserve=" -cpf"
190 ZVOL_DEVDIR="/dev/zvol"
191 ZVOL_RDEVDIR="/dev/zvol"
193 DEV_MPATHDIR="/dev/mapper"
195 NEWFS_DEFAULT_FS="ext2"
200 unpack_preserve="xpf"
203 ZVOL_DEVDIR="/dev/zvol/dsk"
204 ZVOL_RDEVDIR="/dev/zvol/rdsk"
205 DEV_DSKDIR="/dev/dsk"
206 DEV_RDSKDIR="/dev/rdsk"
208 NEWFS_DEFAULT_FS="ufs"
210 export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
211 ZVOL_DEVDIR ZVOL_RDEVDIR NEWFS_DEFAULT_FS DEV_RDSKDIR DEV_MPATHDIR