[cacl][test] Expect dhcp_server docker0 syslog rule on tcp/2514 - #26477
Open
Xichen96 wants to merge 3 commits into
Open
[cacl][test] Expect dhcp_server docker0 syslog rule on tcp/2514#26477Xichen96 wants to merge 3 commits into
Xichen96 wants to merge 3 commits into
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
github-actions
Bot
requested review from
ZhaohuiS,
matthew-soulsby and
xwjiang-ms
July 22, 2026 16:46
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CACL application test expectations to match the current caclmgrd behavior for the dhcp_server container’s syslog traffic over docker0, ensuring the regression test aligns with the control-plane ACL rebuild behavior.
Changes:
- Update the expected
dhcp_server_syslogiptables exception from UDP/514 to TCP/2514. - Refresh the in-code rationale comment describing why/when this exception should be present.
Xichen96
force-pushed
the
dev/xichenlin/cacl-test-dhcp-server-tcp2514
branch
from
July 22, 2026 16:50
5f4f9fb to
7c8e31d
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
21 tasks
The dhcp_server docker0 syslog INPUT exception changed from UDP 514 to RELP over tcp/2514, and its ownership moved from the container start/stop script to caclmgrd, which re-installs it on every control-plane ACL flush-and-rebuild while FEATURE|dhcp_server is enabled (sonic-net/sonic-buildimage#28328, sonic-net/sonic-host-services#412, sonic-net/sonic-buildimage#28580; fixes sonic-net/sonic-buildimage#27584). Update generate_expected_rules() to assert the tcp/2514 exception instead of the old udp/514 rule, and gate the expectation on the FEATURE|dhcp_server state that caclmgrd keys on (read via sonic-db-cli), rather than on mere container presence. Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
Xichen96
force-pushed
the
dev/xichenlin/cacl-test-dhcp-server-tcp2514
branch
from
July 22, 2026 17:34
7c8e31d to
94dffbd
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
This PR has backport request label(s) for branch(es): 202605, but is missing required test information. Please make sure you tick the tested branch(es) in the Tested branch section and provide test evidence (e.g., 202605: <test result>) in the Test result section as well in your PR description. ---Powered by SONiC BuildBot
|
Replace the raw sonic-db-cli CONFIG_DB HGET with the mgmt-native duthost.get_feature_status() helper, and shorten the comment. Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Xichen96
force-pushed
the
dev/xichenlin/cacl-test-dhcp-server-tcp2514
branch
from
July 24, 2026 05:40
96f1df3 to
1776ee5
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Signed-off-by: Xichen Lin <lukelin0907@gmail.com>
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
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
Summary:
caclmgrd's control-plane ACL rebuild appends a catch-allINPUT ... -j DROP. Thedhcp_servercontainer forwards its rsyslog to the host overdocker0(it is the only container that does so; other containers, including bridge-moderedfish, log to127.0.0.1), and that traffic now uses RELP over tcp/2514 (not the old udp/514). Ownership of thedocker0ACCEPTexception moved from the container start/stop script tocaclmgrd, which re-installs it on every rebuild keyed onFEATURE|dhcp_server— so it survives the flush-and-rebuild (root cause of sonic-net/sonic-buildimage#27584).This updates
generate_expected_rules()intests/cacl/test_cacl_application.pyto assert the new tcp/2514 exception instead of the stale udp/514 rule and to gate that expectation on theFEATURE|dhcp_serverstate (whatcaclmgrdkeys on) rather than container presence, so the CACL test matches the shipped behavior.Product changes this test requires (merged on master):
caclmgrdowns the rule.Complementary follow-up sonic-net/sonic-buildimage#28580 adds container-side feature-gated waits; it does not change the rule asserted by this test.
Fixes # (issue)
ADO: 38902699 (parent PBI 38699922). Underlying bug: sonic-net/sonic-buildimage#27584.
Type of change
Back port request
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Microsoft ADO 38902699
Failure type: day-one issue (the container-owned docker0 syslog rule never survived a caclmgrd control-plane ACL rebuild; the test expectation must move to tcp/2514 in lockstep with the product change on each branch it is backported to)
Tested branch
Test result
202605 hardware validation passed on
bjw-can-720dt-2(720dt,mx) runningSONiC.20260510.07. The complete PR series was cherry-picked ontointernal-202605and run with:run_tests.sh -n testbed-bjw-can-720dt-2 -c cacl/test_cacl_application.py -i ../ansible/veos,../ansible/bjw -u -x -a FalseResult: 5 passed, 4 topology skips in 25:51. Post-teardown,
FEATURE|dhcp_serverremained enabled, the container was running, and the canonical tcp/2514 rule remained at INPUT position 3 above the catch-all DROP at position 46.Approach
What is the motivation for this PR?
Keep the CACL regression test aligned with the product: the
dhcp_serverdocker0syslog exception is now a caclmgrd-owned tcp/2514 rule, not a container-owned udp/514 rule.How did you do it?
In
generate_expected_rules()(host /asic_index is Nonebranch), changed the expecteddhcp_server_syslogrule from-p udp -m udp --dport 514to-p tcp -m tcp --dport 2514, updated the comment to describe the new caclmgrd ownership, and changed the gate from mere container presence to theFEATURE|dhcp_serverstate returned byduthost.get_feature_status()thatcaclmgrditself keys on.How did you verify/test it?
python3 -m py_compile+ repo pre-commit (flake8) pass. The full 202605 hardware run passed as recorded in Test result; the expected rule matches the liveiptables -S INPUToutput after test teardown.Any platform specific information?
None — host-namespace IPv4 INPUT rule; applies to all platforms running the
dhcp_serverfeature.Supported testbed topology if it's a new test case?
N/A (existing test).
Documentation
N/A.