Skip to content

Commit

Permalink
Macsec fix for portchannel workaround only for Broadcom dnx platforms (
Browse files Browse the repository at this point in the history
…sonic-net#10732)

What I did:
macsec workaround for portchannel as define here sonic-net/sonic-swss#2286 applies only to dnx platforms.

This workaround causes failure of macsec bgp protocol testcase on platforms that does not need this workaround.

How I verify:

Test case passes after this change.
  • Loading branch information
abdosi authored and mssonicbld committed Nov 20, 2023
1 parent 92087f5 commit b010144
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/macsec/macsec_config_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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))

Expand Down

0 comments on commit b010144

Please sign in to comment.