Skip to content

[dhcp_relay] Fix ACL drop count validation for expanded DHCP packet types#20370

Closed
dhanasekar-arista wants to merge 3 commits intosonic-net:masterfrom
dhanasekar-arista:fix-dhcp-relay-acl-drop-count
Closed

[dhcp_relay] Fix ACL drop count validation for expanded DHCP packet types#20370
dhanasekar-arista wants to merge 3 commits intosonic-net:masterfrom
dhanasekar-arista:fix-dhcp-relay-acl-drop-count

Conversation

@dhanasekar-arista
Copy link
Copy Markdown
Contributor

@dhanasekar-arista dhanasekar-arista commented Aug 22, 2025

What is the motivation for this PR?

Fix DHCP relay test failures in dual-ToR testbeds caused by ACL drop count validation mismatch after PR #20059.

Issue Description

  • Tests pass functionally but fail during teardown validation
  • Error: Expected 3 ACL drops, but getting 7 drops consistently
  • Affects: test_dhcp_relay_default, test_dhcp_relay_with_source_port_ip_in_relay_enabled, test_dhcp_relay_random_sport

Root Cause

PR #20059 (Aug 2025) expanded DHCP packet types from 3 to 7:

  • Before: Discover, Request, Bootp (3 packets)
  • After: Unknown, Discover, Request, Bootp, Decline, Release, Inform (7 packets)

The verify_acl_drop_on_standby_tor fixture still expected 3 drops, causing validation failures.

How did you do it?

Update expected ACL drop count from 3 to 7 in the fixture validation logic.

How did you verify/test it?

  • Analyzed consistent failure patterns across multiple testbeds
  • Confirmed 7 drops per test matches the new packet type count
  • Change aligns fixture validation with actual test behavior

Related Issues

Test Results

This fix will resolve teardown failures while maintaining functional test coverage.

dhanasekar-arista and others added 3 commits August 20, 2025 23:50
We have raised a CSP12420291 to get this fixed in SAI, until then we can ignore these errors in loganalyzer.

Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-40b37838-f16e-453b-9f4c-81aa8a177132
- Split long lines to meet code style requirements (max 120 chars)
- Break up conditional statement and regex patterns
- Maintain regex functionality while improving readability

Fixes pre_test failure reported in review comment.
…ypes

- Update expected ACL drop count from 3 to 7 in verify_acl_drop_on_standby_tor fixture
- Aligns with PR sonic-net#20059 that expanded DHCP packet types from 3 to 7:
  (Unknown, Discover, Request, Bootp, Decline, Release, Inform)
- Fixes teardown validation failures in dual-ToR testbeds

Signed-off-by: Dhanasekar <[email protected]>
Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-1c1a042e-0917-4ecf-a747-9dbbdb8a0743
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dhanasekar-arista
Copy link
Copy Markdown
Contributor Author

Closing this PR - created from wrong branch. Will create a clean PR from master.

@dhanasekar-arista dhanasekar-arista deleted the fix-dhcp-relay-acl-drop-count branch August 22, 2025 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants