Skip to content

Commit 4639182

Browse files
committed
Skip check zero-mac neighbor consistency
Signed-off-by: Longxiang Lyu <lolv@microsoft.com>
1 parent 50c8918 commit 4639182

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

scripts/dualtor_neighbor_check.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
66
This tool is designed to verify that, for dualtor SONiC, the neighbors learnt from
77
mux ports should have correct neighbor/route entry in ASIC.
8-
9-
Check steps:
10-
1.
11-
2.
12-
3.
13-
4.
14-
5.
158
"""
169
import argparse
1710
import enum
@@ -420,11 +413,16 @@ def parse_check_results(check_results):
420413
bool_to_yes_no = ("no", "yes")
421414
bool_to_consistency = ("inconsistent", "consistent")
422415
for check_result in check_results:
416+
is_zero_mac = check_result["MAC"] == ZERO_MAC
417+
in_toggle = check_result["IN_MUX_TOGGLE"]
418+
hwstatus = check_result["HWSTATUS"]
419+
if not is_zero_mac:
420+
check_result["IN_MUX_TOGGLE"] = bool_to_yes_no[in_toggle]
423421
check_result["NEIGHBOR_IN_ASIC"] = bool_to_yes_no[check_result["NEIGHBOR_IN_ASIC"]]
424422
check_result["TUNNERL_IN_ASIC"] = bool_to_yes_no[check_result["TUNNERL_IN_ASIC"]]
425-
hwstatus = check_result["HWSTATUS"]
426423
check_result["HWSTATUS"] = bool_to_consistency[hwstatus]
427-
if not hwstatus:
424+
if not (is_zero_mac or in_toggle or hwstatus):
425+
# NOTE: skip zero mac or in-toggling neighbors
428426
failed_neighbors.append(check_result)
429427

430428
output_lines = tabulate.tabulate(
@@ -436,7 +434,7 @@ def parse_check_results(check_results):
436434
WRITE_LOG_WARN(output_line)
437435

438436
if failed_neighbors:
439-
WRITE_LOG_ERROR("Found neighbors that are inconsistent with mux states: %s", [_[0] for _ in failed_neighbors])
437+
WRITE_LOG_ERROR("Found neighbors that are inconsistent with mux states: %s", [_["NEIGHBOR"] for _ in failed_neighbors])
440438
err_output_lines = tabulate.tabulate(
441439
[[neighbor[attr] for attr in NEIGHBOR_ATTRIBUTES] for neighbor in failed_neighbors],
442440
headers=NEIGHBOR_ATTRIBUTES,

0 commit comments

Comments
 (0)