Skip to content

[GCU E2E test] add stop pfcwd test #7308

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

Merged
merged 9 commits into from
Feb 1, 2023

Conversation

isabelmsft
Copy link
Contributor

@isabelmsft isabelmsft commented Jan 20, 2023

Description of PR

Summary:
Fixes # (issue)

Type of change

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

Back port request

  • 201911
  • 202012
  • 202205

Approach

What is the motivation for this PR?

Add GCU E2E test for case where we stop pfcwd on specific port

How did you do it?

How did you verify/test it?

Run E2E test on physical DUT

generic_config_updater/test_pfcwd_interval.py::test_stop_pfcwd PASSED    [ 11%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[True-existing-add] PASSED [ 22%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[True-existing-replace] PASSED [ 33%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[True-nonexistent-add] PASSED [ 44%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[True-nonexistent-replace] PASSED [ 55%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[False-existing-add] PASSED [ 66%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[False-existing-replace] PASSED [ 77%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[False-nonexistent-add] PASSED [ 88%]
generic_config_updater/test_pfcwd_interval.py::test_pfcwd_interval_config_updates[False-nonexistent-replace] PASSED [100%]

Any platform specific information?

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

Documentation

qiluo-msft
qiluo-msft previously approved these changes Jan 21, 2023
Comment on lines +133 to +156
json_patch = [
{
"op": "remove",
"path": "/PFC_WD/{}/detection_time".format(interface),
},
{
"op": "remove",
"path": "/PFC_WD/{}/restoration_time".format(interface),
},
{
"op": "remove",
"path": "/PFC_WD/{}/action".format(interface)
}
]

try:
tmpfile = generate_tmpfile(duthost)
output = apply_patch(duthost, json_data=json_patch, dest_file=tmpfile)
expect_op_success(duthost, output)
pfcwd_updated_config = duthost.shell("show pfcwd config")
pytest_assert(not pfcwd_config['rc'], "Unable to read updated pfcwd config")
pytest_assert(interface not in pfcwd_updated_config['stdout'].split(), "pfcwd unexpectedly still running on interface {}".format(interface))
finally:
delete_tmpfile(duthost, tmpfile)
Copy link
Contributor

Choose a reason for hiding this comment

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

this whole code needs to be indented. Needs to move under the 'for' block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test only intends to test one interface, as the flow would be the same for all interfaces. I added a break statement to the for loop to stop once the first interface is identified for test

@isabelmsft isabelmsft merged commit 9cdc4fc into sonic-net:master Feb 1, 2023
kellyyeh pushed a commit to kellyyeh/sonic-mgmt that referenced this pull request Mar 31, 2023
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