Skip to content

Commit 72b2747

Browse files
okaravasiselldinesh
authored andcommitted
Adding namespace in config interface command for multi-asic support (sonic-net#20448)
Summary: Fixes sonic-net#23847 How did you verify/test it? RAn test generic_config_updater.test_eth_interface::test_replace_fec Signed-off-by: selldinesh <dinesh.sellappan@keysight.com>
1 parent 4cd654e commit 72b2747

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/generic_config_updater/test_eth_interface.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def test_replace_fec(duthosts, rand_one_dut_front_end_hostname, ensure_dut_readi
298298
duthost = duthosts[rand_one_dut_front_end_hostname]
299299
asic_namespace = None if enum_rand_one_frontend_asic_index is None else \
300300
'asic{}'.format(enum_rand_one_frontend_asic_index)
301+
namespace_prefix = '' if asic_namespace is None else '-n ' + asic_namespace
301302
intf_init_status = duthost.get_interfaces_status()
302303
port = get_ethernet_port_not_in_portchannel(duthost, namespace=asic_namespace)
303304
json_patch = [
@@ -322,7 +323,7 @@ def test_replace_fec(duthosts, rand_one_dut_front_end_hostname, ensure_dut_readi
322323

323324
# The rollback after the test cannot revert the fec, when fec is not configured in config_db.json
324325
if intf_init_status[port].get("fec", "N/A") == "N/A":
325-
out = duthost.command("config interface fec {} none".format(port))
326+
out = duthost.command("config interface {} fec {} none".format(namespace_prefix, port))
326327
pytest_assert(out["rc"] == 0, "Failed to set {} fec to none. Error: {}".format(port, out["stderr"]))
327328
else:
328329
expect_op_failure(output)

0 commit comments

Comments
 (0)