1NFSTEST_ALLOC(1)               nfstest_alloc 1.3              NFSTEST_ALLOC(1)
2
3
4

NAME

6       nfstest_alloc - Space reservation tests
7

SYNOPSIS

9       nfstest_alloc --server <server> [options]
10

DESCRIPTION

12       Verify  correct functionality of space reservations so applications are
13       able to reserve or unreserve space for a file. The system  call  fallo‐
14       cate  is used to manipulate the allocated disk space for a file, either
15       to preallocate or deallocate it. For filesystems which support the fal‐
16       locate  system call, preallocation is done quickly by allocating blocks
17       and marking them as uninitialized, requiring no I/O to the data blocks.
18       This is much faster than creating a file and filling it with zeros.
19
20       Basic  allocate tests verify the disk space is actually preallocated or
21       reserved for the given range by filling up the device after the alloca‐
22       tion  and  make sure data can be written to the allocated range without
23       any problems. Also, any data written outside the allocated  range  will
24       fail with NFS4ERR_NOSPC when there is no more space left on the device.
25       On the other hand, deallocating space will give the disk space back  so
26       it  can be used by either the same file on regions not already preallo‐
27       cated or by different files without the risk of getting a no space  er‐
28       ror.
29
30       Performance  testing  using  ALLOCATE versus initializing a file to all
31       zeros is also included. The performance comparison is done with differ‐
32       ent file sizes.
33
34       Some  tests  include  testing  at the protocol level by taking a packet
35       trace and inspecting the actual packets sent to the server or servers.
36
37       Negative testing is included whenever possible since some testing  can‐
38       not  be  done  at  the protocol level because the fallocate system call
39       does some error checking of its own and the NFS client won't even  send
40       an  ALLOCATE  or  DEALLOCATE operation to the server letting the server
41       deal with the error. Negative tests include trying to allocate  an  in‐
42       valid  range,  having  an  invalid  value  for either the offset or the
43       length, trying to allocate or deallocate a region on a file  opened  as
44       read only or the file is a non-regular file type.
45
46
47

OPTIONS

