Skip to content

[Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file.#15069

Merged
yejianquan merged 7 commits intosonic-net:masterfrom
amitpawar12:snappi-variables-file-subsitute
Apr 17, 2025
Merged

[Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file.#15069
yejianquan merged 7 commits intosonic-net:masterfrom
amitpawar12:snappi-variables-file-subsitute

Conversation

@amitpawar12
Copy link
Copy Markdown
Contributor

@amitpawar12 amitpawar12 commented Oct 21, 2024

Description of PR

The purpose of the pull-request is dynamic port_selection from available setup rather than relying on variables.py.

Pull-request adds a function snappi_port_selection in snappi_fixtures.py file.

Summary:
Fixes # (issue)

Type of change

#13769

  • 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?

Existing variables.py had following drawbacks:

  • Various line-cards and ports had to be manually added in this file, making it dependent on that particular setup. For different setup, user had to re-configure this file. This is not scalable. This also hindered selecting setups on run-time.
  • The variables.py did not have any provision for the interface-speed selection. The user had no provision to mention the speeds of the interfaces selected. For example, if the setup had both 100 and 400Gbps ports, user would have to define two different files or create additional dictionaries to accommodate 100 and 400Gbps interface separately.
  • If a line-card is added or removed, then variables.py will require manual modification.

To counter the above drawbacks, function snappi_port_selection is added in snappi_fixtures.py

How did you do it?

Following are the changes and reasoning behind the changes:

  1. Each testbed has to re-run test_pretest.py to generate a .JSON file in tests/metadata/snappi_tests/ folder. Metadata file generations will be in metadata/snappi_tests/ folder. This is avoid modification to the current metadata folder, therefore addressing our concern of conflicting with the current code base.

Syntax:

./run_tests.sh -n TESTBED_NAME -c test_pretest.py::test_update_snappi_testbed_metadata -i ../ansible/INVENTORY,../ansible/veos -e "--topology=multidut-tgen,any --skip_sanity --trim_inv --disable_loganalyzer" -u
  1. If the topology is not 'multi-tgen' or 'tgen', then a skip message for non-tgen topology has been added.

  2. Function 'generate_skeleton_port_info' parses the above JSON file and creates template to fetch port-data from output of 'snappi_port_selection'. Skeleton parameterization format will be -, for example: 400.0-single_linecard_single_asic. The reason for this change is to follow the Pytest standard of using delimiter "-" for parameterization.

  3. This also skips the speed-category combination if it's not available with comes to 'snappi_port_selection' fixtures.

The conditions for skip are:

  • Speed or category is not in snappi_port_selection
  • Or snappi_port_selection return None for the combination
  1. Function snappi_port_selection parses through all the available ports used in the testbed and generates a dictionary with ::.

  2. The line-card combination has three available modes - single line-card single asic, single line-card multiple asic and multiple linecard.

  3. The set of ports are determined by fixture number_of_tx_rx ports with scope "module" defined in each test.

  4. We don't need the setup_ports_and_dut as well now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

Tagging for relevant reach:
@sdszhang , @vmittal-msft , @rawal01 , @selldinesh, @developfast

How did you verify/test it?

Snapshot of the log:

AzDevOps@68684a43ec9e:/data/tests$ python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern board71,board72,board73,board74 --testbed ixre-chassis117-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/f.xml --skip_sanity --log-file=/tmp/f.log  --disable_loganalyzer --topology multidut-tgen,any --cache-clear snappi_tests/pfc/test_lossless_response_to_external_pause_storms.py --pdb
====================================================================================================================== test session starts =======================================================================================================================
platform linux -- Python 3.8.10, pytest-7.4.0, pluggy-1.4.0
ansible: 2.13.13
rootdir: /data/tests
configfile: pytest.ini
------------ curtailing irrelevant output ----------------
20:06:33 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:06:33 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '4', 'location': '100.117.59.187/4', 'peer_port': 'Ethernet0', 'peer_device': 'board74', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board74>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:06:38 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:06:39 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:06:41 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board74 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:11:02 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:11:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:11:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board74 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 16%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:11:04 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic] 
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:11:04 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:11:04 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:11:04 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:11:04 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '5', 'location': '100.117.59.187/5', 'peer_port': 'Ethernet16', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:11:10 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:11:12 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:11:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:14:48 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:14:49 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:14:50 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 33%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:14:51 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic] 
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:14:51 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:14:51 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:14:51 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:14:51 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.3', 'location': '100.117.59.187/9.3', 'peer_port': 'Ethernet144', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic1'}]
20:14:57 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:14:58 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:14:59 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:18:20 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:18:21 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:18:22 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 50%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic] 
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:18:23 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:18:23 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:18:23 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:18:23 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:18:29 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:18:30 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:18:32 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:21:35 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:21:36 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:21:37 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 66%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:21:38 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic] 
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:21:38 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:21:38 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:21:38 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:21:38 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.2', 'location': '100.117.59.187/10.2', 'peer_port': 'Ethernet8', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.3', 'location': '100.117.59.187/10.3', 'peer_port': 'Ethernet16', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:21:44 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.0/31
20:21:45 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet8 with IP 20.10.1.2/31
20:21:46 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:25:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.0/31
20:25:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet8 with ip :20.10.1.2/31
20:25:06 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 83%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:25:07 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic] 
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:25:07 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:25:07 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:25:07 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:25:07 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '3', 'location': '100.117.59.187/3', 'peer_port': 'Ethernet144', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic1'}]
20:25:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:25:14 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:25:16 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:29:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:29:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:29:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [100%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:29:06 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
--------------- curtailed irrelevant output ----------
---------------------------------------------------------------------------------------------------------------- generated xml file: /tmp/f.xml -----------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------------------------
20:29:32 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================== 6 passed, 12 warnings in 1466.75s (0:24:26) ===========================================================================================================
INFO:root:Can not get Allure report URL. Please check logs

Any platform specific information?

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

Documentation

pytestmark = [pytest.mark.topology('multidut-tgen')]


def test_linecard_variation_test(snappi_api, # noqa: F811
Copy link
Copy Markdown
Contributor

@auspham auspham Oct 31, 2024

Choose a reason for hiding this comment

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

i've run into this problem when trying to verify this test:

file /var/src/sonic-mgmt_vmsvc5-t2-8800-ixia_669de75fbbfea63e8b73b319/tests/common/snappi_tests/snappi_fixtures.py, line 1225
  @pytest.fixture(scope="module")
  def get_snappi_ports(duthosts, request):
E       fixture 'get_snappi_ports_multi_dut' not found

could you please adapt the fix in here? https://github.com/sonic-net/sonic-mgmt/pull/14742/files#diff-b8be5d218647ad2511bf0f887565a269ded8b0150bc4c37b5bc7b0cc6c8da9e6R7

Thank you

@sdszhang for viz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have pulled in the fixes from above PR.

Thanks,
-A

@amitpawar12 amitpawar12 force-pushed the snappi-variables-file-subsitute branch from 5b75e12 to 45ce6b0 Compare October 31, 2024 14:43
pytestmark = [pytest.mark.topology('multidut-tgen')]


def test_linecard_variation_test(snappi_api, # noqa: F811
Copy link
Copy Markdown
Contributor

@sdszhang sdszhang Nov 13, 2024

Choose a reason for hiding this comment

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

@amitpawar12 , can you move this test case into test_multidut_snappi.py? as we decided not to use 'sys' name .

@selldinesh
Copy link
Copy Markdown
Contributor

selldinesh commented Dec 4, 2024

Output:

23:12:48 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
23:12:48 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
23:12:48 init.loganalyzer L0067 INFO | Log analyzer is disabled
23:12:48 init.memory_utilization L0091 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS7726-32X, Platform: x86_64-accton_as7726_32x-r0
23:12:48 init.store_fixture_values L0017 INFO | store memory_utilization test_linecard_variation_test
23:12:48 init.pytest_runtest_setup L0024 INFO | collect memory before test test_linecard_variation_test
23:12:48 init.pytest_runtest_setup L0044 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 22.4}}}, 'after_test': {'sonic-s6100-dut1': {}}}
---------------------------------------------------------------------------------------- live log call -----------------------------------------------------------------------------------------
23:12:48 snappi_fixtures.snappi_port_selection L1489 INFO | Rx port count:2, Tx port count:2
23:12:48 snappi_fixtures.snappi_port_selection L1491 INFO | Testing for speeds:100.0
23:12:48 snappi_fixtures.snappi_port_selection L1492 INFO | linecard combos:dict_keys(['single_linecard_single_asic'])
23:12:48 snappi_fixtures.snappi_port_selection L1494 INFO | single_linecard_single_asic
23:12:48 snappi_fixtures.snappi_port_selection L1496 INFO | {'ip': '10.36.78.53', 'card_id': '6', 'port_id': '5', 'peer_port': 'Ethernet64', 'peer_device': 'sonic-s6100-dut1', 'speed': '100000', 'intf_config_changed': False, 'location': '10.36.78.53;6;5', 'api_server_ip': '10.36.78.29', 'asic_type': 'broadcom', 'duthost': , 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}
23:12:48 snappi_fixtures.snappi_port_selection L1496 INFO | {'ip': '10.36.78.53', 'card_id': '6', 'port_id': '6', 'peer_port': 'Ethernet68', 'peer_device': 'sonic-s6100-dut1', 'speed': '100000', 'intf_config_changed': False, 'location': '10.36.78.53;6;6', 'api_server_ip': '10.36.78.29', 'asic_type': 'broadcom', 'duthost': , 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}
23:12:48 snappi_fixtures.snappi_port_selection L1496 INFO | {'ip': '10.36.78.53', 'card_id': '6', 'port_id': '7', 'peer_port': 'Ethernet72', 'peer_device': 'sonic-s6100-dut1', 'speed': '100000', 'intf_config_changed': False, 'location': '10.36.78.53;6;7', 'api_server_ip': '10.36.78.29', 'asic_type': 'broadcom', 'duthost': , 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}
23:12:48 snappi_fixtures.snappi_port_selection L1496 INFO | {'ip': '10.36.78.53', 'card_id': '6', 'port_id': '8', 'peer_port': 'Ethernet76', 'peer_device': 'sonic-s6100-dut1', 'speed': '100000', 'intf_config_changed': False, 'location': '10.36.78.53;6;8', 'api_server_ip': '10.36.78.29', 'asic_type': 'broadcom', 'duthost': , 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}
PASSED [100%]
-------------------------------------------------------------------------------------- live log teardown ---------------------------------------------------------------------------------------

