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 DIR=$(dirname $0)
29 NAME=$(basename $0)
30
31 . $STF_SUITE/include/sharemnt.kshlib
32 . $STC_GENUTILS/include/nfs-tx.kshlib
33
34 export STC_GENUTILS_DEBUG=$STC_GENUTILS_DEBUG:$SHAREMNT_DEBUG
35 [[ :${SHAREMNT_DEBUG}: = *:${NAME}:* \
36 || :${SHAREMNT_DEBUG}: = *:all:* ]] && set -x
37
38 ################################################################################
39 #
40 # __stc_assertion_start
41 #
42 # ID: nosub_test
43 #
44 # DESCRIPTION:
45 # For the mount and export the SERVER's filesystems with nosub
46 #
47 # STRATEGY:
48 # verify the share and mount/automount behaviors
49 #
50 # TESTABILITY: explicit
51 #
52 # TEST_AUTOMATION_LEVEL: automated
53 #
54 # __stc_assertion_end
55 #
56 ################################################################################
57
58 USAGE="Usage: $0 Test_name Share_opt Mnt_opts"
59
60 if (( $# < 2 )); then
61 echo "$USAGE"
62 exit $STF_UNRESOLVED
63 fi
64
65 typeset Tname=$1
66 typeset Shropt=$2
67 typeset Mntopts=$3
68 typeset res="PASS"
69
70 export SHRDIR_OFFSET="/dir0777"
71
72 # Check TX related info
73 check_for_cipso "$SHRDIR" "$MNTDIR" "$Mntopts" || return $STF_UNSUPPORTED
74
75 case $Mntopts in
76 *2|*3)
77 share_check "$Shropt"
78 do_neg_mount_check "$Mntopts" "$Shropt"
79 do_neg_automount_check "$Mntopts" "NBASIC_NOSUB" "$Shropt"
80 ;;
81 *)
82 # Using the runtests to avoid the duplicate code
83 # Notice the output
84 ret=$(runtests "$Tname" "$Shropt" "$Mntopts")
85 [[ $? != 0 ]] && res="FAIL"
86 echo "$ret" | grep -v "runtests: testing complete"
87 ;;
88 esac
89
90 export SHRDIR_OFFSET=""
91 echo "$NAME: testing complete - Result $res"
92 [[ $res == "PASS" ]] && cleanup $STF_PASS || cleanup $STF_FAIL