Change ip_opt_action in vrf test case from drop to deny#20024
Open
patiladarsh99 wants to merge 1 commit intosonic-net:masterfrom
Open
Change ip_opt_action in vrf test case from drop to deny#20024patiladarsh99 wants to merge 1 commit intosonic-net:masterfrom
patiladarsh99 wants to merge 1 commit intosonic-net:masterfrom
Conversation
Signed-off-by: Adarsh Patil <adarshbheemr@marvell.com>
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a failing VRF test case by correcting the SAI attribute value for IP options handling. The test was failing because it used "drop" instead of "deny" for the ip_opt_action attribute. According to SAI specifications, the default "trap" action means COPY and DROP, so using "drop" still allows packets to reach the CPU. The correct action to completely block packets with IP options is "deny".
Changes:
- Changed
ip_opt_actionfrom "drop" to "deny" in VRF test configuration to properly block packets with IP options
aman05382
approved these changes
Feb 20, 2026
kazinator-arista
pushed a commit
to kazinator-arista/sonic-mgmt
that referenced
this pull request
Mar 4, 2026
#### Why I did it
Dropping control character (message sent when XSUB connects to XPUB as part of ZMQ Proxy setup to notify that subscription has been made) in do capture has been flaky since control character is not guaranteed to be the first message sent if there are events (like event-down-ctr) being published to XSUB.
Scenarios
1) Control character is sent and is first message when starting capture service
`eventd#eventd#eventd: :- heartbeat_ctrl: Set heartbeat_ctrl pause=1`
`eventd#eventd#eventd: :- do_capture: Received subscription message when XSUB connects to XPUB`
2) Events like event-down ctr is sent before control character
`eventd#eventd#eventd: :- run: Dropping Message: 22 serialization::archive 18 17 sonic-events-host`
`eventd#eventd#eventd: :- run: Dropping Message: 22 serialization::archive 18 0 0 4 0 0 0 1 d 103 {"sonic-events-host:event-stopped-ctr":{"ctr_name":"EVENTD","timestamp":"2024-08-27T00:02:51.407518Z"}} 1 r 36 3357542f-bae1-458f-a804-660e620d21f5 1 s 1 9 1 t 19 1724716971407591080`
`heartbeat_ctrl: Set heartbeat_ctrl pause=1`
`do_capture: Received subscription message when XSUB connects to XPUB`
3) Control character is not sent at all
`eventd#eventd#eventd: :- heartbeat_ctrl: Set heartbeat_ctrl pause=1`
4) Control character is delayed and not caught when starting capture service, but is then caught after causing deserialize error.
`do_capture: Receiving event from source: 22 serialization::archive 18 17 sonic-events-host, will read second part of event`
`deserialize: deserialize Failed: input stream errorstr[0:64]:(sonic-net#1) data type: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&`
`zmq_read_part: Failed to deserialize part rc=-2`
`zmq_read_part: last:errno=11`
`zmq_message_read: Failure to read part1 rc=-2`
`zmq_message_read: last:errno=11`
We can cover these scenarios by just dropping the control character inside zmq_message_read as part of events_common in swsscommon (different PR). In this PR we will remove such handling logic and make sure that empty events that will be sent by control character are ignored.
##### Work item tracking
- Microsoft ADO **(number only)**:28728116
#### How I did it
Remove logic for handling control character
#### How to verify it
UT and sonic-mgmt test cases.
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.
Description of PR
Fixing the vrf/test_vrf_attr.py::TestVrfAttrIpAction::test_vrf1_drop_pkts_with_ip_opt, which was failing due to wrong usage of SAI attribute.
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
The case vrf/test_vrf_attr.py::TestVrfAttrIpAction::test_vrf1_drop_pkts_with_ip_opt should apply "deny" instead of "drop".
This is because according to SAI the default ip_opt_action is "trap" which means COPY and DROP. So if apply "drop" again, the CPU path are still COPY.
How did you do it?
Modify the tests/vrf/vrf_attr_ip_opt_action.json to change "ip_opt_action": "drop" to "ip_opt_action": "deny"
How did you verify/test it?
Run the test : vrf/test_vrf_attr.py::TestVrfAttrIpAction::test_vrf1_drop_pkts_with_ip_opt
Any platform specific information?
NA
Supported testbed topology if it's a new test case?
NA
Documentation