Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ptftest] Add p4_dash_utils #640

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

jimmyzhai
Copy link
Collaborator

@jimmyzhai jimmyzhai commented Nov 5, 2024

This PR adds a module p4_dash_utils to include helper functions for p4 pipeline.

  • Function set_internal_config aims to update pipeline internal configuration, neighbor mac, data port mac, cpu port mac, etc.
  • Decorator use_flow aims to enable flow lookup stage in p4 pipeline. It wrappers method setUp/tearDown of test class.

@jimmyzhai jimmyzhai requested a review from r12f November 5, 2024 12:53
@KrisNey-MSFT
Copy link
Collaborator

Author used P4 runtime directly to add a fixture to add underlay routing
PTF not using .py tests, so we will add more of a description and example
fyi SAI Challenger uses .py test

stub.Write(req)


def use_flow(cls):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better make it more generic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add general function set_internal_config.

@@ -0,0 +1,115 @@
import grpc
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better add 1 example to show how to use it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Demo the use of set_internal_config in saidashvnet_sanity.py.

@jimmyzhai jimmyzhai changed the title [ptftest] Add decorator use_flow for test case fixture setUp/tearDown [ptftest] Add p4_dash_utils Nov 14, 2024
@jimmyzhai jimmyzhai requested a review from r12f November 14, 2024 02:23
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.

3 participants