1 #! /usr/bin/ksh -p
   2 #
   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 
  23 #
  24 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  25 # Use is subject to license terms.
  26 #
  27 
  28 #
  29 # This subdir tests share a file; it should be cleaned up for other tests.
  30 #
  31 
  32 DIR=$(dirname $0)
  33 NAME=$(basename $0)
  34 
  35 . $STF_SUITE/include/sharemnt.kshlib
  36 
  37 [[ :$SHAREMNT_DEBUG: == *:${NAME}:* \
  38         || :${SHAREMNT_DEBUG}: == *:all:* ]] && set -x
  39 
  40 [[ :$SHAREMNT_DEBUG: == *:RSH:* ]] && SRVDEBUG=all
  41 
  42 # unshare the exported file, just in case, for other testing
  43 RSH root $SERVER \
  44         "export SHAREMNT_DEBUG=$SRVDEBUG; \
  45         $SRV_TMPDIR/srv_setup -u $SHRDIR" > $STF_TMPDIR/rsh.out.$$ 2>&1
  46 if (( $? != 0 )); then
  47         echo "$NAME: failed to unshare <$SHRDIR>"
  48         cat $STF_TMPDIR/rsh.out.$$
  49         echo "\t Tests that follow in execution may fail"
  50         cleanup $STF_FAIL
  51 fi
  52 
  53 [[ :$SRVDEBUG: == *:all:* ]] && cat $STF_TMPDIR/rsh.out.$$
  54 
  55 cleanup $STF_PASS