From 4648194f6867ab891ae1c5a10c4799266c784c43 Mon Sep 17 00:00:00 2001 From: Austin Pham Date: Thu, 27 Mar 2025 18:50:24 +1100 Subject: [PATCH 1/2] chore: update platform Signed-off-by: Austin Pham --- tests/platform_tests/test_intf_fec.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/platform_tests/test_intf_fec.py b/tests/platform_tests/test_intf_fec.py index 1627acde7fe..5321dac920f 100644 --- a/tests/platform_tests/test_intf_fec.py +++ b/tests/platform_tests/test_intf_fec.py @@ -15,7 +15,8 @@ "mlnx_msn", "8101_32fh", "8111_32eh", - "arista" + "arista", + "x86_64-88_lc0_36fh_m-r0" ] SUPPORTED_SPEEDS = [ @@ -78,8 +79,12 @@ def test_config_fec_oper_mode(duthosts, enum_rand_one_per_hwsku_frontend_hostnam if fec_mode == "n/a": pytest.fail("FEC status is N/A for interface {}".format(intf)) - config_status = duthost.command("sudo config interface fec {} {}" - .format(intf, fec_mode)) + asic_cli_option = "" + if duthost.is_multi_asic: + asic_cli_option = duthost.get_port_asic_instance(intf).cli_ns_option + + config_status = duthost.command("sudo config interface {} fec {} {}" + .format(asic_cli_option, intf, fec_mode)) if config_status: pytest_assert(wait_until(30, 2, 0, duthost.is_interface_status_up, intf), "Interface {} did not come up after configuring FEC mode".format(intf)) @@ -177,7 +182,12 @@ def get_fec_histogram(duthost, intf_name): """ try: logging.info("Get output of 'show interfaces counters fec-histogram {}'".format(intf_name)) - fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram {}".format(intf_name)) + if duthost.is_multi_asic: + intf_asic = duthost.get_port_asic_instance(intf_name).namespace + fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram -n {} {}" + .format(intf_asic, intf_name)) + else: + fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram {}".format(intf_name)) except Exception as e: logging.error("Failed to execute 'show interfaces counters fec-histogram {}': {}".format(intf_name, e)) pytest.skip("Command 'show interfaces counters fec-histogram {}' not found \ From 500b9ba9b0fb6fd84b8867beb20c8713fae7f0f4 Mon Sep 17 00:00:00 2001 From: Austin Pham Date: Thu, 3 Apr 2025 12:27:24 +1100 Subject: [PATCH 2/2] chore: pr review Signed-off-by: Austin Pham --- tests/platform_tests/test_intf_fec.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/platform_tests/test_intf_fec.py b/tests/platform_tests/test_intf_fec.py index 5321dac920f..0224e5930c8 100644 --- a/tests/platform_tests/test_intf_fec.py +++ b/tests/platform_tests/test_intf_fec.py @@ -79,9 +79,7 @@ def test_config_fec_oper_mode(duthosts, enum_rand_one_per_hwsku_frontend_hostnam if fec_mode == "n/a": pytest.fail("FEC status is N/A for interface {}".format(intf)) - asic_cli_option = "" - if duthost.is_multi_asic: - asic_cli_option = duthost.get_port_asic_instance(intf).cli_ns_option + asic_cli_option = duthost.get_port_asic_instance(intf).cli_ns_option config_status = duthost.command("sudo config interface {} fec {} {}" .format(asic_cli_option, intf, fec_mode)) @@ -182,12 +180,9 @@ def get_fec_histogram(duthost, intf_name): """ try: logging.info("Get output of 'show interfaces counters fec-histogram {}'".format(intf_name)) - if duthost.is_multi_asic: - intf_asic = duthost.get_port_asic_instance(intf_name).namespace - fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram -n {} {}" - .format(intf_asic, intf_name)) - else: - fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram {}".format(intf_name)) + asic_cli_option = duthost.get_port_asic_instance(intf_name).cli_ns_option + fec_hist = duthost.show_and_parse("show interfaces counters fec-histogram {} {}".format(asic_cli_option, + intf_name)) except Exception as e: logging.error("Failed to execute 'show interfaces counters fec-histogram {}': {}".format(intf_name, e)) pytest.skip("Command 'show interfaces counters fec-histogram {}' not found \