[macsec]: Return recent packets in macsec_dp_poll#6992
Merged
theasianpianist merged 2 commits intosonic-net:masterfrom Dec 20, 2022
Merged
[macsec]: Return recent packets in macsec_dp_poll#6992theasianpianist merged 2 commits intosonic-net:masterfrom
theasianpianist merged 2 commits intosonic-net:masterfrom
Conversation
Signed-off-by: Lawrence Lee <[email protected]>
Pterosaur
reviewed
Dec 19, 2022
tests/macsec/macsec_helper.py
Outdated
| if ptf.dataplane.match_exp_pkt(exp_pkt, pkt): | ||
| return ret | ||
| else: | ||
| macsec_info = load_macsec_info(test.duthost, find_portname_from_ptf_id(test.mg_facts, ret.port), force_reload[ret.port]) |
Contributor
There was a problem hiding this comment.
According to the PR #6828,
To non-Ether packet, we don't need to go to MACsec decap at all.
So, maybe need to skip this condition.
Contributor
Author
There was a problem hiding this comment.
Sure, I've moved this inside the packet type check
Signed-off-by: Lawrence Lee <[email protected]>
Pterosaur
approved these changes
Dec 20, 2022
wangxin
pushed a commit
that referenced
this pull request
Dec 26, 2022
- Always store received packets in case they need to be returned in a PollFailure object later. Signed-off-by: Lawrence Lee <[email protected]>
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.
Signed-off-by: Lawrence Lee [email protected]
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
macsec_dp_pollreplaces the originaldp_pollfunction from the PTF library in all test cases (this is used by methods such asptf.testutils.verify_packet). Whenmacsec_dp_polldoesn't find a packet matching the expected packet, it doesn't return a list of recently received packets (the originaldp_polldoes), which makes debugging difficult. Instead, it will raise an error with the following message:How did you do it?
Always store received packets in case they need to be returned in a
PollFailureobject later.How did you verify/test it?
Call
ptf.testutils.verify_packetand provide some expected packet which will not be received. The method should fail with a message similar to below:Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation