NFSTEST_SSC(1)

NAME
nfstest_ssc - Server side copy tests

SYNOPSIS
nfstest_ssc --server <server> [options]

DESCRIPTION
Verify correct functionality of server side copy

Copying a file via NFS the client reads the data from the source file and then writes the same data to the destination file which is located in the same server or it could be located in a different server. Either way the file data is transferred twice, once for reading and the second for writing. Server side copy allows unnecessary network traffic to be eliminated. The intra-server copy allows the client to request the server to perform the copy internally thus avoiding any data being sent through the network at all. In the case for the inter-server copy where the destination server is different from the source server, the client authorizes both servers to interact directly with one another.

The system call copy_file_range is used to send both intra and inter server side copy requests to the correct server.

Basic server side copy tests verify the actual file range from the source file(s) are copied correctly to the destination file(s). Most tests deal with a single source and destination file while verifying the data is copied correctly. Also it verifies the data is copied starting from the correct source offset and it is copied to the correct offset on the destination file. Other tests deal with multiple files: copying multiple source files to a single destination file, a single source file to multiple destination files, or N number of source files to M number of destination files.

Some tests include testing at the protocol level by taking a packet trace and inspecting the actual packets sent to the server or servers. For the intra-server side copy, these tests verify the COPY/CLONE operation is sent to the server with correct arguments. For the inter-server side copy, these tests verify the COPY_NOTIFY operation is sent to the source server with correct arguments to authorize the source server to allow the destination server to copy the data directly; then the client sends the COPY operation to the destination server so it could initiate the actual copy.

The server side copy could either be synchronous or asynchronous depending on both client and server(s). The client could issue either a synchronous or asynchronous copy and the server could either copy the file data in either mode depending on implementation or other factors. In either case, the tests verify the correct functionality for both cases. The CB_OFFLOAD operation is used by the destination server to report the actual results of the copy when it is done. The client could also actively query the destination server for status on a current asynchronous copy using the OFFLOAD_STATUS operation. Also the client has a mechanism to cancel a given asynchronous copy using the OFFLOAD_CANCEL operation.

Negative testing is included whenever possible since some testing cannot be done at the protocol level because the copy_file_range system call does some error checking of its own and the NFS client won't even send a COPY_NOTIFY or COPY operation to the server letting the server deal with the error. Negative tests include trying to copy an invalid source range, having an invalid value for either the offset or the length, trying to copy a region on a source file opened as write only, a destination file opened as read only or the file is a non-regular file type.

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.2]

-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']

--nconnect=NCONNECT
    Multiple TCP connections option [default: '1']

-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: 'opts|info|dbg1|dbg2|dbg3']

--tverbose=TVERBOSE
    Verbose level for test messages [default: '1']

--createlog
    Create log file

--rexeclog
    Create rexec log files

--warnings
    Display warnings

--tag=TAG
    Informational tag, it is displayed as an INFO message [default: '']

--notty
    Do not use terminal colors on output

--isatty
    Use terminal colors on output -- useful when running with nohup

  Packet trace options:

--createtraces
    Create a packet trace for each test

--tbsize=TBSIZE
    Capture buffer size for tcpdump [default: 192k]

--trcdelay=TRCDELAY
    Seconds to delay before stopping packet trace [default: 2.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]

  File options:

--nfiles=NFILES
    Number of files to create [default: 2]

--filesize=FILESIZE
    File size to use for test files [default: 256k]

--rsize=RSIZE
    Read size to use when reading files [default: 4k]

--wsize=WSIZE
    Write size to use when writing files [default: 4k]

--iodelay=IODELAY
    Seconds to delay I/O operations [default: 0.1]

--offset-delta=OFFSET_DELTA
    Read/Write offset delta [default: 4k]

  Path options:

--sudo=SUDO
    Full path of binary for sudo [default: '/usr/bin/sudo']

--kill=KILL
    Full path of binary for kill [default: '/usr/bin/kill']

--nfsstat=NFSSTAT
    Full path of binary for nfsstat [default: '/usr/sbin/nfsstat']

--tcpdump=TCPDUMP
    Full path of binary for tcpdump [default: '/usr/sbin/tcpdump']

--iptables=IPTABLES
    Full path of binary for iptables [default: '/usr/sbin/iptables']

--messages=MESSAGES
    Full path of log messages file [default: '/var/log/messages']

--trcevents=TRCEVENTS
    Full path of tracing events directory [default: '/sys/kernel/debug/tracing/events']

--trcpipe=TRCPIPE
    Full path of trace pipe file [default: '/sys/kernel/debug/tracing/trace_pipe']

--tmpdir=TMPDIR
    Temporary directory [default: '/tmp']

  Debug options:

--nocleanup
    Do not cleanup created files

--notimestamps
    Do not display timestamps in debug messages

--bugmsgs=BUGMSGS
    File containing test messages to mark as bugs if they failed

--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: '']

--tracepoints=TRACEPOINTS
    List of trace points modules to enable [default: '']

--nfsstats
    Get NFS stats [default: 'False']

--pktdisp
    Display main packets related to the given test

--nfserrors
    Fail every NFS error found in the packet trace

--client-ipaddr=CLIENT_IPADDR
    IP address of localhost

  Reporting options:

--xunit-report
    Generate xUnit compatible test report

--xunit-report-file=XUNIT_REPORT_FILE
    Path to xout report file

  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']

