NFSTEST_XATTR(1)

🌸 NFSTEST_XATTR πŸ’–

okay so bestie, this is nfstest_xattr, it lives in section 1 of the manual, and it's version nfstest_xattr 1.1. it's giving very much "let's verify extended attributes and have a whole journey about it" energy, and honestly? we love that for us.


✨ NAME ✨

nfstest_xattr β€” Extended Attributes tests πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

nfstest_xattr --server <server> [options]

πŸ’… DESCRIPTION πŸ’…

okay so first thing first, the whole point: verify correct functionality of extended attributes. that's the vibe check, that's the assignment. πŸ”₯

so like, extended attributes are these name:value pairs that are permanently associated with files and directories, kinda like how environment strings are associated with a process, iykyk. an attribute can be defined or undefined. and if it is defined, its value can be empty or non-empty, both are valid, no drama. extended attributes are basically extensions to the normal attributes that get associated with all inodes in the system, and they're often used to give a filesystem some extra functionality. iconic behavior tbh.

the tests are divided into five groups: getxattr, setxattr, removexattr, listxattr and cinfo. let me break it down:

  • the getxattr tests verify the retrieval of extended attribute values πŸ‘‘
  • the setxattr tests verify the creation or modification of extended attributes ✨
  • the removexattr tests verify the removal of extended attributes πŸ—‘οΈ
  • the listxattr tests verify the listing of extended attributes πŸ“‹
  • and finally, the cinfo tests verify the change info returned by the server is correct when the file is either modified or not from a different client 🧚

and bestie, there's more. when a different client is holding a read delegation, we verify the delegation is recalled only when creating, modifying or removing an extended attribute. on the other hand, verify the read delegation is not recalled when listing attributes or retrieving their values. the way that distinction matters... main character energy fr fr. πŸ’–

negative testing is included too, like retrieval or removal of an extended attribute name which does not exist. creating an attribute which already exists should fail while using XATTR_CREATE flag. trying to modify an attribute which does not exist should fail if using XATTR_REPLACE flag. yes we test the fails too, we contain multitudes. 😭


🌈 OPTIONS 🌈

  • --version β€” show program's version number and exit, cute and simple πŸ’«
  • -h, --help β€” show this help message and exit, the classic "help me help you" move 🫢
  • -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. so you got layers of config files, so many places to stash your options πŸ’œ

🌸 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: 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 🧚

  • --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]
  • --num-xattrs=NUM_XATTRS β€” Number of extended attributes to create for listxattr tests with many attributes [default: 20]
  • --client=CLIENT β€” Remote NFS client and options used for delegation tests. Clients are separated by a , and each client definition is a list of arguments separated by a : given in the following order if positional arguments is used (see examples):
clientname:server:export:nfsversion:port:proto:sec:mtpoint

[default: nfsversion=3:proto=tcp:port=2049]

  • --client-nfsvers=CLIENT_NFSVERS β€” Comma separated list of valid NFS versions to use in the --client option. An NFS version from this list, which is different than that given by --nfsversion, is selected and included in the --client option [default: 4.0,4.1]

πŸ§ͺ TESTS πŸ§ͺ

Okay bestie, this is the whole test menu. Every single one is listed, no skips, no cap. ✨

ngetxattr01

Verify getting extended attribute. simple, clean, iconic. πŸ’–

ngetxattr02

Verify getting extended attribute fails when attribute does not exist. the β€œwhere is it tho” test. 😭

dgetxattr01

Verify getting extended attribute β€” when delegation is granted on second client. πŸ’…

dgetxattr02

Verify getting extended attribute fails when attribute does not exist β€” when delegation is granted on second client. πŸ¦‹

nsetxattr01

Verify setting extended attribute with SETXATTR4_EITHER when attribute does not exist. either way, we ball. ✨

nsetxattr02

Verify setting extended attribute with SETXATTR4_CREATE when attribute does not exist. create the thing. 🌱

