nfstest.nfs_util (3) - Linux Manuals
nfstest.nfs_util: NFS utilities module
NAME
nfstest.nfs_util - NFS utilities moduleDESCRIPTION
Provides a set of tools for testing NFS including methods for starting a packet trace, stopping the packet trace and then open the packet trace for analysis. It also provides a mechanism to enable NFS/RPC kernel debug and saving the log messages for further analysis.
Furthermore, methods for finding specific NFSv4 operations within the packet trace are also included.
CLASSES
class NFSUtil(nfstest.host.Host)
NFSUtil object NFSUtil() -> New NFSUtil object Usage: from nfstest.nfs_util import NFSUtil # Create object for local host x = NFSUtil() # Start packet trace x.trace_start() # Stop packet trace x.trace_stop() # Open packet trace x.trace_open() # Enable NFS kernel debug x.nfs_debug_enable(nfsdebug='all'): # Stop NFS kernel debug x.nfs_debug_reset() Methods defined here: --------------------- __del__(self) Destructor Gracefully stop the packet trace and unreference all client objects __init__(self, **kwargs) Constructor Initialize object's private data.
- rpcdebug:
- Set RPC kernel debug flags and save log messages [default: '']
- nfsdebug:
- Set NFS kernel debug flags and save log messages [default: '']
- dbgname:
- Base name for log messages files to create [default: 'dbgfile']
- tracename:
- Base name for trace files to create [default: 'tracefile']
- trcdelay:
- Seconds to delay before stopping packet trace [default: 0.0]
- notrace:
- Debug option so a trace is not actually started [default: False]
- tcpdump:
- Tcpdump command [default: '/usr/sbin/tcpdump']
- messages:
- Location of file for system messages [default: '/var/log/messages']
- tmpdir:
- Temporary directory where trace files are created [default: '/tmp']
- tbsize:
- Capture buffer size in kB [default: 50000]
- ipaddr:
- Destination IP address [default: self.server]
- port:
- Destination port [default: self.port]
- Store the callback IP/TCP expression in object attribute cb_dst Return a tuple: (pktcall, pktreply).
- deviceid:
- Look for an specific deviceid [default: any deviceid]
- Return a tuple: (pktcall, pktreply, dslist).
- op:
- NFS operation to find
- ipaddr:
- Destination IP address
- port:
- Destination port [default: any destination port]
- match:
- Match string to include [default: '']
- status:
- Match the status of the operation [default: 0]
- src_ipaddr:
- Source IP address [default: any IP address]
- maxindex:
- The match fails if packet index hits this limit [default: no limit]
- call_only:
- Find the call only [default: False]
- Return a tuple: (pktcall, pktreply).
- filename:
- Find open call and reply for this file [default: None]
- claimfh:
- Find open call and reply for this file handle using CLAIM_FH [default: None]
- ipaddr:
- Destination IP address [default: self.server]
- port:
- Destination port [default: self.port]
- deleg_type:
- Expected delegation type on reply [default: None]
- deleg_stateid:
- Delegation stateid expected on call in delegate_cur_info [default: None]
- fh:
- Find open call and reply for this file handle when using deleg_stateid [default: None]
- src_ipaddr:
- Source IP address [default: any IP address]
- maxindex:
- The match fails if packet index hits this limit [default: no limit]
- anyclaim:
- Find open for either regular open or using delegate_cur_info [default: False]
- Must specify either filename, claimfh or both. Return a tuple: (filehandle, open_stateid, deleg_stateid).
- rpcdebug:
- Set RPC kernel debug flags and save log messages [default: self.rpcdebug]
- nfsdebug:
- Set NFS kernel debug flags and save log messages [default: self.nfsdebug]
- dbgfile:
- Name of log messages file to create, default is a unique name created in the temporary directory using self.dbgname as the base name.
- tracefile:
- Name of trace file to create, default is a unique name created in the temporary directory using self.tracename as the base name.
- capsize:
- Use the -C option of tcpdump to split the trace files every 1000000*capsize bytes. See documentation for tcpdump for more information
- clients:
- List of Host() objects to monitor
- Return the name of the trace file created.
- ipaddr:
- Destination IP address of MDS or DS
- port:
- Destination port number of MDS or DS
- filehandle:
- Find commits for this file handle
- init:
- Initialized test variables [default: False]
- Return the number of commits sent to the server.
- ipaddr:
- Destination IP address of MDS or DS
- port:
- Destination port number of MDS or DS
- ds:
- True if ipaddr/port defines a DS, otherwise MDS [default: False]
- nocreate:
- True if expecting the client NOT to send EXCHANGE_ID, CREATE_SESSION, and RECLAIM_COMPLETE. Otherwise, verify all these operations are sent by the client [default: False]
- ds_index:
- DS index used for displaying purposes only [default: None]
- exchid_status:
- Expected status for EXCHANGE_ID [default: 0]
- cs_status:
- Expected status for CREATE_SESSION [default: 0]
- Return the sessionid and it is also stored in the object attribute sessionid.
- iomode:
- Verify reads (iomode == 1) or writes (iomode == 2)
- stateid:
- Expected stateid to use in all I/O requests
- ipaddr:
- Destination IP address of MDS or DS [default: do not match destination]
- port:
- Destination port number of MDS or DS [default: do not match destination port]
- src_ipaddr:
- Source IP address of request [default: do not match source]
- filehandle:
- Find I/O for this file handle. This option is used when verifying I/O sent to the MDS [default: use filehandle given by ds_index]
- ds_index:
- Data server index. This option is used when verifying I/O sent to the DS -- filehandle is taken from x.layout for this index [default: None]
- init:
- Initialized test variables [default: False]
- maxindex:
- The match fails if packet index hits this limit [default: no limit]
- pattern:
- Data pattern to compare [default: default data pattern]
- Return the number of I/O operations sent to the server.
- filehandle:
- Find layoutcommit for this file handle
- filesize:
- Expected size of file
- filehandle:
- Find LAYOUTGET for this file handle
- iomode:
- Expected I/O mode for LAYOUTGET call
- riomode:
- Expected I/O mode for LAYOUTGET reply if specified, else verify reply I/O mode is equal to call I/O mode if iomode == 2. If iomode == 1, the reply I/O mode could be equal to 1 or 2
- status:
- Expected status for LAYOUTGET reply [default: 0]
- offset:
- Expected layout range for LAYOUTGET reply [default: None]
- length:
- Expected layout range for LAYOUTGET reply [default: None]
- If both offset and length are not given, verify LAYOUTGET reply should be a full layout [0, NFS4_UINT64_MAX]. If only one is provided the following defaults are used: offset = 0, length = NFS4_UINT64_MAX. Layout information is stored in the object attribute layout. Return a tuple: (layoutget, layoutget_res, loc_body).
- offset:
- Real file offset
- size:
- I/O size
- ds_index:
- Data server index
- Return True if stripe is correctly verified, False otherwise.
- bitmap:
- Bitmap to convert
- count:
- Number of occurrences of bitmap
- bmap:
- Dictionary mapping the bits to strings
- blist:
- List of all possible bit combinations
BUGS
No known bugs.AUTHOR
Jorge Mora (mora [at] netapp.com)