1d583b39bSJohn Wren Kennedy# 2d583b39bSJohn Wren Kennedy# CDDL HEADER START 3d583b39bSJohn Wren Kennedy# 4d583b39bSJohn Wren Kennedy# The contents of this file are subject to the terms of the 5d583b39bSJohn Wren Kennedy# Common Development and Distribution License (the "License"). 6d583b39bSJohn Wren Kennedy# You may not use this file except in compliance with the License. 7d583b39bSJohn Wren Kennedy# 8d583b39bSJohn Wren Kennedy# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9d583b39bSJohn Wren Kennedy# or http://www.opensolaris.org/os/licensing. 10d583b39bSJohn Wren Kennedy# See the License for the specific language governing permissions 11d583b39bSJohn Wren Kennedy# and limitations under the License. 12d583b39bSJohn Wren Kennedy# 13d583b39bSJohn Wren Kennedy# When distributing Covered Code, include this CDDL HEADER in each 14d583b39bSJohn Wren Kennedy# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15d583b39bSJohn Wren Kennedy# If applicable, add the following below this CDDL HEADER, with the 16d583b39bSJohn Wren Kennedy# fields enclosed by brackets "[]" replaced with your own identifying 17d583b39bSJohn Wren Kennedy# information: Portions Copyright [yyyy] [name of copyright owner] 18d583b39bSJohn Wren Kennedy# 19d583b39bSJohn Wren Kennedy# CDDL HEADER END 20d583b39bSJohn Wren Kennedy# 21d583b39bSJohn Wren Kennedy 22d583b39bSJohn Wren Kennedy# 23d583b39bSJohn Wren Kennedy# Copyright 2008 Sun Microsystems, Inc. All rights reserved. 24d583b39bSJohn Wren Kennedy# Use is subject to license terms. 25d583b39bSJohn Wren Kennedy# 26d583b39bSJohn Wren Kennedy 27d583b39bSJohn Wren Kennedy# 28286ef713SPaul Dagnelie# Copyright (c) 2012, 2016 by Delphix. All rights reserved. 29d583b39bSJohn Wren Kennedy# 30d583b39bSJohn Wren Kennedy 31d583b39bSJohn Wren Kennedy. $STF_SUITE/include/commands.cfg 32d583b39bSJohn Wren Kennedy. $STF_SUITE/include/libtest.shlib 33d583b39bSJohn Wren Kennedy 34d583b39bSJohn Wren Kennedy# Define run length constants 35d583b39bSJohn Wren Kennedyexport RT_LONG="3" 36d583b39bSJohn Wren Kennedyexport RT_MEDIUM="2" 37d583b39bSJohn Wren Kennedyexport RT_SHORT="1" 38d583b39bSJohn Wren Kennedy 39d583b39bSJohn Wren Kennedy# Define macro for zone test 40d583b39bSJohn Wren Kennedyexport ZONE_POOL="zonepool" 41d583b39bSJohn Wren Kennedyexport ZONE_CTR="zonectr" 42d583b39bSJohn Wren Kennedy 43d583b39bSJohn Wren Kennedy# Test Suite Specific Commands 44d583b39bSJohn Wren Kennedyexport CHG_USR_EXEC="/opt/zfs-tests/bin/chg_usr_exec" 45d583b39bSJohn Wren Kennedyexport DEVNAME2DEVID="/opt/zfs-tests/bin/devname2devid" 46d583b39bSJohn Wren Kennedyexport DIR_RD_UPDATE="/opt/zfs-tests/bin/dir_rd_update" 47d583b39bSJohn Wren Kennedyexport FILE_CHECK="/opt/zfs-tests/bin/file_check" 48d583b39bSJohn Wren Kennedyexport FILE_TRUNC="/opt/zfs-tests/bin/file_trunc" 49d583b39bSJohn Wren Kennedyexport FILE_WRITE="/opt/zfs-tests/bin/file_write" 5052244c09SJohn Wren Kennedyexport GETHOLES="/opt/zfs-tests/bin/getholes" 51d583b39bSJohn Wren Kennedyexport LARGEST_FILE="/opt/zfs-tests/bin/largest_file" 52d583b39bSJohn Wren Kennedyexport MKBUSY="/opt/zfs-tests/bin/mkbusy" 53286ef713SPaul Dagnelieexport MKFILES="/opt/zfs-tests/bin/mkfiles" 5452244c09SJohn Wren Kennedyexport MKHOLES="/opt/zfs-tests/bin/mkholes" 55d583b39bSJohn Wren Kennedyexport MKTREE="/opt/zfs-tests/bin/mktree" 56d583b39bSJohn Wren Kennedyexport MMAPWRITE="/opt/zfs-tests/bin/mmapwrite" 57d583b39bSJohn Wren Kennedyexport RANDFREE_FILE="/opt/zfs-tests/bin/randfree_file" 58d583b39bSJohn Wren Kennedyexport READMMAP="/opt/zfs-tests/bin/readmmap" 59d583b39bSJohn Wren Kennedyexport RENAME_DIR="/opt/zfs-tests/bin/rename_dir" 60d583b39bSJohn Wren Kennedyexport RM_LNKCNT_ZERO_FILE="/opt/zfs-tests/bin/rm_lnkcnt_zero_file" 61d583b39bSJohn Wren Kennedy 62d583b39bSJohn Wren Kennedy# ensure we're running in the C locale, since 63d583b39bSJohn Wren Kennedy# localised messages may result in test failures 64d583b39bSJohn Wren Kennedyexport LC_ALL="C" 65d583b39bSJohn Wren Kennedyexport LANG="C" 66d583b39bSJohn Wren Kennedy 67d583b39bSJohn Wren Kennedy# 68d583b39bSJohn Wren Kennedy# pattern to ignore from 'zpool list'. 69d583b39bSJohn Wren Kennedy# 70d583b39bSJohn Wren Kennedyexport NO_POOLS="no pools available" 71d583b39bSJohn Wren Kennedy 72d583b39bSJohn Wren Kennedy# pattern to ignore from 'zfs list'. 73d583b39bSJohn Wren Kennedyexport NO_DATASETS="no datasets available" 74d583b39bSJohn Wren Kennedy 75d583b39bSJohn Wren Kennedyexport TEST_BASE_DIR="/" 76d583b39bSJohn Wren Kennedy 77d583b39bSJohn Wren Kennedy# Default to compression ON 78d583b39bSJohn Wren Kennedyexport COMPRESSION_PROP=on 79d583b39bSJohn Wren Kennedy 80d583b39bSJohn Wren Kennedy# Default to using the checksum 81d583b39bSJohn Wren Kennedyexport CHECKSUM_PROP=on 82d583b39bSJohn Wren Kennedy 83d583b39bSJohn Wren Kennedy# some common variables used by test scripts : 84d583b39bSJohn Wren Kennedy 85d583b39bSJohn Wren Kennedy# some test pool names 86d583b39bSJohn Wren Kennedyexport TESTPOOL=testpool.$$ 87d583b39bSJohn Wren Kennedyexport TESTPOOL1=testpool1.$$ 88d583b39bSJohn Wren Kennedyexport TESTPOOL2=testpool2.$$ 89d583b39bSJohn Wren Kennedyexport TESTPOOL3=testpool3.$$ 90d583b39bSJohn Wren Kennedy 91d583b39bSJohn Wren Kennedy# some test file system names 92d583b39bSJohn Wren Kennedyexport TESTFS=testfs.$$ 93d583b39bSJohn Wren Kennedyexport TESTFS1=testfs1.$$ 94d583b39bSJohn Wren Kennedyexport TESTFS2=testfs2.$$ 95d583b39bSJohn Wren Kennedyexport TESTFS3=testfs3.$$ 96d583b39bSJohn Wren Kennedy 97d583b39bSJohn Wren Kennedy# some test directory names 98d583b39bSJohn Wren Kennedyexport TESTDIR=${TEST_BASE_DIR%%/}/testdir$$ 99d583b39bSJohn Wren Kennedyexport TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$ 100d583b39bSJohn Wren Kennedyexport TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$ 101d583b39bSJohn Wren Kennedyexport TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$ 102d583b39bSJohn Wren Kennedy 103d583b39bSJohn Wren Kennedyexport ZFSROOT= 104d583b39bSJohn Wren Kennedy 105d583b39bSJohn Wren Kennedyexport TESTSNAP=testsnap$$ 106d583b39bSJohn Wren Kennedyexport TESTSNAP1=testsnap1$$ 107d583b39bSJohn Wren Kennedyexport TESTSNAP2=testsnap2$$ 108d583b39bSJohn Wren Kennedyexport TESTCLONE=testclone$$ 109d583b39bSJohn Wren Kennedyexport TESTCLONE1=testclone1$$ 110d583b39bSJohn Wren Kennedyexport TESTCLONE2=testclone2$$ 111d583b39bSJohn Wren Kennedyexport TESTCLCT=testclct$$ 112d583b39bSJohn Wren Kennedyexport TESTCTR=testctr$$ 113d583b39bSJohn Wren Kennedyexport TESTCTR1=testctr1$$ 114d583b39bSJohn Wren Kennedyexport TESTCTR2=testctr2$$ 115d583b39bSJohn Wren Kennedyexport TESTVOL=testvol$$ 116d583b39bSJohn Wren Kennedyexport TESTVOL1=testvol1$$ 117d583b39bSJohn Wren Kennedyexport TESTVOL2=testvol2$$ 118d583b39bSJohn Wren Kennedyexport TESTFILE0=testfile0.$$ 119d583b39bSJohn Wren Kennedyexport TESTFILE1=testfile1.$$ 120d583b39bSJohn Wren Kennedyexport TESTFILE2=testfile2.$$ 121*fbc66171SMarcel Telkaexport TESTBKMARK=testbkmark$$ 122d583b39bSJohn Wren Kennedy 123d583b39bSJohn Wren Kennedyexport LONGPNAME="poolname50charslong_012345678901234567890123456789" 124d583b39bSJohn Wren Kennedyexport LONGFSNAME="fsysname50charslong_012345678901234567890123456789" 125d583b39bSJohn Wren Kennedyexport SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP" 126d583b39bSJohn Wren Kennedyexport SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP" 127d583b39bSJohn Wren Kennedy 128d583b39bSJohn Wren Kennedyexport VOLSIZE=150m 129d583b39bSJohn Wren Kennedyexport BIGVOLSIZE=1eb 130d583b39bSJohn Wren Kennedy 131d583b39bSJohn Wren Kennedy# Default to limit disks to be checked 132d583b39bSJohn Wren Kennedyexport MAX_FINDDISKSNUM=6 133d583b39bSJohn Wren Kennedy 134d583b39bSJohn Wren Kennedyexport AUTO_SNAP=$($SVCS -a | $GREP auto-snapshot | $GREP online | $AWK \ 135d583b39bSJohn Wren Kennedy '{print $3}') 136d583b39bSJohn Wren Kennedy 137d583b39bSJohn Wren Kennedy# finally, if we're running in a local zone 138d583b39bSJohn Wren Kennedy# we take some additional actions 139d583b39bSJohn Wren Kennedyif ! is_global_zone; then 140d583b39bSJohn Wren Kennedy reexport_pool 141d583b39bSJohn Wren Kennedyfi 142d583b39bSJohn Wren Kennedy 143d583b39bSJohn Wren Kennedyexport ZFS_VERSION=5 144d583b39bSJohn Wren Kennedyexport ZFS_ALL_VERSIONS="1 2 3 4 5" 145d583b39bSJohn Wren Kennedy 146d583b39bSJohn Wren Kennedyfor i in $ZFS_ALL_VERSIONS; do 147d583b39bSJohn Wren Kennedy eval 'export ZFS_VERSION_$i="v${i}-fs"' 148d583b39bSJohn Wren Kennedydone 149