[LTP] [PATCH 1/9] tst_net.sh: Use tst_res_()

Petr Vorel
2023-01-26T21:54:21Z

To avoid error on legacy network tests:

./tcpdump01.sh
Usage: tst_res TTYPE FNAME STRING
TTYPE - Test Result Type; one of TFAIL, TBROK and TCONF.
FNAME - Print contents of this file after the message
STRING - Message explaining the test result
tcpdump01 1 TINFO: initialize 'lhost' 'ltp_ns_veth2' interface

NOTE: only check in tst_net_detect_ipv6() requires to call tst_res_(),
but it's better to be consistent.

Fixes: ecc29beeda ("tst_net.sh: Harden library against deadlocks")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
testcases/lib/tst_net.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh
index e6bb09d81f..925cf50e1c 100644
--- a/testcases/lib/tst_net.sh
+++ b/testcases/lib/tst_net.sh
@@ -74,15 +74,15 @@ tst_net_setup()
}

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)"
+ 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)"
+ 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)"
+ tst_res_ TWARN "TST_USAGE_CALLER same as TST_USAGE, unset it ($TST_USAGE)"
unset TST_USAGE_CALLER
fi

@@ -117,7 +117,7 @@ tst_net_detect_ipv6()
TST_NET_IPV6_ENABLED=1
else
TST_NET_IPV6_ENABLED=0
- tst_res TINFO "IPv6 disabled on $type"
+ tst_res_ TINFO "IPv6 disabled on $type"
fi
}