On Wed, 2024-05-08 at 04:06 +0000, Taehee Yoo wrote:
@@ -210,40 +217,52 @@ check_features() test_ipv4_forward() {
- RESULT4=$(ip netns exec "${LISTENER}" nc -w 1 -l -u 239.0.0.1 4000)
- echo "" > $RESULT
- bash -c "$(ip netns exec "${LISTENER}" \
timeout 10s > $RESULT)"
- RESULT4=$(< $RESULT)
if you instead do:
RESULT4=$(timeout 10s ip netns exec \ "${LISTENER}" nc -w 1 -l -u 239.0.0.1 4000)
You can avoid the additional tmp file (RESULT)
if [ "$RESULT4" == "172.17.0.2" ]; then printf "TEST: %-60s [ OK ]\n" "IPv4 amt multicast forwarding"
else printf "TEST: %-60s [FAIL]\n" "IPv4 amt multicast forwarding"exit 0
fiexit 1
}
[...]
@@ -259,19 +278,17 @@ setup_iptables setup_mcast_routing test_remote_ip test_ipv4_forward & -pid=$! -send_mcast4 -wait $pid || err=$? -if [ $err -eq 1 ]; then
- ERR=1
-fi +spid=$! +send_mcast4 & +cpid=$! +wait $spid
It looks like you don't capture anymore the return code from test_ipv4_forward, why?
That will foul the test runner infra to think that this test is always successful.
Paolo