Skip to content

Commit

Permalink
[dualtor][route_check] filter out soc_ipv6 (sonic-net#2899)
Browse files Browse the repository at this point in the history
What I did
Skip soc_ipv6 when comparing appl_db and asic_db route entries on active-active dualtor. Because it's creating false alarms when tunnel route is added for soc ips. The route is meant to be programmed in asic only.

sign-off: Jing Zhang zhangjing@microsoft.com

How I did it
How to verify it
Run the updated script on active-active dualtor devices.
  • Loading branch information
zjswhhh authored and rajkumar38 committed Jul 25, 2023
1 parent 09b5df0 commit c36f9dd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,12 @@ def get_soc_ips(config_db):
mux_table = config_db.get_table('MUX_CABLE')
soc_ips = []
for _, mux_entry in mux_table.items():
if mux_entry.get("cable_type", "") == "active-active" and "soc_ipv4" in mux_entry:
soc_ips.append(mux_entry["soc_ipv4"])
if mux_entry.get("cable_type", "") == "active-active":
if "soc_ipv4" in mux_entry and mux_entry["soc_ipv4"]:
soc_ips.append(mux_entry["soc_ipv4"])

if "soc_ipv6" in mux_entry and mux_entry["soc_ipv6"]:
soc_ips.append(mux_entry["soc_ipv6"])

return soc_ips

Expand Down
4 changes: 3 additions & 1 deletion tests/route_check_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
"server_ipv4": "192.168.0.2/32",
"server_ipv6": "fc02:1000::2/128",
"soc_ipv4": "192.168.0.3/32",
"soc_ipv6": "fc02:1000::3/128",
"state": "auto"
},
}
Expand All @@ -356,7 +357,8 @@
RT_ENTRY_TABLE: {
RT_ENTRY_KEY_PREFIX + "192.168.0.2/32" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "fc02:1000::2/128" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {}
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "fc02:1000::3/128" + RT_ENTRY_KEY_SUFFIX: {}
}
}
}
Expand Down

0 comments on commit c36f9dd

Please sign in to comment.