From 3cbf8b4bde7fdefe662bbf8bb3b53f48dd3e1f51 Mon Sep 17 00:00:00 2001 From: bingwang-ms <66248323+bingwang-ms@users.noreply.github.com> Date: Thu, 16 Jan 2025 13:06:04 -0800 Subject: [PATCH] Support smartswitch in get_testbed_type and announce_routes --- ansible/library/announce_routes.py | 4 ++-- tests/common/testbed.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ansible/library/announce_routes.py b/ansible/library/announce_routes.py index 3128110b7ea..a3a24b98fce 100644 --- a/ansible/library/announce_routes.py +++ b/ansible/library/announce_routes.py @@ -117,7 +117,7 @@ def wait_for_http(host_ip, http_port, timeout=10): def get_topo_type(topo_name): pattern = re.compile( - r'^(t0-mclag|t0|t1|ptf|fullmesh|dualtor|t2|mgmttor|m0|mc0|mx|dpu)') + r'^(t0-mclag|t0|t1|ptf|fullmesh|dualtor|t2|mgmttor|m0|mc0|mx|dpu|smartswitch-t1)') match = pattern.match(topo_name) if not match: return "unsupported" @@ -1065,7 +1065,7 @@ def main(): if topo_type == "t0": fib_t0(topo, ptf_ip, no_default_route=is_storage_backend, action=action) module.exit_json(changed=True) - elif topo_type == "t1": + elif topo_type == "t1" or topo_type == "smartswitch-t1": fib_t1_lag( topo, ptf_ip, no_default_route=is_storage_backend, action=action) module.exit_json(changed=True) diff --git a/tests/common/testbed.py b/tests/common/testbed.py index d226603f513..f15b5fe02fb 100644 --- a/tests/common/testbed.py +++ b/tests/common/testbed.py @@ -255,7 +255,9 @@ def _generate_sai_ptf_topo(self, tb_dict): return sai_topo def get_testbed_type(self, topo_name): - pattern = re.compile(r'^(wan|t0|t1|ptf|fullmesh|dualtor|t2|tgen|mgmttor|m0|mc0|mx|dpu|ptp)') + pattern = re.compile( + r'^(wan|t0|t1|ptf|fullmesh|dualtor|ciscovs|t2|tgen|mgmttor|m0|mc0|mx|dpu|ptp|smartswitch)' + ) match = pattern.match(topo_name) if match is None: logger.warning("Unsupported testbed type - {}".format(topo_name))