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