# Initializing dictionary port_list{speed}{line-card-asic-combo}
# example port_list['100']['single_linecard_single_asic']

# for 'single-linecard-single-asic'
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.

Hi @amitpawar12

This code works for me. Just a few improvement suggestions which could help improving the readability.

I notice that you're separating into 3 cases:

  1. for 'single-linecard-single-asic'
  2. for 'single_linecard_multiple_asic'
  3. for 'multiple linecard, multiple ASIC'

Could we have some if statement to separate these logic instead of letting the code goes through all? It will be easier to debug if we need to modify later.

A suggestion could be:

is_single_linecard_single_asic = len(f) == 1 and len(f[0].keys()) == 1
if (is_single_linecard_single_asic):
   # logic for single_linecard_single_asic
   
is_single_linecard_multi_asic = len(f) == 1 and len(f[0].keys()) >= 1
 
if (is_single_linecard_multi_asic):
   # logic for is_single_linecard_multi_asic
   

cc @sdszhang

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good. I think we should pass a parameter called "test_subtype" which is default = ALL, in case user wants just to pull a specific subtype ONLY instead of all the test_subtypes.

I am keeping this as enhancement of functionality.

@amitpawar12 amitpawar12 force-pushed the snappi-variables-file-subsitute branch from 45ce6b0 to 6d4a935 Compare January 3, 2025 22:05
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@amitpawar12
Copy link
Copy Markdown
Contributor Author

Incorporated the functionality in existing testcase tests/snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py.

To keep things simple, I am parameterizing 100 and 400 as test_speeds, and three subtypes as 'test_subtype'. If the ports are found, the test is executed, else it is skipped with INFO log message.

Thanks,

@sdszhang
Copy link
Copy Markdown
Contributor

sdszhang commented Jan 8, 2025

@amitpawar12 can you upload the test log pls?

