Skip to content

Testcase and pipeline updates for supporting nightly run with macsec enabled topology.#17087

Merged
judyjoseph merged 27 commits intosonic-net:masterfrom
judyjoseph:macsec_nightly_run_fixes
May 15, 2025
Merged

Testcase and pipeline updates for supporting nightly run with macsec enabled topology.#17087
judyjoseph merged 27 commits intosonic-net:masterfrom
judyjoseph:macsec_nightly_run_fixes

Conversation

@judyjoseph
Copy link
Copy Markdown
Contributor

@judyjoseph judyjoseph commented Feb 21, 2025

What is the motivation for this PR?

This PR has a set of fixes during the macsec nightly run.

How did you do it?

Following are the changes

  1. Add the macsec.py to the acstests so that the tests which depends on this folder eg: lag_test.py passes

  2. updates in ptftests/macsec.py, macsec/macsec_helper.py to handle the following

    macsec_send() API should handle case when caller passes a packet count

  3. Add "import macsec.py" to all py3/* tests so that we get the global variable defined in ptftests/macsec.py

  4. tests/acl/test_acl.py, force reload the masec key to make sure we get the updated macsec keys. This was needed as in acl testsuite there are cases when one of the test reboots the linecard, the following test will fail if we use the old key which is stored.

  5. tests/acl/test_acl.py, skip the egress ACLI tests when macsec is enabled on topology - with broadcom DNX ASIC. since there is limitation in number of egress ACL groups (CS00012393192)

  6. if the pipeline is run with enable-macsec option, use the override option always when load_minigraph is called to make sure we use the MACSEC_PROFILE defined in golden config

  7. Remove autouse from macsec_setup() as the macsec sessions are already setup with add-topo and deploy-mg commands. So no need to setup here. Instead we set the auto_use=true to function load_macsec_info() which will make sure the macsec info is loaded

  8. Add macsec.py in saitests/ dir. This is needed for qos testcases.

Outstanding issue:
I am still not able to pass a few tests in qos, and all copp tests where we have to send packets at a high rate. macsec_Send() function cannot send frames at a high rate since it does scapy.encap and scapy.encrypt. Need to find a solution.

How did you verify/test it?

The entire pipeline was run with the option "-e enable_macsec=True -e macsec_profile=MACSEC_PROFILE " with a good pass rate.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Pull request contains merge conflicts.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Pull request contains merge conflicts.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@judyjoseph judyjoseph force-pushed the macsec_nightly_run_fixes branch from 4967786 to 4fbc9b3 Compare February 28, 2025 02:06
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

abdosi
abdosi previously approved these changes May 9, 2025
@judyjoseph
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@judyjoseph judyjoseph requested a review from abdosi May 13, 2025 03:08
@judyjoseph
Copy link
Copy Markdown
Contributor Author

judyjoseph commented May 13, 2025

Resolved a conflict with master branch, I am keeping change in master branch itself

@judyjoseph
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@judyjoseph
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@judyjoseph judyjoseph enabled auto-merge (squash) May 15, 2025 14:44
@judyjoseph judyjoseph merged commit c4561f9 into sonic-net:master May 15, 2025
17 checks passed
arlakshm pushed a commit to Azure/sonic-mgmt.msft that referenced this pull request Jun 24, 2025
This PR is to cherry-pick macsec changes done in master to get the
macsec nightly pipeline run.

Below are the commits included.

sonic-net/sonic-mgmt#15905
sonic-net/sonic-mgmt#16048
sonic-net/sonic-mgmt#16978
sonic-net/sonic-mgmt#17087

---------

Co-authored-by: Tejaswini Chadaga <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…enabled topology. (sonic-net#17087)

* Fixes found during nightly run with macsec enabled topology
* Ffix for copp pfc voq ptftests
* Fix the port_number to port_id things again
* Fixes for acl tests, changes in config reload to pass override option if macsec is anebled, introduce the force_reload option if we need to reload macsec config for a port
* Fixes to get generate_golden_config work when this run for a non macsec case in t2 topo
* Add macsec support in acstests and saitests
* Loop for count of packets to be sent as we need to increment PN
* We need to import macsec to override send_packet and dp_poll
* Changes moved to a different PR : sonic-net#17530
* Remove redundant macsec.py files - make it all point to ansible/roles/test/files/ptftests/macsec.py
* Take care of T0 macsec tests as well, so that t0-sonic is fine
* Additional fix to support multiple profile names given as input
* Use the right command KEYS instead of HGET
* Update comment, use macsec_card to set MacSecEnabled in DeviceMetadata
* Skip ACL egress tests when run on macsec enabled toplogy with braodcom DNX

Signed-off-by: opcoder0 <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…enabled topology. (sonic-net#17087)

* Fixes found during nightly run with macsec enabled topology
* Ffix for copp pfc voq ptftests
* Fix the port_number to port_id things again
* Fixes for acl tests, changes in config reload to pass override option if macsec is anebled, introduce the force_reload option if we need to reload macsec config for a port
* Fixes to get generate_golden_config work when this run for a non macsec case in t2 topo
* Add macsec support in acstests and saitests
* Loop for count of packets to be sent as we need to increment PN
* We need to import macsec to override send_packet and dp_poll
* Changes moved to a different PR : sonic-net#17530
* Remove redundant macsec.py files - make it all point to ansible/roles/test/files/ptftests/macsec.py
* Take care of T0 macsec tests as well, so that t0-sonic is fine
* Additional fix to support multiple profile names given as input
* Use the right command KEYS instead of HGET
* Update comment, use macsec_card to set MacSecEnabled in DeviceMetadata
* Skip ACL egress tests when run on macsec enabled toplogy with braodcom DNX

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…enabled topology. (sonic-net#17087)

* Fixes found during nightly run with macsec enabled topology
* Ffix for copp pfc voq ptftests
* Fix the port_number to port_id things again
* Fixes for acl tests, changes in config reload to pass override option if macsec is anebled, introduce the force_reload option if we need to reload macsec config for a port
* Fixes to get generate_golden_config work when this run for a non macsec case in t2 topo
* Add macsec support in acstests and saitests
* Loop for count of packets to be sent as we need to increment PN
* We need to import macsec to override send_packet and dp_poll
* Changes moved to a different PR : sonic-net#17530
* Remove redundant macsec.py files - make it all point to ansible/roles/test/files/ptftests/macsec.py
* Take care of T0 macsec tests as well, so that t0-sonic is fine
* Additional fix to support multiple profile names given as input
* Use the right command KEYS instead of HGET
* Update comment, use macsec_card to set MacSecEnabled in DeviceMetadata
* Skip ACL egress tests when run on macsec enabled toplogy with braodcom DNX

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…enabled topology. (sonic-net#17087)

* Fixes found during nightly run with macsec enabled topology
* Ffix for copp pfc voq ptftests
* Fix the port_number to port_id things again
* Fixes for acl tests, changes in config reload to pass override option if macsec is anebled, introduce the force_reload option if we need to reload macsec config for a port
* Fixes to get generate_golden_config work when this run for a non macsec case in t2 topo
* Add macsec support in acstests and saitests
* Loop for count of packets to be sent as we need to increment PN
* We need to import macsec to override send_packet and dp_poll
* Changes moved to a different PR : sonic-net#17530
* Remove redundant macsec.py files - make it all point to ansible/roles/test/files/ptftests/macsec.py
* Take care of T0 macsec tests as well, so that t0-sonic is fine
* Additional fix to support multiple profile names given as input
* Use the right command KEYS instead of HGET
* Update comment, use macsec_card to set MacSecEnabled in DeviceMetadata
* Skip ACL egress tests when run on macsec enabled toplogy with braodcom DNX

Signed-off-by: Guy Shemesh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants