Skip to content

Enable dynamic port selection from setup in snappi pfcwd test#23225

Merged
auspham merged 1 commit intosonic-net:masterfrom
ediwibowo-msft:pfcwd-basic-with-snappi
Mar 26, 2026
Merged

Enable dynamic port selection from setup in snappi pfcwd test#23225
auspham merged 1 commit intosonic-net:masterfrom
ediwibowo-msft:pfcwd-basic-with-snappi

Conversation

@ediwibowo-msft
Copy link
Copy Markdown
Contributor

@ediwibowo-msft ediwibowo-msft commented Mar 23, 2026

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

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 23, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: ediwibowo-msft / name: Edi Wibowo (049342d)

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from e6b7d57 to a574782 Compare March 24, 2026 06:57
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions github-actions bot requested a review from sdszhang March 24, 2026 06:58
@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from a574782 to cf5bd12 Compare March 24, 2026 07:00
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from cf5bd12 to ffefa43 Compare March 24, 2026 22:45
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from ffefa43 to a5d2fe9 Compare March 25, 2026 05:03
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@github-actions github-actions bot requested review from r12f and wangxin March 25, 2026 05:04
@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from a5d2fe9 to 3355b86 Compare March 25, 2026 05:06
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from 3355b86 to 086dbb0 Compare March 25, 2026 05:12
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

…ction from setup in snappi

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 <[email protected]>
@ediwibowo-msft ediwibowo-msft force-pushed the pfcwd-basic-with-snappi branch from 086dbb0 to 049342d Compare March 25, 2026 05:31
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@github-actions github-actions bot requested a review from sdszhang March 25, 2026 05:31
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@auspham auspham merged commit 37cfa87 into sonic-net:master Mar 26, 2026
15 checks passed
@sdszhang sdszhang added the Request for 202511 branch Request to backport a change to 202511 branch label Mar 27, 2026
@ediwibowo-msft
Copy link
Copy Markdown
Contributor Author

ediwibowo-msft commented Mar 27, 2026

Github issue: #23366

mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Mar 27, 2026
…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 <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202511: #23369

ravaliyel pushed a commit to ravaliyel/sonic-mgmt that referenced this pull request Mar 27, 2026
…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 <[email protected]>
vmittal-msft pushed a commit that referenced this pull request Mar 27, 2026
…ction from setup in snappi (#23225) (#23369)

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 <[email protected]>
Signed-off-by: mssonicbld <[email protected]>
Co-authored-by: ediwibowo-msft <[email protected]>
@ediwibowo-msft ediwibowo-msft deleted the pfcwd-basic-with-snappi branch March 28, 2026 02:51
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