1NFSTEST_ALLOC(1)               nfstest_alloc 1.2              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
28       error.
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
42       invalid  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       -o MTOPTS, --mtopts=MTOPTS
84              Mount options [default: 'hard,rsize=4096,wsize=4096']
85
86       --datadir=DATADIR
87              Data  directory where files are created, directory is created on
88              the mount point [default: '']
89
90
91   Logging options:
92       -v VERBOSE, --verbose=VERBOSE
93              Verbose level for debug messages [default: 'none']
94
95       --tverbose=TVERBOSE
96              Verbose level for test messages [default: '1']
97
98       --createlog
99              Create log file
100
101       --rexeclog
102              Create rexec log files
103
104       --warnings
105              Display warnings
106
107       --tag=TAG
108              Informational tag, it is displayed as an INFO message  [default:
109              '']
110
111       --notty
112              Do not use terminal colors on output
113
114
115   Packet trace options:
116       --createtraces
117              Create a packet trace for each test
118
119       --tbsize=TBSIZE
120              Capture buffer size for tcpdump [default: 192k]
121
122       --trcdelay=TRCDELAY
123              Seconds to delay before stopping packet trace [default: 0.0]
124
125       --keeptraces
126              Do not remove any trace files [default: remove trace files if no
127              errors]
128
129       --rmtraces
130              Remove trace files [default: remove trace files if no errors]
131
132       -i INTERFACE, --interface=INTERFACE
133              Device interface [default: automatically selected]
134
135
136   File options:
137       --nfiles=NFILES
138              Number of files to create [default: 2]
139
140       --filesize=FILESIZE
141              File size to use for test files [default: 64k]
142
143       --rsize=RSIZE
144              Read size to use when reading files [default: 4k]
145
146       --wsize=WSIZE
147              Write size to use when writing files [default: 4k]
148
149       --iodelay=IODELAY
150              Seconds to delay I/O operations [default: 0.1]
151
152       --offset-delta=OFFSET_DELTA
153              Read/Write offset delta [default: 4k]
154
155
156   Path options:
157       --sudo=SUDO
158              Full path of binary for sudo [default: '/usr/bin/sudo']
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       --tmpdir=TMPDIR
170              Temporary directory [default: '/tmp']
171
172
173   Debug options:
174       --nocleanup
175              Do not cleanup created files
176
177       --bugmsgs=BUGMSGS
178              File containing test messages to mark as bugs if they failed
179
180       --ignore
181              Ignore all bugs given by bugmsgs
182
183       --nomount
184              Do not mount server and run the tests on local disk space
185
186       --basename=BASENAME
187              Base name for all files and logs [default: automatically  gener‐
188              ated]
189
190       --nfsdebug=NFSDEBUG
191              Set NFS kernel debug flags and save log messages [default: '']
192
193       --rpcdebug=RPCDEBUG
194              Set RPC kernel debug flags and save log messages [default: '']
195
196       --pktdisp
197              Display main packets related to the given test
198
199
200   Test options:
201       --runtest=RUNTEST
202              Comma  separated list of tests to run, if list starts with a '^'
203              then all tests are run except the ones listed [default: 'all']
204
205       --perf-fsize=PERF_FSIZE
206              Starting file size for the perf01 test [default: 1MB]
207
208       --perf-mult=PERF_MULT
209              File size multiplier for the perf01 test,  the  tests  are  per‐
210              formed  for a file size which is a multiple of the previous test
211              file size [default: 4]
212
213       --perf-time=PERF_TIME
214              Run the performance test perf01 until the sub-test for the  cur‐
215              rent file size executes for more than this time [default: 15]
216

TESTS

218   alloc
219       Run all ALLOCATE tests: alloc01, alloc02, alloc03, alloc04, alloc05,
220       alloc06
221
222   alloc01
223       Verify ALLOCATE succeeds on files opened as write only
224
225   alloc02
226       Verify ALLOCATE succeeds on files opened as read and write
227
228   alloc03
229       Verify ALLOCATE fails on files opened as read only
230
231   alloc04
232       Verify ALLOCATE fails with EINVAL for invalid offset or length
233
234   alloc05
235       Verify ALLOCATE fails with ESPIPE when using a named pipe file handle
236
237   alloc06
238       Verify ALLOCATE reserves the disk space
239
240   dealloc
241       Run all DEALLOCATE tests: dealloc01, dealloc02, dealloc03, dealloc04,
242       dealloc05, dealloc06
243
244   dealloc01
245       Verify DEALLOCATE succeeds on files opened as write only
246
247   dealloc02
248       Verify DEALLOCATE succeeds on files opened as read and write
249
250   dealloc03
251       Verify DEALLOCATE fails on files opened as read only
252
253   dealloc04
254       Verify DEALLOCATE fails with EINVAL for invalid offset or length
255
256   dealloc05
257       Verify DEALLOCATE fails with ESPIPE when using a named pipe file handle
258
259   dealloc06
260       Verify DEALLOCATE unreserves the disk space
261
262   perf01
263       Verify ALLOCATE outperforms initializing the file to all zeros
264

EXAMPLES

266       The only required option is --server
267       $ nfstest_alloc --server 192.168.0.11
268

NOTES

270       The  user id in the local host must have access to run commands as root
271       using the 'sudo' command without the need for a password.
272
273       Tests which require filling up all the disk space on the mounted device
274       should have exclusive access to the device.
275
276       Valid only for NFS version 4.2 and above.
277

SEE ALSO

279       formatstr(3), nfstest.test_util(3), nfstest.utils(3), nfstest_cache(1),
280       nfstest_delegation(1),         nfstest_dio(1),         nfstest_file(1),
281       nfstest_interop(1),   nfstest_io(1),  nfstest_lock(1),  nfstest_pkt(1),
282       nfstest_pnfs(1), nfstest_posix(1),  nfstest_sparse(1),  nfstest_ssc(1),
283       nfstest_xid(1), packet.nfs.nfs4_const(3)
284
285

BUGS

287       No known bugs.
288

AUTHOR

290       Jorge Mora (mora@netapp.com)
291
292
293
294NFStest 2.1.5                  14 February 2017               NFSTEST_ALLOC(1)
Impressum