Skip to content

[QoS] PFC test cases#2599

Merged
neethajohn merged 14 commits intosonic-net:masterfrom
baiwei0427:pfc-test-dev
Dec 15, 2020
Merged

[QoS] PFC test cases#2599
neethajohn merged 14 commits intosonic-net:masterfrom
baiwei0427:pfc-test-dev

Conversation

@baiwei0427
Copy link
Copy Markdown
Contributor

@baiwei0427 baiwei0427 commented Nov 29, 2020

Signed-off-by: Wei Bai [email protected]

Description of PR

Summary: Add PFC test cases implemented using Tgen API & Update Tgen sample script

Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

We need PFC test cases

How did you do it?

  1. Add pre-tests to get lossless and lossy priority information of each DUT in the testbed (see tests/test_pretest.py and tests/conftest.py)
  2. Add IXIA fixtures, e.g., ixia_api and ixia_t0_testbed (L2/L3 config of a T0 testbed).
  3. Add QoS fixtures and other helper functions
  4. Add general PFC test helper functions in tests/pfc/files/helper.py. Currently, we reuse an IXIA session (ixia_api, module-level fixture) to run a series of tests. Different tests use the same testbed configuration (ixia_t0_testbed) but have different flow configurations and expected results.

How did you verify/test it?

I did test using SONiC switches and IXIA chassis. The Tgen API version is 0.0.64.

Any platform specific information?

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

T0 topology using IXIA chassis as the fanout

Documentation

https://github.com/Azure/sonic-mgmt/blob/master/docs/pfc/GLOBAL_PAUSE_README.md
https://github.com/Azure/sonic-mgmt/blob/master/docs/pfc/PFC_PAUSE_LOSSLESS_README.md
https://github.com/Azure/sonic-mgmt/blob/master/docs/pfc/PFC_PAUSE_LOSSY_README.md

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 29, 2020

This pull request introduces 21 alerts and fixes 6 when merging 9462b8f into 345323c - view on LGTM.com

new alerts:

  • 18 for Unused import
  • 3 for Result of integer division may be truncated

fixed alerts:

  • 3 for Unused local variable
  • 2 for Wrong name for an argument in a call
  • 1 for Result of integer division may be truncated

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 30, 2020

This pull request introduces 3 alerts and fixes 7 when merging bcde48b into 345323c - view on LGTM.com

new alerts:

  • 3 for Result of integer division may be truncated

fixed alerts:

  • 3 for Unused local variable
  • 2 for Wrong name for an argument in a call
  • 1 for Unused import
  • 1 for Result of integer division may be truncated

@baiwei0427
Copy link
Copy Markdown
Contributor Author

retest this please

@yxieca
Copy link
Copy Markdown
Collaborator

yxieca commented Dec 3, 2020

There are quite some LGTM warnings, can you address these?

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Dec 11, 2020

This pull request introduces 3 alerts and fixes 7 when merging 4f02571 into 4cdc296 - view on LGTM.com

new alerts:

  • 3 for Result of integer division may be truncated

fixed alerts:

  • 3 for Unused local variable
  • 2 for Wrong name for an argument in a call
  • 1 for Unused import
  • 1 for Result of integer division may be truncated

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Dec 11, 2020

This pull request fixes 7 alerts when merging 6ce66d6 into 4cdc296 - view on LGTM.com

fixed alerts:

  • 3 for Unused local variable
  • 2 for Wrong name for an argument in a call
  • 1 for Unused import
  • 1 for Result of integer division may be truncated

@baiwei0427 baiwei0427 changed the title Add PFC test cases [QoS] PFC test cases Dec 11, 2020
@baiwei0427
Copy link
Copy Markdown
Contributor Author

There are quite some LGTM warnings, can you address these?

fixed

@baiwei0427
Copy link
Copy Markdown
Contributor Author

retest this please

@ashutshkumr
Copy link
Copy Markdown

Hello, I'm a part of team working on stabilizing tgen and have been going through this PR to understand the use cases being targeted with regards to PFC (using Ixia Test Ports).

I looked at the test plan and TCs, and felt there were few areas where we could've achieved (IMHO) more complete validation:

  • keep tx traffic flows active, longer than rx traffic flows (pause frames) so we can receive packets with lossless priorities (i.e. after pause storm is over)
  • use exact packet counts for tx traffic flows and use flow stats to validate packet count for each priority before and after pause storm
  • configure tx flows with all 8 priorities and send pause storm enabled for all priorities

I have uploaded a test script for reference (works against back-to-back connected Ixia Ports): https://github.com/open-traffic-generator/ixnetwork/blob/test-pfc/tests/pfc/test_pfc_pause_e2e.py

I'm also curious if you think there's value in covering following separate cases:

  • tx traffic flows should resume sending packets with lossless priorities when pause quanta for all pause frames originating from rx change from non-zero to zero
  • accuracy of DUT's reaction to being overwhelmed by lossless flows and duration for which the reaction persists


def get_egress_lossless_buffer_size(host_ans):
"""
Get egress losless buffer size of a switch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

'lossless'

Comment on lines +196 to +198
fanout_graph_facts,
duthosts,
rand_one_dut_hostname):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you fix the alignment?

@neethajohn
Copy link
Copy Markdown
Contributor

@baiwei0427 , can you also include the check to ensure that the DUT sends PFC to the Tx port? That can be addressed in a separate PR

@baiwei0427
Copy link
Copy Markdown
Contributor Author

  • n rx traffic flows (pause frames) so we can receive packets with lossless priorities (i.e. after pause storm is over)
  • use exact packet counts for tx traffic flows and use flow stats to validate packet count for each priority before and after pause storm

I agree with you. Our current test plan and implementation cannot fully verify all the functionalities of PFC. Let's update the test plan and add some PFC tests in the separate PRs.

@neethajohn neethajohn merged commit 49625a1 into sonic-net:master Dec 15, 2020
neethajohn added a commit that referenced this pull request Dec 15, 2020
neethajohn added a commit that referenced this pull request Dec 16, 2020
Signed-off-by: Neetha John <[email protected]>

Fixes the error seen during test case collection introduced by #2599. Initialize the variable as a list
https://sonic-jenkins.westus2.cloudapp.azure.com/job/common/job/sonic-mgmt-testing/job/sonic-mgmt-pr/2462/consoleFull

How did you verify/test it?
Tried test case collection with the fix. No longer seeing the error
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.

4 participants