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

Add new test for generic hash feature #10538

Closed
wants to merge 1 commit into from

Conversation

congh-nvidia
Copy link
Contributor

Description of PR

Summary:
Add nine test cases according to test plan:
https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/Generic-Hash-test-plan.md
For now, the test contains the validation for hash fields IN_PORT, SRC_MAC, DST_MAC, ETHERTYPE, VLAN_ID, L4_SRC_PORT, L4_DST_PORT, IP_PROTOCOL, INNER_SRC_IP, INNER_DST_IP. Test for other field will be added in future.
The test covers IPv4 and IPv6, vxlan/nvgre/ipinip encapsulations.
By default, the test is executed in random mode, the test parameters(including hash filed, ip version, encapsulation, reboot type) are generated randomly. The parameters can also be specified by pytest options.

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305

Approach

What is the motivation for this PR?

Add new test for generic hash feature.

How did you do it?

How did you verify/test it?

Run test on Nvidia testbeds.

Any platform specific information?

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

Documentation

@@ -2317,6 +2317,17 @@ def links_status_up(self, ports):
logging.info("Interface {} is up on {}".format(output_port, self.hostname))
return True

def interface_status_up(self, interface):
Copy link
Contributor

Choose a reason for hiding this comment

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

**is_**interface_status_up would be more clear

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


def pytest_addoption(parser):
parser.addoption("--hash_field", action="store", default="random",
help="The hash field to test, can be 'all', 'random' or a designated one")
Copy link
Contributor

Choose a reason for hiding this comment

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

is it possible to list all the available ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Add nine test cases according to test plan:
https://github.com/sonic-net/sonic-mgmt/blob/master/docs/testplan/Generic-Hash-test-plan.md

6 files added/updated:
conftest.py: the conftest for generic hash test
generic_hash_test.py: the ptf test file
sonic.py: add functions for generic hash cli
generic_hash_helper.py: helper file of the test
test_generic_hash.py: pytest file of the test
test_pretest.py: update the metadata to store the global hash capabilities of the dut
@congh-nvidia
Copy link
Contributor Author

congh-nvidia commented Dec 7, 2023

Since the Hash Algorithm feature has been merged to master, we need to align the test with it. This part of work is being handled by @echuawu. Close this draft and Chuan will open a new one based on this.

@congh-nvidia congh-nvidia deleted the generic_hash branch October 17, 2024 02:59
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.

2 participants