From 9c8de46aa3c665fc158f31901cdc0f5c43deb856 Mon Sep 17 00:00:00 2001 From: Jarry Shaw Date: Thu, 15 Oct 2026 12:49:27 -0400 Subject: [PATCH] test: exercise option type 0x23 in the SMF_DPD truncation loop (#1771) The type loop in test_smf_dpd_truncated_len_unit.py skipped RPL_Option_0x23 through EXCLUDED = {0x23}, citing #1196 as the cause of an unrelated failure. #1196 is closed by #1197 and #1198, and both HOPOPT and IPv6_Opts given PREFIX + b'\x23\x00' now raise the library ProtocolError ("runs past the end of the data"), so the exclusion only hid two subtests that pass. Drop EXCLUDED, its comment and the skip, so the loop covers all 256 option types for both protocols: 512 loop subtests, up from 510. Checked by mutation: making the RPL sub-TLV length callable raise a TypeError for type 0x23 fails exactly the two 0x23 subtests here, while the origin/main version of the test still passes. Restoring the #1196 registry bug is not caught here, as the truncation error fires before reader dispatch; test_rpl_option_unit.py covers that one. The docstring-contract line reference is fixed in #1103 round 2. Closes #1771 --- tests/protocols/internet/test_smf_dpd_truncated_len_unit.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/protocols/internet/test_smf_dpd_truncated_len_unit.py b/tests/protocols/internet/test_smf_dpd_truncated_len_unit.py index 71f7816c1..7d67bd52d 100644 --- a/tests/protocols/internet/test_smf_dpd_truncated_len_unit.py +++ b/tests/protocols/internet/test_smf_dpd_truncated_len_unit.py @@ -37,9 +37,6 @@ ('pcapkit.protocols.internet.ipv6_opts', 'IPv6_Opts'), ) -#: ``RPL_Option_0x23`` fails here for an unrelated reason, tracked in #1196. -EXCLUDED = {0x23} - class TestSMFDPDTruncatedLength(unittest.TestCase): """Pin the error an option in the last two octets of the header raises.""" @@ -65,8 +62,6 @@ def test_no_option_type_raises_a_non_library_error(self) -> None: for cls in self._protocols(): for code in range(256): - if code in EXCLUDED: - continue with self.subTest(protocol=cls.__name__, type=f'0x{code:02x}'): with warnings.catch_warnings(): warnings.simplefilter('ignore')