Skip to content

Commit 7ec22e0

Browse files
abdosimssonicbld
authored andcommitted
Macsec fix for portchannel workaround only for Broadcom dnx platforms (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.
1 parent 82332ce commit 7ec22e0

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
@@ -88,14 +88,17 @@ def enable_macsec_port(host, port, profile_name):
8888
return
8989

9090
pc = find_portchannel_from_member(port, get_portchannel(host))
91-
if pc:
91+
92+
dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx'
93+
94+
if dnx_platform and pc:
9295
host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port))
9396
time.sleep(2)
9497

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

98-
if pc:
101+
if dnx_platform and pc:
99102
time.sleep(2)
100103
host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port))
101104

@@ -110,14 +113,16 @@ def disable_macsec_port(host, port):
110113
return
111114

112115
pc = find_portchannel_from_member(port, get_portchannel(host))
113-
if pc:
116+
dnx_platform = host.facts.get("platform_asic") == 'broadcom-dnx'
117+
118+
if dnx_platform and pc:
114119
host.command("sudo config portchannel {} member del {} {}".format(getns_prefix(host, port), pc["name"], port))
115120
time.sleep(2)
116121

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

120-
if pc:
125+
if dnx_platform and pc:
121126
time.sleep(2)
122127
host.command("sudo config portchannel {} member add {} {}".format(getns_prefix(host, port), pc["name"], port))
123128

0 commit comments

Comments
 (0)