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 # Global test environment used for all tests.
  27 #
  28 
  29 # Test root directory
  30 TESTROOT=${TESTROOT:-`pwd`}; export TESTROOT
  31 
  32 # make sure we use the correct locale to prevent failures
  33 LC_ALL=C; export LC_ALL
  34 
  35 # DNS server for domain information
  36 DNS_SERVER=${DNS_SERVER:-"jurassic.sfbay.sun.com"}; export DNS_SERVER
  37 
  38 # Server lease time period default value
  39 LEASE_TIME=${LEASE_TIME:-90}; export LEASE_TIME
  40 
  41 DELAY=${DELAY:-300}; export DELAY
  42 
  43 # non-global zone path for BASEDIR and MNTPTR
  44 # for Trusted Extensions CIPSO testing.
  45 # For example: ZONE_PATH=/zone/public
  46 #
  47 ZONE_PATH=${ZONE_PATH:-""}; export ZONE_PATH
  48 
  49 # BASE (exported) test directory from $SERVER
  50 # Note:
  51 #       For Trusted Extensions CIPSO connections you
  52 #       MUST define a non-global zone's path in ZONE_PATH.
  53 #       For example:
  54 #               ZONE_PATH=/zone/public
  55 #       This would produce the resultant default BASEDIR of:
  56 #               /zone/public/NFSv4Test
  57 #
  58 #As the nfs4test.env is sourced in the runit script, so in order to produce the
  59 #right BASEDIR, the $ZONE_PATH is needed to strip from the $BASEDIR
  60 BASEDIR=${BASEDIR#$ZONE_PATH}
  61 BASEDIR=$ZONE_PATH${BASEDIR:-"/NFSv4Test"}; export BASEDIR
  62 
  63 # NOTICEDIR restart/reboot daemon test directory
  64 NOTICEDIR=${NOTICEDIR:-"._Notice__Dir_."}; export NOTICEDIR
  65 
  66 # ROOT (exported) test directory from $SERVER
  67 ROOTDIR=${ROOTDIR:-"$BASEDIR/RootFS"}; export ROOTDIR
  68 
  69 # PUBLIC (exported) public option test filesystem from $SERVER
  70 PUBTDIR=${PUBTDIR:-"$BASEDIR/PublicFS"}; export PUBTDIR
  71 
  72 # ROFS (exported) read-only test filesystem from $SERVER
  73 ROFSDIR=${ROFSDIR:-"$BASEDIR/RoFS"}; export ROFSDIR
  74 
  75 # NSPC (exported) test filesystem with no more space from $SERVER
  76 NSPCDIR=${NSPCDIR:-"$BASEDIR/NoSPC_FS"}; export NSPCDIR
  77 
  78 # quota (exported) test filesystem from $SERVER
  79 #
  80 # For Trusted Extensions testing.
  81 #
  82 # QUOTADIR must be prefaced with the zone root path
  83 # of the same zone set in ZONE_PATH. QUOTADIR must
  84 # be set prior to executing any test.
  85 #
  86 # The reason to use the zone root here is that
  87 # in most cases, if not all, there will be a small extra
  88 # file system within the non-global zone to be used for
  89 # QUOTA testing.  The non-global's mount point for that
  90 # file system will based upon its zone root path as part
  91 # of the mount point.
  92 #
  93 # For example, if there is an extra ufs file system in a
  94 # non-global zone called "public" and it is mounted
  95 # locally in "public" under /NFSv4Test, then the
  96 # exported directory for QUOTA_FS from the server in this
  97 # example should be set to:
  98 #       QUOTADIR=/zone/public/root/NFSv4Test/QUOTA_FS
  99 #       export QUOTADIR
 100 #
 101 if [[ ! -z $ZONE_PATH ]]; then
 102         RELDIR=${BASEDIR#$ZONE_PATH}
 103         QUOTADIR=${QUOTADIR:-"$ZONE_PATH/root$RELDIR/QUOTA_FS"}
 104 else
 105         QUOTADIR=${QUOTADIR:-"$BASEDIR/QUOTA_FS"}
 106 fi
 107 export QUOTADIR
 108 
 109 # KRB5 (exported) test filesystem from $SERVER
 110 KRB5DIR=${KRB5DIR:-"$BASEDIR/KRB5_FS"}; export KRB5DIR
 111 
 112 # test filesystems from $SERVER for namespace
 113 SSPCDIR=${SSPCDIR:-"$BASEDIR/SRVsp_FS"}; export SSPCDIR
 114 SSPCDIR2=${SSPCDIR2:-"$SSPCDIR/hide/SRVsp_d2"}; export SSPCDIR2
 115 SSPCDIR3=${SSPCDIR3:-"$SSPCDIR2/hide2/SRVsp_d3"}; export SSPCDIR3
 116 
 117 # NotSh (unexported) UFS test filesystem from $SERVER
 118 NOTSHDIR=${NOTSHDIR:-"$BASEDIR/NotShare_FS"}; export NOTSHDIR
 119 
 120 # NFS mount options to mount BASEDIR on client
 121 NFSMOPT=${NFSMOPT:-"rw,vers=4"}; export NFSMOPT
 122 
 123 # Test users setup in both client and server
 124 #   TUSER1 & TUSER2 are in the same group (10), and TUSER3 is in group (1)
 125 TUSER1=${TUSER1:-"v4test1"}; export TUSER1
 126 TUSER2=${TUSER2:-"v4test2"}; export TUSER2
 127 TUSER3=${TUSER3:-"v4test3"}; export TUSER3
 128 # These users are for uidmapping. TUSERC is only known to the client and 
 129 #       TUSERS is only known to the server
 130 TUSERC=${TUSERC:-"v4testC"}; export TUSERC
 131 TUSERCID="23456780"; export TUSERCID
 132 TUSERC2=${TUSERC2:-"v4testC2"}; export TUSERC2
 133 TUSERS=${TUSERS:-"v4testS"}; export TUSERS
 134 TUSERSID="23456781"; export TUSERSID
 135 TUSERS2=${TUSERS2:-"v4testS2"}; export TUSERS2
 136 TUSERID="23456782"; export TUSERID
 137 TUSERC3=${TUSERC3:-"v4test4"}; export TUSERC3
 138 TUSERS3="$TUSERC3"; export TUSERS3
 139 TUSERCID3="23456783"; export TUSERCID3
 140 TUSERSID3="23456784"; export TUSERSID3
 141 # Special user for uidmapping, with UTF-8 chars of different byte lengths
 142 UTF8_USR="\0176\0337\0200\0357\0200\0200\0367\0200\0200\0200\0373\0200\0200\
 143 \0200\0200\0375\0200\0200\0200\0200\0200"; export UTF8_USR
 144 # Special string for testing a badly formed UTF-8 string
 145 BAD_UTF8="\0337\0377\0357\0377\0377\0367\0377\0377\0377\0373\0377\0377\0377\
 146 \0377\0375\0377\0377\0377\0377\0377\0000\0000";export BAD_UTF8
 147 TUSERUTF8="23456785"; export TUSERUTF8
 148 TUSERBUTF8="23456786"; export TUSERBUTF8
 149 
 150 #default compilers and flags
 151 CC_SRV=${CC_SRV:="/opt/SUNWspro/bin/cc"}
 152 cflags_srv=${cflags_srv:=-g}
 153 export CC_SRV cflags_srv
 154 
 155 # Current user
 156 USER=${USER:-"$TUSER1"}; export USER
 157 
 158 # PATH for framework and testing purposes
 159 PATH=/usr/bin:/usr/sbin:/usr/ucb:${TESTROOT}:.:$PATH; export PATH
 160 
 161 # LD_LIBRARY_PATH & TCL_LIBARAY for TCL library and init file
 162 [ "X$LD_LIBRARY_PATH" != "X" ] && \
 163         LD_LIBRARY_PATH="/usr/lib:$LD_LIBRARY_PATH" || \
 164         LD_LIBRARY_PATH="/usr/lib"
 165 TCL_LIBRARY=${TCL_LIBRARY:-"$LD_LIBRARY_PATH/tcl8.5"}
 166 export LD_LIBRARY_PATH TCL_LIBRARY
 167 
 168 # TRANSPORT to be used to connect to $SERVER
 169 TRANSPORT=${TRANSPORT:-"tcp"}; export TRANSPORT
 170 
 171 # MNTPTR to mount BASEDIR on client
 172 MNTPTR=${MNTPTR#$ZONE_PATH}
 173 MNTPTR=$ZONE_PATH${MNTPTR:-"/NFS4_Mnt"}; export MNTPTR
 174 
 175 # PORT to be used to connect to $SERVER
 176 PORT=${PORT:-"2049"}; export PORT
 177 
 178 # PATH DELIMITER
 179 DELM=${DELM:-"/"}; export DELM
 180 
 181 # DONNOT run go_cleanup in runit script if NOCLEANUP flag is set to "1"
 182 NOCLEANUP=${NOCLEANUP:-"0"}; export NOCLEANUP
 183 
 184 # Timer of how long (in seconds) to wait for server to reboot and come back up
 185 REBOOTIMER=${REBOOTIMER:-"900"}; export REBOOTIMER
 186 
 187 # SERVER's OS
 188 SRVOS=${SRVOS:-"Solaris"}; export SRVOS
 189 
 190 # Config file which will be sourced by others if they need 
 191 CONFIGFILE=/var/tmp/nfsv4/config/config.suite; export CONFIGFILE
 192 
 193 # Results dir for log files
 194 LOGDIR=${LOGDIR:-"/var/tmp/nfsv4-tests/results"}; export LOGDIR
 195 
 196 # Standard test result codes
 197 PASS=0;                 export PASS
 198 FAIL=1;                 export FAIL
 199 UNRESOLVED=2;           export UNRESOLVED
 200 NOTINUSE=3;             export NOTINUSE
 201 UNSUPPORTED=4;          export UNSUPPORTED
 202 UNTESTED=5;             export UNTESTED
 203 UNINITIATED=6;          export UNINITIATED
 204 NORESULT=7;             export NORESULT
 205 WARNING=8;              export WARNING
 206 TIMED_OUT=9;            export TIMED_OUT
 207 OTHER=10;               export OTHER