From 7649d9290e821c42258c2833930476661987d131 Mon Sep 17 00:00:00 2001 From: Anant Kishor Sharma Date: Thu, 18 May 2023 20:29:33 -0700 Subject: [PATCH 1/3] fix for failures in orchagent_standby_tor_downstream script --- tests/common/dualtor/dual_tor_mock.py | 2 +- tests/dualtor/test_orchagent_standby_tor_downstream.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/common/dualtor/dual_tor_mock.py b/tests/common/dualtor/dual_tor_mock.py index 9587e4a9dda..3be5659e4b8 100644 --- a/tests/common/dualtor/dual_tor_mock.py +++ b/tests/common/dualtor/dual_tor_mock.py @@ -343,7 +343,7 @@ def apply_peer_switch_table_to_dut(cleanup_mocked_configs, rand_selected_dut, mo restart_swss = True cmd = 'redis-cli -n 4 HSET "{}" "{}" "{}"'.format(device_meta_key, 'subtype', 'DualToR') dut.shell(cmd=cmd) - if restart_swss: + if ((restart_swss) and (dut.get_asic_name() != 'gb')): # Restart swss on TH2 or TD3 platform to trigger syncd restart to regenerate config.bcm # We actually need to restart syncd only, but restarting syncd will also trigger swss # being restarted, and it costs more time than restarting swss diff --git a/tests/dualtor/test_orchagent_standby_tor_downstream.py b/tests/dualtor/test_orchagent_standby_tor_downstream.py index 30caee8fcc0..eec2bd1f299 100644 --- a/tests/dualtor/test_orchagent_standby_tor_downstream.py +++ b/tests/dualtor/test_orchagent_standby_tor_downstream.py @@ -360,6 +360,7 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Step 1.1: Add route to a nexthop which is a standby Neighbor") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) add_nexthop_routes(rand_selected_dut, random_dst_ip, nexthops=[target_server]) + time.sleep(10) logger.info("Step 1.2: Verify traffic to this route dst is forwarded to Active ToR and equally distributed") check_tunnel_balance(**test_params) monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True) @@ -367,12 +368,14 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Stage 2: Verify Active Forwarding") logger.info("Step 2.1: Simulate Mux state change to active") set_mux_state(rand_selected_dut, tbinfo, 'active', tor_mux_intfs, toggle_all_simulator_ports) + time.sleep(10) logger.info("Step 2.2: Verify traffic to this route dst is forwarded directly to server") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=True, expect_tunnel_traffic=False) logger.info("Stage 3: Verify Standby Forwarding Again") logger.info("Step 3.1: Simulate Mux state change to standby") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) + time.sleep(10) logger.info("Step 3.2: Verify traffic to this route dst \ is now redirected back to Active ToR and equally distributed") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True) From f5ea857ef6ca7f679179b856ecb9dd402e1984f4 Mon Sep 17 00:00:00 2001 From: Anant <127479400+AnantKishorSharma@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:11:42 +0530 Subject: [PATCH 2/3] Update test_orchagent_standby_tor_downstream.py --- tests/dualtor/test_orchagent_standby_tor_downstream.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/dualtor/test_orchagent_standby_tor_downstream.py b/tests/dualtor/test_orchagent_standby_tor_downstream.py index eec2bd1f299..76858681313 100644 --- a/tests/dualtor/test_orchagent_standby_tor_downstream.py +++ b/tests/dualtor/test_orchagent_standby_tor_downstream.py @@ -360,7 +360,7 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Step 1.1: Add route to a nexthop which is a standby Neighbor") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) add_nexthop_routes(rand_selected_dut, random_dst_ip, nexthops=[target_server]) - time.sleep(10) + time.sleep(30) logger.info("Step 1.2: Verify traffic to this route dst is forwarded to Active ToR and equally distributed") check_tunnel_balance(**test_params) monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True) @@ -368,14 +368,14 @@ def monitor_tunnel_and_server_traffic(torhost, expect_tunnel_traffic=True, expec logger.info("Stage 2: Verify Active Forwarding") logger.info("Step 2.1: Simulate Mux state change to active") set_mux_state(rand_selected_dut, tbinfo, 'active', tor_mux_intfs, toggle_all_simulator_ports) - time.sleep(10) + time.sleep(30) logger.info("Step 2.2: Verify traffic to this route dst is forwarded directly to server") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=True, expect_tunnel_traffic=False) logger.info("Stage 3: Verify Standby Forwarding Again") logger.info("Step 3.1: Simulate Mux state change to standby") set_mux_state(rand_selected_dut, tbinfo, 'standby', tor_mux_intfs, toggle_all_simulator_ports) - time.sleep(10) + time.sleep(30) logger.info("Step 3.2: Verify traffic to this route dst \ is now redirected back to Active ToR and equally distributed") monitor_tunnel_and_server_traffic(rand_selected_dut, expect_server_traffic=False, expect_tunnel_traffic=True) From a8327c0807f601338a1b03b9673b44814951a797 Mon Sep 17 00:00:00 2001 From: Anant Kishor Sharma Date: Thu, 15 Jun 2023 02:49:38 -0700 Subject: [PATCH 3/3] fix for mocked T0 DToR TC failures due to config push delta --- tests/dualtor/test_ipinip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dualtor/test_ipinip.py b/tests/dualtor/test_ipinip.py index 0498b4d0d85..43ff1794717 100644 --- a/tests/dualtor/test_ipinip.py +++ b/tests/dualtor/test_ipinip.py @@ -114,6 +114,7 @@ def stop_garp(ptfhost): if is_t0_mocked_dualtor(tbinfo): # noqa F405 request.getfixturevalue('apply_active_state_to_orchagent') + time.sleep(30) else: request.getfixturevalue('toggle_all_simulator_ports_to_rand_selected_tor') @@ -126,7 +127,6 @@ def stop_garp(ptfhost): ptf_t1_intf = random.choice(get_t1_ptf_ports(tor, tbinfo)) logging.info("send encapsulated packet from ptf t1 interface %s", ptf_t1_intf) - time.sleep(10) with stop_garp(ptfhost): ptfadapter.dataplane.flush() testutils.send(ptfadapter, int(ptf_t1_intf.strip("eth")), encapsulated_packet)