nfstest_lock (1) - Linux Manuals

nfstest_lock: Locking tests

NAME

nfstest_lock - Locking tests

SYNOPSIS

nfstest_lock --server <server> [--client <client>] [options]

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.

OPTIONS

--version
show program's version number and exit
-h, --help
show this help message and exit
-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

NFS specific options:

-s SERVER, --server=SERVER
Server name or IP address
-e EXPORT, --export=EXPORT
Exported file system to mount [default: '/']
--nfsversion=NFSVERSION
NFS version, e.g., 3, 4, 4.1, etc. [default: 4.1]
-m MTPOINT, --mtpoint=MTPOINT
Mount point [default: '/mnt/t']
-p PORT, --port=PORT
NFS server port [default: 2049]
--proto=PROTO
NFS protocol name [default: 'tcp']
--sec=SEC
Security flavor [default: 'sys']
-o MTOPTS, --mtopts=MTOPTS
Mount options [default: 'hard,rsize=4096,wsize=4096']
--datadir=DATADIR
Data directory where files are created, directory is created on the mount point [default: '']

Logging options:

-v VERBOSE, --verbose=VERBOSE
Verbose level for debug messages [default: 'none']
--tverbose=TVERBOSE
Verbose level for test messages [default: '1']
--createlog
Create log file
--warnings
Display warnings
--tag=TAG
Informational tag, it is displayed as an INFO message [default: '']

Packet trace options:

--createtraces
Create a packet trace for each test
--tbsize=TBSIZE
Capture buffer size for tcpdump [default: '50000']
--trcdelay=TRCDELAY
Seconds to delay before stopping packet trace [default: 0.0]
--keeptraces
Do not remove any trace files [default: remove trace files if no errors]
--rmtraces
Remove trace files [default: remove trace files if no errors]
-i INTERFACE, --interface=INTERFACE
Device interface [default: automatically selected]
--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.

File options:

--nfiles=NFILES
Number of files to create [default: 2]
--filesize=FILESIZE
File size to use for test files [default: 65536]
--rsize=RSIZE
Read size to use when reading files [default: 4096]
--wsize=WSIZE
Write size to use when writing files [default: 4096]
--iodelay=IODELAY
Seconds to delay I/O operations [default: 0.1]
--offset-delta=OFFSET_DELTA
Read/Write offset delta [default: 4096]

Path options:

--sudo=SUDO
Full path of binary for sudo [default: '/usr/bin/sudo']
--tcpdump=TCPDUMP
Full path of binary for tcpdump [default: '/usr/sbin/tcpdump']
--iptables=IPTABLES
Full path of binary for iptables [default: '/sbin/iptables']
--messages=MESSAGES
Full path of log messages file [default: '/var/log/messages']
--tmpdir=TMPDIR
Temporary directory [default: '/tmp']

Debug options:

--nocleanup
Do not cleanup created files
--bugmsgs=BUGMSGS
File containing test messages to mark as bugs if they failed
--ignore
Ignore all bugs given by bugmsgs
--nomount
Do not mount server and run the tests on local disk space
--basename=BASENAME
Base name for all files and logs [default: automatically generated]
--nfsdebug=NFSDEBUG
Set NFS kernel debug flags and save log messages [default: '']
--rpcdebug=RPCDEBUG
Set RPC kernel debug flags and save log messages [default: '']

Test options:

--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']
--client=CLIENT
Remote NFS client used for conflicting lock tests
--offset=OFFSET
Offset of first lock granted [default: 4096]
--length=LENGTH
Length of first lock granted [default: 4096]
--unlock-delay=UNLOCK_DELAY
Time in seconds to unlock first lock [default: 2.0]
--lockw-timeout=LOCKW_TIMEOUT
Time in seconds to wait for blocked lock after conflicting lock has been released [default: 30]
--opentype=OPENTYPE
List of open types to test [default: read,write,rdwr]
--locktype=LOCKTYPE
List of lock types to test [default: read,write]
--opentype2=OPENTYPE2
List of open types to test on remote client [default: read,write,rdwr]
--locktype2=LOCKTYPE2
List of lock types to test on remote client [default: read,write]
--setlock=SETLOCK
List of set lock types to test [default: immediate,block]

