1NFSTEST_LOCK(1)                nfstest_lock 1.3                NFSTEST_LOCK(1)
2
3
4

NAME

6       nfstest_lock - Locking tests
7

SYNOPSIS

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

DESCRIPTION

12       Basic  locking  tests verify that a lock is granted using various argu‐
13       ments to fcntl. These include blocking and non-blocking locks, read  or
14       write  locks,  where  the file is opened either for reading, writing or
15       both. It also checks different ranges including limit conditions.
16
17       Non-overlapping tests verity that locks are granted on both the  client
18       under  test  and  a  second process or a remote client when locking the
19       same file.
20
21       Overlapping tests verity that a lock is granted  on  the  client  under
22       test  and  a  second process or a remote client trying to lock the same
23       file will be denied if a non-blocking lock is issue or will be  blocked
24       if a blocking lock is issue on the second process or remote client.
25
26
27

OPTIONS

29       --version
30              show program's version number and exit
31
32       -h, --help
33              show this help message and exit
34
35       -f FILE, --file=FILE
36              File  where  options  are specified besides the system wide file
37              /etc/nfstest, user wide file $HOME/.nfstest or  in  the  current
38              directory .nfstest file
39
40
41   NFS specific options:
42       -s SERVER, --server=SERVER
43              Server name or IP address
44
45       -e EXPORT, --export=EXPORT
46              Exported file system to mount [default: '/']
47
48       --nfsversion=NFSVERSION
49              NFS version, e.g., 3, 4, 4.1, etc. [default: 4.1]
50
51       -m MTPOINT, --mtpoint=MTPOINT
52              Mount point [default: '/mnt/t']
53
54       -p PORT, --port=PORT
55              NFS server port [default: 2049]
56
57       --proto=PROTO
58              NFS protocol name [default: 'tcp']
59
60       --sec=SEC
61              Security flavor [default: 'sys']
62
63       --nconnect=NCONNECT
64              Multiple TCP connections option [default: '1']
65
66       -o MTOPTS, --mtopts=MTOPTS
67              Mount options [default: 'hard,rsize=4096,wsize=4096']
68
69       --datadir=DATADIR
70              Data  directory where files are created, directory is created on
71              the mount point [default: '']
72
73
74   Logging options:
75       -v VERBOSE, --verbose=VERBOSE
76              Verbose     level     for     debug      messages      [default:
77              'opts|info|dbg1|dbg2|dbg3']
78
79       --tverbose=TVERBOSE
80              Verbose level for test messages [default: '2']
81
82       --createlog
83              Create log file
84
85       --rexeclog
86              Create rexec log files
87
88       --warnings
89              Display warnings
90
91       --tag=TAG
92              Informational  tag, it is displayed as an INFO message [default:
93              '']
94
95       --notty
96              Do not use terminal colors on output
97
98       --isatty
99              Use terminal colors on output -- useful when running with nohup
100
101
102   Packet trace options:
103       --createtraces
104              Create a packet trace for each test
105
106       --tbsize=TBSIZE
107              Capture buffer size for tcpdump [default: 192k]
108
109       --trcdelay=TRCDELAY
110              Seconds to delay before stopping packet trace [default: 2.0]
111
112       --keeptraces
113              Do not remove any trace files [default: remove trace files if no
114              errors]
115
116       --rmtraces
117              Remove trace files [default: remove trace files if no errors]
118
119       -i INTERFACE, --interface=INTERFACE
120              Device interface [default: automatically selected]
121
122       --subtraces
123              Create  a  packet  trace  for each sub-test. Use it with caution
124              since it will create a lot of packet traces. Use  --createtraces
125              instead  unless trying to get a packet trace for a specific sub-
126              test. Best if it is used in combination with the  --runtest  op‐
127              tion.
128
129
130   File options:
131       --nfiles=NFILES
132              Number of files to create [default: 2]
133
134       --filesize=FILESIZE
135              File size to use for test files [default: 64k]
136
137       --rsize=RSIZE
138              Read size to use when reading files [default: 4k]
139
140       --wsize=WSIZE
141              Write size to use when writing files [default: 4k]
142
143       --iodelay=IODELAY
144              Seconds to delay I/O operations [default: 0.1]
145
146       --offset-delta=OFFSET_DELTA
147              Read/Write offset delta [default: 4k]
148
149
150   Path options:
151       --sudo=SUDO
152              Full path of binary for sudo [default: '/usr/bin/sudo']
153
154       --kill=KILL
155              Full path of binary for kill [default: '/usr/bin/kill']
156
157       --nfsstat=NFSSTAT
158              Full path of binary for nfsstat [default: '/usr/sbin/nfsstat']
159
160       --tcpdump=TCPDUMP
161              Full path of binary for tcpdump [default: '/usr/sbin/tcpdump']
162
163       --iptables=IPTABLES
164              Full path of binary for iptables [default: '/usr/sbin/iptables']
165
166       --messages=MESSAGES
167              Full path of log messages file [default: '/var/log/messages']
168
169       --trcevents=TRCEVENTS
170              Full path of tracing events directory [default: '/sys/kernel/de‐
171              bug/tracing/events']
172
173       --trcpipe=TRCPIPE
174              Full path of trace pipe file [default:  '/sys/kernel/debug/trac‐
175              ing/trace_pipe']
176
177       --tmpdir=TMPDIR
178              Temporary directory [default: '/tmp']
179
180
181   Debug options:
182       --nocleanup
183              Do not cleanup created files
184
185       --notimestamps
186              Do not display timestamps in debug messages
187
188       --bugmsgs=BUGMSGS
189              File containing test messages to mark as bugs if they failed
190
191       --nomount
192              Do not mount server and run the tests on local disk space
193
194       --basename=BASENAME
195              Base  name for all files and logs [default: automatically gener‐
196              ated]
197
198       --nfsdebug=NFSDEBUG
199              Set NFS kernel debug flags and save log messages [default: '']
200
201       --rpcdebug=RPCDEBUG
202              Set RPC kernel debug flags and save log messages [default: '']
203
204       --tracepoints=TRACEPOINTS
205              List of trace points modules to enable [default: '']
206
207       --nfsstats
208              Get NFS stats [default: 'False']
209
210       --pktdisp
211              Display main packets related to the given test
212
213       --nfserrors
214              Fail every NFS error found in the packet trace
215
216       --client-ipaddr=CLIENT_IPADDR
217              IP address of localhost
218
219
220   Reporting options:
221       --xunit-report
222              Generate xUnit compatible test report
223
224       --xunit-report-file=XUNIT_REPORT_FILE
225              Path to xout report file
226
227
228   Test options:
229       --runtest=RUNTEST
230              Comma separated list of tests to run, if list starts with a  '^'
231              then all tests are run except the ones listed [default: 'all']
232
233       --client=CLIENT
234              Remote  NFS  client and options used for conflicting lock tests.
235              Clients are separated by a ',' and each client definition  is  a
236              list  of arguments separated by a ':' given in the following or‐
237              der if positional arguments  is  used  (see  examples):  client‐
238              name:server:export:nfsversion:port:proto:sec:mtpoint
239
240       --nfsopts=NFSOPTS
241              Local  process NFS options used for conflicting lock tests. Pro‐
242              cesses are separated by a ',' and each process definition  is  a
243              list  of arguments separated by a ':' given in the following or‐
244              der if positional arguments is used (see examples):  :server:ex‐
245              port:nfsversion:port:proto:sec:mtpoint
246
247       --offset=OFFSET
248              Offset of first lock granted [default: 4k]
249
250       --length=LENGTH
251              Length of first lock granted [default: 4k]
252
253       --unlock-delay=UNLOCK_DELAY
254              Time in seconds to unlock first lock [default: 2.0]
255
256       --lockw-timeout=LOCKW_TIMEOUT
257              Time  in seconds to wait for blocked lock after conflicting lock
258              has been released [default: 30]
259
260       --opentype=OPENTYPE
261              List of open types to test [default: read,write,rdwr]
262
263       --locktype=LOCKTYPE
264              List of lock types to test [default: read,write]
265
266       --opentype2=OPENTYPE2
267              List  of  open  types  to  test  on  remote   client   [default:
268              read,write,rdwr]
269
270       --locktype2=LOCKTYPE2
271              List   of   lock  types  to  test  on  remote  client  [default:
272              read,write]
273
274       --setlock=SETLOCK
275              List of set lock types to test [default: immediate,block]
276

TESTS

278   btest01
279       Basic locking tests
280       These tests verify that a lock is granted using various arguments
281       to fcntl. These include blocking and non-blocking locks, read or
282       write locks, where the file is opened either for reading, writing
283       or both. It also checks different ranges including limit conditions.
284
285   noverlap
286       Run all non-overlapping locking tests: nptest01, nptest02, nptest03,
287       nptest04, nctest01, nctest02, nctest03, nctest04
288
289   nptest
290       Run all non-overlapping locking tests using a second process: nptest01,
291       nptest02, nptest03, nptest04
292
293   nptest01
294       Locking non-overlapping range from a second process where end2 < start1
295       process1:                     |------------------|
296       process2: |--------|
297
298   nptest02
299       Locking non-overlapping range from a second process where end2 == start1 - 1
300       process1:                     |------------------|
301       process2: |------------------|
302
303   nptest03
304       Locking non-overlapping range from a second process where start2 > end1
305       process1: |------------------|
306       process2:                               |--------|
307
308   nptest04
309       Locking non-overlapping range from a second process where start2 == end1 + 1
310       process1: |------------------|
311       process2:                     |------------------|
312
313   nctest
314       Run all non-overlapping locking tests using a second client: nctest01,
315       nctest02, nctest03, nctest04
316
317   nctest01
318       Locking non-overlapping range from a second client where end2 < start1
319       client1:                      |------------------|
320       client2:  |--------|
321
322   nctest02
323       Locking non-overlapping range from a second client where end2 == start1 - 1
324       client1:                      |------------------|
325       client2:  |------------------|
326
327   nctest03
328       Locking non-overlapping range from a second client where start2 > end1
329       client1:  |------------------|
330       client2:                                |--------|
331
332   nctest04
333       Locking non-overlapping range from a second client where start2 == end1 + 1
334       client1:  |------------------|
335       client2:                      |------------------|
336
337   overlap
338       Run all overlapping locking tests: optest01, optest02, optest03,
339       optest04, optest05, optest06, optest07, optest08, optest09, octest01,
340       octest02, octest03, octest04, octest05, octest06, octest07, octest08,
341       octest09
342
343   optest
344       Run all overlapping locking tests using a second process: optest01,
345       optest02, optest03, optest04, optest05, optest06, optest07, optest08,
346       optest09
347
348   optest01
349       Locking same range from a second process
350       process1:                     |------------------|
351       process2:                     |------------------|
352
353   optest02
354       Locking overlapping range from a second process where start2 < start1
355       process1:                     |------------------|
356       process2:           |------------------|
357
358   optest03
359       Locking overlapping range from a second process where end2 > end1
360       process1:                     |------------------|
361       process2:                               |------------------|
362
363   optest04
364       Locking overlapping range from a second process where range2 is entirely within range1
365       process1:                     |------------------|
366       process2:                          |--------|
367
368   optest05
369       Locking overlapping range from a second process where range1 is entirely within range2
370       process1:                     |------------------|
371       process2:                |----------------------------|
372
373   optest06
374       Locking full file range from a second process
375
376   optest07
377       Locking overlapping range from a second process where end2 == start1
378       process1:                     |------------------|
379       process2:  |------------------|
380
381   optest08
382       Locking overlapping range from a second process where start2 == end1
383       process1:  |------------------|
384       process2:                     |------------------|
385
386   optest09
387       Locking overlapping range from multiple processes where range2 and
388       range3 are entirely within range1
389         process1:                     |-----------------------------|
390         process2:                          |--------|
391         process3:                                    |--------|
392
393   octest
394       Run all overlapping locking tests using a second client: octest01,
395       octest02, octest03, octest04, octest05, octest06, octest07, octest08,
396       octest09
397
398   octest01
399       Locking same range from a second client
400       client1:                      |------------------|
401       client2:                      |------------------|
402
403   octest02
404       Locking overlapping range from a second client where start2 < start1
405       client1:                      |------------------|
406       client2:            |------------------|
407
408   octest03
409       Locking overlapping range from a second client where end2 > end1
410       client1:                      |------------------|
411       client2:                                |------------------|
412
413   octest04
414       Locking overlapping range from a second client where range2 is entirely within range1
415       client1:                      |------------------|
416       client2:                           |--------|
417
418   octest05
419       Locking overlapping range from a second client where range1 is entirely within range2
420       client1:                      |------------------|
421       client2:                 |----------------------------|
422
423   octest06
424       Locking full file range from a second client
425
426   octest07
427       Locking overlapping range from a second client where end2 == start1
428       client1:                      |------------------|
429       client2:   |------------------|
430
431   octest08
432       Locking overlapping range from a second client where start2 == end1
433       client1:   |------------------|
434       client2:                      |------------------|
435
436   octest09
437       Locking overlapping range from multiple clients where range2 and
438       range3 are entirely within range1
439         client1:                     |-----------------------------|
440         client2:                          |--------|
441         client3:                                    |--------|
442
443   all
444       Run all tests: btest01, nptest01, nptest02, nptest03, nptest04,
445       nctest01, nctest02, nctest03, nctest04, optest01, optest02, optest03,
446       optest04, optest05, optest06, optest07, optest08, optest09, octest01,
447       octest02, octest03, octest04, octest05, octest06, octest07, octest08,
448       octest09
449

EXAMPLES

451       Run the tests which use only the main client (no client option):
452           nfstest_lock --server 192.168.0.2 --export /exports
453
454       Use short options instead:
455           nfstest_lock -s 192.168.0.2 -e /exports
456
457       Use positional arguments with nfsversion=3 for extra client:
458           nfstest_lock -s 192.168.0.2 -e /exports --client 192.168.0.10:::3
459
460       Use named arguments instead:
461           nfstest_lock    -s     192.168.0.2     -e     /exports     --client
462       192.168.0.10:nfsversion=3
463
464       Use positional arguments with nfsversion=3 for second process:
465           nfstest_lock -s 192.168.0.2 -e /exports --nfsopts :::3
466
467       Use named arguments instead:
468           nfstest_lock -s 192.168.0.2 -e /exports --nfsopts nfsversion=3
469

NOTES

471       The  user  id in the local host and the host specified by --client must
472       have access to run commands as root using the  'sudo'  command  without
473       the need for a password.
474
475       The user id must be able to 'ssh' to remote host without the need for a
476       password.
477

SEE ALSO

479       baseobj(3), formatstr(3), nfstest.test_util(3),  nfstest_alloc(1),  nf‐
480       stest_cache(1), nfstest_delegation(1), nfstest_dio(1), nfstest_fcmp(1),
481       nfstest_file(1), nfstest_interop(1), nfstest_io(1), nfstest_pkt(1), nf‐
482       stest_pnfs(1),  nfstest_posix(1),  nfstest_rdma(1),  nfstest_sparse(1),
483       nfstest_ssc(1),            nfstest_xattr(1),            nfstest_xid(1),
484       packet.nfs.nfs3_const(3),                     packet.nfs.nfs4_const(3),
485       packet.nfs.nlm4_const(3)
486
487

BUGS

489       No known bugs.
490

AUTHOR

492       Jorge Mora (mora@netapp.com)
493
494
495
496NFStest 3.2                      21 March 2023                 NFSTEST_LOCK(1)
Impressum