Skip to content

test: exercise option type 0x23 in the SMF_DPD truncation loop (#1771) - #1776

Merged
JarryShaw merged 1 commit into
mainfrom
test/1771-smf-dpd-exclusion
Oct 15, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
test/1771-smf-dpd-exclusion

Conversation

@JarryShaw

Copy link
Copy Markdown
Owner

Please follow the guide below

What is the purpose of your pull request?

Tick the commit type your subject line carries.

  • fix — corrects a defect
  • feat — adds a feature
  • perf — changes performance, not behaviour
  • refactor — changes neither behaviour nor performance
  • test — tests only
  • docs — documentation only
  • ci — workflows or build tooling
  • release — bumps the version or rolls up a distribution
  • chore — anything else

Summary

The type loop in tests/protocols/internet/test_smf_dpd_truncated_len_unit.py skipped RPL_Option_0x23 via EXCLUDED = {0x23}, citing #1196. That bug is fixed: HOPOPT and IPv6_Opts given PREFIX + b'\x23\x00' now raise the library ProtocolError. So the exclusion only hid two passing subtests. This PR drops it, and the loop covers all 256 types for both protocols (512 subtests, up from 510).

  • Bite: a mutation that makes the RPL sub-TLV length raise TypeError for 0x23 fails exactly the two 0x23 subtests; the origin/main test passes it.
  • Runs: this file 2 passed, 514 subtests passed; tests/project exit 0; adjacent RPL/SMF_DPD/IPv6-options files 95 passed, 816 subtests passed.

Closes #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
@JarryShaw JarryShaw added the test Pull requests that add or correct tests (test: subject prefix) label Oct 15, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Verdict: GOOD TO GO at 9c8de46aa. Sonnet cross-review (author: Opus). It confirmed the 0x23 inputs now raise ProtocolError, the mutation bite (the old test misses it), and 514 subtests passing. The exclusion has no other references.

@JarryShaw JarryShaw added the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 89.59% (unit tier, Python 3.15, 9c8de46aa, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 3 20 3 95.16%
pcapkit/const 18862 954 2368 868 91.06%
pcapkit/corekit 2461 69 780 35 96.54%
pcapkit/dumpkit 276 3 100 3 98.40%
pcapkit/foundation 2915 164 1016 34 93.59%
pcapkit/interface 138 7 52 5 93.68%
pcapkit/protocols 17184 224 4574 189 98.08%
pcapkit/toolkit 872 177 298 8 77.18%
pcapkit/utilities 512 2 158 4 99.10%
pcapkit/vendor 4417 2342 1010 157 43.38%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw
JarryShaw merged commit 7c3ed8a into main Oct 15, 2026
56 checks passed
@JarryShaw
JarryShaw deleted the test/1771-smf-dpd-exclusion branch October 15, 2026 21:58
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 15, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 15, 2026
JarryShaw added a commit that referenced this pull request Oct 15, 2026
…1803)

Entries:
- add #1791 (breaking: pack() leaves its instance unchanged), #1778
  (Protocol in protocol.__all__), #1781 (PortEnumField miss with a
  nameless proto), #1779 (vendor.ipx _path), #1780 (examples READMEs to
  Markdown, build leftovers) and #1790 (36 ambiguous cross-references)
- fold #1776 into the RPL 0x23 entry and #1381 into the dump-schema one

Accuracy:
- the benchmark and legacy_smoke READMEs are README.md since #1780
- EngineBase stays out of __all__, as #1016 settled
- the #575 peek calls get() only once the value resolves
- the #647 and #764 entries point at #775/#860, under which nothing mints
- the #861 entry names #869 and #874 for the EnumRegistry move

Figures:
- preamble: 685 citations, #340 to #1791
- process.rst pin: 298 entries; CHANGELOG.md regenerated

Refs #1103
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Pull requests that add or correct tests (test: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

test: drop the SMF_DPD 0x23 exclusion and a stale line reference

1 participant