[LTP] [PATCH 1/2] tst_test.sh: Cleanup getopts usage

Petr Vorel pvorel@suse.cz
Sat Apr 2 00:11:54 CEST 2022


Hi,

patch needs to be slightly adjusted: to fix tst_ipaddr_un.sh
which uses $TST_NET_SKIP_VARIABLE_INIT, so that shell library needs to be loaded
before.

(NOTE also netns tests are planning [1] to use $TST_NET_SKIP_VARIABLE_INIT
- I'll repost rebased patch after this is merged).

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/patch/20220204194648.32165-4-pvorel@suse.cz/

diff --git testcases/lib/tst_net.sh testcases/lib/tst_net.sh
index 2ca9bea492..dae0ceaf1f 100644
--- testcases/lib/tst_net.sh
+++ testcases/lib/tst_net.sh
@@ -935,6 +935,7 @@ tst_default_max_pkt()
 	echo "$((mtu + mtu / 10))"
 }
 
+[ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh
 [ -n "$TST_PRINT_HELP" -o -n "$TST_NET_SKIP_VARIABLE_INIT" ] && return 0
 
 # Management Link
@@ -973,7 +974,6 @@ if [ -z "$_tst_net_parse_variables" ]; then
 	eval $(tst_net_ip_prefix -r $IPV6_RHOST || echo "exit $?")
 fi
 
-[ -n "$TST_USE_LEGACY_API" ] && . test.sh || . tst_test.sh
 [ -n "$TST_USE_NETNS" -a "$TST_INIT_NETNS" != "no" ] && init_ltp_netspace
 
 if [ -z "$_tst_net_parse_variables" ]; then


More information about the ltp mailing list