From 07c6f601c39aa50e4caf348b87945801d5700049 Mon Sep 17 00:00:00 2001 From: yaqiangz Date: Tue, 10 Dec 2024 10:11:25 +0000 Subject: [PATCH 1/2] [dhcp_relay] Increase wait time for default route check in dhcp_relay test --- tests/dhcp_relay/conftest.py | 2 +- tests/dhcp_relay/dhcp_relay_utils.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/dhcp_relay/conftest.py b/tests/dhcp_relay/conftest.py index 7a974767918..2b0d58a4067 100644 --- a/tests/dhcp_relay/conftest.py +++ b/tests/dhcp_relay/conftest.py @@ -146,7 +146,7 @@ def dut_dhcp_relay_data(duthosts, rand_one_dut_hostname, ptfhost, tbinfo): def validate_dut_routes_exist(duthosts, rand_one_dut_hostname, dut_dhcp_relay_data): """Fixture to valid a route to each DHCP server exist """ - py_assert(wait_until(120, 5, 0, check_routes_to_dhcp_server, duthosts[rand_one_dut_hostname], + py_assert(wait_until(360, 5, 0, check_routes_to_dhcp_server, duthosts[rand_one_dut_hostname], dut_dhcp_relay_data), "Packets relayed to DHCP server should go through default route via upstream neighbor, but now it's" + " going through mgmt interface, which means device is in an unhealthy status") diff --git a/tests/dhcp_relay/dhcp_relay_utils.py b/tests/dhcp_relay/dhcp_relay_utils.py index 37544150cc0..667f1c7cc84 100644 --- a/tests/dhcp_relay/dhcp_relay_utils.py +++ b/tests/dhcp_relay/dhcp_relay_utils.py @@ -9,6 +9,8 @@ def check_routes_to_dhcp_server(duthost, dut_dhcp_relay_data): """Validate there is route on DUT to each DHCP server """ + output = duthost.shell("show ip bgp sum", module_ignore_errors=True) + logger.info("bgp state: {}".format(output["stdout"])) default_gw_ip = dut_dhcp_relay_data[0]['default_gw_ip'] dhcp_servers = set() for dhcp_relay in dut_dhcp_relay_data: From d20fa7ff440c3a1e62f398000ef8008ca731de30 Mon Sep 17 00:00:00 2001 From: yaqiangz Date: Tue, 10 Dec 2024 10:25:30 +0000 Subject: [PATCH 2/2] Add pc --- tests/dhcp_relay/dhcp_relay_utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/dhcp_relay/dhcp_relay_utils.py b/tests/dhcp_relay/dhcp_relay_utils.py index 667f1c7cc84..1ea04c8021b 100644 --- a/tests/dhcp_relay/dhcp_relay_utils.py +++ b/tests/dhcp_relay/dhcp_relay_utils.py @@ -11,6 +11,8 @@ def check_routes_to_dhcp_server(duthost, dut_dhcp_relay_data): """ output = duthost.shell("show ip bgp sum", module_ignore_errors=True) logger.info("bgp state: {}".format(output["stdout"])) + output = duthost.shell("show int po", module_ignore_errors=True) + logger.info("portchannel state: {}".format(output["stdout"])) default_gw_ip = dut_dhcp_relay_data[0]['default_gw_ip'] dhcp_servers = set() for dhcp_relay in dut_dhcp_relay_data: