Generalize client packet mark test#13384
Open
JosiahWI wants to merge 3 commits into
Open
Conversation
This introduces common utilities to make it easy to add a server-side packet mark test.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the existing client packet mark test plugin by extracting shared logic into a reusable helper module, making it easier to add additional packet-mark plugins (e.g., server-side) with minimal duplication.
Changes:
- Added
packet_mark_common.{h,cc}with shared helpers to parse a mark from request headers, apply it via TS API, read backSO_MARK, and echo it in response headers. - Refactored
client_packet_markplugin to use the shared helpers and updated plugin build sources accordingly. - Added a new AuTest (
packet_mark.test.py) that validatesTSHttpTxnClientPacketMarkSetbehavior and skips cleanly whenSO_MARKcan’t be set/read.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/tools/plugins/packet_mark_common.h | New shared helper API for packet-mark test plugins. |
| tests/tools/plugins/packet_mark_common.cc | New shared implementation for mark parsing, setting, and echoing. |
| tests/tools/plugins/CMakeLists.txt | Builds client_packet_mark plugin with the new shared helper source. |
| tests/tools/plugins/client_packet_mark.cc | Simplified plugin implementation by delegating to the shared helper module. |
| tests/gold_tests/pluginTest/packet_mark/packet_mark.test.py | New AuTest verifying TSHttpTxnClientPacketMarkSet with capability-based skipping. |
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.
This makes adding the server packet mark test a much simpler change.