From c71356157ea8384e824c6ead44c908861097e9ac 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 (#16536) * Support smartswitch in get_testbed_type --- ansible/library/announce_routes.py | 4 ++-- tests/common/testbed.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ansible/library/announce_routes.py b/ansible/library/announce_routes.py index 01f9fee2067..06b77abbce9 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" @@ -1072,7 +1072,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 16347f9c5b9..fb67d2fc3e2 100644 --- a/tests/common/testbed.py +++ b/tests/common/testbed.py @@ -256,7 +256,7 @@ def _generate_sai_ptf_topo(self, tb_dict): def get_testbed_type(self, topo_name): pattern = re.compile( - r'^(wan|t0|t1|ptf|fullmesh|dualtor|ciscovs|t2|tgen|mgmttor|m0|mc0|mx|dpu|ptp)' + 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: