public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v1] tst_net.sh: Add more tst_require_cmds check
@ 2023-01-17  4:01 Wei Gao via ltp
  2023-01-17  8:33 ` Petr Vorel
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Gao via ltp @ 2023-01-17  4:01 UTC (permalink / raw)
  To: ltp

More strict check for ns_xxx etc will help avoid following issue:
https://github.com/linux-test-project/ltp/issues/991

Signed-off-by: Wei Gao <wegao@suse.com>
Suggested-by: Petr Vorel <pvorel@suse.cz>
---
 testcases/lib/tst_net.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index ceb45c98d..ec915ad74 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -205,6 +205,7 @@ tst_rhost_run()
 	sh_cmd="$pre_cmd $cmd $post_cmd"
 
 	if [ -n "${TST_USE_NETNS:-}" ]; then
+		tst_require_cmds ip ns_create ns_exec ns_ifmove
 		use="NETNS"
 		rcmd="$LTP_NETNS sh -c"
 	else
@@ -1006,6 +1007,7 @@ IPV6_RHOST="${IPV6_RHOST:-fd00:1:1:1::1/64}"
 # tst_net_iface_prefix -h
 # tst_net_vars -h
 if [ -z "$_tst_net_parse_variables" ]; then
+	tst_require_cmds tst_net_ip_prefix
 	eval $(tst_net_ip_prefix $IPV4_LHOST || echo "exit $?")
 	eval $(tst_net_ip_prefix -r $IPV4_RHOST || echo "exit $?")
 
-- 
2.35.3


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-26 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-17  4:01 [LTP] [PATCH v1] tst_net.sh: Add more tst_require_cmds check Wei Gao via ltp
2023-01-17  8:33 ` Petr Vorel
2023-01-17  8:48   ` Wei Gao via ltp
2023-01-20  8:38     ` Petr Vorel
2023-01-20 11:01       ` Wei Gao via ltp
2023-01-22 21:58         ` Petr Vorel
2023-01-26 22:04           ` Petr Vorel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox