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 .nfstest file 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 with nohup 🌈

πŸ¦‹ 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_GETFD and F_SETFD β€” we set the FD_CLOEXEC flag and make sure it actually gets set.
  • F_GETFL and F_SETFL β€” we set the O_APPEND flag 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(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.

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.

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.

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_CREAT flag and verify the file mode is set to the specified value.
  • Verify the st_ctime and st_mtime are updated on the parent directory after the file was created.
  • Verify open on an existing file fails with the O_EXCL flag 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_APPEND set are to the end of the file.
  • Use O_DSYNC, O_RSYNC, and O_SYNC flags in open calls.
  • Verify file open with O_CREAT and O_TRUNC set will truncate an existing file.
  • Verify that it updates the file st_ctime and st_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. πŸ«ΆπŸ’–