[LTP] [PATCH v3 1/2] nfs_lib.sh: Add support for extra NFS mount options

Martin Doucha mdoucha@suse.cz
Wed Dec 4 18:23:09 CET 2024


Signed-off-by: Martin Doucha <mdoucha@suse.cz>
---

Changes since v2: New patch

 testcases/network/nfs/nfs_stress/nfs_lib.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index d3de3b7f1..f0da1fc99 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -168,6 +168,7 @@ nfs_setup()
 	local local_dir
 	local remote_dir
 	local mount_dir
+	local nfs_opts
 
 	if [ "$(stat -f . | grep "Type: nfs")" ]; then
 		tst_brk TCONF "Cannot run nfs-stress test on mounted NFS"
@@ -192,8 +193,14 @@ nfs_setup()
 		remote_dir="$(get_remote_dir $i $type)"
 		nfs_setup_server "$remote_dir" "$(($$ + n))"
 		local_dir="$(get_local_dir $i $n)"
+		nfs_opts="-o proto=$type,vers=$i"
+
+		if [ ! -z "$NFS_MOUNT_OPTS" ]; then
+			nfs_opts="$nfs_opts,$NFS_MOUNT_OPTS"
+		fi
+
 		tst_res TINFO "Mounting $local_dir"
-		nfs_mount "$local_dir" "$remote_dir" "-o proto=$type,vers=$i"
+		nfs_mount "$local_dir" "$remote_dir" "$nfs_opts"
 
 		n=$(( n + 1 ))
 	done
-- 
2.47.0



More information about the ltp mailing list