Home | History | Annotate | Download | only in nfsv4
      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 2009 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"@(#)README	1.4	09/07/23 SMI"
     27 #
     28 
     29 Overview
     30 --------
     31 
     32 This "nfsv4" is a general test framework consists of different tests for 
     33 testing NFSv4 server and client.  Test sub-directories include :
     34 
     35 	acl		   - access control list tests
     36 	basic_ops 	   - server tests of basic operations for RFC3530
     37 	num_attrs	   - number attribute tests
     38 	named_attr	   - named attribute tests
     39 	other_tests	   - uidmapping and I18N 
     40 	recovery	   - client recovery and server unshare tests
     41 	srv_namespc	   - server namespace tests
     42 	workloads_in_zones - workload stress tests with zone and ZFS
     43 
     44 The tests under these subdirs are written in different programming languages, 
     45 including C, Shell(s) and TCL that uses "nfsv4shell" tool.  Makefiles are 
     46 provided to build and install the executables to the "proto" directory or
     47 package for execution.  Scripts are also included for automation of setup
     48 and cleanup.
     49 
     50 
     51 Requirements
     52 ------------
     53 
     54 The following requirements must be met before running the tests:
     55 
     56  1) Require minimum of two systems, a localhost and a remote host.  Both
     57     systems under test must be able to 'rsh' to each other as root.
     58 
     59  2) Must be "root" to run the setup and cleanup and the recovery tests.
     60 
     61  3) Define the following required environment variables.  For those
     62     that are optional, if not set, the default value will be used:
     63 
     64 	setenv SERVER remote_host_w/NFSv4_available 		(required)
     65 		No default for this variable
     66 	setenv CC_SRV compiler_used_in_$SERVER			(optional)
     67 		default is /ws/onnv-tools/SUNWspro/SS12/bin/cc
     68 	setenv LOGDIR the_result_logs_directory			(optional)
     69 		default is /var/tmp/nfsv4-test/results
     70 	setenv DNS_SERVER a_DNS_server_accessed_by_all_systems	(optional)
     71 		default is jurassic.eng.sun.com
     72 
     73  4) TCL (Tools Command Language, tcl8.5), must be available or
     74     installed in the localhost before building and running the tests.
     75 
     76     To install tcl8.5, we can download source codes from website 
     77     http://www.tcl.tk/software/tcltk/download.html 
     78     then build and install it to localhost.
     79     e.g. 
     80     root# wget http://prdownloads.sourceforge.net/tcl/tcl8.5.2-src.tar.gz
     81     root# gtar zxvf tcl8.5.2-src.tar.gz
     82     root# cd tcl8.5.2/unix
     83     root# ./configure --prefix=/opt/TCL85
     84     root# gmake
     85     root# gmake install
     86 
     87     For the convenient of internal users, a solaris package is built and made 
     88     available at: /net/nfs.sfbay/sea/Test/tools/tcl/snv
     89     Install the package to localhost,
     90     root# cd /net/nfs.sfbay/sea/Test/tools/tcl/snv
     91     root# cp TCL85.8.5.2.$(uname -p).pkg.tar.gz /tmp
     92     root# cd /tmp
     93     root# gtar zxvf TCL85.8.5.2.$(uname -p).pkg.tar.gz
     94     root# pkgadd -d TCL85.8.5.2.$(uname -p).pkg
     95     Uninstall the package from localhost,
     96     root# pkgrm TCL85
     97 
     98     By default, the tests look for TCL library and init file in /opt/TCL85/lib
     99     directories, i.e. assuming tcl8.5 is installed.  If you have these
    100     installed in a different directory of your local system, please set the
    101     following environment variables as well:
    102 
    103 	setenv TCL_DIR path_to_TCL_directory			(optional)
    104 	(This one must be set to build the nfsv4shell tool)
    105 		default is /opt/TCL85
    106 	setenv LD_LIBRARY_PATH path_of_TCL_library		(optional)
    107 		default is /opt/TCL85/lib
    108 	setenv TCL_LIBRARY path_of_TCL_init_files		(optional)
    109 		default is /opt/TCL85/lib/tcl8.5
    110 
    111  5) If run on opensolaris, please make sure the SUNWhea (SunOS Header Files)
    112     package is installed or the related headers are available on the server,
    113     otherwise, the uidmapping_stress01 test will fail.
    114 
    115 
    116 Other setup (optional)
    117 ----------------------
    118 
    119 There are several test filesystems required for testing.  The tests
    120 currently support two types of filesystem, one is ZFS, the other is UFS.
    121 
    122 By default, tests itself will detect automatically the filesystem type of
    123 BASEDIR on SERVER.
    124 If filesystem type is ZFS, tests will run over ZFS;
    125 If filesystem type is UFS, tests will run over UFS;
    126 Otherwise, tests will print error message and exit. 
    127 	setenv BASEDIR a_base_testing_directory_in_server	(optional)
    128 		default is /NFSv4Test
    129 
    130 If SERVER is zfs boot, and you also want to run the tests over UFS,
    131 you must provide a dir based on UFS and define BASEDIR as the following:
    132 	setenv BASEDIR your_ufs_dir_in_server
    133 
    134 Similarly, if SERVER is ufs boot, and you also want to run the tests over ZFS,
    135 you must provide a dir based on ZFS and define BASEDIR as the following:
    136 	setenv BASEDIR your_zfs_dir_in_server
    137 
    138 If tests would be run over UFS, by default they will be setup using LOFI (but
    139 NOTE that the LOFI setup will be lost if you reboot the SERVER). If you prefer
    140 not to use LOFI setup, but to supply your own real filesystems, you must provide
    141 the following filesystems and UFS mount them to the correct directory names.
    142 	BASEDIR the base testing directory, default is /NFSv4Test
    143 	PUBTDIR to $BASEDIR/PublicFS, e.g. /NFSv4Test/PublicFS
    144 	ROOTDIR to $BASEDIR/RootFS, e.g. /NFSv4Test/RootFS
    145 	ROFSDIR to $BASEDIR/RoFS, e.g. /NFSv4Test/RoFS
    146 	NSPCDIR to $BASEDIR/NoSPC_FS, e.g. /NFSv4Test/NoSPC_FS
    147 		(where NSPCDIR must be a small filesystem, e.g. 3MB)
    148 	KRB5DIR to $BASEDIR/KRB5C_FS, e.g. /NFSv4Test/KRB5C_FS
    149 	SSPCDIR to $BASEDIR/SRVsp_FS, e.g. /NFSv4Test/SRVsp_FS
    150 	SSPCDIR2 to $SSPCDIR/hide/SRVsp_d2
    151 		e.g. /NFSv4Test/SRVsp_FS/hide/SRVsp_d2
    152 	SSPCDIR3 to $SSPCDIR2/hide2/SRVsp_d3
    153 		e.g. /NFSv4Test/SRVsp_FS/hide/SRVsp_d2/hide2/SRVsp_d3
    154 
    155 Tests may fail unexpectedly if these test filesystems are not pre-setup
    156 correctly when not using LOFI.  
    157 
    158 Sometimes during the recovery tests the server is not visible on the network
    159 for several minutes after the server has rebooted. This causes some of the
    160 tests that are intended to run in the grace period to fail. The solution to
    161 this problem is to add an /etc/defaultrouter file to the server.
    162 
    163 If your server takes a long time to reboot, e.g. a SunFire machine that has
    164 lots of memory/disk, you may want to set the following variable a bigger value
    165 (in seconds):
    166 	setenv REBOOTIMER 1800				(optional)
    167 		default is 480
    168 
    169 Note: the recovery tests will reboot the server.  It may ask for fsck
    170 	during the rebboot due to the LOFI setup.  Hence, it may help 
    171 	to turn on logging (via /etc/vfstab) of the filesystem that 
    172 	the BASEDIR, e.g. /NFSv4Test, is set to before running the tests.
    173 
    174 Note: This test suite now uses sharectl(1M) to change/reset the NFS properties,
    175 	which would restart the corresponding services. Any transient (or
    176 	temporary) exported filesystems in the test systems shared prior to the
    177 	test run would get lost/unshared. If these shares in the test systems
    178 	need to be available after running the suite, make sure they are shared
    179 	permanently, e.g. use sharemgr(1M) "share -p" to share the filesystems.
    180 
    181 IPv6 support
    182 ------------
    183    The test suite has IPv6 support turned on by default.  If your client and
    184    server supports NFS over IPv6 and you want to run the tests over the IPv6
    185    connection, please make sure the SERVER variable is set to the valid name
    186    for IPv6 and set the following variable before running the tests:
    187 	setenv TRANSPORT tcp6
    188 		default is tcp
    189 
    190 Trusted Extensions over a CIPSO connection
    191 ------------------------------------------
    192    In order to successfully test NFS in Trusted Extensions over a CIPSO
    193    connection, the NFS server MUST be configured with at least two IP
    194    addresses, one of which is allocated solely for use by the global zone.
    195    The following variable must also be defined:
    196 
    197         setenv ZONE_PATH /zone/<zone name>                         (required)
    198 
    199             where:
    200                   /zone directory is where the non-global zone
    201                   paths reside.
    202 
    203      example:
    204         setenv ZONE_PATH /zone/public
    205 
    206         This would produce the resultant MNTPTR default of:
    207                 /zone/public/NFS4_Mnt
    208         And would produce the resultant BASEDIR default of:
    209                 /zone/public/NFSv4Test
    210         And would produce the resultant QUOTADIR variable to contain:
    211                 /zone/public/root/NFSv4Test/QUOTA_FS
    212 
    213    NOTE:
    214         For the NFS client, there is no need to allocate a unique IP to
    215         the global zone; the entire system can be configured to have just
    216         a single all-zones IP address.
    217 
    218         The default for ZONE_PATH is NULL.
    219 
    220 
    221 To build the tests
    222 ------------------
    223 
    224 Please make sure the tests are built in a system with the NFSv4 installed,
    225 and has Solaris 12 (or later) and proper compiler and linker packages.
    226 Note, this version of the test suite will ONLY be built with Studio 12
    227 (or later) compiler.  Please make sure you have it available.
    228 
    229 To build test binaries:
    230         . With SS12 compiler, use "make install __SS12="
    231         . With GUNC compiler,  use "make install __GNUC="
    232 
    233 By default with "make install", the compiler found from user's PATH will
    234 be used to build test binaries.
    235 
    236 
    237 Make sure TCL library are available/installed in the proper location;
    238 then type "make install" from the top level, i.e. nfsv4 to build the
    239 entire tree.  The "proto" tree will be created along with all test
    240 executables and data files.
    241 	$ cd .../src/.../nfs/nfsv4
    242 	$ make install
    243 
    244 If you only want to build a subdir, cd into the subdir and make with the
    245 TESTROOT set; for example to build basic_ops, do:
    246 	$ cd .../src/.../nfs/nfsv4
    247 	$ export TESTROOT=`pwd`
    248 	$ cd tests/basic_ops
    249 	$ make install TESTROOT=$TESTROOT
    250 
    251 
    252 You can also build the package from the top suite level, after the "proto"
    253 tree is built:
    254 	$ cd .../src/.../nfs/nfsv4
    255 	$ make package
    256 
    257 	
    258 
    259 To run the tests
    260 ----------------
    261 
    262 Once the tests are built, you can run the tests in the proto directory.
    263 The tests require root permission to do setup and cleanup.  You may run
    264 the tests as root as well. Make sure you have the TCL85 library installed
    265 or mounted.
    266 	# cd .../proto/proto_<arch>/suites/nfs/nfsv4
    267 	# (set the appropriate environment variables, as the minimum,
    268 	   $SERVER must be set).
    269 	# ./runit -a		(to run all tests once)
    270 
    271 You can install the package the run it from the package directory as well.
    272 	# cd .../package/<arch>/SUNWstc-nfsv4
    273 	# pkgadd -d . SUNWstc-nfsv4
    274 	# cd /opt/SUNWstc-nfsv4
    275 	# (set the appropriate environment variables, as the minimum,
    276 	   $SERVER must be set).
    277 	# ./runit -a		(to run all tests once)
    278 
    279 You may also run tests in a loop after system setup; but the 'recovery' subdir
    280 will be run last, after the looping of other tests are done since the 'recovery'
    281 tests will reboot the $SERVER which would remove the test filesystems (if using
    282 LOFI) used by other tests.
    283 	# (cd to the test suite root from proto tree or the package directory)
    284 	# (set the appropriate environment variables, as the minimum,
    285 	   $SERVER must be set).
    286 	# ./runit -t 5 -a   (to loop all tests 5 times with one setup/cleanup)
    287    or   # ./runit -t 8 -b   (to loop only the basic_ops tests 8 times) 
    288 
    289 	(You may use './runit' with no argument to see the available subdirs.)
    290 
    291 You may apply the following simple steps to run on subdirs manually.
    292 Each subdir has a driver program, called "runtests".  You can cd into the
    293 subdir and run the 'runtests' program after setting required environment.
    294 	# (cd to the test suite root from proto tree of the package directory)
    295         # export SERVER=<server name>   ($SERVER must be set)
    296 	# ./go_setup                    (setup on all systems under tests)
    297 	# ./runtests -b			(run only the basic_ops subdir)
    298    or   # cd basic_ops; ./runtests	(same as 'runtests -b')
    299 	# ./go_cleanup                  (cleanup on all systems under tests)
    300 
    301 You may also use the <subdir>.flist (test file list) under each subdir to
    302 control the tests to be executed.  You can add the '#' in the first column
    303 to comment out the test files you do not want to run.
    304 
    305 
    306 A journal file of the test results will be created for each subdir, along 
    307 with a Summary file containing condensed test status under $LOGDIR directory.
    308 These Summary files can be compared against the baseline results.
    309 
    310 
    311 References:
    312 -----------
    313 
    314 Please check the NFSv4 specification for more information on NFS version 4
    315 protocols.
    316   http://www.ietf.org/rfc/rfc3530.txt
    317 
    318 
    319 The nfsv4shell/nfsh/nfsh.man manpage details the usage of each NFSv4 
    320 operation in the nfsv4shell, which is used for most of the tests in 
    321 the basic_ops subdir, and a few tests in other subdirs as well.
    322 
    323 
    324 -------------
    325 End of README
    326