Skip to content

[action] [PR:23225] Enable dynamic port selection from setup in snappi pfcwd test#23369

Merged
vmittal-msft merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/23225
Mar 27, 2026
Merged

[action] [PR:23225] Enable dynamic port selection from setup in snappi pfcwd test#23369
vmittal-msft merged 1 commit intosonic-net:202511from
mssonicbld:cherry/202511/23225

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description of PR

Summary:
Adapt the PFC watchdog basic snappi test to use the tgen_port_info fixture for dynamic port selection, aligning with the refactoring introduced in PR #18067. Also fix a fixture scope mismatch and improve reboot test reliability.

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
  • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511

Approach

What is the motivation for this PR?

PR #18067 refactored snappi port selection by introducing tgen_port_info and snappi_port_selection fixtures. The pfcwd basic test needed to be updated to consume these new fixtures instead of directly calling setup_ports_and_dut in each test body.

How did you do it?

  • Replace inline setup_ports_and_dut usage in all 6 test function bodies with the tgen_port_info fixture parameter
  • Remove redundant setup_ports_and_dut from test function signatures where it was no longer used in the body
  • Change number_of_tx_rx_ports fixture scope from function (default) to module to match the module-scoped snappi_port_selection dependency
  • Add snappi_port_selection to imports (was missing)
  • Update save_restore_config to use tgen_port_info fixture parameter. save_restore_config needs tgen_port_info to get the snappi_ports list, which contains duthost handles for each port. It uses those to identify which DUTs to back up and restore config on.

How did you verify/test it?

Validated on a T0/T1 and T2 chassis testbed (Cisco 8800) with IXIA traffic generator:

  • test_pfcwd_basic_single_lossless_prio — PASSED
  • test_pfcwd_basic_multi_lossless_prio — PASSED
  • test_pfcwd_basic_single_lossless_prio_reboot (cold reboot) — PASSED
  • test_pfcwd_basic_multi_lossless_prio_reboot (cold reboot) — PASSED
  • test_pfcwd_basic_single_lossless_prio_service_restart — PASSED
  • test_pfcwd_basic_multi_lossless_prio_restart_service — PASSED
T0/T1:
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio_service_restart[multidut_port_info0-tgen_port_info0-True-swss] PASSED [ 82%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info0-True-swss] PASSED [ 92%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio_reboot[multidut_port_info0-cold-NOTSET-tgen_port_info0-False] SKIPPED [ 30%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_reboot[multidut_port_info0-warm-tgen_port_info0-True] SKIPPED [ 52%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio_service_restart[multidut_port_info0-tgen_port_info0-True-swss] PASSED [ 82%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info0-True-swss] PASSED [ 92%]

T2:
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio[multidut_port_info0-tgen_port_info1-False] PASSED [ 5%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio[multidut_port_info0-tgen_port_info0-True] SKIPPED [ 11%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio_reboot[multidut_port_info0-warm-NOTSET-tgen_port_info0-True] SKIPPED [ 21%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_reboot[multidut_port_info0-warm-tgen_port_info0-True] SKIPPED [ 51%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_single_lossless_prio_service_restart[multidut_port_info0-tgen_port_info0-True-swss] SKIPPED [ 81%]

Individual tests on T2:
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info0-True-swss] 
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info0-False-swss] SKIPPED [ 25%]
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info1-True-swss] 
snappi_tests/pfcwd/test_pfcwd_basic_with_snappi.py::test_pfcwd_basic_multi_lossless_prio_restart_service[multidut_port_info0-tgen_port_info1-False-swss] PASSED [ 50%]

Any platform specific information?

T0/T1: Tested on Arista 8102 (single-ASIC per linecard)
T2: Tested on Cisco 8800 modular chassis (multi-ASIC, 3 ASICs per linecard).

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

N/A — existing test, supports multidut-tgen and tgen topologies.

Documentation

N/A

…ction from setup in snappi (sonic-net#23225)

Replace setup_ports_and_dut with tgen_port_info fixture in
test_pfcwd_basic_with_snappi.py for dynamic port selection

Signed-off-by: Edi Wibowo <ediwibowo@microsoft.com>
Signed-off-by: mssonicbld <sonicbld@microsoft.com>
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #23225

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@github-actions github-actions bot requested a review from sdszhang March 27, 2026 03:50
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vmittal-msft vmittal-msft merged commit c4a4582 into sonic-net:202511 Mar 27, 2026
13 checks passed
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.

3 participants