N/A
"""
testbed_config, port_config_list, snappi_ports = setup_ports_and_dut
multidut_port_info = snappi_port_selection(get_snappi_ports)
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.

let's move this block of code into a fixture if possible.

lossless_prio_list, # noqa: F811
tbinfo, # noqa: F811
get_snappi_ports, # noqa: F811
setup_ports_and_dut, # noqa: F811
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.

I believe we need disable_pfcwd in this case?

@sdszhang
Copy link
Copy Markdown
Contributor

@amitpawar12 can you send out the email for solution suggestions as discussed?

@sdszhang sdszhang moved this to Todo in SONiC Snappi Mar 26, 2025
@sdszhang sdszhang moved this from Todo to In Progress in SONiC Snappi Mar 26, 2025
@amitpawar12 amitpawar12 force-pushed the snappi-variables-file-subsitute branch from 6d4a935 to cbab42d Compare April 2, 2025 15:05
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@amitpawar12 amitpawar12 force-pushed the snappi-variables-file-subsitute branch from cbab42d to 9869d49 Compare April 2, 2025 18:51
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

"""
Prepare metadata json for snappi tests, will be stored in metadata/snappi_tests/<tb>.json
"""
pytest_require("tgen" in request.config.getoption("--topology"),
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.

Hi @amitpawar12 , lets do this so that it will not throw error if we don't provide "topology" cli option

Suggested change
pytest_require("tgen" in request.config.getoption("--topology"),
topology_list = request.config.getoption("--topology")
pytest_require(topology_list is not None and "tgen" in topology_list,
"Skip snappi metadata generation for non-tgen testbed")

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.

single liner to make code cleaner

Suggested change
pytest_require("tgen" in request.config.getoption("--topology"),
pytest_require("tgen" in (request.config.getoption("--topology") or "")),

return metadata.get(tbname)


def get_snappi_testbed_metadata(request):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@auspham - I am going to remove this function from conftest because there is already check (and code) in test_pretest.py to create metadata/snappi_tests/.json file.

please let me know if this is ok.

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.

This is to rather read this metadata/snappi_tests/testbed.json. Are you planning to integrate with an already existing function from conftest? @amitpawar12

@amitpawar12 amitpawar12 force-pushed the snappi-variables-file-subsitute branch from 9869d49 to 5cc78b3 Compare April 3, 2025 21:31
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
Description of PR
Summary:
This PR adds the following features:

Enable options to overwrite dynamic port selection introduced by [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069. We can force running dynamic-port selection feature by adding --enable-snappi-dynamic-ports in the CLI.
We can override by using variables.override.yml. The config is similar to our variable.py but in yaml.

Add option to overwrite pfcQueueGroupSize as well and the default fallback value. So we can adjust per testbed.
Fix some minimal issue from [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069
Create folder and subfolder if it does not exist correctly for metadata.json
Revert the tx_rx port in the dynamic snappi port selection
Refactor the use of snappi_dut_base_config needed for consistency when toggle on and off dynamic ports selection make sure everything still work
Fixes # (issue) 32317078

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202012
 202205
 202305
 202311
 202405
 202411
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
without --enable-snappi-dynamic-ports
image

with --enable-snappi-dynamic-ports

image

Signed-off-by: Austin Pham <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------

Signed-off-by: opcoder0 <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>

Signed-off-by: opcoder0 <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 2025
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt #1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: opcoder0 <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 2025
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt sonic-net#1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…lacing variables.py file. (sonic-net#15069)

Description of PR
The purpose of the pull-request is dynamic port_selection from available setup rather than relying on variables.py.

Pull-request adds a function snappi_port_selection in snappi_fixtures.py file.

Summary:
Fixes # (issue)

Type of change
sonic-net#13769

 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?
Existing variables.py had following drawbacks:

Various line-cards and ports had to be manually added in this file, making it dependent on that particular setup. For different setup, user had to re-configure this file. This is not scalable. This also hindered selecting setups on run-time.
The variables.py did not have any provision for the interface-speed selection. The user had no provision to mention the speeds of the interfaces selected. For example, if the setup had both 100 and 400Gbps ports, user would have to define two different files or create additional dictionaries to accommodate 100 and 400Gbps interface separately.
If a line-card is added or removed, then variables.py will require manual modification.
To counter the above drawbacks, function snappi_port_selection is added in snappi_fixtures.py

How did you do it?
Following are the changes and reasoning behind the changes:

Each testbed has to re-run test_pretest.py to generate a .JSON file in tests/metadata/snappi_tests/ folder. Metadata file generations will be in metadata/snappi_tests/ folder. This is avoid modification to the current metadata folder, therefore addressing our concern of conflicting with the current code base.
Syntax:

./run_tests.sh -n TESTBED_NAME -c test_pretest.py::test_update_snappi_testbed_metadata -i ../ansible/INVENTORY,../ansible/veos -e "--topology=multidut-tgen,any --skip_sanity --trim_inv --disable_loganalyzer" -u
If the topology is not 'multi-tgen' or 'tgen', then a skip message for non-tgen topology has been added.

Function 'generate_skeleton_port_info' parses the above JSON file and creates template to fetch port-data from output of 'snappi_port_selection'. Skeleton parameterization format will be -, for example: 400.0-single_linecard_single_asic. The reason for this change is to follow the Pytest standard of using delimiter "-" for parameterization.

This also skips the speed-category combination if it's not available with comes to 'snappi_port_selection' fixtures.

The conditions for skip are:

Speed or category is not in snappi_port_selection
Or snappi_port_selection return None for the combination
Function snappi_port_selection parses through all the available ports used in the testbed and generates a dictionary with ::.

The line-card combination has three available modes - single line-card single asic, single line-card multiple asic and multiple linecard.

The set of ports are determined by fixture number_of_tx_rx ports with scope "module" defined in each test.

We don't need the setup_ports_and_dut as well now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

Tagging for relevant reach:
@sdszhang , @vmittal-msft , @rawal01 , @selldinesh, @developfast

How did you verify/test it?
Snapshot of the log:

AzDevOps@68684a43ec9e:/data/tests$ python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern board71,board72,board73,board74 --testbed ixre-chassis117-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/f.xml --skip_sanity --log-file=/tmp/f.log  --disable_loganalyzer --topology multidut-tgen,any --cache-clear snappi_tests/pfc/test_lossless_response_to_external_pause_storms.py --pdb
====================================================================================================================== test session starts =======================================================================================================================
platform linux -- Python 3.8.10, pytest-7.4.0, pluggy-1.4.0
ansible: 2.13.13
rootdir: /data/tests
configfile: pytest.ini
------------ curtailing irrelevant output ----------------
20:06:33 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:06:33 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '4', 'location': '100.117.59.187/4', 'peer_port': 'Ethernet0', 'peer_device': 'board74', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board74>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:06:38 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:06:39 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:06:41 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board74 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:11:02 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:11:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:11:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board74 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 16%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:11:04 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:11:04 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:11:04 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:11:04 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:11:04 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '5', 'location': '100.117.59.187/5', 'peer_port': 'Ethernet16', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:11:10 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:11:12 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:11:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:14:48 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:14:49 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:14:50 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 33%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:14:51 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:14:51 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:14:51 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:14:51 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:14:51 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.3', 'location': '100.117.59.187/9.3', 'peer_port': 'Ethernet144', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic1'}]
20:14:57 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:14:58 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:14:59 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:18:20 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:18:21 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:18:22 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 50%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:18:23 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:18:23 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:18:23 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:18:23 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:18:29 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:18:30 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:18:32 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:21:35 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:21:36 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:21:37 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 66%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:21:38 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:21:38 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:21:38 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:21:38 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:21:38 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.2', 'location': '100.117.59.187/10.2', 'peer_port': 'Ethernet8', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.3', 'location': '100.117.59.187/10.3', 'peer_port': 'Ethernet16', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:21:44 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.0/31
20:21:45 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet8 with IP 20.10.1.2/31
20:21:46 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:25:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.0/31
20:25:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet8 with ip :20.10.1.2/31
20:25:06 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 83%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:25:07 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:25:07 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:25:07 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:25:07 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:25:07 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '3', 'location': '100.117.59.187/3', 'peer_port': 'Ethernet144', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic1'}]
20:25:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:25:14 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:25:16 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:29:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:29:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:29:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [100%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:29:06 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
--------------- curtailed irrelevant output ----------
---------------------------------------------------------------------------------------------------------------- generated xml file: /tmp/f.xml -----------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------------------------
20:29:32 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================== 6 passed, 12 warnings in 1466.75s (0:24:26) ===========================================================================================================
INFO:root:Can not get Allure report URL. Please check logs
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation

Signed-off-by: Austin Pham <[email protected]>
Co-authored-by: Austin Pham <[email protected]>
Signed-off-by: Aharon Malkin <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
Description of PR
Summary:
This PR adds the following features:

Enable options to overwrite dynamic port selection introduced by [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069. We can force running dynamic-port selection feature by adding --enable-snappi-dynamic-ports in the CLI.
We can override by using variables.override.yml. The config is similar to our variable.py but in yaml.

Add option to overwrite pfcQueueGroupSize as well and the default fallback value. So we can adjust per testbed.
Fix some minimal issue from [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069
Create folder and subfolder if it does not exist correctly for metadata.json
Revert the tx_rx port in the dynamic snappi port selection
Refactor the use of snappi_dut_base_config needed for consistency when toggle on and off dynamic ports selection make sure everything still work
Fixes # (issue) 32317078

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202012
 202205
 202305
 202311
 202405
 202411
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
without --enable-snappi-dynamic-ports
image

with --enable-snappi-dynamic-ports

image

Signed-off-by: Austin Pham <[email protected]>
Signed-off-by: Aharon Malkin <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------

Signed-off-by: Aharon Malkin <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
Signed-off-by: Aharon Malkin <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 2025
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt #1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…lacing variables.py file. (sonic-net#15069)

Description of PR
The purpose of the pull-request is dynamic port_selection from available setup rather than relying on variables.py.

Pull-request adds a function snappi_port_selection in snappi_fixtures.py file.

Summary:
Fixes # (issue)

Type of change
sonic-net#13769

 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?
Existing variables.py had following drawbacks:

Various line-cards and ports had to be manually added in this file, making it dependent on that particular setup. For different setup, user had to re-configure this file. This is not scalable. This also hindered selecting setups on run-time.
The variables.py did not have any provision for the interface-speed selection. The user had no provision to mention the speeds of the interfaces selected. For example, if the setup had both 100 and 400Gbps ports, user would have to define two different files or create additional dictionaries to accommodate 100 and 400Gbps interface separately.
If a line-card is added or removed, then variables.py will require manual modification.
To counter the above drawbacks, function snappi_port_selection is added in snappi_fixtures.py

How did you do it?
Following are the changes and reasoning behind the changes:

Each testbed has to re-run test_pretest.py to generate a .JSON file in tests/metadata/snappi_tests/ folder. Metadata file generations will be in metadata/snappi_tests/ folder. This is avoid modification to the current metadata folder, therefore addressing our concern of conflicting with the current code base.
Syntax:

./run_tests.sh -n TESTBED_NAME -c test_pretest.py::test_update_snappi_testbed_metadata -i ../ansible/INVENTORY,../ansible/veos -e "--topology=multidut-tgen,any --skip_sanity --trim_inv --disable_loganalyzer" -u
If the topology is not 'multi-tgen' or 'tgen', then a skip message for non-tgen topology has been added.

Function 'generate_skeleton_port_info' parses the above JSON file and creates template to fetch port-data from output of 'snappi_port_selection'. Skeleton parameterization format will be -, for example: 400.0-single_linecard_single_asic. The reason for this change is to follow the Pytest standard of using delimiter "-" for parameterization.

This also skips the speed-category combination if it's not available with comes to 'snappi_port_selection' fixtures.

The conditions for skip are:

Speed or category is not in snappi_port_selection
Or snappi_port_selection return None for the combination
Function snappi_port_selection parses through all the available ports used in the testbed and generates a dictionary with ::.

The line-card combination has three available modes - single line-card single asic, single line-card multiple asic and multiple linecard.

The set of ports are determined by fixture number_of_tx_rx ports with scope "module" defined in each test.

We don't need the setup_ports_and_dut as well now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

Tagging for relevant reach:
@sdszhang , @vmittal-msft , @rawal01 , @selldinesh, @developfast

How did you verify/test it?
Snapshot of the log:

AzDevOps@68684a43ec9e:/data/tests$ python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern board71,board72,board73,board74 --testbed ixre-chassis117-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/f.xml --skip_sanity --log-file=/tmp/f.log  --disable_loganalyzer --topology multidut-tgen,any --cache-clear snappi_tests/pfc/test_lossless_response_to_external_pause_storms.py --pdb
====================================================================================================================== test session starts =======================================================================================================================
platform linux -- Python 3.8.10, pytest-7.4.0, pluggy-1.4.0
ansible: 2.13.13
rootdir: /data/tests
configfile: pytest.ini
------------ curtailing irrelevant output ----------------
20:06:33 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:06:33 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '4', 'location': '100.117.59.187/4', 'peer_port': 'Ethernet0', 'peer_device': 'board74', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board74>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:06:38 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:06:39 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:06:41 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board74 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:11:02 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:11:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:11:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board74 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 16%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:11:04 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:11:04 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:11:04 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:11:04 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:11:04 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '5', 'location': '100.117.59.187/5', 'peer_port': 'Ethernet16', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:11:10 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:11:12 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:11:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:14:48 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:14:49 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:14:50 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 33%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:14:51 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:14:51 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:14:51 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:14:51 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:14:51 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.3', 'location': '100.117.59.187/9.3', 'peer_port': 'Ethernet144', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic1'}]
20:14:57 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:14:58 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:14:59 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:18:20 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:18:21 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:18:22 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 50%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:18:23 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:18:23 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:18:23 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:18:23 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:18:29 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:18:30 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:18:32 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:21:35 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:21:36 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:21:37 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 66%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:21:38 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:21:38 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:21:38 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:21:38 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:21:38 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.2', 'location': '100.117.59.187/10.2', 'peer_port': 'Ethernet8', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.3', 'location': '100.117.59.187/10.3', 'peer_port': 'Ethernet16', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:21:44 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.0/31
20:21:45 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet8 with IP 20.10.1.2/31
20:21:46 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:25:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.0/31
20:25:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet8 with ip :20.10.1.2/31
20:25:06 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 83%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:25:07 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:25:07 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:25:07 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:25:07 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:25:07 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '3', 'location': '100.117.59.187/3', 'peer_port': 'Ethernet144', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic1'}]
20:25:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:25:14 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:25:16 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:29:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:29:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:29:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [100%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:29:06 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
--------------- curtailed irrelevant output ----------
---------------------------------------------------------------------------------------------------------------- generated xml file: /tmp/f.xml -----------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------------------------
20:29:32 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================== 6 passed, 12 warnings in 1466.75s (0:24:26) ===========================================================================================================
INFO:root:Can not get Allure report URL. Please check logs
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation

Signed-off-by: Austin Pham <[email protected]>
Co-authored-by: Austin Pham <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
Description of PR
Summary:
This PR adds the following features:

Enable options to overwrite dynamic port selection introduced by [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069. We can force running dynamic-port selection feature by adding --enable-snappi-dynamic-ports in the CLI.
We can override by using variables.override.yml. The config is similar to our variable.py but in yaml.

Add option to overwrite pfcQueueGroupSize as well and the default fallback value. So we can adjust per testbed.
Fix some minimal issue from [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069
Create folder and subfolder if it does not exist correctly for metadata.json
Revert the tx_rx port in the dynamic snappi port selection
Refactor the use of snappi_dut_base_config needed for consistency when toggle on and off dynamic ports selection make sure everything still work
Fixes # (issue) 32317078

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202012
 202205
 202305
 202311
 202405
 202411
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
without --enable-snappi-dynamic-ports
image

with --enable-snappi-dynamic-ports

image

Signed-off-by: Austin Pham <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 2025
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt sonic-net#1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: Guy Shemesh <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt sonic-net#1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…lacing variables.py file. (sonic-net#15069)

Description of PR
The purpose of the pull-request is dynamic port_selection from available setup rather than relying on variables.py.

Pull-request adds a function snappi_port_selection in snappi_fixtures.py file.

Summary:
Fixes # (issue)

Type of change
sonic-net#13769

 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?
Existing variables.py had following drawbacks:

Various line-cards and ports had to be manually added in this file, making it dependent on that particular setup. For different setup, user had to re-configure this file. This is not scalable. This also hindered selecting setups on run-time.
The variables.py did not have any provision for the interface-speed selection. The user had no provision to mention the speeds of the interfaces selected. For example, if the setup had both 100 and 400Gbps ports, user would have to define two different files or create additional dictionaries to accommodate 100 and 400Gbps interface separately.
If a line-card is added or removed, then variables.py will require manual modification.
To counter the above drawbacks, function snappi_port_selection is added in snappi_fixtures.py

How did you do it?
Following are the changes and reasoning behind the changes:

Each testbed has to re-run test_pretest.py to generate a .JSON file in tests/metadata/snappi_tests/ folder. Metadata file generations will be in metadata/snappi_tests/ folder. This is avoid modification to the current metadata folder, therefore addressing our concern of conflicting with the current code base.
Syntax:

./run_tests.sh -n TESTBED_NAME -c test_pretest.py::test_update_snappi_testbed_metadata -i ../ansible/INVENTORY,../ansible/veos -e "--topology=multidut-tgen,any --skip_sanity --trim_inv --disable_loganalyzer" -u
If the topology is not 'multi-tgen' or 'tgen', then a skip message for non-tgen topology has been added.

Function 'generate_skeleton_port_info' parses the above JSON file and creates template to fetch port-data from output of 'snappi_port_selection'. Skeleton parameterization format will be -, for example: 400.0-single_linecard_single_asic. The reason for this change is to follow the Pytest standard of using delimiter "-" for parameterization.

This also skips the speed-category combination if it's not available with comes to 'snappi_port_selection' fixtures.

The conditions for skip are:

Speed or category is not in snappi_port_selection
Or snappi_port_selection return None for the combination
Function snappi_port_selection parses through all the available ports used in the testbed and generates a dictionary with ::.

The line-card combination has three available modes - single line-card single asic, single line-card multiple asic and multiple linecard.

The set of ports are determined by fixture number_of_tx_rx ports with scope "module" defined in each test.

We don't need the setup_ports_and_dut as well now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

Tagging for relevant reach:
@sdszhang , @vmittal-msft , @rawal01 , @selldinesh, @developfast

How did you verify/test it?
Snapshot of the log:

AzDevOps@68684a43ec9e:/data/tests$ python3 -m pytest --inventory ../ansible/ixia-sonic --host-pattern board71,board72,board73,board74 --testbed ixre-chassis117-t2 --testbed_file ../ansible/testbed.csv --log-cli-level info --log-file-level info --kube_master unset --showlocals -ra --show-capture stdout --junit-xml=/tmp/f.xml --skip_sanity --log-file=/tmp/f.log  --disable_loganalyzer --topology multidut-tgen,any --cache-clear snappi_tests/pfc/test_lossless_response_to_external_pause_storms.py --pdb
====================================================================================================================== test session starts =======================================================================================================================
platform linux -- Python 3.8.10, pytest-7.4.0, pluggy-1.4.0
ansible: 2.13.13
rootdir: /data/tests
configfile: pytest.ini
------------ curtailing irrelevant output ----------------
20:06:33 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:06:33 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:06:33 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '4', 'location': '100.117.59.187/4', 'peer_port': 'Ethernet0', 'peer_device': 'board74', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board74>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:06:38 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:06:39 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:06:41 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board74 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:11:02 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:11:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:11:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board74 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 16%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-multiple_linecard_multiple_asic]
20:11:04 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:11:04 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:11:04 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:11:04 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:11:04 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:11:04 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:11:04 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '5', 'location': '100.117.59.187/5', 'peer_port': 'Ethernet16', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}]
20:11:10 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:11:12 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:11:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:14:48 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:14:49 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:14:50 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 33%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_single_asic]
20:14:51 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:14:51 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:14:51 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:14:51 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:14:51 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:14:51 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:14:51 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.3', 'location': '100.117.59.187/9.3', 'peer_port': 'Ethernet144', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic1'}]
20:14:57 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:14:58 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:14:59 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:18:20 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:18:21 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:18:22 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 50%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:18:23 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:18:23 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:18:23 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:18:23 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:18:23 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:18:23 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '9.1', 'location': '100.117.59.187/9.1', 'peer_port': 'Ethernet0', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '9.2', 'location': '100.117.59.187/9.2', 'peer_port': 'Ethernet8', 'peer_device': 'board71', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board71>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:18:29 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet0 with IP 20.10.1.0/31
20:18:30 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board71 with port Ethernet8 with IP 20.10.1.2/31
20:18:32 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:21:35 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet0 with ip :20.10.1.0/31
20:21:36 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board71 with port Ethernet8 with ip :20.10.1.2/31
20:21:37 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 66%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-multiple_linecard_multiple_asic]
20:21:38 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:21:38 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:21:38 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:21:38 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:21:38 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:21:38 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:21:38 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '10.1', 'location': '100.117.59.187/10.1', 'peer_port': 'Ethernet0', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.2', 'location': '100.117.59.187/10.2', 'peer_port': 'Ethernet8', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '10.3', 'location': '100.117.59.187/10.3', 'peer_port': 'Ethernet16', 'peer_device': 'board72', 'speed': '100000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board72>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': 'asic0'}]
20:21:44 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet0 with IP 20.10.1.0/31
20:21:45 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet8 with IP 20.10.1.2/31
20:21:46 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board72 with port Ethernet16 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:25:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet0 with ip :20.10.1.0/31
20:25:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet8 with ip :20.10.1.2/31
20:25:06 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board72 with port Ethernet16 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [ 83%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[100.0-single_linecard_single_asic]
20:25:07 __init__.pytest_runtest_teardown         L0072 INFO   | After test: collected memory_values {'before_test': {}, 'after_test': {}}

snappi_tests/multidut/pfc/test_lossless_response_to_external_pause_storms.py::test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
------------------------------------------------------------------------------------------------------------------------- live log setup -------------------------------------------------------------------------------------------------------------------------
20:25:07 __init__.set_default                     L0053 INFO   | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
20:25:07 __init__.check_test_completeness         L0151 INFO   | Test has no defined levels. Continue without test completeness checks
20:25:07 __init__.loganalyzer                     L0051 INFO   | Log analyzer is disabled
20:25:07 __init__.store_fixture_values            L0017 INFO   | store memory_utilization test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0024 INFO   | collect memory before test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
20:25:07 __init__.pytest_runtest_setup            L0044 INFO   | Before test: collected memory_values {'before_test': {}, 'after_test': {}}
------------------------------------------------------------------------------------------------------------------------- live log call --------------------------------------------------------------------------------------------------------------------------
20:25:07 test_lossless_response_to_external_pause L0070 INFO   | Ports:[{'ip': '100.117.59.187', 'port_id': '1', 'location': '100.117.59.187/1', 'peer_port': 'Ethernet0', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '2', 'location': '100.117.59.187/2', 'peer_port': 'Ethernet8', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic0'}, {'ip': '100.117.59.187', 'port_id': '3', 'location': '100.117.59.187/3', 'peer_port': 'Ethernet144', 'peer_device': 'board73', 'speed': '400000', 'intf_config_changed': False, 'api_server_ip': '10.251.30.110', 'asic_type': 'broadcom', 'duthost': <MultiAsicSonicHost board73>, 'snappi_speed_type': 'speed_400_gbps', 'asic_value': 'asic1'}]
20:25:13 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet0 with IP 20.10.1.0/31
20:25:14 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet8 with IP 20.10.1.2/31
20:25:16 snappi_fixtures.__intf_config_multidut   L0934 INFO   | Configuring Dut: board73 with port Ethernet144 with IP 20.10.1.4/31
--------------- curtailed irrelevant output ----------
20:29:03 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet0 with ip :20.10.1.0/31
20:29:04 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet8 with ip :20.10.1.2/31
20:29:05 snappi_fixtures.cleanup_config           L1159 INFO   | Removing Configuration on Dut: board73 with port Ethernet144 with ip :20.10.1.4/31
PASSED                                                                                                                                                                                                                                                     [100%]
----------------------------------------------------------------------------------------------------------------------- live log teardown ------------------------------------------------------------------------------------------------------------------------
20:29:06 __init__.pytest_runtest_teardown         L0049 INFO   | collect memory after test test_lossless_response_to_external_pause_storms_test[400.0-single_linecard_multiple_asic]
--------------- curtailed irrelevant output ----------
---------------------------------------------------------------------------------------------------------------- generated xml file: /tmp/f.xml -----------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------- live log sessionfinish ---------------------------------------------------------------------------------------------------------------------
20:29:32 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
========================================================================================================== 6 passed, 12 warnings in 1466.75s (0:24:26) ===========================================================================================================
INFO:root:Can not get Allure report URL. Please check logs
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation

Signed-off-by: Austin Pham <[email protected]>
Co-authored-by: Austin Pham <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
Description of PR
Summary:
This PR adds the following features:

Enable options to overwrite dynamic port selection introduced by [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069. We can force running dynamic-port selection feature by adding --enable-snappi-dynamic-ports in the CLI.
We can override by using variables.override.yml. The config is similar to our variable.py but in yaml.

Add option to overwrite pfcQueueGroupSize as well and the default fallback value. So we can adjust per testbed.
Fix some minimal issue from [Snappi] - Infra change for dynamic port selection from the setup replacing variables.py file. sonic-net#15069
Create folder and subfolder if it does not exist correctly for metadata.json
Revert the tx_rx port in the dynamic snappi port selection
Refactor the use of snappi_dut_base_config needed for consistency when toggle on and off dynamic ports selection make sure everything still work
Fixes # (issue) 32317078

Type of change
 Bug fix
 Testbed and Framework(new/improvement)
 New Test case
 Skipped for non-supported platforms
 Test case improvement
Back port request
 202012
 202205
 202305
 202311
 202405
 202411
Approach
What is the motivation for this PR?
How did you do it?
How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
without --enable-snappi-dynamic-ports
image

with --enable-snappi-dynamic-ports

image

Signed-off-by: Austin Pham <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------

Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt sonic-net#1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: Guy Shemesh <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------

Signed-off-by: Yael Tzur <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
Signed-off-by: Yael Tzur <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt #1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED

Signed-off-by: Yael Tzur <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
Description of PR
Summary:
Fixes # (issue)

Type of change
After sonic-net#16729 and sonic-net#15069, existing test cases need to be updated to support dynamic port selection.

 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
Approach
What is the motivation for this PR?
Update test case to adopt the new feature

How did you do it?
How did you verify/test it?
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info0]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|3-tgen_port_info1] PASSED [ 50%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info0] PASSED [ 75%]
snappi_tests/pfc/test_pfc_pause_lossless_with_snappi.py::test_pfc_pause_single_lossless_prio[str3-8800-lc4-1|4-tgen_port_info1] PASSED [100%]
------------------------------ live log teardown -------------------------------
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
…ection from the setup replacing variables.py file (sonic-net#18091)

Description of PR
Summary:
Fixes # (issue)
sonic-net#13769

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

Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Ran in Microsoft Lab on T2 Arista Chassis.

Co-authored-by: yatishkoul <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
sonic-net#18886)

Description of PR
Summary:
Fixes # (issue)sonic-net#13769

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
Approach
What is the motivation for this PR?
To support infra changes in snappi tests introduced by this Pull Request - sonic-net#15069

How did you do it?
We don't need the setup_ports_and_dut now and we can simply call the snappi_testbed_config in the test itself and iterate through the available ports.

How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation
OUTPUT
snappi_tests/pfc/test_pfc_pause_lossy_with_snappi.py::test_pfc_pause_single_lossy_prio[multidut_port_info0-sonic-s6100-dut1|0-400.0-single_linecard_single_asic]
----------------------------------------------------------------------------------------------------------------------------------------- live log setup ------------------------------------------------------------------------------------------------------------------------------------------
16:01:24 init.set_default L0053 INFO | Completeness level not set during test execution. Setting to default level: CompletenessLevel.basic
16:01:24 init.check_test_completeness L0151 INFO | Test has no defined levels. Continue without test completeness checks
16:01:24 conftest.enhance_inventory L0313 INFO | Inventory file: ['../ansible/snappi-sonic']
16:01:27 ptfhost_utils.run_icmp_responder_session L0310 INFO | Skip running icmp_responder at session level, it is only for dualtor testbed with active-active mux ports.
16:01:27 init._sanity_check L0431 INFO | Skip sanity check according to command line argument
16:01:27 conftest.collect_before_test L2695 INFO | Dumping Disk and Memory Space information before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2699 INFO | Collecting core dumps before test on sonic-s6100-dut1
16:01:28 conftest.collect_before_test L2708 INFO | Collecting running config before test on sonic-s6100-dut1
16:01:30 conftest.temporarily_disable_route_check L2974 INFO | Skipping temporarily_disable_route_check fixture
16:01:30 conftest.generate_params_dut_hostname L1498 INFO | Using DUTs ['sonic-s6100-dut1'] in testbed 'vms-snappi-sonic'
16:01:30 conftest.set_rand_one_dut_hostname L0647 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture enable_packet_aging_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture enable_packet_aging_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossless_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossless_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture rand_lossy_prio setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture rand_lossy_prio setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture start_pfcwd_after_test setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture start_pfcwd_after_test setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture disable_voq_watchdog setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture disable_voq_watchdog setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture number_of_tx_rx_ports setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture number_of_tx_rx_ports setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_ip setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_ip setup ends --------------------
16:01:30 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_api_serv_port setup starts --------------------
16:01:30 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_api_serv_port setup ends --------------------
16:01:30 init._fixture_generator_decorator L0081 INFO | -------------------- fixture snappi_api setup starts --------------------
16:01:30 init._fixture_generator_decorator L0085 INFO | -------------------- fixture snappi_api setup ends --------------------
16:01:31 conftest.rand_one_dut_front_end_hostname L0683 INFO | Randomly select dut sonic-s6100-dut1 for testing
16:01:31 init._fixture_func_decorator L0069 INFO | -------------------- fixture prio_dscp_map setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture prio_dscp_map setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture all_prio_list setup starts --------------------
16:01:32 init._fixture_func_decorator L0076 INFO | -------------------- fixture all_prio_list setup ends --------------------
16:01:32 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossless_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossless_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture lossy_prio_list setup starts --------------------
16:01:33 init._fixture_func_decorator L0076 INFO | -------------------- fixture lossy_prio_list setup ends --------------------
16:01:33 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports setup starts --------------------
16:01:34 conftest.generate_port_lists L1590 INFO | Generate dut_port_map: {'sonic-s6100-dut1': ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']}
16:01:34 conftest.generate_port_lists L1613 INFO | Generate port_list: ['sonic-s6100-dut1|Ethernet0', 'sonic-s6100-dut1|Ethernet8', 'sonic-s6100-dut1|Ethernet16', 'sonic-s6100-dut1|Ethernet24']
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture get_snappi_ports_single_dut setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports_single_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture get_snappi_ports setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture snappi_port_selection setup starts --------------------
16:01:34 init._fixture_func_decorator L0076 INFO | -------------------- fixture snappi_port_selection setup ends --------------------
16:01:34 init.loganalyzer L0074 INFO | Log analyzer is disabled
16:01:34 init.memory_utilization L0125 INFO | Hostname: sonic-s6100-dut1, Hwsku: Accton-AS9716-32D, Platform: x86_64-accton_as9716_32d-r0
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=monit, cmd=sudo monit status, memory_params={'memory_usage': {'memory_increase_threshold': {'type': 'value', 'value': 10}, 'memory_high_threshold': {'type': 'value', 'value': 70}}}, memory_check=<function parse_monit_status_output at 0x7f9baa8983a0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=top, cmd=top -b -n 1, memory_params={'bgpd': {'memory_increase_threshold': {'type': 'value', 'value': 128}, 'memory_high_threshold': None}, 'zebra': {'memory_increase_threshold': {'type': 'value', 'value': 64}, 'memory_high_threshold': None}}, memory_check=<function parse_top_output at 0x7f9baa88cd30>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=free, cmd=free -m, memory_params={'used': {'memory_increase_threshold': {'type': 'percentage', 'value': '20%'}, 'memory_high_threshold': None}}, memory_check=<function parse_free_output at 0x7f9baa898310>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=docker, cmd=docker stats --no-stream, memory_params={'snmp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'pmon': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'lldp': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 4}}, 'gnmi': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}, 'radv': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 3}}, 'syncd': {'memory_increase_threshold': {'type': 'value', 'value': 5}, 'memory_high_threshold': {'type': 'value', 'value': 18}}, 'bgp': {'memory_increase_threshold': {'type': 'value', 'value': 4}, 'memory_high_threshold': {'type': 'value', 'value': 14}}, 'teamd': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 5}}, 'swss': {'memory_increase_threshold': {'type': 'value', 'value': 3}, 'memory_high_threshold': {'type': 'value', 'value': 8}}, 'database': {'memory_increase_threshold': {'type': 'value', 'value': 2}, 'memory_high_threshold': {'type': 'value', 'value': 6}}}, memory_check=<function parse_docker_stats_output at 0x7f9baa898430>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_bgp, cmd=vtysh -c "show memory bgp", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 32}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 memory_utilization.register_command L0023 INFO | Registering command: name=frr_zebra, cmd=vtysh -c "show memory zebra", memory_params={'used': {'memory_increase_threshold': [{'type': 'percentage', 'value': '50%'}, {'type': 'value', 'value': 16}], 'memory_high_threshold': {'type': 'value', 'value': 128}}}, memory_check=<function parse_frr_memory_output at 0x7f9baa8984c0>
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture multidut_port_info setup starts --------------------
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture multidut_port_info setup ends --------------------
16:01:34 init._fixture_generator_decorator L0081 INFO | -------------------- fixture setup_ports_and_dut setup starts --------------------
16:01:34 helper.setup_ports_and_dut L0152 INFO | Running test for testbed subtype: single-dut-single-asic
16:01:34 init._fixture_generator_decorator L0085 INFO | -------------------- fixture setup_ports_and_dut setup ends --------------------
16:01:34 init._fixture_func_decorator L0069 INFO | -------------------- fixture tgen_port_info setup starts --------------------
16:01:35 init._fixture_func_decorator L0076 INFO | -------------------- fixture tgen_port_info setup ends --------------------
16:01:40 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory bgp"' returned no output
16:01:40 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 memory_utilization.execute_command L0039 WARNING| Command 'vtysh -c "show memory zebra"' returned no output
16:01:41 memory_utilization.parse_frr_memory_outp L0481 WARNING| Empty output for FRR memory command, returning empty values
16:01:41 init.pytest_runtest_setup L0061 INFO | Before test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 7.8}, 'top': {}, 'free': {'used': 1988}, 'docker': {'radv': '0.24', 'syncd': '3.76', 'teamd': '0.26', 'swss': '0.60', 'pmon': '0.76', 'database': '0.88', 'bgp': '0.03', 'lldp': '0.10'}, 'frr_bgp': {}, 'frr_zebra': {}}}, 'after_test': {'sonic-s6100-dut1': {}}}
------------------------------------------------------------------------------------------------------------------------------------------ live log call ------------------------------------------------------------------------------------------------------------------------------------------
16:01:54 connection._warn L0336 WARNING| Verification of certificates is disabled
16:01:54 connection._info L0333 INFO | Determining the platform and rest_port using the 10.36.79.8 address...
16:01:54 connection._warn L0336 WARNING| Unable to connect to http://10.36.79.8:443.
16:01:55 connection._info L0333 INFO | Connection established to https://10.36.79.8:443 on linux
16:02:14 connection._info L0333 INFO | Using IxNetwork api server version 10.25.2406.6
16:02:14 connection._info L0333 INFO | User info IxNetwork/ixnetworkweb/admin-162-10063
16:02:16 snappi_api.info L1488 INFO | snappi-1.31.1
16:02:16 snappi_api.info L1488 INFO | snappi_ixnetwork-1.31.2
16:02:16 snappi_api.info L1488 INFO | ixnetwork_restpy-1.7.0
16:02:16 snappi_api.info L1488 INFO | Config validation 0.020s
16:02:19 snappi_api.info L1488 INFO | Ports configuration 1.715s
16:02:19 snappi_api.info L1488 INFO | Captures configuration 0.200s
16:02:22 snappi_api.info L1488 INFO | Add location hosts [10.36.79.8] 2.336s
16:02:24 snappi_api.info L1488 INFO | Location hosts ready [10.36.79.8] 2.482s
16:02:25 snappi_api.info L1488 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'aresOneOneByFourHundredGigNonFanOut'), ('Port 1', 'aresOneOneByFourHundredGigNonFanOut')]
16:02:25 snappi_api.info L1488 INFO | Aggregation mode speed change 0.412s
16:02:25 snappi_api.info L1488 INFO | Location preemption [10.36.79.8/3, 10.36.79.8/1] 0.143s
16:02:42 snappi_api.info L1488 INFO | Location connect [Port 0, Port 1] 16.540s
16:02:42 snappi_api.info L1488 INFO | Location state check [Port 0, Port 1] 0.363s
16:02:42 snappi_api.info L1488 INFO | Location configuration 23.254s
16:02:46 snappi_api.info L1488 INFO | Layer1 configuration 3.795s
16:02:46 snappi_api.info L1488 INFO | Lag Configuration 0.157s
16:02:47 snappi_api.info L1488 INFO | Convert device config : 0.325s
16:02:47 snappi_api.info L1488 INFO | Create IxNetwork device config : 0.000s
16:02:48 snappi_api.info L1488 INFO | Push IxNetwork device config : 0.963s
16:02:48 snappi_api.info L1488 INFO | Devices configuration 1.391s
16:02:56 snappi_api.info L1488 INFO | Flows configuration 8.034s
16:03:03 snappi_api.info L1488 INFO | Start interfaces 7.636s
16:03:04 snappi_api.info L1488 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
16:03:04 traffic_generation.run_traffic L0433 INFO | Wait for Arp to Resolve ...
16:03:10 traffic_generation.run_traffic L0456 INFO | Starting transmit on all flows ...
16:03:14 snappi_api.info L1488 INFO | Flows generate/apply 3.528s
16:03:27 snappi_api.info L1488 INFO | Flows clear statistics 12.289s
16:03:27 snappi_api.info L1488 INFO | Captures start 0.000s
16:03:30 snappi_api.info L1488 INFO | Flows start 2.733s
16:03:30 traffic_generation.run_traffic L0472 INFO | Polling DUT for traffic statistics for 23 seconds ...
16:03:57 traffic_generation.run_traffic L0491 INFO | Polling TGEN for in-flight traffic statistics...
16:03:59 traffic_generation.run_traffic L0496 INFO | In-flight traffic statistics for flows: ['Test Flow Prio 0', 'Background Flow Prio 1', 'Background Flow Prio 3', 'Background Flow Prio 4', 'Background Flow Prio 5', 'Background Flow Prio 6', 'Background Flow Prio 2']
16:03:59 traffic_generation.run_traffic L0497 INFO | In-flight TX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:03:59 traffic_generation.run_traffic L0498 INFO | In-flight RX frames: [409482758, 63697318, 63697318, 63697318, 63697318, 63697318, 63697318]
16:04:16 traffic_generation.run_traffic L0499 INFO | DUT polling complete
16:04:16 traffic_generation.run_traffic L0510 INFO | Checking if all flows have stopped. Attempt sonic-net#1
16:04:18 traffic_generation.run_traffic L0517 INFO | All test and background traffic flows stopped
16:04:20 traffic_generation.run_traffic L0540 INFO | Dumping per-flow statistics
16:04:21 traffic_generation.run_traffic L0542 INFO | Stopping transmit on all remaining flows
16:04:26 snappi_api.info L1488 INFO | Flows stop 5.387s
PASSED
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants