nfstest (1) - Linux Manuals
nfstest: NFS Test Suite
NAME
NFStest - NFS Test SuiteDESCRIPTION
Provides a set of tools for testing either the NFS client or the NFS server, included tests focused mainly on testing the client. These tools include the following:.SS Test utilities package (nfstest) Provides a set of tools for testing either the NFS client or the NFS server, most of the functionality is focused mainly on testing the client. These tools include the following:
For example, you can run the connectathon test suite on pNFS, it runs, it passes
all the tests -- but how can we make sure that pNFS worked properly. How can we
verify that a layout is granted, but not only that a layout is granted, what
type of layout was granted (read, rw). Did the client sent IO to the data
servers or to the metadata server.
The Packet trace module takes a trace file created by tcpdump and unpacks
the contents of each packet. You can decode one packet at a time, or do a
search for specific packets. The main difference between this modules and
other tools used to decode trace files is that you can use this module to
completely automate your tests.
How does it work? It opens the trace file and reads one record at a time
keeping track where each record starts. This way, very large trace files
can be opened without having to wait for the file to load and avoid loading
the whole file into memory.
Packet layers supported:
Network partition is simulated by the use of 'iptables', please be advised
that after every test is run the iptables is flushed and reset so any rules
previously setup will be lost. Currently, there is no mechanism to restore
the iptables rules to their original state.
2. Make sure user running the tests can run commands using 'sudo' without
3. Make sure user running the tests can run commands remotely using 'ssh'
4. Create the mount point specified by the --mtpoint (default: /mnt/t) option
Required options are --server and --client
Testing with different values of --acmin and --acmax (this takes a long time)
The only required option is --server but only the basic delegation tests will
be run. In order to run the recall tests the --client option must be used
The only required option is --server
The only required option is --server
The only required option is --server but use the --client option
to run the conflicting lock tests
The only required option is --server
The only required option is --server
The only required option is --server
The only required option is --datadir (-d)
Display all the NFS packets in the trace file
Display all packets for the file name given
The only required option is --path (-p)
Search the packet trace for XID inconsistencies
Example:
Example:
Example:
Packet trace package (packet)
Testing NFS has mostly been done using test tools like connectathon test suite,
filebench, iozone and others. But mostly using the connectathon test suite.
These are good tools for testing, but they are outdated and they also cannot
be used for testing pNFS thoroughly.
REQUIREMENTS AND LIMITATIONS
In order to run the included tests, the user id in all the client hosts must
have access to run commands as root using the 'sudo' command without the need
for a password, this includes the host where the test is being executed.
This is used to run commands like 'mount' and 'umount'. Furthermore, the
user id must be able to ssh to remote hosts without the need for a password
if test requires the use of multiple clients.
TESTS
nfstest_alloc
Verify correct functionality of space reservations so applications are
able to reserve or unreserve space for a file. The system call fallocate
is used to manipulate the allocated disk space for a file, either to
preallocate or deallocate it. For filesystems which support the fallocate
system call, preallocation is done quickly by allocating blocks and
marking them as uninitialized, requiring no I/O to the data blocks.
This is much faster than creating a file and filling it with zeros.
Basic allocate tests verify the disk space is actually preallocated or
reserved for the given range by filling up the device after the allocation
and make sure data can be written to the allocated range without any
problems. Also, any data written outside the allocated range will fail
with NFS4ERR_NOSPC when there is no more space left on the device.
On the other hand, deallocating space will give the disk space back
so it can be used by either the same file on regions not already
preallocated or by different files without the risk of getting
a no space error.
Valid for NFSv4.2 and beyond
nfstest_cache
Verify consistency of attribute caching by varying acregmin, acregmax,
acdirmin, acdirmax and actimo. Verify consistency of data caching by varying
acregmin, acregmax, acdirmin, acdirmax and actimo.
Valid for any version of NFS
nfstest_delegation
Basic delegation tests verify that a correct delegation is granted when
opening a file for reading or writing. Also, another OPEN should not be
sent for the same file when the client is holding a delegation. Verify
that the stateid of all I/O operations should be the delegation stateid.
Reads from a different process on the same file should not cause the client
to send additional READ packets when the client is holding a read delegation.
Furthermore, a LOCK packet should not be sent to the server when the client
is holding a delegation.
Recall delegation tests verify the delegation is recalled when a conflicting
operation is sent to the server from a different client. Conflicting operations
are reading, writing and changing the permissions on the same file. Note, that
reading a file from a different client can only recall a read delegation.
Also, verify that a delegation is not recalled when a different client is
granted a read delegation. After a delegation is recalled, the client should
send an OPEN with CLAIM_DELEGATE_CUR before returning the delegation and the
stateid should be the same as the original OPEN stateid. Also, a delegation
should not be granted when re-opening the file right before returning
the delegation. Verify client flushes all written data before returning
the WRITE delegation. The LOCK should be sent as well right before returning
a delegation which has been recalled. A delegation should not be granted
on the second client who cause the delegation recall on the first client.
Valid for any version of NFS granting delegations
nfstest_dio
Functional direct I/O tests verify that every READ/WRITE is sent to the server
instead of the client caching the requests. Client bypasses read ahead by
sending the READ with only the requested bytes. Verify the client correctly
handles eof marker when reading the whole file. Verify client ignores delegation
while writing a file.
Direct I/O on pNFS tests verify the client sends the READ/WRITE to the correct
DS or the MDS if using a PAGESIZE aligned buffer or not, respectively.
Direct I/O data correctness tests verify that a file written with buffered I/O
is read correctly with direct I/O. Verify that a file written with direct I/O
is read correctly with buffered I/O.
Vectored I/O tests verify coalescence of multiple vectors into one READ/WRITE
packet when all vectors are PAGESIZE aligned. Vectors with different alignments
are sent on separate packets.
Valid for NFSv4.0 and NFSv4.1 including pNFS
nfstest_interop
Basic interoperability tests verify that a file written with different
versions of NFS is written correctly. The contents of the file are verified
by reading the file back using one of the NFS versions.
The tests append different data from different versions of NFS one at a
time then reads the contents of the file to verify it was written
correctly. This is done twice for each test.
nfstest_lock
Basic locking tests verify that a lock is granted using various arguments
to fcntl. These include blocking and non-blocking locks, read or write locks,
where the file is opened either for reading, writing or both. It also checks
different ranges including limit conditions.
Non-overlapping tests verity that locks are granted on both the client under
test and a second process or a remote client when locking the same file.
Overlapping tests verity that a lock is granted on the client under test
and a second process or a remote client trying to lock the same file will
be denied if a non-blocking lock is issue or will be blocked if a blocking
lock is issue on the second process or remote client.
Valid for any version of NFS
nfstest_pnfs
Verify basic pNFS functionality for file (both READ and WRITE), including
opening a second file within the same mount and having a lock on the file.
Also, verify basic pNFS functionality for a file opened for both READ and
WRITE while reading the file first and then writing to it or the other way
around by writing to the file fist and then reading the file. These tests
verify proper functionality of pNFS and NFSv4.1 as well:
- Verify EXCHANGE_ID is sent to MDS
- Verify CREATE_SESSION is sent to MDS
- Verify LAYOUTGET is sent to MDS (check layout type, iomode, layout range)
- Verify GETDEVICEINFO is sent to MDS
- Verify EXCHANGE_ID is sent to the correct DS
- Verify CREATE_SESSION is sent to DS
- Verify READ/WRITE is sent to DS (check correct stateid, correct offset and size)
- Verify no GETATTR is sent to DS
Only valid using NFSv4.1 with pNFS enabled and file layout type
nfstest_posix
Verify POSIX file system level access over the specified path using
positive and negative testing.
Valid for any version of NFS
nfstest_sparse
Verify correct functionality of sparse files. These are files which
have unallocated or uninitialized data blocks as holes. The new NFSv4.2
operation SEEK is used to search for the next hole or data segment
in a file.
Basic tests verify the SEEK operation returns the correct offset of the
next hole or data with respect to the starting offset given to the seek
system call. Verify the SEEK operation is sent to the server with the
correct stateid as a READ call. All files have a virtual hole at the
end of the file so when searching for the next hole, even if the file
does not have a hole, it returns the size of the file.
Valid for NFSv4.2 and beyond
TOOLS
nfstest_io
This I/O tool is used to create and manipulate files of different types.
The arguments allow running for a specified period of time as well as running
multiple processes. Each process modifies a single file at a time and the
file name space is different for each process so there are no collisions
between two different processes modifying the same file.
nfstest_pkt
Decode and display all packets in the packet trace file(s) given.
The match option gives the ability to search for specific packets within
the packet trace file. Other options allow displaying of their corresponding
call or reply when only one or the other is matched. Only a range of packets
can be displayed if the start and/or end options are used.
nfstest_file
Display all NFS packets for the specified path. It takes a relative path,
where it searches for each of the directory entries given in the path until
it gets the file handle for the directory where the file is located. Once the
directory file handle is found, a LOOKUP or OPEN/CREATE is searched for the
given file name. If the file lookup or creation is found, all file handles
and state ids associated with that file are searched and all packets found,
including their respective replies are displayed.
nfstest_xid
Search all the packet traces given for XID inconsistencies. Verify all
operations in the NFSv4.x COMPOUND reply are the same as the operations
given in the call.
Valid for packet traces with NFSv4 and above
INSTALLATION
1. Install package using one of the following methods:
a. Install the rpm as root:
#
All manual pages are available
$
Run tests:
$
b. Untar the tarball:
Get the latest tarball from
$
The tests can run without installation, just set the python path
environment variable:
$
$
$
$
Or install to standard python site-packages and executable directories:
$
$
All manual pages are available
$
Run tests:
$
c. Clone the git repository:
$
$
The tests can run without installation, just set the python path
environment variable:
$
$
$
$
Or install to standard python site-packages and executable directories:
$
$
All manual pages are available
$
Run tests:
$
the need for a password.
without the need for a password. This is only needed for tests which
require multiple clients.
on all the clients.
$
$ EXAMPLES
The only required option is --server
$ nfstest_pnfs --server 192.168.0.11
$ nfstest_cache --server 192.168.0.11 --client 192.168.0.20
$ nfstest_cache --server 192.168.0.11 --client 192.168.0.20 --acmin 10,20 --acmax 20,30,60,80
$ nfstest_delegation --server 192.168.0.11 --client 192.168.0.20
$ nfstest_dio --server 192.168.0.11
$ nfstest_interop --server 192.168.0.11
$ nfstest_lock --server 192.168.0.11 --client 192.168.0.20
$ nfstest_posix --server 192.168.0.11
$ nfstest_alloc --server 192.168.0.11
$ nfstest_sparse --server 192.168.0.11
$ nfstest_io -d /mnt/t/data -v all -n 10 -r 3600
$ nfstest_pkt /tmp/trace.cap
$ nfstest_file -p f00000001 /tmp/trace.cap
$ nfstest_xid /tmp/trace.cap
USEFUL OPTIONS
BUGS
No known bugs.
AUTHOR
Jorge Mora (mora [at] netapp.com)
SEE ALSO
nfstest_alloc(1),
nfstest_cache(1),
nfstest_delegation(1),
nfstest_dio(1),
nfstest_file(1),
nfstest_interop(1),
nfstest_io(1),
nfstest_lock(1),
nfstest_pkt(1),
nfstest_pnfs(1),
nfstest_posix(1),
nfstest_sparse(1),
nfstest_xid(1)