TESTS

btest01

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.

noverlap

Run all non-overlapping locking tests: nptest01, nptest02, nptest03,
nptest04, nctest01, nctest02, nctest03, nctest04

nptest

Run all non-overlapping locking tests using a second process: nptest01,
nptest02, nptest03, nptest04

nptest01

Locking non-overlapping range from a second process where end2 < start1
process1:                     |------------------|
process2: |--------|

nptest02

Locking non-overlapping range from a second process where end2 == start1 - 1
process1:                     |------------------|
process2: |------------------|

nptest03

Locking non-overlapping range from a second process where start2 > end1
process1: |------------------|
process2:                               |--------|

nptest04

Locking non-overlapping range from a second process where start2 == end1 + 1
process1: |------------------|
process2:                     |------------------|

nctest

Run all non-overlapping locking tests using a second client: nctest01,
nctest02, nctest03, nctest04

nctest01

Locking non-overlapping range from a second client where end2 < start1
client1:                      |------------------|
client2:  |--------|

nctest02

Locking non-overlapping range from a second client where end2 == start1 - 1
client1:                      |------------------|
client2:  |------------------|

nctest03

Locking non-overlapping range from a second client where start2 > end1
client1:  |------------------|
client2:                                |--------|

nctest04

Locking non-overlapping range from a second client where start2 == end1 + 1
client1:  |------------------|
client2:                      |------------------|

overlap

Run all overlapping locking tests: optest01, optest02, optest03,
optest04, optest05, optest06, optest07, optest08, octest01, octest02,
octest03, octest04, octest05, octest06, octest07, octest08

optest

Run all overlapping locking tests using a second process: optest01,
optest02, optest03, optest04, optest05, optest06, optest07, optest08

optest01

Locking same range from a second process
process1:                     |------------------|
process2:                     |------------------|

optest02

Locking overlapping range from a second process where start2 < start1
process1:                     |------------------|
process2:           |------------------|

optest03

Locking overlapping range from a second process where end2 > end1
process1:                     |------------------|
process2:                               |------------------|

optest04

Locking overlapping range from a second process where range2 is entirely within range1
process1:                     |------------------|
process2:                          |--------|

optest05

Locking overlapping range from a second process where range1 is entirely within range2
process1:                     |------------------|
process2:                |----------------------------|

optest06

Locking full file range from a second process

optest07

Locking overlapping range from a second process where end2 == start1
process1:                     |------------------|
process2:  |------------------|

optest08

Locking overlapping range from a second process where start2 == end1
process1:  |------------------|
process2:                     |------------------|

octest

Run all overlapping locking tests using a second client: octest01,
octest02, octest03, octest04, octest05, octest06, octest07, octest08

octest01

Locking same range from a second client
client1:                      |------------------|
client2:                      |------------------|

octest02

Locking overlapping range from a second client where start2 < start1
client1:                      |------------------|
client2:            |------------------|

octest03

Locking overlapping range from a second client where end2 > end1
client1:                      |------------------|
client2:                                |------------------|

octest04

Locking overlapping range from a second client where range2 is entirely within range1
client1:                      |------------------|
client2:                           |--------|

octest05

Locking overlapping range from a second client where range1 is entirely within range2
client1:                      |------------------|
client2:                 |----------------------------|

octest06

Locking full file range from a second client

octest07

Locking overlapping range from a second client where end2 == start1
client1:                      |------------------|
client2:   |------------------|

octest08

Locking overlapping range from a second client where start2 == end1
client1:   |------------------|
client2:                      |------------------|

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.

BUGS

No known bugs.

AUTHOR

Jorge Mora (mora [at] netapp.com)