NFSv4 Test Suite
Introduction
The NFSv4 test suite (
nfsv4-test) is one of the test suites used
to functionally test the NFSv4.0 protocol during and after the
project development in Solaris 10. This test suite is independent
from other Solaris test harnesses. Users can easily build and execute
the tests (or a subset of the tests), and generate summary results
using the suite source tarball from the download center.
The
source tarball
also includes the nfsv4shell, the TCL tool that can be used to
generate different NFSv4.0 compound operations to test against the
NFSv4.0 server, which we found it as very useful for the negative
testing and to verify that the client has correct behavior for the
server's responses.
The HowTo's
To start, download the nfsv4-test
source tarball
to a directory in an
OpenSolaris system and unzip it. For example,
assuming the downloaded file is at /export:
$ cd /export
$ bzcat ontest-nfsv4test-src-20061218.tar.bz2 | tar -xvf -
Then use the /usr/sfw/bin/gcc compiler to
build the suite:
$ cd usr/ontest/uts/fs/nfs/nfsv4-test
$ make install __GNUC=""
If there is no errors, the test executables will be installed in an
./exe.`uname -p` directory under the current directory. This will be
the TESTROOT for the execution, in the NFSv4 client, we call this the
localhost. This TESTROOT includes executables of test sub directories
that group the tests in those areas e.g.:
acl basic_ops ctests delegation named_attrs
num_attrs other_tests recovery srv_namespc stress_nfs4
and other tools for setup and execution.
This test suite is fully automated, where a few simple commands will setup
the suite, run the tests, cleanup the systems, and generate results.
Some prerequisites are required, but usually the default values will
be used for the standard runs. Check out a file named nfs4test.env
under $TESTROOT for the variables and the default values.
Although
it requires 3 test systems, (including the localhost as NFSv4 client,
the NFSv4 server and a third system), some test subdirs only require
two systems, the client and the server. The client should be able to
"rsh" to the server for the setup.
For example, the following commands will run the tests in the basic_ops
and acl subdirs:
$ cd ./exe.`uname -p`
$ SERVER=my_server_hostname; export SERVER
$ ./runit -bl
where the “-b” is for the “basic_ops” tests and
“-l” is for the “acl” tests. Or you can type
“./runit -x” to have it list the available test subdirs.
Test results by default will be written to /usr/tmp/results directory.
The test subdirs which require 3 systems to run are "ctests",
"delegation", and "recovery". Users may comment
out any subdirs they do not want to compile or user by modifying the
values of “SUBDIRS=” in the .../nfsv4-test/tests/Makefile .
Currently the tests are only running well with OpenSolaris systems, e.g.
clients and servers. This is due to the limitations on the remote
server configuration (where tests use "rsh"s).
All tests can also run in the OpenSolaris non-global zones, with a
regular server running OpenSolaris 10 and above.
Test Cases Overview
This test suite is divided into different functional subdirs to test
different areas of the NFSv4 client and server. Tests are written in
C, ksh and TCL and automated for easy execution. The subdirs are:
acl
This sub-directory consists of the "srv_tests" and "cmd_tests".
The test cases under the "srv_tests" use the nfsv4shell
toolto send over-the-wire different Setattr/Getattr operations with
ACL attributes to verify correct server behavior. The test cases
under the "cmd_tests" use user level commands getfacl(1)
and setfacl(2) to test ACL over NFSv4 filesystem.
Note,
since there are tests for acl(2)/facl(2) written in other Solaris
test suite (mstc), which can be run over NFS as well, we do not
include those tests in this suite. We have planned to develop new
tests for "chmod(1)" with ACL operation, for NFSv4 over ZFS
filesystems.
basic_ops
There are 31 sub-directories included in the directory. Each of these
subdirs is related to the NFSv4 operations from RFC3530. All tests
are TCL scripts using the nfsv4shell tool to test the NFSv4 server
behavior. Many of the tests are negative tests to send over-the-wire
with illegal compound operations to ensure server is not surprised
and responds with correct errors.
ctests
Tests under this directory are written in C, to test the "open"
and "lock" features in NFSv4 client and server. The "open"
tests include assertions for different file modes and open-flags,
while the "lock" tests verify read/write locks with
different file access. We run the tests twice with server having
delegation turned on and off.
delegation
This
directory consists of tests for testing NFSv4 delegation feature.
Tests require 3 test systems, including the localhost as the client,
an NFSv4 server, and a third system (for forcing the delegation
recall). The tests use kstat(1M) and nfssys-call to verify server
returns correct delegation types when clients have different access
to the files. Some tests use NFSv2 or NFSv3 client access for force
the file recall.
named_attrs
This
directory consists of tests for testing the NFSv4 named attributes.
There are TCL tests with nfsv4shell to test Nfsv4 server directly
with OPENATTR op, and ksh tests using runat(1) command in
OpenSolaris.
num_attrs
This
directory consists of tests for testing the NFSv4 mandatory and
recommended attributes. These are TCL tests with GETATTR op to verify
the attributes returned by server are correct.
srv_namespc
This
directory consists of tests to test the server name space, and the
NFSv4 pseudo filesystem. Some tests specifically verify the pseudo
nodes used in building the server filesystem tree, and make sure
client and traverse the tree from server's root filesystem.
other_tests
We
put the other miscellaneous tests into this directory, which include
some I18N tests and "nobody" (NFSv4 uid/gid domain name
mapping) tests. The "domain" subdir in this directory
consists of tests to verify the generation of the NFSMAPID_DOMAIN
from /etc/default/nfs file, NIS and DNS, in OpenSolaris system.
recovery
This
directory consists tests for testing recovery (such as reboot,
restart nfsd in server) of NFSv4 client and server. There are mostly
"open" and "lock" tests to verify states
recovered correctly. There are also tests for filesystem unshared and
"open downgrade" tests. This subdir requires 3 test systems
to run, and both the SERVER and CLIENT2 will be rebooted.
stress_tests
These
are random stress tests to stress the NFSv4 server with a large
number of read, write, open, (conflict) lock, uidmapping operations
simultaneously. Tests will take longer time to complete depending on
how much stress is desired. Such numbers can be reconfigured in the
"stress_nfs4.flist" file under the directory.
Test Results
The tests can be run with different configurations, such as: server using
UFS or ZFS filesystems, client (localhost) as system (in global
zone), or in a non global zone. Test result baselines are different
depending on how the tests are configured and run.
The
following is the baseline results for tests run from a client's
global zone (the system) with the server using LOFI (UFS) and ZFS
filesystems. The results with NOTINUSE/UNTESTED/UNSUPPORTED status
are due to the test assertions are either not runable in current test
environment, or not supported by Solaris, or scenarios cannot be
tested at this time.
-
|
Test
subdirs / Server test filesystem
|
LOFI/UFS
|
ZFS
|
|
acl
|
PASS: 241
|
PASS: 241
|
|
basic_ops
|
PASS:
713; UNSUPPORTED: 10 NOTINUSE: 5; UNTESTD: 4
|
PASS: 701; UNSUPPORTED:
10 NOTINUSE: 5; UNTESTD: 4; FAIL: 12
|
|
ctests
|
PASS:
964
|
PASS:
964
|
|
delegation
|
PASS:
160; UNSUPPORTED: 16
|
PASS:
160; UNSUPPORTED: 16
|
|
named_attrs
|
PASS:
22
|
PASS:
22
|
|
num_attrs
|
PASS:
66
|
PASS:
66
|
|
srv_namespc
|
PASS:
44; FAIL: 1
|
PASS:
43; FAIL: 2
|
|
other_tests
|
PASS:
135; UNTESTED: 2
|
PASS:
135; UNTESTED: 2
|
|
recovery
|
PASS:
39; UNTESTED: 2
|
PASS:
39; UNTESTED: 2
|
|
stress_tests
|
PASS:
9
|
PASS:
9
|
Note:
the above results obtained from client and servers running
OpenSolaris snv_60 . The details of the knonw failures listed above
can be found from the bug database (http://bugs.opensolaris.org/ ,
select catgory “stc/stc” and subcategory “nfsv4-test”)