Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dualtor][route_check] filter out soc_ipv6 #2899

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]:
zjswhhh marked this conversation as resolved.
Show resolved Hide resolved
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