nsetxattr03

Verify setting extended attribute with SETXATTR4_REPLACE fails when attribute does not exist. can’t replace what isn’t there, bestie. πŸ’€

nsetxattr04

Verify setting extended attribute with SETXATTR4_EITHER when attribute already exists. already here, still valid. πŸ‘

nsetxattr05

Verify setting extended attribute with SETXATTR4_CREATE fails when attribute already exists. no duplicates, periodt. πŸ™…β€β™€οΈ

nsetxattr06

Verify setting extended attribute with SETXATTR4_REPLACE when attribute already exists. swap it out, slay. πŸ’œ

dsetxattr01

Verify setting extended attribute with SETXATTR4_EITHER when attribute does not exist β€” when delegation is granted on second client. 🌈

dsetxattr02

Verify setting extended attribute with SETXATTR4_CREATE when attribute does not exist β€” when delegation is granted on second client. 🧚

dsetxattr03

Verify setting extended attribute with SETXATTR4_REPLACE fails when attribute does not exist β€” when delegation is granted on second client. 😭

dsetxattr04

Verify setting extended attribute with SETXATTR4_EITHER when attribute already exists β€” when delegation is granted on second client. πŸ’–

dsetxattr05

Verify setting extended attribute with SETXATTR4_CREATE fails when attribute already exists β€” when delegation is granted on second client. 🫢

dsetxattr06

Verify setting extended attribute with SETXATTR4_REPLACE when attribute already exists β€” when delegation is granted on second client. πŸ‘‘

nremovexattr01

Verify removing extended attribute. bye-bye, attribute. πŸ‘‹

nremovexattr02

Verify removing extended attribute fails when attribute does not exist. nothing to remove, bestie. πŸ’€

dremovexattr01

Verify removing extended attribute β€” when delegation is granted on second client. πŸ¦‹

dremovexattr02

Verify removing extended attribute fails when attribute does not exist β€” when delegation is granted on second client. 😭

nlistxattr01

Verify listing extended attributes with no user namespace attributes. empty list, but make it fashion. ✨

nlistxattr02

Verify listing extended attribute. just show me the list. πŸ“

nlistxattr03

Verify listing extended attribute (many attributes). so many attributes, so little time. πŸ”₯

dlistxattr01

Verify listing extended attributes with no user namespace attributes β€” when delegation is granted on second client. 🌸

dlistxattr02

Verify listing extended attribute β€” when delegation is granted on second client. πŸ’…

dlistxattr03

Verify listing extended attribute (many attributes) β€” when delegation is granted on second client. πŸ’–

ncinfo01

Verify SETXATTR change info with SETXATTR4_EITHER when attribute does not exist. change info, but make it either. πŸ‘

ncinfo02

Verify SETXATTR change info with SETXATTR4_EITHER when attribute already exists. either again, but now it exists. πŸ’–

ncinfo03

Verify SETXATTR change info with SETXATTR4_CREATE when attribute does not exist. create and inform. 🌱

ncinfo04

Verify SETXATTR change info with SETXATTR4_REPLACE when attribute already exists. replace and inform. πŸ’œ

mcinfo01

Verify SETXATTR change info with SETXATTR4_EITHER when attribute does not exist β€” when file is modified on second client. 🌈

mcinfo02

Verify SETXATTR change info with SETXATTR4_EITHER when attribute already exists β€” when file is modified on second client. 🧚

mcinfo03

Verify SETXATTR change info with SETXATTR4_CREATE when attribute does not exist β€” when file is modified on second client. ✨

mcinfo04

Verify SETXATTR change info with SETXATTR4_REPLACE when attribute already exists β€” when file is modified on second client. πŸ‘‘

getxattr

Run all GETXATTR tests: ngetxattr01, ngetxattr02, dgetxattr01, dgetxattr02. the whole GETXATTR crew. πŸ’–

ngetxattr