49       --version
50              show program's version number and exit
51
52       -h, --help
53              show this help message and exit
54
55       -f FILE, --file=FILE
56              File  where  options  are specified besides the system wide file
57              /etc/nfstest, user wide file $HOME/.nfstest or  in  the  current
58              directory .nfstest file
59
60
61   NFS specific options:
62       -s SERVER, --server=SERVER
63              Server name or IP address
64
65       -e EXPORT, --export=EXPORT
66              Exported file system to mount [default: '/']
67
68       --nfsversion=NFSVERSION
69              NFS version, e.g., 3, 4, 4.1, etc. [default: 4.2]
70
71       -m MTPOINT, --mtpoint=MTPOINT
72              Mount point [default: '/mnt/t']
73
74       -p PORT, --port=PORT
75              NFS server port [default: 2049]
76
77       --proto=PROTO
78              NFS protocol name [default: 'tcp']
79
80       --sec=SEC
81              Security flavor [default: 'sys']
82
83       --nconnect=NCONNECT
84              Multiple TCP connections option [default: '1']
85
86       -o MTOPTS, --mtopts=MTOPTS
87              Mount options [default: 'hard,rsize=4096,wsize=4096']
88
89       --datadir=DATADIR
90              Data  directory where files are created, directory is created on
91              the mount point [default: '']
92
93
94   Logging options:
95       -v VERBOSE, --verbose=VERBOSE
96              Verbose     level     for     debug      messages      [default:
97              'opts|info|dbg1|dbg2|dbg3']
98
99       --tverbose=TVERBOSE
100              Verbose level for test messages [default: '1']
101
102       --createlog
103              Create log file
104
105       --rexeclog
106              Create rexec log files
107
108       --warnings
109              Display warnings
110
111       --tag=TAG
112              Informational  tag, it is displayed as an INFO message [default:
113              '']
114
115       --notty
116              Do not use terminal colors on output
117
118       --isatty
119              Use terminal colors on output -- useful when running with nohup
120
121
122   Packet trace options:
123       --createtraces
124              Create a packet trace for each test
125
126       --tbsize=TBSIZE
127              Capture buffer size for tcpdump [default: 192k]
128
129       --trcdelay=TRCDELAY
130              Seconds to delay before stopping packet trace [default: 2.0]
131
132       --keeptraces
133              Do not remove any trace files [default: remove trace files if no
134              errors]
135
136       --rmtraces
137              Remove trace files [default: remove trace files if no errors]
138
139       -i INTERFACE, --interface=INTERFACE
140              Device interface [default: automatically selected]
141
142
143   File options:
144       --nfiles=NFILES
145              Number of files to create [default: 2]
146
147       --filesize=FILESIZE
148              File size to use for test files [default: 64k]
149
150       --rsize=RSIZE
151              Read size to use when reading files [default: 4k]
152
153       --wsize=WSIZE
154              Write size to use when writing files [default: 4k]
155
156       --iodelay=IODELAY
157              Seconds to delay I/O operations [default: 0.1]
158
159       --offset-delta=OFFSET_DELTA
160              Read/Write offset delta [default: 4k]
161
162
163   Path options:
164       --sudo=SUDO
165              Full path of binary for sudo [default: '/usr/bin/sudo']
166
167       --kill=KILL
168              Full path of binary for kill [default: '/usr/bin/kill']
169
170       --nfsstat=NFSSTAT
171              Full path of binary for nfsstat [default: '/usr/sbin/nfsstat']
172
173       --tcpdump=TCPDUMP
174              Full path of binary for tcpdump [default: '/usr/sbin/tcpdump']
175
176       --iptables=IPTABLES
177              Full path of binary for iptables [default: '/usr/sbin/iptables']
178
179       --messages=MESSAGES
180              Full path of log messages file [default: '/var/log/messages']
181
182       --trcevents=TRCEVENTS
183              Full path of tracing events directory [default: '/sys/kernel/de‐
184              bug/tracing/events']
185
186       --trcpipe=TRCPIPE
187              Full path of trace pipe file [default:  '/sys/kernel/debug/trac‐
188              ing/trace_pipe']
189
190       --tmpdir=TMPDIR
191              Temporary directory [default: '/tmp']
192
193
194   Debug options:
195       --nocleanup
196              Do not cleanup created files
197
198       --notimestamps
199              Do not display timestamps in debug messages
200
201       --bugmsgs=BUGMSGS
202              File containing test messages to mark as bugs if they failed
203
204       --nomount
205              Do not mount server and run the tests on local disk space
206
207       --basename=BASENAME
208              Base  name for all files and logs [default: automatically gener‐
209              ated]
210
211       --nfsdebug=NFSDEBUG
212              Set NFS kernel debug flags and save log messages [default: '']
213
214       --rpcdebug=RPCDEBUG
215              Set RPC kernel debug flags and save log messages [default: '']
216
217       --tracepoints=TRACEPOINTS
218              List of trace points modules to enable [default: '']
219
220       --nfsstats
221              Get NFS stats [default: 'False']
222
223       --pktdisp
224              Display main packets related to the given test
225
226       --nfserrors
227              Fail every NFS error found in the packet trace
228
229       --client-ipaddr=CLIENT_IPADDR
230              IP address of localhost
231
232
233   Reporting options:
234       --xunit-report
235              Generate xUnit compatible test report
236
237       --xunit-report-file=XUNIT_REPORT_FILE
238              Path to xout report file
239
240
241   Test options:
242       --runtest=RUNTEST
243              Comma separated list of tests to run, if list starts with a  '^'
244              then all tests are run except the ones listed [default: 'all']
245
246       --free-blocks=FREE_BLOCKS
247              Number  of free blocks to use when trying to allocate all avail‐
248              able space [default: 64]
249
250       --perf-fsize=PERF_FSIZE
251              Starting file size for the perf01 test [default: 1MB]
252
253       --perf-mult=PERF_MULT
254              File size multiplier for the perf01 test,  the  tests  are  per‐
255              formed  for a file size which is a multiple of the previous test
256              file size [default: 4]
257
258       --perf-time=PERF_TIME
259              Run the performance test perf01 until the sub-test for the  cur‐
260              rent file size executes for more than this time [default: 15]
261

TESTS

263   alloc
264       Run all ALLOCATE tests: alloc01, alloc02, alloc03, alloc04, alloc05,
265       alloc06
266
267   alloc01
268       Verify ALLOCATE succeeds on files opened as write only
269
270   alloc02
271       Verify ALLOCATE succeeds on files opened as read and write
272
273   alloc03
274       Verify ALLOCATE fails on files opened as read only
275
276   alloc04
277       Verify ALLOCATE fails with EINVAL for invalid offset or length
278
279   alloc05
280       Verify ALLOCATE fails with ESPIPE when using a named pipe file handle
281
282   alloc06
283       Verify ALLOCATE reserves the disk space
284
285   dealloc
286       Run all DEALLOCATE tests: dealloc01, dealloc02, dealloc03, dealloc04,
287       dealloc05, dealloc06
288
289   dealloc01
290       Verify DEALLOCATE succeeds on files opened as write only
291
292   dealloc02
293       Verify DEALLOCATE succeeds on files opened as read and write
294
295   dealloc03
296       Verify DEALLOCATE fails on files opened as read only
297
298   dealloc04
299       Verify DEALLOCATE fails with EINVAL for invalid offset or length
300
301   dealloc05
302       Verify DEALLOCATE fails with ESPIPE when using a named pipe file handle
303
304   dealloc06
305       Verify DEALLOCATE unreserves the disk space
306
307   perf01
308       Verify ALLOCATE outperforms initializing the file to all zeros
309
310   all
311       Run all tests: alloc01, alloc02, alloc03, alloc04, alloc05, alloc06,
312       dealloc01, dealloc02, dealloc03, dealloc04, dealloc05, dealloc06, perf01
313

EXAMPLES

315       The only required option is --server
316       $ nfstest_alloc --server 192.168.0.11
317

NOTES

319       The  user id in the local host must have access to run commands as root
320       using the 'sudo' command without the need for a password.
321
322       Tests which require filling up all the disk space on the mounted device
323       should have exclusive access to the device.
324
325       Valid only for NFS version 4.2 and above.
326

SEE ALSO

328       formatstr(3), nfstest.test_util(3), nfstest.utils(3), nfstest_cache(1),
329       nfstest_delegation(1),     nfstest_dio(1),     nfstest_fcmp(1),     nf‐
330       stest_file(1),  nfstest_interop(1), nfstest_io(1), nfstest_lock(1), nf‐
331       stest_pkt(1), nfstest_pnfs(1), nfstest_posix(1),  nfstest_rdma(1),  nf‐
332       stest_sparse(1),   nfstest_ssc(1),   nfstest_xattr(1),  nfstest_xid(1),
333       packet.nfs.nfs4_const(3)
334
335

BUGS

337       No known bugs.
338

AUTHOR

340       Jorge Mora (mora@netapp.com)
341
342
343
344NFStest 3.2                      21 March 2023                NFSTEST_ALLOC(1)
Impressum