xref: /freebsd/tests/sys/cddl/zfs/include/constants.cfg (revision 148a8da8)
1#!/usr/bin/env ksh93
2# vim: filetype=sh
3# $FreeBSD$
4
5# Add test-specific binaries to PATH
6export PATH=${STF_SUITE}/bin:${PATH}
7export TMPDIR=${TMPDIR-/tmp}
8
9# Set default value of TMPDIR
10export TMPDIR=${TMPDIR-/tmp}
11
12# Define run length constants
13export RT_LONG="3"
14export RT_MEDIUM="2"
15export RT_SHORT="1"
16
17# Define macro for zone test
18export ZONE_POOL="zonepool"
19export ZONE_CTR="zonectr"
20
21# Test Suite Specific Commands
22export DEVNAME2DEVID="devname2devid"
23export FILE_WRITE="file_write"
24export FILE_CHECK="file_check"
25export LARGEST_FILE="largest_file"
26export MMAPWRITE="mmapwrite"
27export MKFILE="mkfile"
28export READMMAP="readmmap"
29export FILE_TRUNC="file_trunc"
30export CHG_USR_EXEC="chg_usr_exec"
31export MKTREE="mktree"
32export RANDFREE_FILE="randfree_file"
33export DIR_RD_UPDATE="dir_rd_update"
34export RM_LNKCNT_ZERO_FILE="rm_lnkcnt_zero_file"
35export RENAME_DIR="rename_dir"
36
37# ensure we're running in the C locale, since
38# localised messages may result in test failures
39export LC_ALL="C"
40export LANG="C"
41
42#
43# pattern to ignore from 'zpool list'.
44#
45export NO_POOLS="no pools available"
46
47# pattern to ignore from 'zfs list'.
48export NO_DATASETS="no datasets available"
49
50export TEST_BASE_DIR="/"
51
52# Default to compression ON
53export COMPRESSION_PROP=on
54
55# Default to using the checksum
56export CHECKSUM_PROP=on
57
58# some common variables used by test scripts :
59
60export TESTCASE_ID=${TESTCASE_ID:-$$}
61# some test pool names
62export TESTPOOL=testpool.${TESTCASE_ID}
63export TESTPOOL1=testpool1.${TESTCASE_ID}
64export TESTPOOL2=testpool2.${TESTCASE_ID}
65export TESTPOOL3=testpool3.${TESTCASE_ID}
66
67# some test file system names
68export TESTCTR=testctr${TESTCASE_ID}
69export TESTFS=testfs.${TESTCASE_ID}
70export TESTFS1=testfs1.${TESTCASE_ID}
71export TESTFS2=testfs2.${TESTCASE_ID}
72export TESTFS3=testfs3.${TESTCASE_ID}
73
74# some test directory names
75export TESTDIR=${TEST_BASE_DIR%%/}/testdir${TESTCASE_ID}
76export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0${TESTCASE_ID}
77export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1${TESTCASE_ID}
78export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2${TESTCASE_ID}
79
80# Default to limit disks to be checked
81export MAX_FINDDISKSNUM=100
82
83# For iscsi target support
84export ISCSITGTFILE=$TMPDIR/iscsitgt_file
85export ISCSITGT_FMRI=svc:/system/iscsitgt:default
86
87if [ -n "$SVCS" ]; then
88    export AUTO_SNAP=$($SVCS -a | $GREP auto-snapshot | $GREP online | $AWK '{print $3}')
89fi
90
91# zfs upgrade should output the first line as:
92# This system is currently running ZFS filesystem version 2.
93# .
94
95ZFS_VERSION=
96$ZFS upgrade -v > /dev/null 2>&1
97if [ $? -eq 0 ]; then
98	export ZFS_VERSION=$($ZFS upgrade | $HEAD -1 | $AWK '{print $NF}' \
99		| $SED -e 's/\.//g')
100fi
101
102if [ -n "$ZFS_VERSION" ]; then
103	i=1
104	ZFS_ALL_VERSIONS=""
105	while [ "$i" -le "$ZFS_VERSION" ]; do
106		eval 'export ZFS_VERSION_$i="v${i}-fs"'
107		ZFS_ALL_VERSIONS="$ZFS_ALL_VERSIONS $i"
108		i=$(( i + 1 ))
109	done
110	export ZFS_ALL_VERSIONS
111fi
112
113$TRUE
114