55
66This tool is designed to verify that, for dualtor SONiC, the neighbors learnt from
77mux ports should have correct neighbor/route entry in ASIC.
8-
9- Check steps:
10- 1.
11- 2.
12- 3.
13- 4.
14- 5.
158"""
169import argparse
1710import 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