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 SAVEFH operation test - negative tests
27
28 # include all test enironment
29 source SAVEFH.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
39 # Start testing
40 # --------------------------------------------------------------
41 # a: Savefh without Putrootfh, expect NOFILEHANDLE
42 set expcode "NOFILEHANDLE"
43 set ASSERTION "Savefh without Putrootfh, expect $expcode"
44 putmsg stdout 0 "$TNAME{a}: $ASSERTION"
45 set res [compound {Savefh}]
46 ckres "Savefh" $status $expcode $res $PASS
47
48
49 # e: try to Savefh while file is removed, expect STALE
50 set expcode "STALE"
51 set ASSERTION "try to Savefh while file is removed, expect $expcode"
52 #putmsg stdout 0 "$TNAME{e}: $ASSERTION"
53 #set tmpd "tmp.[pid]"
54 #set res [compound {Putfh $bfh; Create $tmpd {{mode 0775}} d; Getfh
55 # Putfh $bfh; Remove $tmpd; Savefh; Getfh}]
56 #set cont [ckres "Savefh" $status $expcode $res $PASS]
57 #puts "\t Test UNTESTED: XXX need support/hook in server to remove CFH.\n"
58
59
60 # g: Savefh with Bad-Fh, expect BADHANDLE
61 set expcode "BADHANDLE"
62 set ASSERTION "Savefh with Bad-FH, expect $expcode"
63 #putmsg stdout 0 "$TNAME{g}: $ASSERTION"
64 #puts "\t Test UNTESTED: XXX need support/hook in server to trash CFH.\n"
65
66
67 # h: Savefh with WrongSec, expect WRONGSEC
68 set expcode "WRONGSEC"
69 set ASSERTION "Savefh with wrongsec, expect $expcode"
70 #putmsg stdout 0 "$TNAME{h}: $ASSERTION"
71 #puts "\t Test UNTESTED: XXX need hook to change SEC of <CFH> in server.\n"
72
73
74 # m: try to getfh of expired FH, expect FHEXPIRED
75 set expcode "FHEXPIRED"
76 set ASSERTION "Savefh an expired FH, expect $expcode"
77 #putmsg stdout 0 "$TNAME{m}: $ASSERTION"
78 #puts "\t Test UNTESTED: XXX need hook to get FH expired.\n"
79
80
81 # u: XXX how do we simulate some server errors:
82 # NFS4ERR_MOVE
83 # NFS4ERR_SERVERFAULT
84 # NFS4ERR_RESOURCE
85
86
87 # --------------------------------------------------------------
88 # disconnect and exit
89 Disconnect
90 exit $PASS