Skip to content

Commit 553a343

Browse files
authored
[dualtor][route_check] filter out soc_ipv6 (sonic-net#2899)
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 [email protected] How I did it How to verify it Run the updated script on active-active dualtor devices.
1 parent 7ca3147 commit 553a343

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

scripts/route_check.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,12 @@ def get_soc_ips(config_db):
582582
mux_table = config_db.get_table('MUX_CABLE')
583583
soc_ips = []
584584
for _, mux_entry in mux_table.items():
585-
if mux_entry.get("cable_type", "") == "active-active" and "soc_ipv4" in mux_entry:
586-
soc_ips.append(mux_entry["soc_ipv4"])
585+
if mux_entry.get("cable_type", "") == "active-active":
586+
if "soc_ipv4" in mux_entry and mux_entry["soc_ipv4"]:
587+
soc_ips.append(mux_entry["soc_ipv4"])
588+
589+
if "soc_ipv6" in mux_entry and mux_entry["soc_ipv6"]:
590+
soc_ips.append(mux_entry["soc_ipv6"])
587591

588592
return soc_ips
589593

tests/route_check_test_data.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@
342342
"server_ipv4": "192.168.0.2/32",
343343
"server_ipv6": "fc02:1000::2/128",
344344
"soc_ipv4": "192.168.0.3/32",
345+
"soc_ipv6": "fc02:1000::3/128",
345346
"state": "auto"
346347
},
347348
}
@@ -356,7 +357,8 @@
356357
RT_ENTRY_TABLE: {
357358
RT_ENTRY_KEY_PREFIX + "192.168.0.2/32" + RT_ENTRY_KEY_SUFFIX: {},
358359
RT_ENTRY_KEY_PREFIX + "fc02:1000::2/128" + RT_ENTRY_KEY_SUFFIX: {},
359-
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {}
360+
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {},
361+
RT_ENTRY_KEY_PREFIX + "fc02:1000::3/128" + RT_ENTRY_KEY_SUFFIX: {}
360362
}
361363
}
362364
}

0 commit comments

Comments
 (0)