Skip to content

[action] [PR:3712] [vs][mirror]: Update test to use the max TC number provided by VS lib#103

Merged
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/3712
Jul 12, 2025
Merged

[action] [PR:3712] [vs][mirror]: Update test to use the max TC number provided by VS lib#103
mssonicbld merged 1 commit intoAzure:202412from
mssonicbld:cherry/msft-202412/3712

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

The PR is intended to provide a fix for the change sonic-net/sonic-swss#1957

The old test behavior relies on a hardcoded max TC value of 255. Now it needs to be updated following the SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES attribute implementation in VS lib.

Due to the circular dependency, in order to have clean sonic-sairedis CI,
the current change should be merged first.

DEPENDS:

  1. [trim]: Add Packet Trimming Asym DSCP to VS lib sonic-net/sonic-sairedis#1610

What I did

  • Updated mirror VS test

Why I did it

  • To align the behaviour with a new VS lib implementation

How I verified it

  1. Run VS test
root@sonic: tests# pytest --dvsname=vs --log-cli-level=info -vvv test_mirror_port_span.py
======================================================================== test session starts =========================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/work/debug/trim/asym/sonic-swss/tests
plugins: flaky-3.7.0
collected 10 items

test_mirror_port_span.py::TestMirror::test_PortMirrorQueue PASSED                                                                                              [ 10%]
test_mirror_port_span.py::TestMirror::test_PortMirrorAddRemove PASSED                                                                                          [ 20%]
test_mirror_port_span.py::TestMirror::test_PortMirrorMultiSpanAddRemove PASSED                                                                                 [ 30%]
test_mirror_port_span.py::TestMirror::test_PortMirrorPolicerAddRemove PASSED                                                                                   [ 40%]
test_mirror_port_span.py::TestMirror::test_PortMultiMirrorPolicerAddRemove PASSED                                                                              [ 50%]
test_mirror_port_span.py::TestMirror::test_LAGMirrorSpanAddRemove PASSED                                                                                       [ 60%]
test_mirror_port_span.py::TestMirror::test_PortMirrorPolicerWithAcl PASSED                                                                                     [ 70%]
test_mirror_port_span.py::TestMirror::test_PortMirrorLAGPortSpanAddRemove PASSED                                                                               [ 80%]
test_mirror_port_span.py::TestMirror::test_PortLAGMirrorUpdateLAG PASSED                                                                                       [ 90%]
test_mirror_port_span.py::test_nonflaky_dummy PASSED                                                                                                           [100%]

Details if related

  • N/A

A picture of a cute animal (not mandatory but encouraged)

      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

The PR is intended to provide a fix for the change sonic-net/sonic-swss#1957

The old test behavior relies on a hardcoded max TC value of 255. Now it needs to be updated following the `SAI_SWITCH_ATTR_QOS_MAX_NUMBER_OF_TRAFFIC_CLASSES` attribute implementation in VS lib.

Due to the circular dependency, in order to have clean `sonic-sairedis` CI,
the current change should be merged first.

**DEPENDS:**
1. sonic-net/sonic-sairedis#1610

**What I did**
* Updated mirror VS test

**Why I did it**
* To align the behaviour with a new VS lib implementation

**How I verified it**
1. Run VS test
```
root@sonic: tests# pytest --dvsname=vs --log-cli-level=info -vvv test_mirror_port_span.py
======================================================================== test session starts =========================================================================
platform linux -- Python 3.8.10, pytest-7.1.2, pluggy-0.13.1 -- /usr/bin/python3
cachedir: .pytest_cache
rootdir: /root/work/debug/trim/asym/sonic-swss/tests
plugins: flaky-3.7.0
collected 10 items

test_mirror_port_span.py::TestMirror::test_PortMirrorQueue PASSED                                                                                              [ 10%]
test_mirror_port_span.py::TestMirror::test_PortMirrorAddRemove PASSED                                                                                          [ 20%]
test_mirror_port_span.py::TestMirror::test_PortMirrorMultiSpanAddRemove PASSED                                                                                 [ 30%]
test_mirror_port_span.py::TestMirror::test_PortMirrorPolicerAddRemove PASSED                                                                                   [ 40%]
test_mirror_port_span.py::TestMirror::test_PortMultiMirrorPolicerAddRemove PASSED                                                                              [ 50%]
test_mirror_port_span.py::TestMirror::test_LAGMirrorSpanAddRemove PASSED                                                                                       [ 60%]
test_mirror_port_span.py::TestMirror::test_PortMirrorPolicerWithAcl PASSED                                                                                     [ 70%]
test_mirror_port_span.py::TestMirror::test_PortMirrorLAGPortSpanAddRemove PASSED                                                                               [ 80%]
test_mirror_port_span.py::TestMirror::test_PortLAGMirrorUpdateLAG PASSED                                                                                       [ 90%]
test_mirror_port_span.py::test_nonflaky_dummy PASSED                                                                                                           [100%]
```

**Details if related**
* N/A

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: sonic-net/sonic-swss#3712

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld mssonicbld merged commit 4eba7af into Azure:202412 Jul 12, 2025
5 of 8 checks passed
mssonicbld added a commit that referenced this pull request Jul 13, 2025
```<br>* 4d979d5 - (HEAD -> 202503) Merge branch '202412' of https://github.com/Azure/sonic-swss.msft into 202503 (2025-07-13) [Sonic Automation]
* 4eba7af - (base/202412) [vs][mirror]: Update test to use the max TC number provided by VS lib (#103) (2025-07-12) [mssonicbld]<br>```
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.

1 participant