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

sonic-mgmt / IXIA : T2 test to verify ECN Counter operation pre and post port state toggle #15586

Merged

Conversation

sreejithsreekumaran
Copy link
Contributor

Description of PR

Summary:
Fixes # (issue)

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?

MIGSMSFT-630 Add sonic-mgmt / IXIA test for cisco platforms to verify ECN Counter operation.

How did you do it?

Create two flows one for each lossless TC per Ixia port each at half of 99.98% rate

  • Inject traffic and read ECN Counters and verify it incremented.

  • flap the interface state (shut, wait for 0.2 seconds, no shut the interfaces of Ixia)

  • restart the traffic streams

  • verify that the ECN counters increment from the baseline value (new values read MUST NOT be zero)

How did you verify/test it?

Verified on T2 DUT setup

============================================================================================================================================ PASSES =============================================================================================================================================
____________________________________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_keys=single-dut-multi-asic] _____________________________________________________________________________________________________________
____________________________________________________________________________________________________________ test_ecn_marking_port_toggle[multidut_port_keys=single-dut-single-asic] ____________________________________________________________________________________________________________
---------------------------------------------------------------------------------------------------- generated xml file: /run_logs/ixia/17467/2024-11-15-16-20-28/tr_2024-11-15-16-20-28.xml ----------------------------------------------------------------------------------------------------
INFO:root:Can not get Allure report URL. Please check logs
------------------------------------------------------------------------------------------------------------------------------------ live log sessionfinish -------------------------------------------------------------------------------------------------------------------------------------
16:34:46 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
==================================================================================================================================== short test summary info ====================================================================================================================================
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_keys=single-dut-multi-asic]
PASSED snappi_tests/multidut/ecn/test_multidut_ecn_marking_with_snappi.py::test_ecn_marking_port_toggle[multidut_port_keys=single-dut-single-asic]
=========================================================================================================================== 2 passed, 5 warnings in 856.18s (0:14:16) ==========================================================================================================================

Any platform specific information?

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

Documentation

@sreejithsreekumaran
Copy link
Contributor Author

@sdszhang
Copy link
Contributor

@abdosi can you help to review this one? Thanks.

flow4_ecn = post_ctr_4['SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS'] -\
init_ctr_4['SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS']

pytest_assert(flow3_ecn > 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

is flow3_ecn > 0 enough? Do we expect a percentage of packets to be marked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this specific port toggle test case, we are only making sure the ECN marking is happening.

We will have separate test to check the percentage of marking probably based on DWRR.

@abdosi
Copy link
Contributor

abdosi commented Nov 26, 2024

@sreejithsreekumaran : please resolve conflict.

@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...........................................(no files to check)Skipped
check for added large files..............................................Passed
check python ast.........................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

tests/snappi_tests/multidut/ecn/files/multidut_helper.py:74:1: E302 expected 2 blank lines, found 1
tests/snappi_tests/multidut/ecn/files/multidut_helper.py:150:1: E302 expected 2 blank lines, found 1
tests/snappi_tests/multidut/ecn/files/multidut_helper.py:311:1: E302 expected 2 blank lines, found 1
tests/snappi_tests/multidut/ecn/files/multidut_helper.py:330:1: F811 redefinition of unused 'toggle_dut_port_state' from line 311
tests/snappi_tests/multidut/ecn/files/multidut_helper.py:330:1: E302 expected 2 blank lines, found 1
tests/snappi_tests/multidut/ecn/files/multidut_helper.py:509:1: E302 expected 2 blank lines, found 1

flake8...............................................(no files to check)Skipped
check conditional mark sort..........................(no files to check)Skipped

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>

@abdosi abdosi merged commit 037f80a into sonic-net:master Nov 26, 2024
16 checks passed
@mssonicbld
Copy link
Collaborator

@sreejithsreekumaran PR conflicts with 202405 branch

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Nov 27, 2024
…re and post port state toggle (sonic-net#15586)

[cisco] sonic-mgmt / IXIA : T2 test to verify ECN Counter operation pre and post port state toggle
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #15763

mssonicbld pushed a commit that referenced this pull request Nov 27, 2024
…re and post port state toggle (#15586)

[cisco] sonic-mgmt / IXIA : T2 test to verify ECN Counter operation pre and post port state toggle
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.

6 participants