Home | History | Annotate | only in /test/stcnv/usr/src/suites/nfs/nfsv4/nfsv4shell
Up to higher level directory
NameDateSize
Makefile17-Jun-20091.3K
Makefile.master09-Sep-20091.8K
nfs4_prot.x17-Jun-200935K
nfsh/17-Jun-2009
README17-Jun-20096.3K
scripts/17-Jun-2009

README

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