diff --git a/tests/macsec/macsec_config_helper.py b/tests/macsec/macsec_config_helper.py index 620ba150699..e1271b64643 100644 --- a/tests/macsec/macsec_config_helper.py +++ b/tests/macsec/macsec_config_helper.py @@ -93,14 +93,17 @@ def enable_macsec_port(host, port, profile_name): return pc = find_portchannel_from_member(port, get_portchannel(host)) - if pc: + + dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx' + + if dnx_platform and pc: host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port)) time.sleep(2) cmd = "sonic-db-cli {} CONFIG_DB HSET 'PORT|{}' 'macsec' '{}'".format(getns_prefix(host, port), port, profile_name) host.command(cmd) - if pc: + if dnx_platform and pc: time.sleep(2) host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port)) @@ -116,14 +119,16 @@ def disable_macsec_port(host, port): return pc = find_portchannel_from_member(port, get_portchannel(host)) - if pc: + dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx' + + if dnx_platform and pc: host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port)) time.sleep(2) cmd = "sonic-db-cli {} CONFIG_DB HDEL 'PORT|{}' 'macsec'".format(getns_prefix(host, port), port) host.command(cmd) - if pc: + if dnx_platform and pc: time.sleep(2) host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port))