--dst-server=DST_SERVER
    Destination server for inter server side copy [default: none]

--dst-export=DST_EXPORT
    Destination export for inter server side copy [default: none]

--ncopies=NCOPIES
    Number of concurrent copies to use on intra14 and inter14 tests [default: 4]

--src-files=SRC_FILES
    Number of source files to use concurrently on intra15 and inter15 tests [default: 3]

--dst-files=DST_FILES
    Number of destination files to use concurrently on intra15 and inter15 tests [default: 2]

--pre-write=PRE_WRITE
    Write destination file before copy_file_range [default: 1]

--locks=LOCKS
    Lock files [default: 1]

TESTS

  intra
Run all intra server side copy tests: intra01, intra02, intra03,
intra04, intra05, intra06, intra07, intra08, intra09, intra10, intra11,
intra12, intra13, intra14, intra15

  pintra
Run all positive intra server side copy tests: intra01, intra02,
intra03, intra04, intra05, intra06, intra07, intra08, intra14, intra15

  nintra
Run all negative intra server side copy tests: intra09, intra10,
intra11, intra12, intra13

  intra01
Verify intra server side COPY succeeds

  intra02
Verify intra server side COPY succeeds when using source offset

  intra03
Verify intra server side COPY succeeds when using destination offset

  intra04
Verify intra server side COPY succeeds when using NULL as source offset

  intra05
Verify intra server side COPY succeeds when using NULL as destination
offset

  intra06
Verify intra server side COPY succeeds when using count = 0

  intra07
Verify intra server side COPY succeeds when the source file is opened
as read/write

  intra08
Verify intra server side COPY succeeds when the destination file is
opened as read/write

  intra09
Verify intra server side COPY fails when the source file is opened
as write only

  intra10
Verify intra server side COPY fails when the destination file is opened
as read only

  intra11
Verify intra server side COPY succeeds when source offset is beyond the
end of the file

  intra12
Verify intra server side COPY succeeds when source offset plus count
is beyond the end of the file

  intra13
Verify intra server side COPY may fail when both source and destination
files point to the same file

  intra14
Verify intra server side COPY succeeds when using multiple source and
destination offsets

  intra15
Verify intra server side COPY succeeds when using multiple source and
destination files

  inter
Run all inter server side copy tests: inter01, inter02, inter03,
inter04, inter05, inter06, inter07, inter08, inter09, inter10, inter11,
inter12, inter13, inter14, inter15

  pinter
Run all positive inter server side copy tests: inter01, inter02,
inter03, inter04, inter05, inter06, inter07, inter08, inter13, inter14,
inter15

  ninter
Run all negative inter server side copy tests: inter09, inter10,
inter11, inter12

  inter01
Verify inter server side COPY succeeds

  inter02
Verify inter server side COPY succeeds when using source offset

  inter03
Verify inter server side COPY succeeds when using destination offset

  inter04
Verify inter server side COPY succeeds when using NULL as source offset

  inter05
Verify inter server side COPY succeeds when using NULL as destination
offset

  inter06
Verify inter server side COPY succeeds when using count = 0

  inter07
Verify inter server side COPY succeeds when the source file is opened
as read/write

  inter08
Verify inter server side COPY succeeds when the destination file is
opened as read/write

  inter09
Verify inter server side COPY fails when the source file is opened
as write only

  inter10
Verify inter server side COPY fails when the destination file is opened
as read only

  inter11
Verify inter server side COPY succeeds when source offset is beyond the
end of the file

  inter12
Verify inter server side COPY succeeds when source offset plus count
is beyond the end of the file

  inter13
Verify inter server side COPY succeeds when both source and destination
file names are the same

  inter14
Verify inter server side COPY succeeds when using multiple source and
destination offsets

  inter15
Verify inter server side COPY succeeds when using multiple source and
destination files

  positive
Run all positive server side copy tests: intra01, intra02, intra03,
intra04, intra05, intra06, intra07, intra08, intra14, intra15, inter01,
inter02, inter03, inter04, inter05, inter06, inter07, inter08, inter13,
inter14, inter15

  negative
Run all negative server side copy tests: intra09, intra10, intra11,
intra12, intra13, inter09, inter10, inter11, inter12

  all
Run all tests: intra01, intra02, intra03, intra04, intra05, intra06,
intra07, intra08, intra09, intra10, intra11, intra12, intra13, intra14,
intra15, inter01, inter02, inter03, inter04, inter05, inter06, inter07,
inter08, inter09, inter10, inter11, inter12, inter13, inter14, inter15

EXAMPLES
The only required option is --server
$ nfstest_ssc --server 192.168.0.11

NOTES
The user id in the local host and the host specified by --dst-server 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.

Valid only for NFS version 4.2 and above.

SEE ALSO
baseobj(3), formatstr(3), nfstest.test_util(3), nfstest_alloc(1), nfstest_cache(1), nfstest_delegation(1), nfstest_dio(1), nfstest_fcmp(1), nfstest_file(1), nfstest_interop(1), nfstest_io(1), nfstest_lock(1), nfstest_pkt(1), nfstest_pnfs(1), nfstest_posix(1), nfstest_rdma(1), nfstest_sparse(1), nfstest_xattr(1), nfstest_xid(1), packet.nfs.nfs3_const(3), packet.nfs.nfs4_const(3)

BUGS
No known bugs.

AUTHOR
Jorge Mora (mora@netapp.com)