diff --git a/tests/macsec/macsec_config_helper.py b/tests/macsec/macsec_config_helper.py index e080f05da79..4e793c9c6ed 100644 --- a/tests/macsec/macsec_config_helper.py +++ b/tests/macsec/macsec_config_helper.py @@ -88,14 +88,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)) @@ -110,14 +113,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))