Skip to content

Commit 8d2c936

Browse files
authored
Macsec fix for portchannel workaround only for Broadcom dnx platforms (#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.
1 parent fe078a1 commit 8d2c936

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

tests/macsec/macsec_config_helper.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,17 @@ def enable_macsec_port(host, port, profile_name):
9393
return
9494

9595
pc = find_portchannel_from_member(port, get_portchannel(host))
96-
if pc:
96+
97+
dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx'
98+
99+
if dnx_platform and pc:
97100
host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port))
98101
time.sleep(2)
99102

100103
cmd = "sonic-db-cli {} CONFIG_DB HSET 'PORT|{}' 'macsec' '{}'".format(getns_prefix(host, port), port, profile_name)
101104
host.command(cmd)
102105

103-
if pc:
106+
if dnx_platform and pc:
104107
time.sleep(2)
105108
host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port))
106109

@@ -116,14 +119,16 @@ def disable_macsec_port(host, port):
116119
return
117120

118121
pc = find_portchannel_from_member(port, get_portchannel(host))
119-
if pc:
122+
dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx'
123+
124+
if dnx_platform and pc:
120125
host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port))
121126
time.sleep(2)
122127

123128
cmd = "sonic-db-cli {} CONFIG_DB HDEL 'PORT|{}' 'macsec'".format(getns_prefix(host, port), port)
124129
host.command(cmd)
125130

126-
if pc:
131+
if dnx_platform and pc:
127132
time.sleep(2)
128133
host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port))
129134

0 commit comments

Comments
 (0)