Print this page
7290 ZFS test suite needs to control what utilities it can run
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>


  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/commands.cfg
  32 . $STF_SUITE/include/libtest.shlib
  33 
  34 # Define run length constants
  35 export RT_LONG="3"
  36 export RT_MEDIUM="2"
  37 export RT_SHORT="1"
  38 
  39 # Define macro for zone test
  40 export ZONE_POOL="zonepool"
  41 export ZONE_CTR="zonectr"
  42 
  43 # Test Suite Specific Commands
  44 export CHG_USR_EXEC="/opt/zfs-tests/bin/chg_usr_exec"
  45 export DEVNAME2DEVID="/opt/zfs-tests/bin/devname2devid"
  46 export DIR_RD_UPDATE="/opt/zfs-tests/bin/dir_rd_update"
  47 export FILE_CHECK="/opt/zfs-tests/bin/file_check"
  48 export FILE_TRUNC="/opt/zfs-tests/bin/file_trunc"
  49 export FILE_WRITE="/opt/zfs-tests/bin/file_write"
  50 export GETHOLES="/opt/zfs-tests/bin/getholes"
  51 export LARGEST_FILE="/opt/zfs-tests/bin/largest_file"
  52 export MKBUSY="/opt/zfs-tests/bin/mkbusy"
  53 export MKFILES="/opt/zfs-tests/bin/mkfiles"
  54 export MKHOLES="/opt/zfs-tests/bin/mkholes"
  55 export MKTREE="/opt/zfs-tests/bin/mktree"
  56 export MMAPWRITE="/opt/zfs-tests/bin/mmapwrite"
  57 export RANDFREE_FILE="/opt/zfs-tests/bin/randfree_file"
  58 export READMMAP="/opt/zfs-tests/bin/readmmap"
  59 export RENAME_DIR="/opt/zfs-tests/bin/rename_dir"
  60 export RM_LNKCNT_ZERO_FILE="/opt/zfs-tests/bin/rm_lnkcnt_zero_file"
  61 
  62 # ensure we're running in the C locale, since
  63 # localised messages may result in test failures
  64 export LC_ALL="C"
  65 export LANG="C"
  66 
  67 #
  68 # pattern to ignore from 'zpool list'.
  69 #
  70 export NO_POOLS="no pools available"
  71 
  72 # pattern to ignore from 'zfs list'.
  73 export NO_DATASETS="no datasets available"
  74 
  75 export TEST_BASE_DIR="/"
  76 
  77 # Default to compression ON
  78 export COMPRESSION_PROP=on
  79 
  80 # Default to using the checksum
  81 export CHECKSUM_PROP=on


 122 export TESTFILE1=testfile1.$$
 123 export TESTFILE2=testfile2.$$
 124 
 125 export LONGPNAME="poolname50charslong_012345678901234567890123456789"
 126 export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
 127 export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
 128 export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
 129 
 130 export VOLSIZE=150m
 131 export BIGVOLSIZE=1eb
 132 
 133 # Default to limit disks to be checked
 134 export MAX_FINDDISKSNUM=6
 135 
 136 # Default minimum size for file based vdevs in the test suite
 137 export MINVDEVSIZE=$((256 * 1024 * 1024))
 138 
 139 # Minimum vdev size possible as defined in the OS
 140 export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
 141 
 142 export AUTO_SNAP=$($SVCS -a | $GREP auto-snapshot | $GREP online | $AWK \
 143     '{print $3}')
 144 
 145 # finally, if we're running in a local zone
 146 # we take some additional actions
 147 if ! is_global_zone; then
 148         reexport_pool
 149 fi
 150 
 151 export ZFS_VERSION=5
 152 export ZFS_ALL_VERSIONS="1 2 3 4 5"
 153 
 154 for i in $ZFS_ALL_VERSIONS; do
 155         eval 'export ZFS_VERSION_$i="v${i}-fs"'
 156 done


  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


 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