DHCPv4 test update for new sonic-dhcpv4-relay design and added functionality#19198
DHCPv4 test update for new sonic-dhcpv4-relay design and added functionality#19198Blueve merged 10 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@yaqiangz Please review. |
| duthost.shell('sonic-db-cli CONFIG_DB hset "FEATURE|dhcp_relay" "has_sonic_dhcpv4_relay" "True"', module_ignore_errors=True) | ||
| duthost.shell('sudo config save -y', module_ignore_errors=True) | ||
| restart_dhcp_service(duthost) | ||
| # Checking DHCPV4 relay Process on DUT |
There was a problem hiding this comment.
restart_dhcp_service already has a check for the process.
Please change the pattern from
dhcp to dhc to accommodate the isc process name.
|
|
||
| def check_interface_status(duthost, relay_agent="isc-relay-agent"): | ||
| if relay_agent == "sonic-relay-agent": | ||
| cmd = "docker exec -t dhcp_relay ss -nlp | grep dhcp4relay" |
There was a problem hiding this comment.
Can we merge this udp port 67 check?
There was a problem hiding this comment.
We included 67 port check
| self.server_vrf = self.test_params.get('server_vrf', None) | ||
| self.vrf_selection = self.test_params.get('vrf_selection', None) | ||
| self.portchannels_ip_list = self.test_params.get('portchannels_ip_list', None) | ||
| self.agent_relay_mode = self.test_params.get('agent_relay_mode', None) |
There was a problem hiding this comment.
Can we just pass the agent relay mode instead of passing each relay mode value separately?
| bootp = scapy.BOOTP(op=1, | ||
| htype=1, | ||
| hlen=6, | ||
| hops=1, |
There was a problem hiding this comment.
Can we add a test to check the valid/invalid hop count range?
There was a problem hiding this comment.
Added new testcase
|
|
||
| class DHCPTest(DataplaneBaseTest): | ||
|
|
||
| BROADCAST_MAC = 'ff:ff:ff:ff:ff:ff' |
There was a problem hiding this comment.
Please revert change in scope for these.
Also the changes in the rest of the diff caused by this change of scope.
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
| #DHCP packet macro's |
There was a problem hiding this comment.
Please make them DHCPTest class scope
| pytest_assert(wait_until(40, 5, 0, check_process_and_socket_status, duthost, dut_dhcp_relay_data, "isc_dhcp_process_check")) | ||
| pytest_assert(wait_until(40, 5, 0, check_process_and_socket_status, duthost, dut_dhcp_relay_data, "sonic_dhcpv4_socket_check")) | ||
|
|
||
| def check_process_and_socket_status(duthost, dut_dhcp_relay_data=None, process_and_socket_check=None): |
There was a problem hiding this comment.
Please use existing restart_dhcp_service util to check the process status
L52-59 are not needed
| dut_dhcp_relay_data = request.getfixturevalue("dut_dhcp_relay_data") | ||
| if dut_dhcp_relay_data: | ||
| pytest_assert(wait_until(40, 5, 0, check_process_and_socket_status, duthost, dut_dhcp_relay_data, "isc_dhcp_process_check")) | ||
| pytest_assert(wait_until(40, 5, 0, check_process_and_socket_status, duthost, dut_dhcp_relay_data, "sonic_dhcpv4_socket_check")) |
There was a problem hiding this comment.
Why check the status of sonic_dhcpv4_socket_check after cleaning up new design feature flag?
L39-44 are not needed.
|
|
||
| """ | ||
|
|
||
| CLIENT_VRF_NAME = "Vrf01" |
There was a problem hiding this comment.
This is also defined at L#1061. Can we make them global to avoid duplicate definitions?
| restart_dhcp_service(duthost) | ||
| pytest_assert(wait_until(60, 2, 0, dhcp_ready, False), "Source port ip in relay is not disabled!") | ||
|
|
||
| @pytest.mark.parametrize("relay_agent", ["isc-relay-agent"]) |
There was a problem hiding this comment.
Please make this global instead of defining for each test and adapt the remaining 2 TC that are not being run for new design to run on both the designs.
| ) | ||
|
|
||
| @pytest.mark.parametrize("relay_agent", ["sonic-relay-agent"]) | ||
| @pytest.mark.parametrize("testcase", ["source_intf", "server_id_override"]) |
There was a problem hiding this comment.
Please move these new tests specific to new design to a new script and add a skip for this script based on release 202511 in test_mark_conditions.yaml
| @@ -0,0 +1,92 @@ | |||
| import re | |||
There was a problem hiding this comment.
Please add this in common/dhcp_relay_utils.py Instead of creating this new file here.
| delete_checkpoint(duthost, check_point) | ||
| restart_dhcp_service(duthost) | ||
| pytest_assert(wait_until(60, 2, 0, dhcp_ready, False), "Source port ip in relay is not disabled!") | ||
|
|
There was a problem hiding this comment.
2 blank line indentation is needed. Please fix all other indentation/pre-commit errors
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
…onality (#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: Ashutosh Agrawal <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: Ashutosh Agrawal <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: selldinesh <[email protected]>
* DHCPv4 test update for new sonic-dhcpv4-relay design and added functionality (#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: Ashutosh Agrawal <[email protected]> * Addressed review comments 3 and 4 from StormLiangMS Signed-off-by: Ashutosh Agrawal <[email protected]> * Remove test_dhcp_relay_on_dualtor_standby - test is fundamentally broken as DHCP relay is dualtor-agnostic (matches PR 22214 and its 202511 backport 23063) Signed-off-by: Ashutosh Agrawal <[email protected]> --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: Ashutosh Agrawal <[email protected]> Co-authored-by: Akshath TR <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]>
|
@Akshath-17 please help raise manual pr for 202511 since there are cherry-pick conflicts |
|
@vmittal-msft I manually backported it to 202511. Here is the merged PR - #23223. I've also added "Included in 202511" label on this PR. |
…onality (sonic-net#19198) This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details: https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md --------- Signed-off-by: Venkata Gouri Rajesh Etla <[email protected]> Co-authored-by: vrajeshe <[email protected]> Co-authored-by: Venkata Gouri Rajesh Etla <[email protected]> Signed-off-by: opcoder0 <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp for sonic-relay-agent support, but test_dhcp_relay_stress.py was not updated. This causes KeyError and TypeError failures when the stress test calls DHCPTest to verify relay functionality after stress. Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
…ve excessive buffer PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp, but test_dhcp_counter_stress.py was not updated. Also removes the excessive BUFFER_SIZE (1GB kernel buffer) that caused memory spikes, using the default instead. Fixes count file extension mismatch (.json removed). Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
…ve excessive buffer PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp, but test_dhcp_counter_stress.py was not updated. Also removes the excessive BUFFER_SIZE (1GB kernel buffer) that caused memory spikes, using the default instead. Fixes count file extension mismatch (.json removed). Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
…ve excessive buffer PR sonic-net#19198 added relay_agent and downlink_vlan_iface_name as required parameters in DHCPTest.setUp, but test_dhcp_counter_stress.py was not updated. Also removes the excessive BUFFER_SIZE (1GB kernel buffer) that caused memory spikes, using the default instead. Fixes count file extension mismatch (.json removed). Co-authored-by: Copilot <[email protected]> Signed-off-by: Xichen Lin <[email protected]>
Summary:
This PR is to support the new DHCPv4 Relay design being introduced in SONiC to replace the existing ISC implementation. Please see the following HLD for more details:
https://github.com/sonic-net/SONiC/blob/2eb20e2d2bcc181ab8cf1f502173ac0dbd528698/doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Type of change
Approach
motivation: Run existing sonic-mgmt tests on both ISC and the new sonic-dhcpv4-relay designs and add new tests for functionality introduced in sonic-dhcpv4-relay