Repository navigation
test: cover V9 options templates carried inside IPFIX messages - #331
Merged
Merged
Conversation
#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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 bytests/decoded_output_limits.rs,tests/round_trip.rsandtests/template_store.rs. Neither needed restoring.What the retired
can_read_ipfixcapture 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.shpasses all seven checks.