From bc4228286a6faab1202dee956411ac1615a2d2c5 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 26 Feb 2026 13:12:39 -0600 Subject: [PATCH] [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. --- tests/nexus/verify_9_2_14.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/nexus/verify_9_2_14.py b/tests/nexus/verify_9_2_14.py index 4eec9aef8..4b626f919 100644 --- a/tests/nexus/verify_9_2_14.py +++ b/tests/nexus/verify_9_2_14.py @@ -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