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 # See the License for the specific language governing permissions
10 # and limitations under the License.
11 #
12 # When distributing Covered Code, include this CDDL HEADER in each
13 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 # If applicable, add the following below this CDDL HEADER, with the
15 # fields enclosed by brackets "[]" replaced with your own identifying
16 # information: Portions Copyright [yyyy] [name of copyright owner]
17 #
18 # CDDL HEADER END
19 #
20
21 #
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25
26 NFS v4 shell - NFS Version 4 TCL Test Client
27 ====================================
28
29 This user-level test client is a Tcl-based C program that generates
30 and verifies NFS version 4 calls. It is a shell like tool which can
31 generate a wide variety of version 4 calls that cannot be generated
32 from kernel-based clients or clients that are implemented behind a
33 generic filesystem API such as Win32 or POSIX. For instance, no
34 client supports all the v4 attributes.
35
36 This test client was inspired by previous work on a Tcl-based
37 test client for NFS version 2 by James Lau and Dave Hitz of
38 Network Appliance, Inc.
39
40 ------------------------------------------------------------------
41
42 Contents in this directory:
43 ==========================
44
45 README - this file
46 Makefile - top level Makefile
47 Makefile.master - Global definitions for including into other Makefiles
48 nfsh/ - source files for the nfsh tool
49 scripts/ - sample tcl scripts using 'nfsh' to test NFSv4 server
50 nfs4_prot.x - the current version of NFSv4 definitions (rfc3010updates)
51
52
53 Requirements:
54 ============
55
56 1. TCL
57
58 NFS v4 shell provides a TCL environment; thus required TCL header
59 files and libraries to build and use. The TCL version used for
60 development of this tool is 8.5. A copy may be downloaded from the
61 website http://dev.scriptics.com/software/tcltk; and follow the TCL
62 instructions to build the TCL libraries. Or a pre-compiled TCL
63 package may be used.
64
65 The following header files and libraries are needed for this nfsh
66 under the ${TCL_DIR}, e.g. /usr or /opt/TCL85:
67
68 ${TCL_DIR}/include/
69 tcl.h, tclDecls.h, tclPlatDecls.h
70 ${TCL_DIR}/lib/
71 libtcl8.5.so
72 ${TCL_DIR}/lib/tcl8.5
73 init.tcl
74
75 If you install a different version of TCL, you may need to update
76 the ${TCL_LIB} in the Makefile.master to provide the correct
77 library. The nfsh tool depends the above tcl files to build and
78 execute.
79
80 Important note:
81
82 nfsh uses a file, tclprocs, to initialize shared procedures.
83 This file is installed in the same location as nfsh. If
84 tclprocs is not located in the same directory as nfsh, then
85 the $PATH environment variable should include the directory
86 where the tclprocs file is located.
87
88 2. Compiler
89
90 User should have their C compiler and make utilities in the PATH.
91
92 3. RPCGEN
93
94 The "rpcgen" utility is used to generate the nfs4_prot.h and xdr*.c
95 files. If you create your own xdr* programs and header files, you
96 can copy them to the "nfsh" directory and comment out the rpcgen
97 section from the nfsh/Makefile.
98
99
100 To run the program:
101 ==================
102
103 The nfsh program is installed in the bin directory. To execute the
104 program:
105
106 $ cd ../bin
107 $ ./nfsh
108 (or run any of the provided tcl scripts)
109
110 Please refer to "nfsh.man" (manpage) under ./nfsh directory for
111 details how to run "nfsh" tool; and the usage of each implemented NFS
112 version 4 operation.
113
114 The following is sample output from one of the tcl sample scripts:
115
116 $ cd ../bin
117 $ ./test dragonite export/v4/dir1
118 compound returned Status=[OK]
119 Putrootfh OK
120 Lookup OK
121 Getfh OK 0080000700000002000A000000005900099ACD63000A0000000016406A35C717
122 Readdir OK 0000000000000000 {{000000000000000C . {{type dir}
123 {size 512}}} {0000000000000018 .. {{type dir} {size 512}}}
124 {0000000000000028 file1 {{type reg} {size 30}}} {0000000000000038 dir2
125 {{type dir} {size 512}}} {000000000000004C file.empty {{type reg}
126 {size 0}}} {0000000000000060 file_noperm {{type reg} {size 30}}}
127 {0000000000000200 file.bin {{type reg} {size 18204}}}} true
128 Access OK {supported=[MODIFY,EXTEND]} {access=[]}
129 Putrootfh OK
130 Getattr OK {{type dir} {change 4111984389472839712} {size 1024}
131 {link_support true} {cansettime true} {mode 755} {time_modify
132 {957395972 410708000}}}
133 $
134
135 ------------------------------------------------------------------
136
137 Bugs/Gotchas:
138 ============
139
140 Please note, the nfsh is still under development. Therefore, some
141 NFSv4 operations have not yet been implemented. Please see "nfsh.man"
142 for more information on what features are currently available.
143
144 Bugs -
145
146 Gotchas -
147
148 1. compilation may fail if TCL_DIR is defined incorrectly.
149
150 2. When calling Setattr with a long list of attributes, the
151 program may dump core at some TCL_*() functions. One
152 way to work around it is to set the arguments as variables
153 and use the variables in the compound call, e.g.:
154 % % set path "export v4 f1"
155 export v4 f1
156 % set now "[ clock seconds] 0"
157 961805699 0
158 %
159 % compound { ...; Setattr 0 {{time_modify_set $now}}}
160 {Putrootfh OK} {Lookup OK} {Setattr OK {time_modify_set}}
161
162 3. The "clock format" command can print "nicetimedate":
163 % clock format [clock seconds]
164 Fri Jun 23 17:18:34 PDT 2000
165 %
166