.\" DO NOT MODIFY THIS FILE! It was generated by setup.py 1.2. .TH NFSTEST_LOCK 1 "21 March 2023" "NFStest 3.2" "nfstest_lock 1.3" .SH NAME nfstest_lock - Locking tests .SH SYNOPSIS nfstest_lock --server [--client ] [options] .SH DESCRIPTION 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. .SH OPTIONS .IP "--version" show program's version number and exit .IP "-h, --help" show this help message and exit .IP "-f FILE, --file=FILE" File where options are specified besides the system wide file /etc/nfstest, user wide file $HOME/.nfstest or in the current directory .nfstest file .SS NFS specific options: .IP "-s SERVER, --server=SERVER" Server name or IP address .IP "-e EXPORT, --export=EXPORT" Exported file system to mount [default: '/'] .IP "--nfsversion=NFSVERSION" NFS version, e.g., 3, 4, 4.1, etc. [default: 4.1] .IP "-m MTPOINT, --mtpoint=MTPOINT" Mount point [default: '/mnt/t'] .IP "-p PORT, --port=PORT" NFS server port [default: 2049] .IP "--proto=PROTO" NFS protocol name [default: 'tcp'] .IP "--sec=SEC" Security flavor [default: 'sys'] .IP "--nconnect=NCONNECT" Multiple TCP connections option [default: '1'] .IP "-o MTOPTS, --mtopts=MTOPTS" Mount options [default: 'hard,rsize=4096,wsize=4096'] .IP "--datadir=DATADIR" Data directory where files are created, directory is created on the mount point [default: ''] .SS Logging options: .IP "-v VERBOSE, --verbose=VERBOSE" Verbose level for debug messages [default: \t'opts|info|dbg1|dbg2|dbg3'] .IP "--tverbose=TVERBOSE" Verbose level for test messages [default: '2'] .IP "--createlog" Create log file .IP "--rexeclog" Create rexec log files .IP "--warnings" Display warnings .IP "--tag=TAG" Informational tag, it is displayed as an INFO message [default: ''] .IP "--notty" Do not use terminal colors on output .IP "--isatty" Use terminal colors on output -- useful when running with nohup .SS Packet trace options: .IP "--createtraces" Create a packet trace for each test .IP "--tbsize=TBSIZE" Capture buffer size for tcpdump [default: 192k] .IP "--trcdelay=TRCDELAY" Seconds to delay before stopping packet trace [default: 2.0] .IP "--keeptraces" Do not remove any trace files [default: remove trace files if no errors] .IP "--rmtraces" Remove trace files [default: remove trace files if no errors] .IP "-i INTERFACE, --interface=INTERFACE" Device interface [default: automatically selected] .IP "--subtraces" Create a packet trace for each sub-test. Use it with caution since it will create a lot of packet traces. Use --createtraces instead unless trying to get a packet trace for a specific sub-test. Best if it is used in combination with the --runtest option. .SS File options: .IP "--nfiles=NFILES" Number of files to create [default: 2] .IP "--filesize=FILESIZE" File size to use for test files [default: 64k] .IP "--rsize=RSIZE" Read size to use when reading files [default: 4k] .IP "--wsize=WSIZE" Write size to use when writing files [default: 4k] .IP "--iodelay=IODELAY" Seconds to delay I/O operations [default: 0.1] .IP "--offset-delta=OFFSET_DELTA" Read/Write offset delta [default: 4k] .SS Path options: .IP "--sudo=SUDO" Full path of binary for sudo [default: '/usr/bin/sudo'] .IP "--kill=KILL" Full path of binary for kill [default: '/usr/bin/kill'] .IP "--nfsstat=NFSSTAT" Full path of binary for nfsstat [default: '/usr/sbin/nfsstat'] .IP "--tcpdump=TCPDUMP" Full path of binary for tcpdump [default: '/usr/sbin/tcpdump'] .IP "--iptables=IPTABLES" Full path of binary for iptables [default: '/usr/sbin/iptables'] .IP "--messages=MESSAGES" Full path of log messages file [default: '/var/log/messages'] .IP "--trcevents=TRCEVENTS" Full path of tracing events directory [default: \t'/sys/kernel/debug/tracing/events'] .IP "--trcpipe=TRCPIPE" Full path of trace pipe file [default: \t'/sys/kernel/debug/tracing/trace_pipe'] .IP "--tmpdir=TMPDIR" Temporary directory [default: '/tmp'] .SS Debug options: .IP "--nocleanup" Do not cleanup created files .IP "--notimestamps" Do not display timestamps in debug messages .IP "--bugmsgs=BUGMSGS" File containing test messages to mark as bugs if they failed .IP "--nomount" Do not mount server and run the tests on local disk space .IP "--basename=BASENAME" Base name for all files and logs [default: automatically generated] .IP "--nfsdebug=NFSDEBUG" Set NFS kernel debug flags and save log messages [default: ''] .IP "--rpcdebug=RPCDEBUG" Set RPC kernel debug flags and save log messages [default: ''] .IP "--tracepoints=TRACEPOINTS" List of trace points modules to enable [default: ''] .IP "--nfsstats" Get NFS stats [default: 'False'] .IP "--pktdisp" Display main packets related to the given test .IP "--nfserrors" Fail every NFS error found in the packet trace .IP "--client-ipaddr=CLIENT_IPADDR" IP address of localhost .SS Reporting options: .IP "--xunit-report" Generate xUnit compatible test report .IP "--xunit-report-file=XUNIT_REPORT_FILE" Path to xout report file .SS Test options: .IP "--runtest=RUNTEST" Comma separated list of tests to run, if list starts with a '^' then all tests are run except the ones listed [default: 'all'] .IP "--client=CLIENT" Remote NFS client and options used for conflicting lock tests. Clients are separated by a ',' and each client definition is a list of arguments separated by a ':' given in the following order if positional arguments is used (see examples): clientname:server:export:nfsversion:port:proto:sec:mtpoint .IP "--nfsopts=NFSOPTS" Local process NFS options used for conflicting lock tests. Processes are separated by a ',' and each process definition is a list of arguments separated by a ':' given in the following order if positional arguments is used (see examples): :server:export:nfsversion:port:proto:sec:mtpoint .IP "--offset=OFFSET" Offset of first lock granted [default: 4k] .IP "--length=LENGTH" Length of first lock granted [default: 4k] .IP "--unlock-delay=UNLOCK_DELAY" Time in seconds to unlock first lock [default: 2.0] .IP "--lockw-timeout=LOCKW_TIMEOUT" Time in seconds to wait for blocked lock after conflicting lock has been released [default: 30] .IP "--opentype=OPENTYPE" List of open types to test [default: read,write,rdwr] .IP "--locktype=LOCKTYPE" List of lock types to test [default: read,write] .IP "--opentype2=OPENTYPE2" List of open types to test on remote client [default: read,write,rdwr] .IP "--locktype2=LOCKTYPE2" List of lock types to test on remote client [default: read,write] .IP "--setlock=SETLOCK" List of set lock types to test [default: immediate,block] .SH TESTS .SS btest01 .nf Basic locking tests These 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. .fi .SS noverlap .nf Run all non-overlapping locking tests: nptest01, nptest02, nptest03, nptest04, nctest01, nctest02, nctest03, nctest04 .fi .SS nptest .nf Run all non-overlapping locking tests using a second process: nptest01, nptest02, nptest03, nptest04 .fi .SS nptest01 .nf Locking non-overlapping range from a second process where end2 < start1 process1: |------------------| process2: |--------| .fi .SS nptest02 .nf Locking non-overlapping range from a second process where end2 == start1 - 1 process1: |------------------| process2: |------------------| .fi .SS nptest03 .nf Locking non-overlapping range from a second process where start2 > end1 process1: |------------------| process2: |--------| .fi .SS nptest04 .nf Locking non-overlapping range from a second process where start2 == end1 + 1 process1: |------------------| process2: |------------------| .fi .SS nctest .nf Run all non-overlapping locking tests using a second client: nctest01, nctest02, nctest03, nctest04 .fi .SS nctest01 .nf Locking non-overlapping range from a second client where end2 < start1 client1: |------------------| client2: |--------| .fi .SS nctest02 .nf Locking non-overlapping range from a second client where end2 == start1 - 1 client1: |------------------| client2: |------------------| .fi .SS nctest03 .nf Locking non-overlapping range from a second client where start2 > end1 client1: |------------------| client2: |--------| .fi .SS nctest04 .nf Locking non-overlapping range from a second client where start2 == end1 + 1 client1: |------------------| client2: |------------------| .fi .SS overlap .nf Run all overlapping locking tests: optest01, optest02, optest03, optest04, optest05, optest06, optest07, optest08, optest09, octest01, octest02, octest03, octest04, octest05, octest06, octest07, octest08, octest09 .fi .SS optest .nf Run all overlapping locking tests using a second process: optest01, optest02, optest03, optest04, optest05, optest06, optest07, optest08, optest09 .fi .SS optest01 .nf Locking same range from a second process process1: |------------------| process2: |------------------| .fi .SS optest02 .nf Locking overlapping range from a second process where start2 < start1 process1: |------------------| process2: |------------------| .fi .SS optest03 .nf Locking overlapping range from a second process where end2 > end1 process1: |------------------| process2: |------------------| .fi .SS optest04 .nf Locking overlapping range from a second process where range2 is entirely within range1 process1: |------------------| process2: |--------| .fi .SS optest05 .nf Locking overlapping range from a second process where range1 is entirely within range2 process1: |------------------| process2: |----------------------------| .fi .SS optest06 .nf Locking full file range from a second process .fi .SS optest07 .nf Locking overlapping range from a second process where end2 == start1 process1: |------------------| process2: |------------------| .fi .SS optest08 .nf Locking overlapping range from a second process where start2 == end1 process1: |------------------| process2: |------------------| .fi .SS optest09 .nf Locking overlapping range from multiple processes where range2 and range3 are entirely within range1 process1: |-----------------------------| process2: |--------| process3: |--------| .fi .SS octest .nf Run all overlapping locking tests using a second client: octest01, octest02, octest03, octest04, octest05, octest06, octest07, octest08, octest09 .fi .SS octest01 .nf Locking same range from a second client client1: |------------------| client2: |------------------| .fi .SS octest02 .nf Locking overlapping range from a second client where start2 < start1 client1: |------------------| client2: |------------------| .fi .SS octest03 .nf Locking overlapping range from a second client where end2 > end1 client1: |------------------| client2: |------------------| .fi .SS octest04 .nf Locking overlapping range from a second client where range2 is entirely within range1 client1: |------------------| client2: |--------| .fi .SS octest05 .nf Locking overlapping range from a second client where range1 is entirely within range2 client1: |------------------| client2: |----------------------------| .fi .SS octest06 .nf Locking full file range from a second client .fi .SS octest07 .nf Locking overlapping range from a second client where end2 == start1 client1: |------------------| client2: |------------------| .fi .SS octest08 .nf Locking overlapping range from a second client where start2 == end1 client1: |------------------| client2: |------------------| .fi .SS octest09 .nf Locking overlapping range from multiple clients where range2 and range3 are entirely within range1 client1: |-----------------------------| client2: |--------| client3: |--------| .fi .SS all .nf Run all tests: btest01, nptest01, nptest02, nptest03, nptest04, nctest01, nctest02, nctest03, nctest04, optest01, optest02, optest03, optest04, optest05, optest06, optest07, optest08, optest09, octest01, octest02, octest03, octest04, octest05, octest06, octest07, octest08, octest09 .fi .SH EXAMPLES Run the tests which use only the main client (no client option): nfstest_lock --server 192.168.0.2 --export /exports Use short options instead: nfstest_lock -s 192.168.0.2 -e /exports Use positional arguments with nfsversion=3 for extra client: nfstest_lock -s 192.168.0.2 -e /exports --client 192.168.0.10:::3 Use named arguments instead: nfstest_lock -s 192.168.0.2 -e /exports --client 192.168.0.10:nfsversion=3 Use positional arguments with nfsversion=3 for second process: nfstest_lock -s 192.168.0.2 -e /exports --nfsopts :::3 Use named arguments instead: nfstest_lock -s 192.168.0.2 -e /exports --nfsopts nfsversion=3 .SH NOTES The user id in the local host and the host specified by --client must have access to run commands as root using the 'sudo' command without the need for a password. The user id must be able to 'ssh' to remote host without the need for a password. .SH SEE ALSO .BR baseobj(3), .BR formatstr(3), .BR nfstest.test_util(3), .BR nfstest_alloc(1), .BR nfstest_cache(1), .BR nfstest_delegation(1), .BR nfstest_dio(1), .BR nfstest_fcmp(1), .BR nfstest_file(1), .BR nfstest_interop(1), .BR nfstest_io(1), .BR nfstest_pkt(1), .BR nfstest_pnfs(1), .BR nfstest_posix(1), .BR nfstest_rdma(1), .BR nfstest_sparse(1), .BR nfstest_ssc(1), .BR nfstest_xattr(1), .BR nfstest_xid(1), .BR packet.nfs.nfs3_const(3), .BR packet.nfs.nfs4_const(3), .BR packet.nfs.nlm4_const(3) .SH BUGS No known bugs. .SH AUTHOR Jorge Mora (mora@netapp.com)