public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/1] tst_net.sh: Move run code after loading test lib
@ 2023-02-01 11:41 Petr Vorel
  2023-02-13 10:35 ` Richard Palethorpe
  0 siblings, 1 reply; 3+ messages in thread
From: Petr Vorel @ 2023-02-01 11:41 UTC (permalink / raw)
  To: ltp; +Cc: Richard Palethorpe

This is important mostly for variable checks (tst_res() would not be
loaded). Originally added in ecc29beeda on correct place, but left on
wrong place during 04021637f4.

Fixes: 04021637f4 ("tst_test.sh: Cleanup getopts usage")

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

this is expected to be applied on the top of
"[9/9] tst_net.sh: Move net setup into separate function"
https://patchwork.ozlabs.org/project/ltp/patch/20230126215401.29101-10-pvorel@suse.cz/
(non-applied patches starts from the 6th)

Kind regards,
Petr

 testcases/lib/tst_net.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index 45c37a85ec..4c4a1c271e 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -84,23 +84,6 @@ tst_brk_()
 	[ -z "$TST_USE_LEGACY_API" ] && tst_brk $@ || tst_brkm $@
 }
 
-if [ "$TST_PARSE_ARGS_CALLER" = "$TST_PARSE_ARGS" ]; then
-	tst_res_ TWARN "TST_PARSE_ARGS_CALLER same as TST_PARSE_ARGS, unset it ($TST_PARSE_ARGS)"
-	unset TST_PARSE_ARGS_CALLER
-fi
-if [ "$TST_SETUP_CALLER" = "$TST_SETUP" ]; then
-	tst_res_ TWARN "TST_SETUP_CALLER same as TST_SETUP, unset it ($TST_SETUP)"
-	unset TST_SETUP_CALLER
-fi
-if [ "$TST_USAGE_CALLER" = "$TST_USAGE" ]; then
-	tst_res_ TWARN "TST_USAGE_CALLER same as TST_USAGE, unset it ($TST_USAGE)"
-	unset TST_USAGE_CALLER
-fi
-
-if [ -n "$TST_USE_LEGACY_API" ]; then
-	tst_net_read_opts "$@"
-fi
-
 # Detect IPv6 disabled via ipv6.disable=1 kernel cmdline parameter
 # or via CONFIG_IPV6=y kernel configure option.
 tst_net_detect_ipv6_cmdline()
@@ -1067,6 +1050,23 @@ tst_net_setup_network()
 
 [ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh
 
+if [ -n "$TST_USE_LEGACY_API" ]; then
+	tst_net_read_opts "$@"
+else
+	if [ "$TST_PARSE_ARGS_CALLER" = "$TST_PARSE_ARGS" ]; then
+		tst_res_ TWARN "TST_PARSE_ARGS_CALLER same as TST_PARSE_ARGS, unset it ($TST_PARSE_ARGS)"
+		unset TST_PARSE_ARGS_CALLER
+	fi
+	if [ "$TST_SETUP_CALLER" = "$TST_SETUP" ]; then
+		tst_res_ TWARN "TST_SETUP_CALLER same as TST_SETUP, unset it ($TST_SETUP)"
+		unset TST_SETUP_CALLER
+	fi
+	if [ "$TST_USAGE_CALLER" = "$TST_USAGE" ]; then
+		tst_res_ TWARN "TST_USAGE_CALLER same as TST_USAGE, unset it ($TST_USAGE)"
+		unset TST_USAGE_CALLER
+	fi
+fi
+
 # detect IPv6 support on lhost for tests which don't use test links
 tst_net_detect_ipv6_cmdline
 
-- 
2.39.1


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

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

end of thread, other threads:[~2023-02-14  7:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01 11:41 [LTP] [PATCH 1/1] tst_net.sh: Move run code after loading test lib Petr Vorel
2023-02-13 10:35 ` Richard Palethorpe
2023-02-14  7:29   ` Petr Vorel

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