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 READ operation test - more negative tests
27 # verify SERVER errors returned with invalid read.
28
29 # include all test enironment
30 source READ.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: Read a file where <cfh> is bad - expect BADHANDLE
43 #
44 set expcode "BADHANDLE"
45 set ASSERTION "Read a file w/<cfh> bad, expect $expcode"
46 #set tag "$TNAME{a}"
47 #putmsg stdout 0 "$tag: $ASSERTION"
48 #puts "\t TEST UNTESTED: XXX need hook to trash <cfh> from server.\n"
49
50
51 # b: Read a file while the file is moved to a new server - expect LEASE_MOVED
52 #
53 set expcode "LEASE_MOVED"
54 set ASSERTION "Read a file to update lease but <cfh> moved, expect $expcode"
55 set tag "$TNAME{b}"
56 #putmsg stdout 0 "$tag: $ASSERTION"
57 #puts "\t TEST UNTESTED: XXX need migration support.\n"
58
59
60 # c: the FS if <cfh> is moved to a new server - expect MOVED
61 #
62 set expcode "MOVED"
63 set ASSERTION "Read a file but the FS of <cfh> moved, expect $expcode"
64 set tag "$TNAME{c}"
65 #putmsg stdout 0 "$tag: $ASSERTION"
66 #puts "\t TEST UNTESTED: XXX need migration support.\n"
67
68
69 # d: Read a file w/<cfh> is volatile and expired - expect FHEXPIRED
70 #
71 set expcode "FHEXPIRED"
72 set ASSERTION "Read a file w/<cfh> is volatile and expired, expect $expcode"
73 set tag "$TNAME{d}"
74 #putmsg stdout 0 "$tag: $ASSERTION"
75 #puts "\t TEST UNTESTED: XXX need migration support.\n"
76
77
78 # e: Read w/special stateid, server unable to obtain lock - expect DENIED
79 #
80 set expcode "DENIED"
81 set ASSERTION "Read w/special stateid, server unable to obtain lock, expect $expcode"
82 set tag "$TNAME{e}"
83 #putmsg stdout 0 "$tag: $ASSERTION"
84 #puts "\t TEST UNTESTED: XXX need migration support.\n"
85
86
87 # XXX the following errors are difficult to simulate
88 #
89 #I NFS4ERR_DELAY
90 #I NFS4ERR_IO
91 #I NFS4ERR_RESOURCE
92 #I NFS4ERR_SERVERFAULT
93 #I NFS4ERR_WRONGSEC
94 #? NFS4ERR_NXIO
95
96
97 # --------------------------------------------------------------
98 # disconnect and exit
99 Disconnect
100 exit $PASS