NFSTEST_POSIX(1)
β¨ NFSTEST_POSIX β¨
okay bestie, welcome to nfstest_posix β this is the 1.2 era of the page and it's giving thorough. it's the POSIX file system level access test suite and she does NOT skip leg day. π¦
πΈ NAME πΈ
nfstest_posix β POSIX file system level access tests π
π SYNOPSIS π
nfstest_posix --server <server> [options]
π DESCRIPTION π
So what she does is verify POSIX file system level access over the path you give her, using positive and negative testing. like she tests the good path AND the "what happens if you do this cursed thing" path. icon behavior honestly.
Valid for any version of NFS. every single one. she doesn't play favorites. β¨
π OPTIONS π
the main character section. buckle up.
--versionβ show program's version number and exit. bye bestie π-h,--helpβ show this help message and exit-f FILE,--file=FILEβ the file where options are specified, on top of the system wide file/etc/nfstest, the user wide file$HOME/.nfstest, or the.nfstestfile in the current directory π«Ά
π NFS specific options π
the NFS-flavored ones. iykyk.
-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.1]-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; the directory is created on the mount point [default:'']
π Logging options π
receipts. we keep them.
-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 withnohupπ
π¦ Packet trace options π¦
for when you need to see every little packet's business. nosy (affectionate).
--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 π
making files, reading files, writing files. the whole little family.
--nfiles=NFILESβ number of files to create [default:2]--filesize=FILESIZEβ file size to use for test files [default:64k]--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 π§
where all the little binaries live. she needs to know their addresses fr fr.
--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 π₯
the "why is this happening to me" section. we've all been there.
--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 β
for when you need to show the teacher your work.
--xunit-reportβ generate xUnit compatible test report--xunit-report-file=XUNIT_REPORT_FILEβ path to xout report file
πΈ Test options πΈ
the actual "what are we running today" of it all.
--runtest=RUNTESTβ comma separated list of tests to run; if the list starts with a^then all tests are run except the ones listed [default:all]
and that's part one, bestie. more is coming, don't you dare close the tab π
β¨ TESTS β¨
access π
okay so this one's literally just vibe-checking the POSIX API access() on files with different modes. no cap.
chdir π¦
bestie we're testing chdir() by changing into a freshly made directory and then changing right back to where we started. it's giving homecoming.
close π
this one checks that close() actually works, and that if you try to write to a file descriptor after closing it, you get an error. as you should π.
closedir β¨
just verifying that closedir() does its thing.
creat πΈ
so creat(path, mode) should be exactly equivalent to open(path, O_WRONLY|O_CREAT|O_TRUNC, mode). first we test with a path that doesn't exist yet to make sure the file gets created, then we test with a path that does exist to make sure it gets truncated. periodt.
fcntl π
this is the big one for the POSIX API fcntl(). we're checking these commands: F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_SETFL, and FD_CLOEXEC.
F_DUPFDβ we do operations on the original and the dupped file descriptor to make sure they both behave correctly.F_GETFDandF_SETFDβ we set theFD_CLOEXECflag and make sure it actually gets set.F_GETFLandF_SETFLβ we set theO_APPENDflag and make sure it gets set.
and we run the whole test for both 'read' and 'write'. slay.
fdatasync π₯
just making sure fdatasync() works.
fstat π
checking fstat() by looking at the mode on a file and making sure it returns the expected structure members. then we create a symlink and verify that fstat returns info about the link. iconic.
fstatvfs π¦
verifying fstatvfs() by making sure all the members of the structure are returned. all of them. no missing pieces.
fsync β
yep, just fsync(). making sure it works.
link π
link(src, dst) should create a link and update the st_ctime field for the file. also verify that link updates the st_ctime and st_mtime for the directory. and verify that the st_link count gets incremented by 1 for the file. math is mathing.
lseek π
testing lseek() with different offsets and whence values, including seeking past the end of the file. living on the edge.
lstat π
checking lstat() by looking at the mode on a file and making sure it returns the expected structure members. create a symlink and verify that lstat returns info about the link. (not the file it points to, bestie.)
mkdir πΈ
verifying mkdir(). also verify that mkdir with a path of a symbolic link fails. and verify that the st_ctime and st_mtime fields of the parent directory get updated. we love a timestamp refresh.
mmap π₯
testing mmap() by mapping a file and verifying I/O operations. verify that mmap followed by a memory read of an existing file works. verify that mmap followed by a memory write to the file works. it's giving memory-mapped realness.
munmap β¨
mapping a file and then unmapping it. that's munmap().
opendir π¦
just checking opendir() on a directory.
read π
testing read() by reading data from a file. verify that the st_atime of the file is updated after the read. verify that a read of 0 bytes returns 0. period.
readdir π
verifying readdir() on a directory.
readlink π
verify readlink() by reading a symbolic link.
rename π
testing rename() by renaming a file, a directory, and a symbolic link. also verify that a rename from a file to a symbolic link will cause the symbolic link to be removed. bye bye link.
rewinddir π
verifying rewinddir() on a directory.
rmdir πΈ
testing rmdir() by removing a directory. verify that the parent's st_ctime and st_mtime are updated. we love updated timestamps.
seekdir β
verifying seekdir() on a directory.
stat π
checking stat() by looking at the mode on a file and making sure it returns the expected structure members. create a symlink and verify that stat returns info about the file. (the file it points to, bestie.)
statvfs π₯
verifying statvfs() by making sure all the members of the structure are returned. all of them.
symlink β¨
testing symlink() by creating a symbolic link and verifying that the file type is slnk. (yes, slnk.)
sync π¦
just sync(). making sure it works.
telldir π
verifying telldir() on a directory.
unlink π
this one's a whole journey. first, unlink a file and verify that it was removed. verify that the st_ctime and st_mtime fields of the parent directory were updated. then unlink a symbolic link and verify that the symbolic link was removed but not the referenced file. then remove an opened file and verify that I/O still occurs to the file after the unlink, and that the file gets removed when the file is closed. finally, create a file and then hard link to it so the link count is greater than 1. unlink the hard file and verify that the st_ctime field is updated. ate.
write π
testing write() by writing 0 bytes and verifying 0 is returned. then write a pattern to the file, seek +N, write another pattern, and close the file. open the file and read in both written patterns and verify that it's the correct pattern. read in the data from the hole in the file and verify that it is 0. hole check slay.
open π
this one is a whole checklist for open() on a file.
- Verify file creation using the
O_CREATflag and verify the file mode is set to the specified value. - Verify the
st_ctimeandst_mtimeare updated on the parent directory after the file was created. - Verify open on an existing file fails with the
O_EXCLflag set. - Verify write succeeds and read fails if the file was opened with
O_WRONLY. - Verify read succeeds and write fails if the file was opened with
O_RDONLY. - Verify that all writes with
O_APPENDset are to the end of the file. - Use
O_DSYNC,O_RSYNC, andO_SYNCflags in open calls. - Verify file open with
O_CREATandO_TRUNCset will truncate an existing file. - Verify that it updates the file
st_ctimeandst_mtime.
chmod π
testing chmod() on a file and a directory by trying all valid combinations of modes. verify that the st_ctime is updated for both the file and directory.
all π
run all the tests: access, chdir, close, closedir, creat, fcntl, fdatasync, fstat, fstatvfs, fsync, link, lseek, lstat, mkdir, mmap, munmap, opendir, read, readdir, readlink, rename, rewinddir, rmdir, seekdir, stat, statvfs, symlink, sync, telldir, unlink, write, open, chmod. that's the whole lineup.
β¨ EXAMPLES β¨
the only required option is --server.
$ nfstest_posix --server 192.168.0.11
πΈ NOTES πΈ
the user id on the local host must have access to run commands as root using the 'sudo' command without needing a password. (so like, passwordless sudo, bestie.)
π¦ SEE ALSO π¦
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_rdma(1), nfstest_sparse(1), nfstest_ssc(1), nfstest_xattr(1), nfstest_xid(1), packet.nfs.nfs3_const(3), packet.nfs.nfs4_const(3)
π BUGS π
no known bugs. (we love a clean slate.)
π AUTHOR π
Jorge Mora (mora@netapp.com)
and that's the tea, bestie. this page is from NFStest 3.2, dated 21 March 2023. stay iconic. π«Άπ
π¦ where this page comes from
- debian trixie: nfstest 3.2-3
- fedora 43: NFStest 3.2-14.fc43 Β· GPL-2.0-or-later
- fedora 44: NFStest 3.2-16.fc44 Β· GPL-2.0-or-later
- ubuntu noble: nfstest 3.2-2
- ubuntu questing: nfstest 3.2-3
- ubuntu resolute: nfstest 3.2-3build1
- ubuntu stonking: nfstest 3.2-5
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms