From 2f641b637e7acb91251ca9c250829357a8b0b597 Mon Sep 17 00:00:00 2001 From: Austin Pham Date: Fri, 17 Oct 2025 22:40:05 +1100 Subject: [PATCH] chore: enable iface_namingmode and gnmi Signed-off-by: Austin Pham --- .../conditional_mark/tests_mark_conditions.yaml | 4 ++-- tests/gnmi/helper.py | 7 +++++++ tests/iface_namingmode/test_iface_namingmode.py | 10 +++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml index ffb808b97e7..b055b6042cd 100644 --- a/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml +++ b/tests/common/plugins/conditional_mark/tests_mark_conditions.yaml @@ -407,7 +407,7 @@ bgp/test_bgpmon.py: reason: "Not supported on T2 topology or topology backend or Skip for IPv6-only topologies, since there are v6 verison of the test" conditions: - - "'backend' in topo_name or 't2' in topo_name" + - "'backend' in topo_name or topo_type in ['t2']" - "'-v6-' in topo_name" bgp/test_bgpmon_v6.py::test_bgpmon_no_ipv6_resolve_via_default: @@ -2330,7 +2330,7 @@ gnmi/test_gnmi_configdb.py: reason: "This feature is not supported for multi asic. Skipping these test for T2 and multi asic." conditions_logical_operator: or conditions: - - "'t2' in topo_name" + - "topo_type in ['t2']" - "is_multi_asic==True" - "release in ['202412']" diff --git a/tests/gnmi/helper.py b/tests/gnmi/helper.py index e20b90a44f6..e2afb47be91 100644 --- a/tests/gnmi/helper.py +++ b/tests/gnmi/helper.py @@ -224,6 +224,13 @@ def gnmi_set(duthost, ptfhost, delete_list, update_list, replace_list, cert=None # There is a chance that the network connection lost between PTF and switch due to table entry timeout # It would lead to execution failure of py_gnmicli.py. The ping action would trigger arp and mac table refresh. ptfhost.shell(f"ping {ip} -c 3", module_ignore_errors=True) + + # Health check to make sure the gnmi server is listening on port + health_check_cmd = f"sudo ss -ltnp | grep {env.gnmi_port} | grep ${env.gnmi_program}" + + wait_until(120, 1, 5, + lambda: len(duthost.shell(health_check_cmd, module_ignore_errors=True)['stdout_lines']) > 0) + output = ptfhost.shell(cmd, module_ignore_errors=True) error = "GRPC error\n" if error in output['stdout']: diff --git a/tests/iface_namingmode/test_iface_namingmode.py b/tests/iface_namingmode/test_iface_namingmode.py index 56350fea240..365e98e9a1c 100644 --- a/tests/iface_namingmode/test_iface_namingmode.py +++ b/tests/iface_namingmode/test_iface_namingmode.py @@ -1014,7 +1014,7 @@ def test_show_vlan_config(self, setup, setup_config_mode): # Tests to be run in t1 topology -@pytest.mark.topology('t1') +@pytest.mark.topology('t1', 'lt2', 'ft2') class TestConfigInterface(): def check_speed_change(self, duthost, asic_index, interface, change_speed): db_cmd = 'sudo {} CONFIG_DB HGET "PORT|{}" speed'\ @@ -1352,7 +1352,7 @@ def test_show_acl_table(setup, setup_config_mode, tbinfo): Checks whether 'show acl table DATAACL' lists the interface names as per the configured naming mode """ - if tbinfo['topo']['type'] not in ['t1', 't2']: + if tbinfo['topo']['type'] not in ['t1', 't2', 'lt2', 'ft2']: pytest.skip('Unsupported topology') if not setup['physical_interfaces']: @@ -1391,7 +1391,7 @@ def test_show_interfaces_neighbor_expected(setup, setup_config_mode, tbinfo, dut Checks whether 'show interfaces neighbor expected' lists the interface names as per the configured naming mode """ - if tbinfo['topo']['type'] not in ['t1', 't2']: + if tbinfo['topo']['type'] not in ['t1', 't2', 'lt2', 'ft2']: pytest.skip('Unsupported topology') dutHostGuest, mode, ifmode = setup_config_mode @@ -1441,7 +1441,7 @@ def test_show_interfaces_neighbor_expected(setup, setup_config_mode, tbinfo, dut ) -@pytest.mark.topology('t1', 't2') +@pytest.mark.topology('t1', 't2', 'lt2', 'ft2') class TestNeighbors(): @pytest.fixture(scope="class", autouse=True) @@ -1531,7 +1531,7 @@ def test_show_ndp(self, duthosts, enum_rand_one_per_hwsku_frontend_hostname, set ).format(addr, detail['interface'], ndp_output) -@pytest.mark.topology('t1', 't2') +@pytest.mark.topology('t1', 't2', 'lt2', 'ft2') class TestShowIP(): @pytest.fixture(scope="class", autouse=True)