[test] enhance test-008-multicast-traffic.py (#12816)

This commit updates `test-008-multicast-traffic.py` to use a strict
equality check for the number of multicast `ping` responses when the
ping originates from an SED.

The test now also verifies the `RxSuccess` IP counter on the SED to
ensure it increases by exactly the number of expected replies. This
confirms that the parent correctly avoids forwarding the original
multicast echo request back to the originating SED, even if the SED
is subscribed to the multicast address. This validates the behavior
introduced in PR #12329.
This commit is contained in:
Abtin Keshavarzian
2026-04-02 00:07:15 -05:00
committed by GitHub
parent 057937c31f
commit 42635a12b2
+12 -1
View File
@@ -324,12 +324,23 @@ for node in [r2, sed]:
# sed =>> site-local mcast addr (on r1, r2, sed) without `multicast-loop`. Expected to receive from [r1, r2].
old_counters = sed.get_ip_counters()
outputs = sed.cli('ping', mcast_addr)
verify(len(outputs) >= 3)
new_counters = sed.get_ip_counters()
verify(len(outputs) == 3)
for node in [r1, r2]:
ml_addr = node.get_mleid_ip_addr()
verify(any(ml_addr in line for line in outputs))
# Validate that the `RxSuccess` counter increased by exactly two (for the
# two ping replies). This confirms the parent did not forward the original
# echo request back to the SED, even though the SED is also subscribed to
# this address. The parent must not forward a multicast packet back to an
# SED if the packet originated from that SED itself.
verify(int(new_counters['RxSuccess']) == int(old_counters['RxSuccess']) + 2)
# -----------------------------------------------------------------------------------------------------------------------
# Test finished