[nexus] fix intermittent failure in test 9.2.14 (#12570)

This commit fixes an intermittent failure in Nexus test 9.2.14 caused by RLOC16 conflicts between independent partitions in the simulation.

When two independent partitions occasionally share the same RLOC16, the packet verification script could incorrectly match a MGMT_PANID_CONFLICT response from the wrong network, leading to out-of-order matching and PacketNotFound errors.

The fix adds a filter to the MGMT_PANID_CONFLICT verification steps to ensure the Channel Mask TLV matches the specific conflict being reported (Channel 20). This uniquely identifies the correct packet even if RLOC16s overlap.

Implementation details:
- tests/nexus/verify_9_2_14.py: Added filtering for the exact Channel Mask TLV value using a defined `CONFLICTING_CHANNEL_MASK` bytes constant in Step 3 and 5.
- Fixed a type mismatch by converting the constant to a `bytes` object and added documentation for the big-endian channel bitmask mapping.

The fix has been verified with 200 successful test runs in the Nexus simulation environment.
This commit is contained in:
Jonathan Hui
2026-02-26 13:12:39 -06:00
committed by GitHub
parent 993cd25b8b
commit bc4228286a
+6
View File
@@ -37,6 +37,10 @@ sys.path.append(CUR_DIR)
import verify_utils
from pktverify import consts
# Channel Mask for Channel 20 (1 << (31 - 20) = 1 << 11 = 0x800).
# The implementation uses a big-endian bit mask where bit 0 is MSB.
CONFLICTING_CHANNEL_MASK = bytes([0x00, 0x04, 0x00, 0x00, 0x08, 0x00])
def verify(pv):
# 9.2.14 PAN ID Query Requests
@@ -104,6 +108,7 @@ def verify(pv):
consts.NM_CHANNEL_MASK_TLV,
consts.NM_PAN_ID_TLV
} <= set(p.coap.tlv.type)).\
filter(lambda p: p.coap.tlv.channel_mask == CONFLICTING_CHANNEL_MASK).\
must_next()
# Step 4: Commissioner
@@ -142,6 +147,7 @@ def verify(pv):
consts.NM_CHANNEL_MASK_TLV,
consts.NM_PAN_ID_TLV
} <= set(p.coap.tlv.type)).\
filter(lambda p: p.coap.tlv.channel_mask == CONFLICTING_CHANNEL_MASK).\
must_next()
# Step 6: Commissioner