Skip to content

Commit

Permalink
[testfix] test_vxlan_ecmp unexpected logs fix. (#9653)
Browse files Browse the repository at this point in the history
Fixed primary secondary tests causing failures due to unexpected logs on various platforms.
  • Loading branch information
siqbal1986 authored and mssonicbld committed Aug 31, 2023
1 parent 399171c commit 9b6e3b3
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions tests/vxlan/test_vxlan_ecmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
from tests.common.utilities import wait_until
from tests.ptf_runner import ptf_runner
from tests.vxlan.vxlan_ecmp_utils import Ecmp_Utils
from tests.common.plugins.loganalyzer.loganalyzer import LogAnalyzer

Logger = logging.getLogger(__name__)
ecmp_utils = Ecmp_Utils()
Expand Down Expand Up @@ -106,7 +105,8 @@ def ignore_route_sync_errlogs(rand_one_dut_hostname, loganalyzer):
".*Look at reported mismatches above.*",
".*Unaccounted_ROUTE_ENTRY_TABLE_entries.*",
".*'vnetRouteCheck' status failed.*",
".*Vnet Route Mismatch reported.*"
".*Vnet Route Mismatch reported.*",
".*_M_construct null not valid.*",
])
return

Expand Down Expand Up @@ -274,7 +274,7 @@ def fixture_setUp(duthosts,
indent=4), dest="/tmp/vxlan_topo_info.json")

data['downed_endpoints'] = []
data[encap_type]['dest_to_nh_map_orignal'] = copy.copy(data[encap_type]['dest_to_nh_map']) # noqa F821
data[encap_type]['dest_to_nh_map_orignal'] = copy.deepcopy(data[encap_type]['dest_to_nh_map']) # noqa F821
yield data

# Cleanup code.
Expand Down Expand Up @@ -943,7 +943,7 @@ def test_vxlan_bfd_health_state_change_a1a2_up(self, setUp, encap_type):
ecmp_utils.get_payload_version(encap_type),
"DEL")

self.setup[encap_type]['dest_to_nh_map'] = self.setup[encap_type]['dest_to_nh_map_orignal']
self.setup[encap_type]['dest_to_nh_map'] = copy.deepcopy(self.setup[encap_type]['dest_to_nh_map_orignal']) # noqa F821
ecmp_utils.set_routes_in_dut(
self.setup['duthost'],
self.setup[encap_type]['dest_to_nh_map'],
Expand Down Expand Up @@ -2013,12 +2013,6 @@ def test_vxlan_priority_single_pri_sec_switchover(self, setUp, encap_type):
pytest.skip("Skipping test. v6 underlay is not supported in priority tunnels.")
self.setup = setUp

loganalyzer = LogAnalyzer(ansible_host=self.setup['duthost'],
marker_prefix="ignore Logic error: basic_string::_M_construct null")
loganalyzer.init()
# ignore this error as this is caused by the case when we try to install a route with no endpoints.
loganalyzer.expect_regex.extend("doTask: Logic error: basic_string::_M_construct null not valid")

Logger.info("Choose a vnet.")
vnet = self.setup[encap_type]['vnet_vni_map'].keys()[0]

Expand Down Expand Up @@ -2147,6 +2141,15 @@ def test_vxlan_priority_single_pri_sec_switchover(self, setUp, encap_type):

time.sleep(10)
self.dump_self_info_and_run_ptf("test1", encap_type, True)
ecmp_utils.create_and_apply_priority_config(
self.setup['duthost'],
vnet,
tc1_new_dest,
ecmp_utils.HOST_MASK[ecmp_utils.get_payload_version(encap_type)],
tc1_end_point_list,
[tc1_end_point_list[0]],
"DEL")
self.setup[encap_type]['dest_to_nh_map'] = copy.deepcopy(self.setup[encap_type]['dest_to_nh_map_orignal'])

except Exception:
ecmp_utils.create_and_apply_priority_config(
Expand Down Expand Up @@ -2189,12 +2192,6 @@ def test_vxlan_priority_multi_pri_sec_switchover(self, setUp, encap_type):
pytest.skip("Skipping test. v6 underlay is not supported in priority tunnels.")
self.setup = setUp

loganalyzer = LogAnalyzer(ansible_host=self.setup['duthost'],
marker_prefix="ignore Logic error: basic_string::_M_construct null")
loganalyzer.init()
# ignore this error as this is caused by the case when we try to install a route with no endpoints.
loganalyzer.expect_regex.extend("doTask: Logic error: basic_string::_M_construct null not valid")

Logger.info("Choose a vnet.")
vnet = self.setup[encap_type]['vnet_vni_map'].keys()[0]

Expand Down

0 comments on commit 9b6e3b3

Please sign in to comment.