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 ACCESS operation test - negative tests
27 # verify SERVER errors returned with invalid access.
28
29 # include all test enironment
30 source ACCESS.env
31
32 # connect to the test server
33 Connect
34
35 # setting local variables
36 set TNAME $argv0
37 set bfh [get_fh "$BASEDIRS"]
38
39
40 # Start testing
41 # --------------------------------------------------------------
42 # a: Access without Putrootfh, expect NOFILEHANDLE
43 set expcode "NOFILEHANDLE"
44 set ASSERTION "Access without Putrootfh, expect $expcode"
45 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
46 set res [compound {Access rlmtdx}]
47 ckres "Access" $status $expcode $res $PASS
48
49
50 # b: try to Access while the obj is removed, expect STALE
51 set expcode "STALE"
52 set ASSERTION "try to Access while obj is removed, expect $expcode"
53 #putmsg stdout 0 "$TNAME{b}: $ASSERTION"
54 #set res [compound {Putfh $tfh; Access rlmtdx; Getfh}]
55 #ckres "Access" $status $expcode $res $PASS
56 #puts "\t Test UNTESTED: XXX need separate thread to remove <cfh> in SERVER.\n"
57
58
59 # d: Access when CFH is bad, expect BADHANDLE
60 set expcode "BADHANDLE"
61 set ASSERTION "Access when CFH is bad, expect $expcode"
62 #putmsg stdout 0 "$TNAME{d}: $ASSERTION"
63 #puts "\t Test UNTESTED: XXX need hook to set <cfh> bad in SERVER.\n"
64
65
66 # h: Access when CFH has WrongSec, expect WRONGSEC
67 set expcode "WRONGSEC"
68 set ASSERTION "Access when CFH has WrongSec, expect $expcode"
69 #putmsg stdout 0 "$TNAME{h}: $ASSERTION"
70 #puts "\t Test UNTESTED: XXX need support to change SEC of <cfh> from SERVER.\n"
71
72
73 # i: XXX how do we simulate some server errors:
74 # NFS4ERR_IO
75 # NFS4ERR_MOVE
76 # NFS4ERR_SERVERFAULT
77 # NFS4ERR_RESOURCE
78
79
80 # m: try to getfh of expired FH, expect FHEXPIRED
81 set expcode "FHEXPIRED"
82 set ASSERTION "Access an expired FH, expect $expcode"
83 #putmsg stdout 0 "$TNAME{m}: $ASSERTION"
84 #putmsg stdout 0 "\t Test UNTESTED: XXX need hooks until migration"
85
86
87 # n: Access when CFH is no accessable, expect ACCESS
88 set expcode "ACCESS"
89 set ASSERTION "Access when CFH no accessable, expect $expcode"
90 putmsg stdout 0 "$TNAME{n}: $ASSERTION"
91 puts "\t Test UNSUPPORTED: Invalid for Solaris.\n"
92
93
94 # --------------------------------------------------------------
95 # disconnect and exit
96 Disconnect
97 exit $PASS