From 354b592c0450705f9bd12f7b1040aa1f51e089b2 Mon Sep 17 00:00:00 2001 From: Anant <127479400+AnantKishorSharma@users.noreply.github.com> Date: Mon, 8 Jan 2024 08:19:48 +0530 Subject: [PATCH] fix for mocked T0 DToR TC failures due to config push delta (#8363) * fix for failures in orchagent_standby_tor_downstream script * Update test_orchagent_standby_tor_downstream.py * fix for mocked T0 DToR TC failures due to config push delta --- tests/common/dualtor/dual_tor_mock.py | 2 +- tests/dualtor/test_ipinip.py | 2 +- tests/dualtor/test_orchagent_standby_tor_downstream.py | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/common/dualtor/dual_tor_mock.py b/tests/common/dualtor/dual_tor_mock.py index 5295e72487..b3dca030f2 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_ipinip.py b/tests/dualtor/test_ipinip.py index 0c7a925dfb..cf04cfbb73 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) diff --git a/tests/dualtor/test_orchagent_standby_tor_downstream.py b/tests/dualtor/test_orchagent_standby_tor_downstream.py index 30caee8fcc..7685868131 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(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) @@ -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(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(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)