Home | History | Annotate | Download | only in zfs
      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 # ident	"@(#)default.cfg	1.8	08/11/03 SMI"
     27 #
     28 # Read the user config file, if it exists
     29 #
     30 
     31 . $STF_SUITE/include/libtest.kshlib
     32 
     33 # source the autogenerated commands.cfg file (built from the commands.txt file
     34 . $STF_SUITE/commands.cfg
     35 
     36 # Define run length constants
     37 export RT_LONG="3"
     38 export RT_MEDIUM="2"
     39 export RT_SHORT="1"
     40 
     41 # Define macro for zone test
     42 export ZONE_POOL="zonepool"
     43 export ZONE_CTR="zonectr"
     44 
     45 # Test Suite Specific Commands
     46 export DEVNAME2DEVID="devname2devid"
     47 export FILE_WRITE="file_write"
     48 export FILE_CHECK="file_check"
     49 export LARGEST_FILE="largest_file"
     50 export MMAPWRITE="mmapwrite"
     51 export READMMAP="readmmap"
     52 export FILE_TRUNC="file_trunc"
     53 export CHG_USR_EXEC="chg_usr_exec"
     54 export MKTREE="mktree"
     55 export RANDFREE_FILE="randfree_file"
     56 export DIR_RD_UPDATE="dir_rd_update"
     57 export RM_LNKCNT_ZERO_FILE="rm_lnkcnt_zero_file"
     58 export RENAME_DIR="rename_dir"
     59 
     60 # ensure we're running in the C locale, since
     61 # localised messages may result in test failures
     62 export LC_ALL="C"
     63 export LANG="C"
     64 
     65 #
     66 # pattern to ignore from 'zpool list'. 
     67 #
     68 export NO_POOLS="no pools available"
     69 
     70 # pattern to ignore from 'zfs list'.
     71 export NO_DATASETS="no datasets available"
     72 
     73 export TEST_BASE_DIR="/"
     74 
     75 # Default to compression ON
     76 export COMPRESSION_PROP=on
     77 
     78 # Default to using the checksum
     79 export CHECKSUM_PROP=on
     80 
     81 # some common variables used by test scripts :
     82 
     83 # some test pool names
     84 export TESTPOOL=testpool.$$
     85 export TESTPOOL1=testpool1.$$
     86 export TESTPOOL2=testpool2.$$
     87 export TESTPOOL3=testpool3.$$
     88 
     89 # some test file system names
     90 export TESTFS=testfs.$$
     91 export TESTFS1=testfs1.$$
     92 export TESTFS2=testfs2.$$
     93 export TESTFS3=testfs3.$$
     94 
     95 # some test directory names
     96 export TESTDIR=${TEST_BASE_DIR%%/}/testdir$$
     97 export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0$$
     98 export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1$$
     99 export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2$$
    100 
    101 # Default to limit disks to be checked
    102 export MAX_FINDDISKSNUM=6
    103 
    104 # For iscsi target support
    105 export ISCSITGTFILE=/tmp/iscsitgt_file
    106 export ISCSITGT_FMRI=svc:/system/iscsitgt:default
    107 
    108 export AUTO_SNAP=$($SVCS -a | $GREP auto-snapshot | $GREP online | $AWK '{print $3}')
    109 
    110 #
    111 # finally, if we're running in a local zone
    112 # we take some additional actions
    113 if ! is_global_zone; then
    114 	reexport_pool
    115 fi
    116 
    117 # zfs upgrade should output the first line as:
    118 # This system is currently running ZFS filesystem version 2.
    119 # .
    120 
    121 ZFS_VERSION=
    122 $ZFS upgrade -v > /dev/null 2>&1
    123 if [[ $? -eq 0 ]]; then
    124 	export ZFS_VERSION=$($ZFS upgrade | $HEAD -1 | $AWK '{print $NF}' \
    125 		| $SED -e 's/\.//g')
    126 fi
    127 
    128 if [[ -n $ZFS_VERSION ]]; then
    129 	typeset -i i=1
    130 	ZFS_ALL_VERSIONS=""
    131 	while (( i <= ZFS_VERSION )); do
    132 		eval 'export ZFS_VERSION_$i="v${i}-fs"'
    133 		ZFS_ALL_VERSIONS="$ZFS_ALL_VERSIONS $i"
    134 		(( i = i + 1 ))
    135 	done
    136 	export ZFS_ALL_VERSIONS
    137 fi
    138 
    139 $TRUE
    140