net: Use API function tst_net_use_netns()
PATCH 1/1 net: Use API function tst_net_use_netns()
instead of LTP_NETNS variable
Signed-off-by Petr Vorel <[email protected]>
--- testcases/network/nfs/nfs_stress/nfs_lib.sh | 4 ++-- testcases/network/nfs/nfsstat01/nfsstat01 | 2 +- testcases/network/virt/wireguard01.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
testcases/network/nfs/nfs_stress/nfs_lib.sh +2 -2
@@ -91,7 +91,7 @@ nfs_mount() local host_type=rhost local mount_dir - [ -n "$LTP_NETNS" ] && host_type= + tst_net_use_netns && host_type= if [ $TST_IPV6 ]; then mount_dir="[$(tst_ipaddr $host_type)]:$remote_dir"
@@ -102,7 +102,7 @@ nfs_mount() local mnt_cmd="mount -v -t nfs $opts $mount_dir $local_dir" tst_res TINFO "Mounting NFS: $mnt_cmd" - if [ -n "$LTP_NETNS" ] && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then + if tst_net_use_netns && [ -z "$LTP_NFS_NETNS_USE_LO" ]; then tst_rhost_run -c "$mnt_cmd" > mount.log else $mnt_cmd > mount.log
testcases/network/nfs/nfsstat01/nfsstat01 +1 -1
@@ -17,7 +17,7 @@ get_calls() local opt= [ "$name" = "rpc" ] && opt="r" || opt="n" - if [ -n "$LTP_NETNS" -o "$nfs_f" = "nfs" ]; then + if tst_net_use_netns || [ "$nfs_f" = "nfs" ]; then calls="$(grep $name /proc/net/rpc/$nfs_f | cut -d' ' -f$field)" ROD nfsstat -c$opt | grep -q "$calls" echo "$calls"
testcases/network/virt/wireguard01.sh +1 -1
@@ -12,7 +12,7 @@ TST_CNT=3 setup() { - if [ -n "$LTP_NETNS" -a "$VIRT_PERF_THRESHOLD" -lt 700 ]; then + if tst_net_use_netns && [ "$VIRT_PERF_THRESHOLD" -lt 700 ]; then tst_res TINFO "Adjust threshold for veth (no encap/encrypt)" VIRT_PERF_THRESHOLD=700 fi
Signature · 5 lines
2.34.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp