Skip to content

SAI validation#15324

Merged
qiluo-msft merged 64 commits intosonic-net:masterfrom
opcoder0:feat/sai-validation
May 23, 2025
Merged

SAI validation#15324
qiluo-msft merged 64 commits intosonic-net:masterfrom
opcoder0:feat/sai-validation

Conversation

@opcoder0
Copy link
Copy Markdown
Contributor

@opcoder0 opcoder0 commented Nov 1, 2024

Description of PR

  • Introduces a new method to access SONiC Redis database instance using gNMI instead of relying on sonic-db-cli.
  • It interacts with sonic-gnmi using standard gNMI API (get, set, subscribe) to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
  • Adds changes to perform SAI validation for ACL tests.
  • Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Summary:
Fixes # Not applicable

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Back port request

  • 202012
  • 202205
  • 202305
  • 202311
  • 202405

Approach

What is the motivation for this PR?

Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?

Refer to description above.

How did you verify/test it?

Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.

Any platform specific information?

No

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

NA

Documentation

TBD.

@opcoder0 opcoder0 marked this pull request as ready for review November 4, 2024 05:44
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

qiluo-msft
qiluo-msft previously approved these changes May 16, 2025
@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).

@qiluo-msft qiluo-msft enabled auto-merge (squash) May 22, 2025 18:03
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft merged commit 98a8487 into sonic-net:master May 23, 2025
17 checks passed
@honllum
Copy link
Copy Markdown
Contributor

honllum commented May 26, 2025

Hi @qiluo-msft ,
It seems with this commit, running test will throw away any uncommitted diff (similar to the effect of 'git stash') in local WS.

@opcoder0
Copy link
Copy Markdown
Contributor Author

Hi @qiluo-msft , It seems with this commit, running test will throw away any uncommitted diff (similar to the effect of 'git stash') in local WS.

Hi @honllum - I checked by running tests in my local environment from current HEAD (2aafdaf2) on master and found things are working as expected. I didn't see my uncommitted files being removed / stashed. Can you please re-check. If the issue persists, please open an issue with all the details (environment details, test that was executed, logs etc.).

bachalla pushed a commit to bachalla/sonic-mgmt that referenced this pull request Jun 2, 2025
Description of PR
Introduces a new method to access SONiC Redis database instance using redis-py native Python library instead of relying on sonic-db-cli.
It also uses the Redis' pub-sub infrastructure to listen to key-space notifications to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
Adds changes to perform SAI validation for ACL tests.
Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Approach
What is the motivation for this PR?
Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?
Refer to description above.

How did you verify/test it?
Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.
@JibinBao
Copy link
Copy Markdown
Contributor

Hi @opcoder0 ,
It looks like the PR will cause running ptfhost.shell() and duthost.shell() stuck.
Can you please check the ticket: #19519

opcoder0 added a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
Description of PR
Introduces a new method to access SONiC Redis database instance using redis-py native Python library instead of relying on sonic-db-cli.
It also uses the Redis' pub-sub infrastructure to listen to key-space notifications to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
Adds changes to perform SAI validation for ACL tests.
Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Approach
What is the motivation for this PR?
Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?
Refer to description above.

How did you verify/test it?
Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.

Signed-off-by: opcoder0 <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
Description of PR
Introduces a new method to access SONiC Redis database instance using redis-py native Python library instead of relying on sonic-db-cli.
It also uses the Redis' pub-sub infrastructure to listen to key-space notifications to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
Adds changes to perform SAI validation for ACL tests.
Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Approach
What is the motivation for this PR?
Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?
Refer to description above.

How did you verify/test it?
Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
Description of PR
Introduces a new method to access SONiC Redis database instance using redis-py native Python library instead of relying on sonic-db-cli.
It also uses the Redis' pub-sub infrastructure to listen to key-space notifications to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
Adds changes to perform SAI validation for ACL tests.
Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Approach
What is the motivation for this PR?
Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?
Refer to description above.

How did you verify/test it?
Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
Description of PR
Introduces a new method to access SONiC Redis database instance using redis-py native Python library instead of relying on sonic-db-cli.
It also uses the Redis' pub-sub infrastructure to listen to key-space notifications to monitor DB changes instead of using the traditional wait_until which performs sleep->check cycle.
Adds changes to perform SAI validation for ACL tests.
Uses this library to monitor STATE_DB changes using the new notification library in test_bfd.py::test_bfd_basic.

Approach
What is the motivation for this PR?
Motivation is to add a simple and easy to use library that allows tests (where applicable) to perform SAI validation and allow tests to use event notification-based method to monitor DB changes.

How did you do it?
Refer to description above.

How did you verify/test it?
Verified ACL tests (on t0) and BFD basic tests (on t1) testbeds.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants