Skip to content

test: cover V9 options templates carried inside IPFIX messages - #331

Merged
mikemiles-dev merged 1 commit into
mainfrom
test/ipfix-v9-options-coverage
Oct 11, 2026
Merged

mikemiles-dev merged 1 commit into
mainfrom
test/ipfix-v9-options-coverage

Conversation

@mikemiles-dev

Copy link
Copy Markdown
Owner

Follow-up to #330.

That PR retired two bundled captures as malformed and noted that the crate therefore needed a well-formed capture to restore template-field and options-template coverage. That note was wrong on both counts, and this corrects it.

IPFIX Template Sets are exercised by roughly a dozen test files and by pcaps/IPFIX.pcap, which asserts 15 cached templates and exact cache hit and miss counts across 6,666 packets -- considerably better coverage than either retired capture provided. IPFIX Options Template Sets are exercised by tests/decoded_output_limits.rs, tests/round_trip.rs and tests/template_store.rs. Neither needed restoring.

What the retired can_read_ipfix capture actually exercised is narrower, and was genuinely left uncovered. It declares Set ID 1, which an IPFIX message routes to the V9-style options template path rather than to anything IPFIX-native, so the capture never covered IPFIX template fields despite its name -- that was already true before #330 touched it. This adds a well-formed version-10 message carrying a Set ID 1 V9 options template and asserts it reaches the parser's cache with its scope and option fields intact, which closes the one path that lost its only vector.

The new test asserts rather than snapshots. Both retired captures were snapshot tests over opaque hex, and their snapshots recorded an empty flowsets list for years without anyone noticing they had stopped decoding anything; a snapshot over a blob cannot fail in a way that draws attention.

The RELEASES note is corrected to say what was retired and what replaced it.

No library code changes. ./scripts/check-all.sh passes all seven checks.

#330 retired two bundled captures as malformed and noted that the crate
therefore needed a well-formed capture to restore template-field and
options-template coverage. That note was wrong on both counts.

IPFIX Template Sets are exercised by roughly a dozen test files and by
pcaps/IPFIX.pcap, which asserts 15 cached templates and exact hit and miss
counts across 6,666 packets. IPFIX Options Template Sets are exercised by
tests/decoded_output_limits.rs, tests/round_trip.rs and
tests/template_store.rs. Neither needed restoring.

What the retired can_read_ipfix capture actually exercised is narrower and
was genuinely left uncovered. It declares Set ID 1, which an IPFIX message
routes to the V9-style options template path, not to anything
IPFIX-native, so the capture never covered IPFIX template fields despite
its name. Add a well-formed version-10 message carrying a Set ID 1 V9
options template and assert it reaches the parser's cache with its scope
and option fields intact.

Assertions rather than a snapshot. Both retired captures were snapshot
tests over opaque hex, and their snapshots recorded an empty flowsets list
for years without anyone noticing they had stopped decoding anything.

Correct the RELEASES note to say what was retired and what replaced it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mikemiles-dev
mikemiles-dev merged commit d981cc8 into main Oct 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant