[LTP] [PATCH 1/1] nfs_lib.sh: Document LTP_NFS_NETNS_USE_LO=1 in help
    Petr Vorel 
    pvorel@suse.cz
       
    Thu Oct 30 12:04:11 CET 2025
    
    
  
Debugging on loopback device can be useful, make users avare.
Due LTP shell API limitations is output a bit inconsistent
(test specific options are printed first, API does not expect test
specific environment variables):
    # nfs10.sh -h
    ...
    Test Specific Environment Variables
    -----------------------------------
    LTP_NFS_NETNS_USE_LO=1    NFS traffic will go through loopback
    interface instead of ltp_ns_veth* netns interfaces (useful for debugging
    whether test failures are related to veth/netns)
    -t x    Socket type, tcp or udp, default is udp
    -v x    NFS version, default is '3'
    -6      IPv6 tests
    -h      Prints this help
    -i n    Execute test n times
    Environment Variables
    ---------------------
    KCONFIG_PATH             Specify kernel config file
    KCONFIG_SKIP_CHECK       Skip kernel config check if variable set (not set by default)
    LTPROOT                  Prefix for installed LTP (default: /opt/ltp)
    LTP_COLORIZE_OUTPUT      Force colorized output behaviour (y/1 always, n/0: never)
    LTP_DEV                  Path to the block device to be used (for .needs_device)
    LTP_DEV_FS_TYPE          Filesystem used for testing (default: ext2)
    LTP_SINGLE_FS_TYPE       Specifies filesystem instead all supported (for TST_ALL_FILESYSTEMS=1)
    LTP_FORCE_SINGLE_FS_TYPE Testing only. The same as LTP_SINGLE_FS_TYPE but ignores test skiplist
    LTP_TIMEOUT_MUL          Timeout multiplier (must be a number >=1, ceiled to int)
    TMPDIR                   Base directory for template directory (for .needs_tmpdir, default: /tmp)
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,
There are other tests which use environment variables (at least
virt_lib.sh and tst_net.sh) but we probably don't want to touch
tst_test.sh to add another function for printing test specific
environment variables.
When thinking about the future (shell loader): I suppose getopts can't
be part of shell loader (i.e. specified via JSON), but environment
variables documentation could be part of JSON doc part.  Or we could
have something specific to environment variables. Generally, JSON
comment has a limitation that it's only for the metadata, not for a
runtime - we need to duplicate to have it both in 1) metadata doc (the
JSON and sphinx readthedoc Test catalog page) and 2) printed in runtime
via -h.
 testcases/network/nfs/nfs_stress/nfs_lib.sh | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index 14425898f9..4628b4ba6e 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -11,6 +11,13 @@ NFS_TYPE=${NFS_TYPE:=nfs}
 
 nfs_usage()
 {
+	echo "Test Specific Environment Variables"
+	echo "-----------------------------------"
+	echo "LTP_NFS_NETNS_USE_LO=1    NFS traffic will go through loopback
+interface instead of ltp_ns_veth* netns interfaces (useful for debugging
+whether test failures are related to veth/netns)"
+
+	echo
 	echo "-t x    Socket type, tcp or udp, default is udp"
 	echo "-v x    NFS version, default is '3'"
 }
-- 
2.51.0
    
    
More information about the ltp
mailing list