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) 2012, 2016 by Delphix. All rights reserved.
29# Copyright 2019 Joyent, Inc.
30# Copyright (c) 2017 Lawrence Livermore National Security, LLC.
31#
32
33. $STF_SUITE/include/libtest.shlib
34
35# Define run length constants
36export RT_LONG="3"
37export RT_MEDIUM="2"
38export RT_SHORT="1"
39
40# Define macro for zone test
41export ZONE_POOL="zonepool"
42export ZONE_CTR="zonectr"
43
44# ensure we're running in the C locale, since
45# localised messages may result in test failures
46export LC_ALL="C"
47export LANG="C"
48
49#
50# pattern to ignore from 'zpool list'.
51#
52export NO_POOLS="no pools available"
53
54# pattern to ignore from 'zfs list'.
55export NO_DATASETS="no datasets available"
56
57export TEST_BASE_DIR="/var/tmp"
58
59# Default to compression ON
60export COMPRESSION_PROP=on
61
62# Default to using the checksum
63export CHECKSUM_PROP=on
64
65# some common variables used by test scripts :
66export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio
67export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts
68
69# some test pool names
70export TESTPOOL=testpool
71export TESTPOOL1=testpool1
72export TESTPOOL2=testpool2
73export TESTPOOL3=testpool3
74export PERFPOOL=perfpool
75
76# some test file system names
77export TESTFS=testfs
78export TESTFS1=testfs1
79export TESTFS2=testfs2
80export TESTFS3=testfs3
81
82# some test directory names
83export TESTDIR=${TEST_BASE_DIR%%/}/testdir
84export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0
85export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1
86export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2
87
88# some temp files
89export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$
90export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$
91export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$
92export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$
93
94
95# some test sub file system names
96export TESTSUBFS=subfs
97export TESTSUBFS1=subfs1
98export TESTSUBFS2=subfs2
99
100export ZFSROOT=
101
102export TESTSNAP=testsnap
103export TESTSNAP1=testsnap1
104export TESTSNAP2=testsnap2
105export TESTCLONE=testclone
106export TESTCLONE1=testclone1
107export TESTCLONE2=testclone2
108export TESTCLCT=testclct
109export TESTCTR=testctr
110export TESTCTR1=testctr1
111export TESTCTR2=testctr2
112export TESTVOL=testvol
113export TESTVOL1=testvol1
114export TESTVOL2=testvol2
115export TESTFILE0=testfile0
116export TESTFILE1=testfile1
117export TESTFILE2=testfile2
118export TESTBKMARK=testbkmark
119
120export LONGPNAME="poolname50charslong_012345678901234567890123456789"
121export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
122export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
123export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
124
125export VOLSIZE=150m
126export BIGVOLSIZE=1eb
127
128# Default to limit disks to be checked
129export MAX_FINDDISKSNUM=6
130
131# Default minimum size for file based vdevs in the test suite
132export MINVDEVSIZE=$((256 * 1024 * 1024))
133
134# Minimum vdev size possible as defined in the OS
135export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
136
137export AUTO_SNAP=$(svcs -a | grep auto-snapshot | grep online | awk \
138    '{print $3}')
139
140# finally, if we're running in a local zone
141# we take some additional actions
142if ! is_global_zone; then
143	reexport_pool
144fi
145
146export ZFS_VERSION=5
147export ZFS_ALL_VERSIONS="1 2 3 4 5"
148
149for i in $ZFS_ALL_VERSIONS; do
150	eval 'export ZFS_VERSION_$i="v${i}-fs"'
151done
152
153export ZVOL_DEVDIR="/dev/zvol/dsk"
154export ZVOL_RDEVDIR="/dev/zvol/rdsk"
155export DEV_DSKDIR="/dev/dsk"
156export DEV_RDSKDIR="/dev/rdsk"
157
158export NEWFS_DEFAULT_FS="ufs"
159