From 83eb368bff4e8ffa2660bed4472d7d74da1b425a Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Fri, 13 Feb 2026 02:12:16 -0600 Subject: [PATCH] [nexus] remove redundant CoAP ACK code checks in verify scripts (#12445) This commit removes redundant `p.coap.code == consts.COAP_CODE_ACK` checks in several Nexus test verification scripts. The `filter_coap_ack()` function in the `pktverify` framework already filters for CoAP ACK messages, which involves checking the message type and the CoAP code. Therefore, adding a manual filter for the same CoAP code is redundant and can be removed for conciseness. Summary of changes: - tests/nexus/verify_5_1_1.py: Remove redundant CoAP ACK code check. - tests/nexus/verify_5_1_5.py: Remove redundant CoAP ACK code checks. - tests/nexus/verify_5_1_6.py: Remove redundant CoAP ACK code check. - tests/nexus/verify_5_2_3.py: Remove redundant CoAP ACK code checks. - tests/nexus/verify_5_2_6.py: Remove redundant CoAP ACK code check. --- tests/nexus/verify_5_1_1.py | 1 - tests/nexus/verify_5_1_5.py | 2 -- tests/nexus/verify_5_1_6.py | 1 - tests/nexus/verify_5_2_3.py | 2 -- tests/nexus/verify_5_2_6.py | 1 - 5 files changed, 7 deletions(-) diff --git a/tests/nexus/verify_5_1_1.py b/tests/nexus/verify_5_1_1.py index 8886d21be..f4ba14f50 100644 --- a/tests/nexus/verify_5_1_1.py +++ b/tests/nexus/verify_5_1_1.py @@ -229,7 +229,6 @@ def verify(pv): consts.NL_RLOC16_TLV, consts.NL_ROUTER_MASK_TLV } <= set(p.coap.tlv.type) and\ - p.coap.code == consts.COAP_CODE_ACK and\ p.coap.tlv.status == 0\ ).\ must_next() diff --git a/tests/nexus/verify_5_1_5.py b/tests/nexus/verify_5_1_5.py index 9fc9c1a82..71ab60274 100644 --- a/tests/nexus/verify_5_1_5.py +++ b/tests/nexus/verify_5_1_5.py @@ -121,7 +121,6 @@ def verify(pv): consts.NL_RLOC16_TLV, consts.NL_ROUTER_MASK_TLV } <= set(p.coap.tlv.type) and - p.coap.code == consts.COAP_CODE_ACK and p.coap.tlv.status == 0).\ must_next() @@ -167,7 +166,6 @@ def verify(pv): consts.NL_RLOC16_TLV, consts.NL_ROUTER_MASK_TLV } <= set(p.coap.tlv.type) and - p.coap.code == consts.COAP_CODE_ACK and p.coap.tlv.status == 0).\ must_next() diff --git a/tests/nexus/verify_5_1_6.py b/tests/nexus/verify_5_1_6.py index 96962a0b5..032f5cea6 100755 --- a/tests/nexus/verify_5_1_6.py +++ b/tests/nexus/verify_5_1_6.py @@ -74,7 +74,6 @@ def verify(pv): consts.NL_RLOC16_TLV, consts.NL_ROUTER_MASK_TLV } <= set(p.coap.tlv.type) and\ - p.coap.code == consts.COAP_CODE_ACK and\ p.coap.tlv.status == 0 ).\ must_next() diff --git a/tests/nexus/verify_5_2_3.py b/tests/nexus/verify_5_2_3.py index e69eec7c1..3ba767dfb 100644 --- a/tests/nexus/verify_5_2_3.py +++ b/tests/nexus/verify_5_2_3.py @@ -99,7 +99,6 @@ def verify(pv): consts.NL_RLOC16_TLV, consts.NL_ROUTER_MASK_TLV } <= set(p.coap.tlv.type) and\ - p.coap.code == consts.COAP_CODE_ACK and\ p.coap.tlv.status == consts.ADDR_SOL_SUCCESS).\ must_next() @@ -137,7 +136,6 @@ def verify(pv): filter(lambda p: { consts.NL_STATUS_TLV } <= set(p.coap.tlv.type) and\ - p.coap.code == consts.COAP_CODE_ACK and\ p.coap.tlv.status == consts.NL_NO_ADDRESS_AVAILABLE).\ must_next() diff --git a/tests/nexus/verify_5_2_6.py b/tests/nexus/verify_5_2_6.py index 47efd4154..e8127e275 100644 --- a/tests/nexus/verify_5_2_6.py +++ b/tests/nexus/verify_5_2_6.py @@ -114,7 +114,6 @@ def verify(pv): print("Step 4: Leader - Receives Address Release message and automatically sends a 2.04 Changed CoAP response.") pkts.filter_wpan_src64(LEADER).\ filter_coap_ack(consts.ADDR_REL_URI).\ - filter(lambda p: p.coap.code == consts.COAP_CODE_ACK).\ must_next() # Step 5: Leader