Run all GETXATTR tests when no open on second client: ngetxattr01, ngetxattr02. πŸ¦‹

dgetxattr

Run all GETXATTR tests when delegation is granted on second client: dgetxattr01, dgetxattr02. πŸ’…

setxattr

Run all SETXATTR tests: nsetxattr01, nsetxattr02, nsetxattr03, nsetxattr04, nsetxattr05, nsetxattr06, dsetxattr01, dsetxattr02, dsetxattr03, dsetxattr04, dsetxattr05, dsetxattr06. all the SETXATTR energy. πŸ”₯

nsetxattr

Run all SETXATTR tests when no open on second client: nsetxattr01, nsetxattr02, nsetxattr03, nsetxattr04, nsetxattr05, nsetxattr06. 🌸

dsetxattr

Run all SETXATTR tests when delegation is granted on second client: dsetxattr01, dsetxattr02, dsetxattr03, dsetxattr04, dsetxattr05, dsetxattr06. πŸ’œ

removexattr

Run all REMOVEXATTR tests: nremovexattr01, nremovexattr02, dremovexattr01, dremovexattr02. bye to all the attrs. πŸ‘‹

nremovexattr

Run all REMOVEXATTR tests when no open on second client: nremovexattr01, nremovexattr02. 😭

dremovexattr

Run all REMOVEXATTR tests when delegation is granted on second client: dremovexattr01, dremovexattr02. πŸ¦‹

listxattr

Run all LISTXATTRS tests: nlistxattr01, nlistxattr02, nlistxattr03, dlistxattr01, dlistxattr02, dlistxattr03. list them all, bestie. πŸ“

nlistxattr

Run all LISTXATTRS tests when no open on second client: nlistxattr01, nlistxattr02, nlistxattr03. 🌸

dlistxattr

Run all LISTXATTRS tests when delegation is granted on second client: dlistxattr01, dlistxattr02, dlistxattr03. ✨

cinfo

Run all CINFO tests: ncinfo01, ncinfo02, ncinfo03, ncinfo04, mcinfo01, mcinfo02, mcinfo03, mcinfo04. change info overload. πŸ’œ

ncinfo

Run all CINFO tests when no open on second client: ncinfo01, ncinfo02, ncinfo03, ncinfo04. πŸŽ€

mcinfo

Run all CINFO tests when file is modified on second client: mcinfo01, mcinfo02, mcinfo03, mcinfo04. 🌈

all

Run all tests: ngetxattr01, ngetxattr02, dgetxattr01, dgetxattr02, nsetxattr01, nsetxattr02, nsetxattr03, nsetxattr04, nsetxattr05, nsetxattr06, dsetxattr01, dsetxattr02, dsetxattr03, dsetxattr04, dsetxattr05, dsetxattr06, nremovexattr01, nremovexattr02, dremovexattr01, dremovexattr02, nlistxattr01, nlistxattr02, nlistxattr03, dlistxattr01, dlistxattr02, dlistxattr03, ncinfo01, ncinfo02, ncinfo03, ncinfo04, mcinfo01, mcinfo02, mcinfo03, mcinfo04. literally every single one. main character energy. πŸ‘‘


🌟 EXAMPLES 🌟

The only required option is --server β€” that’s it, bestie. ✨

$ nfstest_xattr --server 192.168.0.11

πŸ“ NOTES πŸ“

Heads up, queen: the user id in the local host and the host specified by --client 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. so check ur NFS version, fr.

πŸ‘€ SEE ALSO πŸ‘€


πŸ› BUGS πŸ›

No known bugs. we love a clean sheet. πŸ’…


πŸ‘‘ AUTHOR πŸ‘‘

Jorge Mora (mora@netapp.com) β€” the icon who wrote this. πŸ’–


That’s the whole vibe, bestie. This was NFStest 3.2, dated 21 March 2023, and you just read NFSTEST_XATTR(1). Byeee! πŸ¦‹βœ¨