[LTP] [PATCH 1/1] nfs_lib: Cleanup parameters passing

Petr Vorel pvorel@suse.cz
Fri Mar 11 14:01:33 CET 2022


shell function should not expect parameters are defined outside in other
function, directly passing is clearer solution.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/network/nfs/nfs_stress/nfs_lib.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh
index ad96bb4438..1bf31eed25 100644
--- a/testcases/network/nfs/nfs_stress/nfs_lib.sh
+++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh
@@ -98,6 +98,7 @@ nfs_setup_server()
 
 nfs_mount()
 {
+	local opts="$1"
 	local host_type=rhost
 	local mount_dir
 
@@ -138,7 +139,6 @@ nfs_setup()
 	local i
 	local type
 	local n=0
-	local opts
 	local local_dir
 	local remote_dir
 	local mount_dir
@@ -167,8 +167,7 @@ nfs_setup()
 
 		nfs_setup_server $(($$ + n))
 
-		opts="-o proto=$type,vers=$i"
-		nfs_mount
+		nfs_mount "-o proto=$type,vers=$i"
 
 		n=$(( n + 1 ))
 	done
-- 
2.35.1



More information about the ltp mailing list