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