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

Full Mesh Traffic Sanity verification #11968

Merged

Conversation

sreejithsreekumaran
Copy link
Contributor

@sreejithsreekumaran sreejithsreekumaran commented Mar 13, 2024

Description of PR

Summary:
Fixes # (issue)

A test to check reachability from any source port to any destination port in the device for each traffic class.

Type of change

New test case to verify traffic sanity

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

Back port request

  • 201911
  • 202012
  • 202205
  • 202305
  • 202311

Approach

What is the motivation for this PR?

How did you do it?

ptf64 topology is used to have 64 ports of the DUT connected
to 64 PTF ports.

How did you verify/test it?

Ran the test on a T1 ptf-64 topology

Any platform specific information?

This is a Cisco specific test case

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

Documentation

from all src to all dst port pair.

After all src inject traffic to a given dst, queue counters are verified
for any drop
Fixed a bug in longest prefix match in conditional_mark
Added conditional mark to skip if not ptf64 topo
@alpeshspatel
Copy link
Contributor

@kevinwangsk FYI

@kevinskwang
Copy link
Collaborator

@sreejithsreekumaran pls upload the test results based on your branch full_mesh_traffic_sanity

@sreejithsreekumaran
Copy link
Contributor Author

@sreejithsreekumaran pls upload the test results based on your branch full_mesh_traffic_sanity

Below is the snippet from the log file. I am attaching the run logs as well as the ptf logs

[WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details
collected 3 items

qos/test_qos_sai.py::TestQosSai::testQosSaiFullMeshTrafficSanity[single_asic-None] PASSED [ 33%]
qos/test_qos_sai.py::TestQosSai::testQosSaiFullMeshTrafficSanity[single_dut_multi_asic-None] SKIPPED (Did not find any frontend node that is multi-asic - s...) [ 66%]
qos/test_qos_sai.py::TestQosSai::testQosSaiFullMeshTrafficSanity[multi_dut-None] SKIPPED (Don't have 2 frontend nodes - so can't run multi_dut tests) [100%]

========================================================================== warnings summary ===========================================================================
../../usr/local/lib/python3.8/dist-packages/_yaml/init.py:18
/usr/local/lib/python3.8/dist-packages/_yaml/init.py:18: DeprecationWarning: The _yaml extension module is now located at yaml._yaml and its location is subject to change. To use the LibYAML-based parser and emitter, import from yaml: from yaml import CLoader as Loader, CDumper as Dumper.
warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------- generated xml file: /run_logs/sree/tr_2024-03-21-11-21-09.xml ----------------------------------------------------
======================================================================= short test summary info =======================================================================
SKIPPED [1] qos/qos_sai_base.py:613: Did not find any frontend node that is multi-asic - so can't run single_dut_multi_asic tests
SKIPPED [1] qos/qos_sai_base.py:623: Don't have 2 frontend nodes - so can't run multi_dut tests
======================================================== 1 passed, 2 skipped, 1 warning in 4578.74s (1:16:18) =========================================================
INFO:root:Can not get Allure report URL. Please check logs

full_mesh_ptf_logs.tar.gz
fullmesh_run_log.tar.gz

@sreejithsreekumaran
Copy link
Contributor Author

@kevinskwang please suggest the next step. Further, can you please resolve the conflicts?

skip:
reason: "Unsupported testbed type."
conditions:
- "topo_name not in ['ptf64'] and asic_type in ['cisco-8000']"
Copy link
Collaborator

Choose a reason for hiding this comment

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

From your code here, the case should be skipped if asic type is cisco-8000, how you get the test result you posted?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinskwang the case will be skipped only if it's not a ptf64 topology and asic-type is cisco-8000. The test result is posted from a testbed having ptf64 topology and asic_type is cisco-8000

Copy link
Collaborator

Choose a reason for hiding this comment

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

can this case to be used by other platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes it can be used by other platforms as long as it is from Cisco.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No, I mean other platform, like broadcom. mellanox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. I got it now. Yes, it's written currently for Cisco platform only.

I have fixed the condition to skip for other platforms too.

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/saitests/py3/sai_qos_tests.py:1647:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1658:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1662:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1686:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1697:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1701:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1721:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1732:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1736:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1755:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1762:35: E275 missing whitespace after keyword
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@mssonicbld
Copy link
Collaborator

The pre-commit check detected issues in the files touched by this pull request.
The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results:
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...............................................................Passed
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/saitests/py3/sai_qos_tests.py:1647:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1658:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1662:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1686:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1697:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1701:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1721:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1732:27: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1736:23: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1755:19: E275 missing whitespace after keyword
tests/saitests/py3/sai_qos_tests.py:1762:35: E275 missing whitespace after keyword
...
[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@sreejithsreekumaran
Copy link
Contributor Author

sreejithsreekumaran commented May 13, 2024

The pre-commit check detected issues in the files touched by this pull request. The pre-commit check is a mandatory check, please fix detected issues.

Detailed pre-commit check results: trim trailing whitespace.................................................Passedfix end of files.........................................................Passedcheck yaml...............................................................Passedcheck for added large files..............................................Passedcheck python ast.........................................................Passedflake8...................................................................Failed- hook id: flake8- exit code: 1tests/saitests/py3/sai_qos_tests.py:1647:19: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1658:27: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1662:23: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1686:19: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1697:27: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1701:23: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1721:19: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1732:27: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1736:23: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1755:19: E275 missing whitespace after keywordtests/saitests/py3/sai_qos_tests.py:1762:35: E275 missing whitespace after keyword...[truncated extra lines, please run pre-commit locally to view full check results]

To run the pre-commit checks locally, you can follow below steps:

  1. Ensure that default python is python3. In sonic-mgmt docker container, default python is python2. You can run
    the check by activating the python3 virtual environment in sonic-mgmt docker container or outside of sonic-mgmt
    docker container.
  2. Ensure that the pre-commit package is installed:
sudo pip install pre-commit
  1. Go to repository root folder
  2. Install the pre-commit hooks:
pre-commit install
  1. Use pre-commit to check staged file:
pre-commit
  1. Alternatively, you can check committed files using:
pre-commit run --from-ref <commit_id> --to-ref <commit_id>

@kevinskwang these pre-commit warnings are from lines which are part of PR #9896. Looks like the rules have changed from then to now.

@kevinskwang
Copy link
Collaborator

could you resolve the conflicts?

kevinskwang
kevinskwang previously approved these changes May 30, 2024
@sreejithsreekumaran
Copy link
Contributor Author

could you resolve the conflicts?

@kevinskwang I have resolved the conflict. Please re-approve and do the needful.

@kevinskwang kevinskwang merged commit eaba25d into sonic-net:master Jun 14, 2024
16 checks passed
@mssonicbld
Copy link
Collaborator

@sreejithsreekumaran PR conflicts with 202311 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 17, 2024
* Added testcase to run traffic in full mesh
from all src to all dst port pair.

After all src inject traffic to a given dst, queue counters are verified
for any drop

* Removed the unwanted Try block
Fixed a bug in longest prefix match in conditional_mark
Added conditional mark to skip if not ptf64 topo

* Made adding static routes a pytest fixture

* Added fixture to configure ip on ptf interfaces while using PTF64 topo

* Changed to skip for all platforms except Cisco

* flake8 issues reported from changes in PR 9896
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14604

mssonicbld pushed a commit that referenced this pull request Sep 17, 2024
* Added testcase to run traffic in full mesh
from all src to all dst port pair.

After all src inject traffic to a given dst, queue counters are verified
for any drop

* Removed the unwanted Try block
Fixed a bug in longest prefix match in conditional_mark
Added conditional mark to skip if not ptf64 topo

* Made adding static routes a pytest fixture

* Added fixture to configure ip on ptf interfaces while using PTF64 topo

* Changed to skip for all platforms except Cisco

* flake8 issues reported from changes in PR 9896
sreejithsreekumaran added a commit to sreejithsreekumaran/sonic-mgmt that referenced this pull request Sep 20, 2024
* Added testcase to run traffic in full mesh
from all src to all dst port pair.

After all src inject traffic to a given dst, queue counters are verified
for any drop

* Removed the unwanted Try block
Fixed a bug in longest prefix match in conditional_mark
Added conditional mark to skip if not ptf64 topo

* Made adding static routes a pytest fixture

* Added fixture to configure ip on ptf interfaces while using PTF64 topo

* Changed to skip for all platforms except Cisco

* flake8 issues reported from changes in PR 9896
@sreejithsreekumaran
Copy link
Contributor Author

ptf64 topology is used to have 64 ports of the DUT connected
to 64 PTF ports.

@kevinskwang raised PR #14678

kenneth-arista added a commit to kenneth-arista/sonic-mgmt that referenced this pull request Sep 26, 2024
kevinskwang pushed a commit that referenced this pull request Sep 29, 2024
wangxin pushed a commit that referenced this pull request Oct 10, 2024
…arks (#14912)

What is the motivation for this PR?
As part of #11968, a bugfix was introduced in the find_longest_matches function to identify only the longest matching entry in tests_mark_conditions.yaml.

The previous bug led to incorrect behavior in finding the matching entries, deviating from our intended logic before:

Our expected behavior was to retrieve only the longest matching entry and evaluate the conditions under this single, unique entry.
Instead, the bug caused the function to retrieve all entries matching the test case prefix, evaluating conditions from all matching entries.
This resulted in an unintended situation where conditions from shorter matching entries which are absent in the longest one would still be considered during evaluation.
In PR #14395, we optimized the logic for finding marks in conditional marking. Now, although we will retrieve all entries matching the test case prefix but only the longest matching entry is evaluated if the mark is identical across all matching entries, which aligns with our original expectations. Additionally, conditions that exist only in shorter matching entries with the same mark are now ignored. To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.

How did you do it?
To maintain consistency with previous behavior(although unexpected), we have added these conditions to the longer matching entry.
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.

5 participants