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 2006 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
25 #
26 # NFSv4 PUTPUBFH operation test - negative tests
27
28 # include all test enironment
29 source PUTPUBFH.env
30
31 # connect to the test server
32 Connect
33
34 # setting local variables
35 set TNAME $argv0
36 set bfh [get_fh $BASEDIRS]
37
38 # Start testing
39 # --------------------------------------------------------------
40 # a: putpubfh while the public-FS is shared with krb5, expect WRONGSEC
41 set expcode "WRONGSEC"
42 set ASSERTION "Putpubfh while the FS is shared with krb5, expect $expcode"
43 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
44 # Need to check for $PUBTDIR to make sure KRB5 is setup in $SERVER
45 set kpath [path2comp $env(PUBTDIR) $DELM]
46 set dname [lrange $kpath 0 end-1]
47 set lname [lrange $kpath end end]
48 set kfh [get_fh $dname]
49 set res [compound {Putfh $kfh; Secinfo $lname}]
50 set slist [lindex [lindex $res 1] 2]
51 if {[lsearch -regexp $slist "KRB5"] == -1} {
52 putmsg stderr 0 \
53 "\t Test NOTINUSE: Server has no KRB5 setup w/Public-FS."
54 } else {
55 set res [compound {Putpubfh; Getfh}]
56 ckres "Putpubfh" $status $expcode $res $PASS
57 }
58
59
60 # b: XXX how do we simulate some server errors:
61 # NFS4ERR_RESOURCE
62 # NFS4ERR_SERVERFAULT
63
64 # c: XXX SERVER has no public FS exported; what should we expect?
65
66 # --------------------------------------------------------------
67 # disconnect and exit
68 Disconnect
69 exit $PASS