Skip to content

[Snappi] Support for DUT statistics - Interface counters, PFC counters, and Queue counters.#13848

Merged
yejianquan merged 5 commits intosonic-net:masterfrom
amitpawar12:Issue-13843-DUT-Statistics-Support
Sep 5, 2024
Merged

[Snappi] Support for DUT statistics - Interface counters, PFC counters, and Queue counters.#13848
yejianquan merged 5 commits intosonic-net:masterfrom
amitpawar12:Issue-13843-DUT-Statistics-Support

Conversation

@amitpawar12
Copy link
Contributor

Description of PR

Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
#13843

Type of change

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

Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?

Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?

These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))

These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

Any platform specific information?

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

Documentation

@sdszhang
Copy link
Contributor

@vmittal-msft for viz

@sdszhang
Copy link
Contributor

@kamalsahu0001 @selldinesh

@vmittal-msft vmittal-msft self-assigned this Aug 2, 2024
Copy link
Contributor

Choose a reason for hiding this comment

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

@amitpawar12 What is the difference between get_egress_queue_count and this one ? we may need to use better name here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vmittal-msft :
The get_egress_queue_count returns the egress queue packets ONLY for a certain priority. The get_queue_count is internally calling get_egres_queue_count and returns the dictionary for all the priorities, for a given interface and DUT.

This function is one-stop-place to fetch packet counts for all the priorities for a given interface and DUT.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok let's rename get_queue_count() to get_queue_count_all_prio()

@vmittal-msft
Copy link
Contributor

@amitpawar12 we may plan to add such interface for VoQ stats as well as pfcwd stats so our tests may use them.

@amitpawar12
Copy link
Contributor Author

@amitpawar12 we may plan to add such interface for VoQ stats as well as pfcwd stats so our tests may use them.

@vmittal-msft : Ideally, voq counters, priority-group counters, and drop counters also needs to be added. But they can be targeted in different PR's. Adding is just a one part, we will need to also enhance the test-cases to incorporate checks with these counters.

@amitpawar12 amitpawar12 force-pushed the Issue-13843-DUT-Statistics-Support branch from 302d050 to e02f937 Compare August 7, 2024 19:01
Copy link
Contributor

@sdszhang sdszhang Aug 14, 2024

Choose a reason for hiding this comment

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

can we use something like pfc_dict[dut]['tx_pfc'][0]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment. Nested dictionary will require additional logic to initialize and unpacking them. Needs check for the key errors too.

Copy link
Contributor

@sdszhang sdszhang Aug 14, 2024

Choose a reason for hiding this comment

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

same here. try to use multi level dictionary for easy access instead of customized key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment. The flat dictionary was used because at the end of the test, entire dictionary was converted into data-frame. However, I have added the nested dictionaries for get_interface_stats, get_pfc_count and queue count function and then flattening it, for use in data-frame.

@sdszhang
Copy link
Contributor

@rraghav-cisco for review, Thanks.

@amitpawar12 amitpawar12 force-pushed the Issue-13843-DUT-Statistics-Support branch from a0fe77b to b5ffaad Compare August 28, 2024 20:15
@rlhui rlhui assigned amitpawar12 and unassigned vmittal-msft Sep 1, 2024
@sdszhang
Copy link
Contributor

sdszhang commented Sep 4, 2024

@zhixzhu @vmittal-msft @developfast any further comments? or is it fine to approve the updated change?

Copy link
Collaborator

@yejianquan yejianquan left a comment

Choose a reason for hiding this comment

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

LGTM

@yejianquan yejianquan merged commit ae6e923 into sonic-net:master Sep 5, 2024
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Sep 5, 2024
…s, and Queue counters. (sonic-net#13848)

Description of PR
Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
sonic-net#13843

Approach
What is the motivation for this PR?
Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?
Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?
These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))
These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

co-authorized by: [email protected]
@mssonicbld
Copy link
Collaborator

Cherry-pick PR to 202405: #14429

mssonicbld pushed a commit that referenced this pull request Sep 5, 2024
…s, and Queue counters. (#13848)

Description of PR
Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
#13843

Approach
What is the motivation for this PR?
Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?
Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?
These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))
These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

co-authorized by: [email protected]
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Sep 20, 2024
…s, and Queue counters. (sonic-net#13848)

Description of PR
Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
sonic-net#13843

Approach
What is the motivation for this PR?
Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?
Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?
These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))
These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

co-authorized by: [email protected]
arista-hpandya pushed a commit to arista-hpandya/sonic-mgmt that referenced this pull request Oct 2, 2024
…s, and Queue counters. (sonic-net#13848)

Description of PR
Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
sonic-net#13843

Approach
What is the motivation for this PR?
Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?
Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?
These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))
These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

co-authorized by: [email protected]
yejianquan pushed a commit that referenced this pull request Oct 8, 2024
…14416)

Description of PR
Summary: Adding dut counter verification for PFC Oversubscription cases
Fixes # (issue)
#13596

Approach
Dependency
#13848

What is the motivation for this PR?
Verifies the packet drops from the dut interface counters

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
Output
18:43:03 test_m2o_oversubscribe_lossless.test_m2o L0077 INFO | Running test for testbed subtype: single-dut-single-asic
18:43:03 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet0 with IP 20.1.1.1/24
18:43:05 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet4 with IP 20.1.2.1/24
18:43:07 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet8 with IP 20.1.3.1/24
18:43:10 connection._warn L0246 WARNING| Verification of certificates is disabled
18:43:10 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.59 address...
18:43:10 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.59:443.
18:43:10 connection._info L0243 INFO | Connection established to https://10.36.78.59:443 on linux
18:43:24 connection._info L0243 INFO | Using IxNetwork api server version 10.20.2403.2
18:43:24 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-68-20480
18:43:25 snappi_api.info L1132 INFO | snappi-0.9.1
18:43:25 snappi_api.info L1132 INFO | snappi_ixnetwork-0.8.2
18:43:25 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64
18:43:25 snappi_api.info L1132 INFO | Config validation 0.020s
18:43:27 snappi_api.info L1132 INFO | Ports configuration 1.544s
18:43:27 snappi_api.info L1132 INFO | Captures configuration 0.161s
18:43:30 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.285s
18:43:34 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.212s
18:43:35 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'novusHundredGigNonFanOut'), ('Port 1', 'novusHundredGigNonFanOut'), ('Port 2', 'novusHundredGigNonFanOut')]
18:43:35 snappi_api.info L1132 INFO | Aggregation mode speed change 0.479s
18:43:42 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;1, 10.36.78.53;6;2, 10.36.78.53;6;3] 0.111s
18:44:07 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 25.066s
18:44:07 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown
18:44:07 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.245s
18:44:07 snappi_api.info L1132 INFO | Location configuration 39.389s
18:44:19 snappi_api.info L1132 INFO | Layer1 configuration 12.161s
18:44:19 snappi_api.info L1132 INFO | Lag Configuration 0.082s
18:44:19 snappi_api.info L1132 INFO | Convert device config : 0.224s
18:44:19 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
18:44:20 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.641s
18:44:20 snappi_api.info L1132 INFO | Devices configuration 0.940s
18:44:25 snappi_api.info L1132 INFO | Flows configuration 5.128s
18:45:25 snappi_api.info L1132 INFO | Start interfaces 59.556s
18:45:25 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
18:45:30 traffic_generation.run_traffic L0322 INFO | Wait for Arp to Resolve ...
18:45:36 traffic_generation.run_traffic L0322 INFO | Starting transmit on all flows ...
18:48:41 snappi_api.info L1132 INFO | Flows generate/apply 184.474s
18:48:54 snappi_api.info L1132 INFO | Flows clear statistics 12.396s
18:48:54 snappi_api.info L1132 INFO | Captures start 0.000s
18:49:17 snappi_api.info L1132 INFO | Flows start 22.926s
18:49:17 traffic_generation.run_traffic L0322 INFO | Polling DUT for traffic statistics for 15 seconds ...
18:49:23 traffic_generation.run_traffic L0322 INFO | Polling TGEN for in-flight traffic statistics...
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight traffic statistics for flows: ['Test Flow 1 -> 0', 'Test Flow 2 -> 0', 'Background Flow 1 -> 0', 'Background Flow 2 -> 0']
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight TX frames: [6312174, 6312175, 6310775, 6310775]
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight RX frames: [6311444, 6311444, 6310765, 6310766]
18:49:29 traffic_generation.run_traffic L0322 INFO | DUT polling complete
18:49:29 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #1
18:49:30 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:31 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #2
18:49:32 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:33 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #3
18:49:35 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'stopped', 'stopped']
18:49:36 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #4
18:49:37 traffic_generation.run_traffic L0322 INFO | ['stopped', 'stopped', 'stopped', 'stopped']
18:49:37 traffic_generation.run_traffic L0322 INFO | All test and background traffic flows stopped
18:49:39 traffic_generation.run_traffic L0322 INFO | Dumping per-flow statistics
18:49:40 traffic_generation.run_traffic L0322 INFO | Stopping transmit on all remaining flows
18:49:41 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet0 with ip :20.1.1.1/24
18:49:43 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet4 with ip :20.1.2.1/24
18:49:45 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet8 with ip :20.1.3.1/24
PASSED [100%]
------------------------------------------------------------ live log teardown -------------------------------------------------------------
18:49:47 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_m2o_oversubscribe_lossless[multidut_port_info0]
18:49:48 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 13.9}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 31.3}}}}
18:49:48 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts --------------------
18:50:03 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends --------------------
18:50:03 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends --------------------
18:50:05 conftest.core_dump_and_config_check L2203 INFO | Dumping Disk and Memory Space informataion after test on sonic-s6100-dut1
18:50:06 conftest.core_dump_and_config_check L2207 INFO | Collecting core dumps after test on sonic-s6100-dut1
18:50:07 conftest.core_dump_and_config_check L2224 INFO | Collecting running config after test on sonic-s6100-dut1
18:50:08 conftest.core_dump_and_config_check L2352 WARNING| Core dump or config check failed for test_m2o_oversubscribe_lossless.py, results: {"core_dump_check": {"pass": true, "new_core_dumps": {"sonic-s6100-dut1": []}}, "config_db_check": {"pass": false, "pre_only_config": {"sonic-s6100-dut1": {"null": {"INTERFACE": {"Ethernet0": {}, "Ethernet12": {}, "Ethernet4": {}, "Ethernet8": {}, "Ethernet0|21.1.1.1/24": {}, "Ethernet12|24.1.1.1/24": {}, "Ethernet4|22.1.1.1/24": {}, "Ethernet8|23.1.1.1/24": {}}}}}, "cur_only_config": {"sonic-s6100-dut1": {"null": {}}}, "inconsistent_config": {"sonic-s6100-dut1": {"null": {"PFC_WD": {"pre_value": {"GLOBAL": {"POLL_INTERVAL": "200"}}, "cur_value": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}}}}}}}}
18:50:08 conftest.__dut_reload L2091 INFO | dut reload called on sonic-s6100-dut1
18:50:10 parallel.on_terminate L0085 INFO | process __dut_reload-- terminated with exit code None
18:50:10 parallel.parallel_run L0221 INFO | Completed running processes for target "__dut_reload" in 0:00:01.443244 seconds
18:50:10 conftest.core_dump_and_config_check L2362 INFO | -----$$$$$$$$$$--------------- Executing config reload of config_db_bgp.json -------------$$$$$$$$$$$$$$

============================================================= warnings summary =============================================================
../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.test_completeness
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/pytest_ansible/module_dispatcher/v213.py:100: UserWarning: provided hosts list is empty, only localhost is available
warnings.warn("provided hosts list is empty, only localhost is available")

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/var/AzDevOps/.local/lib/python3.8/site-packages/snappi_ixnetwork/device/utils.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/ixnetwork_restpy/testplatform/sessions/sessions.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
elif LooseVersion(build_number) < LooseVersion('8.52'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------------- live log sessionfinish ----------------------------------------------------------
18:50:41 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs
================================================ 1 passed, 13 warnings in 473.16s (0:07:53) ================================================

co-authorized by: [email protected]
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Oct 8, 2024
…onic-net#14416)

Description of PR
Summary: Adding dut counter verification for PFC Oversubscription cases
Fixes # (issue)
sonic-net#13596

Approach
Dependency
sonic-net#13848

What is the motivation for this PR?
Verifies the packet drops from the dut interface counters

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
Output
18:43:03 test_m2o_oversubscribe_lossless.test_m2o L0077 INFO | Running test for testbed subtype: single-dut-single-asic
18:43:03 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet0 with IP 20.1.1.1/24
18:43:05 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet4 with IP 20.1.2.1/24
18:43:07 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet8 with IP 20.1.3.1/24
18:43:10 connection._warn L0246 WARNING| Verification of certificates is disabled
18:43:10 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.59 address...
18:43:10 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.59:443.
18:43:10 connection._info L0243 INFO | Connection established to https://10.36.78.59:443 on linux
18:43:24 connection._info L0243 INFO | Using IxNetwork api server version 10.20.2403.2
18:43:24 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-68-20480
18:43:25 snappi_api.info L1132 INFO | snappi-0.9.1
18:43:25 snappi_api.info L1132 INFO | snappi_ixnetwork-0.8.2
18:43:25 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64
18:43:25 snappi_api.info L1132 INFO | Config validation 0.020s
18:43:27 snappi_api.info L1132 INFO | Ports configuration 1.544s
18:43:27 snappi_api.info L1132 INFO | Captures configuration 0.161s
18:43:30 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.285s
18:43:34 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.212s
18:43:35 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'novusHundredGigNonFanOut'), ('Port 1', 'novusHundredGigNonFanOut'), ('Port 2', 'novusHundredGigNonFanOut')]
18:43:35 snappi_api.info L1132 INFO | Aggregation mode speed change 0.479s
18:43:42 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;1, 10.36.78.53;6;2, 10.36.78.53;6;3] 0.111s
18:44:07 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 25.066s
18:44:07 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown
18:44:07 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.245s
18:44:07 snappi_api.info L1132 INFO | Location configuration 39.389s
18:44:19 snappi_api.info L1132 INFO | Layer1 configuration 12.161s
18:44:19 snappi_api.info L1132 INFO | Lag Configuration 0.082s
18:44:19 snappi_api.info L1132 INFO | Convert device config : 0.224s
18:44:19 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
18:44:20 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.641s
18:44:20 snappi_api.info L1132 INFO | Devices configuration 0.940s
18:44:25 snappi_api.info L1132 INFO | Flows configuration 5.128s
18:45:25 snappi_api.info L1132 INFO | Start interfaces 59.556s
18:45:25 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
18:45:30 traffic_generation.run_traffic L0322 INFO | Wait for Arp to Resolve ...
18:45:36 traffic_generation.run_traffic L0322 INFO | Starting transmit on all flows ...
18:48:41 snappi_api.info L1132 INFO | Flows generate/apply 184.474s
18:48:54 snappi_api.info L1132 INFO | Flows clear statistics 12.396s
18:48:54 snappi_api.info L1132 INFO | Captures start 0.000s
18:49:17 snappi_api.info L1132 INFO | Flows start 22.926s
18:49:17 traffic_generation.run_traffic L0322 INFO | Polling DUT for traffic statistics for 15 seconds ...
18:49:23 traffic_generation.run_traffic L0322 INFO | Polling TGEN for in-flight traffic statistics...
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight traffic statistics for flows: ['Test Flow 1 -> 0', 'Test Flow 2 -> 0', 'Background Flow 1 -> 0', 'Background Flow 2 -> 0']
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight TX frames: [6312174, 6312175, 6310775, 6310775]
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight RX frames: [6311444, 6311444, 6310765, 6310766]
18:49:29 traffic_generation.run_traffic L0322 INFO | DUT polling complete
18:49:29 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #1
18:49:30 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:31 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #2
18:49:32 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:33 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#3
18:49:35 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'stopped', 'stopped']
18:49:36 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#4
18:49:37 traffic_generation.run_traffic L0322 INFO | ['stopped', 'stopped', 'stopped', 'stopped']
18:49:37 traffic_generation.run_traffic L0322 INFO | All test and background traffic flows stopped
18:49:39 traffic_generation.run_traffic L0322 INFO | Dumping per-flow statistics
18:49:40 traffic_generation.run_traffic L0322 INFO | Stopping transmit on all remaining flows
18:49:41 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet0 with ip :20.1.1.1/24
18:49:43 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet4 with ip :20.1.2.1/24
18:49:45 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet8 with ip :20.1.3.1/24
PASSED [100%]
------------------------------------------------------------ live log teardown -------------------------------------------------------------
18:49:47 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_m2o_oversubscribe_lossless[multidut_port_info0]
18:49:48 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 13.9}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 31.3}}}}
18:49:48 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts --------------------
18:50:03 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends --------------------
18:50:03 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends --------------------
18:50:05 conftest.core_dump_and_config_check L2203 INFO | Dumping Disk and Memory Space informataion after test on sonic-s6100-dut1
18:50:06 conftest.core_dump_and_config_check L2207 INFO | Collecting core dumps after test on sonic-s6100-dut1
18:50:07 conftest.core_dump_and_config_check L2224 INFO | Collecting running config after test on sonic-s6100-dut1
18:50:08 conftest.core_dump_and_config_check L2352 WARNING| Core dump or config check failed for test_m2o_oversubscribe_lossless.py, results: {"core_dump_check": {"pass": true, "new_core_dumps": {"sonic-s6100-dut1": []}}, "config_db_check": {"pass": false, "pre_only_config": {"sonic-s6100-dut1": {"null": {"INTERFACE": {"Ethernet0": {}, "Ethernet12": {}, "Ethernet4": {}, "Ethernet8": {}, "Ethernet0|21.1.1.1/24": {}, "Ethernet12|24.1.1.1/24": {}, "Ethernet4|22.1.1.1/24": {}, "Ethernet8|23.1.1.1/24": {}}}}}, "cur_only_config": {"sonic-s6100-dut1": {"null": {}}}, "inconsistent_config": {"sonic-s6100-dut1": {"null": {"PFC_WD": {"pre_value": {"GLOBAL": {"POLL_INTERVAL": "200"}}, "cur_value": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}}}}}}}}
18:50:08 conftest.__dut_reload L2091 INFO | dut reload called on sonic-s6100-dut1
18:50:10 parallel.on_terminate L0085 INFO | process __dut_reload-- terminated with exit code None
18:50:10 parallel.parallel_run L0221 INFO | Completed running processes for target "__dut_reload" in 0:00:01.443244 seconds
18:50:10 conftest.core_dump_and_config_check L2362 INFO | -----$$$$$$$$$$--------------- Executing config reload of config_db_bgp.json -------------$$$$$$$$$$$$$$

============================================================= warnings summary =============================================================
../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.test_completeness
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/pytest_ansible/module_dispatcher/v213.py:100: UserWarning: provided hosts list is empty, only localhost is available
warnings.warn("provided hosts list is empty, only localhost is available")

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/var/AzDevOps/.local/lib/python3.8/site-packages/snappi_ixnetwork/device/utils.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/ixnetwork_restpy/testplatform/sessions/sessions.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
elif LooseVersion(build_number) < LooseVersion('8.52'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------------- live log sessionfinish ----------------------------------------------------------
18:50:41 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs
================================================ 1 passed, 13 warnings in 473.16s (0:07:53) ================================================

co-authorized by: [email protected]
mssonicbld pushed a commit that referenced this pull request Oct 8, 2024
…14416)

Description of PR
Summary: Adding dut counter verification for PFC Oversubscription cases
Fixes # (issue)
#13596

Approach
Dependency
#13848

What is the motivation for this PR?
Verifies the packet drops from the dut interface counters

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
Output
18:43:03 test_m2o_oversubscribe_lossless.test_m2o L0077 INFO | Running test for testbed subtype: single-dut-single-asic
18:43:03 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet0 with IP 20.1.1.1/24
18:43:05 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet4 with IP 20.1.2.1/24
18:43:07 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet8 with IP 20.1.3.1/24
18:43:10 connection._warn L0246 WARNING| Verification of certificates is disabled
18:43:10 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.59 address...
18:43:10 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.59:443.
18:43:10 connection._info L0243 INFO | Connection established to https://10.36.78.59:443 on linux
18:43:24 connection._info L0243 INFO | Using IxNetwork api server version 10.20.2403.2
18:43:24 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-68-20480
18:43:25 snappi_api.info L1132 INFO | snappi-0.9.1
18:43:25 snappi_api.info L1132 INFO | snappi_ixnetwork-0.8.2
18:43:25 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64
18:43:25 snappi_api.info L1132 INFO | Config validation 0.020s
18:43:27 snappi_api.info L1132 INFO | Ports configuration 1.544s
18:43:27 snappi_api.info L1132 INFO | Captures configuration 0.161s
18:43:30 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.285s
18:43:34 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.212s
18:43:35 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'novusHundredGigNonFanOut'), ('Port 1', 'novusHundredGigNonFanOut'), ('Port 2', 'novusHundredGigNonFanOut')]
18:43:35 snappi_api.info L1132 INFO | Aggregation mode speed change 0.479s
18:43:42 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;1, 10.36.78.53;6;2, 10.36.78.53;6;3] 0.111s
18:44:07 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 25.066s
18:44:07 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown
18:44:07 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.245s
18:44:07 snappi_api.info L1132 INFO | Location configuration 39.389s
18:44:19 snappi_api.info L1132 INFO | Layer1 configuration 12.161s
18:44:19 snappi_api.info L1132 INFO | Lag Configuration 0.082s
18:44:19 snappi_api.info L1132 INFO | Convert device config : 0.224s
18:44:19 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
18:44:20 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.641s
18:44:20 snappi_api.info L1132 INFO | Devices configuration 0.940s
18:44:25 snappi_api.info L1132 INFO | Flows configuration 5.128s
18:45:25 snappi_api.info L1132 INFO | Start interfaces 59.556s
18:45:25 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
18:45:30 traffic_generation.run_traffic L0322 INFO | Wait for Arp to Resolve ...
18:45:36 traffic_generation.run_traffic L0322 INFO | Starting transmit on all flows ...
18:48:41 snappi_api.info L1132 INFO | Flows generate/apply 184.474s
18:48:54 snappi_api.info L1132 INFO | Flows clear statistics 12.396s
18:48:54 snappi_api.info L1132 INFO | Captures start 0.000s
18:49:17 snappi_api.info L1132 INFO | Flows start 22.926s
18:49:17 traffic_generation.run_traffic L0322 INFO | Polling DUT for traffic statistics for 15 seconds ...
18:49:23 traffic_generation.run_traffic L0322 INFO | Polling TGEN for in-flight traffic statistics...
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight traffic statistics for flows: ['Test Flow 1 -> 0', 'Test Flow 2 -> 0', 'Background Flow 1 -> 0', 'Background Flow 2 -> 0']
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight TX frames: [6312174, 6312175, 6310775, 6310775]
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight RX frames: [6311444, 6311444, 6310765, 6310766]
18:49:29 traffic_generation.run_traffic L0322 INFO | DUT polling complete
18:49:29 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #1
18:49:30 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:31 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #2
18:49:32 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:33 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #3
18:49:35 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'stopped', 'stopped']
18:49:36 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #4
18:49:37 traffic_generation.run_traffic L0322 INFO | ['stopped', 'stopped', 'stopped', 'stopped']
18:49:37 traffic_generation.run_traffic L0322 INFO | All test and background traffic flows stopped
18:49:39 traffic_generation.run_traffic L0322 INFO | Dumping per-flow statistics
18:49:40 traffic_generation.run_traffic L0322 INFO | Stopping transmit on all remaining flows
18:49:41 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet0 with ip :20.1.1.1/24
18:49:43 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet4 with ip :20.1.2.1/24
18:49:45 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet8 with ip :20.1.3.1/24
PASSED [100%]
------------------------------------------------------------ live log teardown -------------------------------------------------------------
18:49:47 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_m2o_oversubscribe_lossless[multidut_port_info0]
18:49:48 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 13.9}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 31.3}}}}
18:49:48 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts --------------------
18:50:03 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends --------------------
18:50:03 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends --------------------
18:50:05 conftest.core_dump_and_config_check L2203 INFO | Dumping Disk and Memory Space informataion after test on sonic-s6100-dut1
18:50:06 conftest.core_dump_and_config_check L2207 INFO | Collecting core dumps after test on sonic-s6100-dut1
18:50:07 conftest.core_dump_and_config_check L2224 INFO | Collecting running config after test on sonic-s6100-dut1
18:50:08 conftest.core_dump_and_config_check L2352 WARNING| Core dump or config check failed for test_m2o_oversubscribe_lossless.py, results: {"core_dump_check": {"pass": true, "new_core_dumps": {"sonic-s6100-dut1": []}}, "config_db_check": {"pass": false, "pre_only_config": {"sonic-s6100-dut1": {"null": {"INTERFACE": {"Ethernet0": {}, "Ethernet12": {}, "Ethernet4": {}, "Ethernet8": {}, "Ethernet0|21.1.1.1/24": {}, "Ethernet12|24.1.1.1/24": {}, "Ethernet4|22.1.1.1/24": {}, "Ethernet8|23.1.1.1/24": {}}}}}, "cur_only_config": {"sonic-s6100-dut1": {"null": {}}}, "inconsistent_config": {"sonic-s6100-dut1": {"null": {"PFC_WD": {"pre_value": {"GLOBAL": {"POLL_INTERVAL": "200"}}, "cur_value": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}}}}}}}}
18:50:08 conftest.__dut_reload L2091 INFO | dut reload called on sonic-s6100-dut1
18:50:10 parallel.on_terminate L0085 INFO | process __dut_reload-- terminated with exit code None
18:50:10 parallel.parallel_run L0221 INFO | Completed running processes for target "__dut_reload" in 0:00:01.443244 seconds
18:50:10 conftest.core_dump_and_config_check L2362 INFO | -----$$$$$$$$$$--------------- Executing config reload of config_db_bgp.json -------------$$$$$$$$$$$$$$

============================================================= warnings summary =============================================================
../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.test_completeness
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/pytest_ansible/module_dispatcher/v213.py:100: UserWarning: provided hosts list is empty, only localhost is available
warnings.warn("provided hosts list is empty, only localhost is available")

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/var/AzDevOps/.local/lib/python3.8/site-packages/snappi_ixnetwork/device/utils.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/ixnetwork_restpy/testplatform/sessions/sessions.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
elif LooseVersion(build_number) < LooseVersion('8.52'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------------- live log sessionfinish ----------------------------------------------------------
18:50:41 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs
================================================ 1 passed, 13 warnings in 473.16s (0:07:53) ================================================

co-authorized by: [email protected]
hdwhdw pushed a commit to hdwhdw/sonic-mgmt that referenced this pull request Oct 10, 2024
…onic-net#14416)

Description of PR
Summary: Adding dut counter verification for PFC Oversubscription cases
Fixes # (issue)
sonic-net#13596

Approach
Dependency
sonic-net#13848

What is the motivation for this PR?
Verifies the packet drops from the dut interface counters

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
Output
18:43:03 test_m2o_oversubscribe_lossless.test_m2o L0077 INFO | Running test for testbed subtype: single-dut-single-asic
18:43:03 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet0 with IP 20.1.1.1/24
18:43:05 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet4 with IP 20.1.2.1/24
18:43:07 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet8 with IP 20.1.3.1/24
18:43:10 connection._warn L0246 WARNING| Verification of certificates is disabled
18:43:10 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.59 address...
18:43:10 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.59:443.
18:43:10 connection._info L0243 INFO | Connection established to https://10.36.78.59:443 on linux
18:43:24 connection._info L0243 INFO | Using IxNetwork api server version 10.20.2403.2
18:43:24 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-68-20480
18:43:25 snappi_api.info L1132 INFO | snappi-0.9.1
18:43:25 snappi_api.info L1132 INFO | snappi_ixnetwork-0.8.2
18:43:25 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64
18:43:25 snappi_api.info L1132 INFO | Config validation 0.020s
18:43:27 snappi_api.info L1132 INFO | Ports configuration 1.544s
18:43:27 snappi_api.info L1132 INFO | Captures configuration 0.161s
18:43:30 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.285s
18:43:34 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.212s
18:43:35 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'novusHundredGigNonFanOut'), ('Port 1', 'novusHundredGigNonFanOut'), ('Port 2', 'novusHundredGigNonFanOut')]
18:43:35 snappi_api.info L1132 INFO | Aggregation mode speed change 0.479s
18:43:42 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;1, 10.36.78.53;6;2, 10.36.78.53;6;3] 0.111s
18:44:07 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 25.066s
18:44:07 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown
18:44:07 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.245s
18:44:07 snappi_api.info L1132 INFO | Location configuration 39.389s
18:44:19 snappi_api.info L1132 INFO | Layer1 configuration 12.161s
18:44:19 snappi_api.info L1132 INFO | Lag Configuration 0.082s
18:44:19 snappi_api.info L1132 INFO | Convert device config : 0.224s
18:44:19 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
18:44:20 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.641s
18:44:20 snappi_api.info L1132 INFO | Devices configuration 0.940s
18:44:25 snappi_api.info L1132 INFO | Flows configuration 5.128s
18:45:25 snappi_api.info L1132 INFO | Start interfaces 59.556s
18:45:25 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
18:45:30 traffic_generation.run_traffic L0322 INFO | Wait for Arp to Resolve ...
18:45:36 traffic_generation.run_traffic L0322 INFO | Starting transmit on all flows ...
18:48:41 snappi_api.info L1132 INFO | Flows generate/apply 184.474s
18:48:54 snappi_api.info L1132 INFO | Flows clear statistics 12.396s
18:48:54 snappi_api.info L1132 INFO | Captures start 0.000s
18:49:17 snappi_api.info L1132 INFO | Flows start 22.926s
18:49:17 traffic_generation.run_traffic L0322 INFO | Polling DUT for traffic statistics for 15 seconds ...
18:49:23 traffic_generation.run_traffic L0322 INFO | Polling TGEN for in-flight traffic statistics...
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight traffic statistics for flows: ['Test Flow 1 -> 0', 'Test Flow 2 -> 0', 'Background Flow 1 -> 0', 'Background Flow 2 -> 0']
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight TX frames: [6312174, 6312175, 6310775, 6310775]
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight RX frames: [6311444, 6311444, 6310765, 6310766]
18:49:29 traffic_generation.run_traffic L0322 INFO | DUT polling complete
18:49:29 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #1
18:49:30 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:31 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #2
18:49:32 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:33 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #3
18:49:35 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'stopped', 'stopped']
18:49:36 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt #4
18:49:37 traffic_generation.run_traffic L0322 INFO | ['stopped', 'stopped', 'stopped', 'stopped']
18:49:37 traffic_generation.run_traffic L0322 INFO | All test and background traffic flows stopped
18:49:39 traffic_generation.run_traffic L0322 INFO | Dumping per-flow statistics
18:49:40 traffic_generation.run_traffic L0322 INFO | Stopping transmit on all remaining flows
18:49:41 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet0 with ip :20.1.1.1/24
18:49:43 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet4 with ip :20.1.2.1/24
18:49:45 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet8 with ip :20.1.3.1/24
PASSED [100%]
------------------------------------------------------------ live log teardown -------------------------------------------------------------
18:49:47 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_m2o_oversubscribe_lossless[multidut_port_info0]
18:49:48 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 13.9}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 31.3}}}}
18:49:48 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts --------------------
18:50:03 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends --------------------
18:50:03 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends --------------------
18:50:05 conftest.core_dump_and_config_check L2203 INFO | Dumping Disk and Memory Space informataion after test on sonic-s6100-dut1
18:50:06 conftest.core_dump_and_config_check L2207 INFO | Collecting core dumps after test on sonic-s6100-dut1
18:50:07 conftest.core_dump_and_config_check L2224 INFO | Collecting running config after test on sonic-s6100-dut1
18:50:08 conftest.core_dump_and_config_check L2352 WARNING| Core dump or config check failed for test_m2o_oversubscribe_lossless.py, results: {"core_dump_check": {"pass": true, "new_core_dumps": {"sonic-s6100-dut1": []}}, "config_db_check": {"pass": false, "pre_only_config": {"sonic-s6100-dut1": {"null": {"INTERFACE": {"Ethernet0": {}, "Ethernet12": {}, "Ethernet4": {}, "Ethernet8": {}, "Ethernet0|21.1.1.1/24": {}, "Ethernet12|24.1.1.1/24": {}, "Ethernet4|22.1.1.1/24": {}, "Ethernet8|23.1.1.1/24": {}}}}}, "cur_only_config": {"sonic-s6100-dut1": {"null": {}}}, "inconsistent_config": {"sonic-s6100-dut1": {"null": {"PFC_WD": {"pre_value": {"GLOBAL": {"POLL_INTERVAL": "200"}}, "cur_value": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}}}}}}}}
18:50:08 conftest.__dut_reload L2091 INFO | dut reload called on sonic-s6100-dut1
18:50:10 parallel.on_terminate L0085 INFO | process __dut_reload-- terminated with exit code None
18:50:10 parallel.parallel_run L0221 INFO | Completed running processes for target "__dut_reload" in 0:00:01.443244 seconds
18:50:10 conftest.core_dump_and_config_check L2362 INFO | -----$$$$$$$$$$--------------- Executing config reload of config_db_bgp.json -------------$$$$$$$$$$$$$$

============================================================= warnings summary =============================================================
../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.test_completeness
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/pytest_ansible/module_dispatcher/v213.py:100: UserWarning: provided hosts list is empty, only localhost is available
warnings.warn("provided hosts list is empty, only localhost is available")

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/var/AzDevOps/.local/lib/python3.8/site-packages/snappi_ixnetwork/device/utils.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/ixnetwork_restpy/testplatform/sessions/sessions.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
elif LooseVersion(build_number) < LooseVersion('8.52'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------------- live log sessionfinish ----------------------------------------------------------
18:50:41 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs
================================================ 1 passed, 13 warnings in 473.16s (0:07:53) ================================================

co-authorized by: [email protected]
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
…s, and Queue counters. (sonic-net#13848)

Description of PR
Support to pull the DUT statistics, namely interface counters, PFC counters and Queue counters.

This support will enable users to pull the DUT statistics run-time and capture them in form of dictionary for further processing.

Summary:
Fixes # (issue)
sonic-net#13843

Approach
What is the motivation for this PR?
Currently, there is no one stop-place to fetch the DUT statistics and use them for verification, especially the SNAPPI testcases. There should be some way to pull the DUT statistics ( at least important ones) and use them for verification.

How did you do it?
Clear counters:
Common function to clear interface, PFC and queue counter stats.

Interface counters:
Ability to fetch the interface counters for a given DUT and port. Returns dictionary with keys - Rx and Tx packet count, Rx and Tx failures (Error + drops + ovr), and Rx and Tx throughput in Mbps.

PFC counters:
Ability to fetch the PFC counters for a given DUT and port. Returns dictionary with keys - Rx and Tx PFC for the given DUT, port and priority.

Queue counters:
Ability to fetch the Queue counters for a given DUT and port. Internally calls get_egress_queue_count for all the priorities. Returns dictionary with as key with transmitted packets as counter.

How did you verify/test it?
These functions are called as part of new testcases for PFC-ECN.

    for dut, port in dutport_list:
        f_stats = update_dict(m, f_stats, interface_stats(dut, port))
        f_stats = update_dict(m, f_stats, get_pfc_count(dut, port))
        f_stats = update_dict(m, f_stats, get_queue_count(dut, port))
These are then used to create CSV with raw DUT statistics and then to summarize the test in the end.

co-authorized by: [email protected]
vikshaw-Nokia pushed a commit to vikshaw-Nokia/sonic-mgmt that referenced this pull request Oct 23, 2024
…onic-net#14416)

Description of PR
Summary: Adding dut counter verification for PFC Oversubscription cases
Fixes # (issue)
sonic-net#13596

Approach
Dependency
sonic-net#13848

What is the motivation for this PR?
Verifies the packet drops from the dut interface counters

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
Output
18:43:03 test_m2o_oversubscribe_lossless.test_m2o L0077 INFO | Running test for testbed subtype: single-dut-single-asic
18:43:03 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet0 with IP 20.1.1.1/24
18:43:05 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet4 with IP 20.1.2.1/24
18:43:07 snappi_fixtures.__intf_config_multidut L0796 INFO | Configuring Dut: sonic-s6100-dut1 with port Ethernet8 with IP 20.1.3.1/24
18:43:10 connection._warn L0246 WARNING| Verification of certificates is disabled
18:43:10 connection._info L0243 INFO | Determining the platform and rest_port using the 10.36.78.59 address...
18:43:10 connection._warn L0246 WARNING| Unable to connect to http://10.36.78.59:443.
18:43:10 connection._info L0243 INFO | Connection established to https://10.36.78.59:443 on linux
18:43:24 connection._info L0243 INFO | Using IxNetwork api server version 10.20.2403.2
18:43:24 connection._info L0243 INFO | User info IxNetwork/ixnetworkweb/admin-68-20480
18:43:25 snappi_api.info L1132 INFO | snappi-0.9.1
18:43:25 snappi_api.info L1132 INFO | snappi_ixnetwork-0.8.2
18:43:25 snappi_api.info L1132 INFO | ixnetwork_restpy-1.0.64
18:43:25 snappi_api.info L1132 INFO | Config validation 0.020s
18:43:27 snappi_api.info L1132 INFO | Ports configuration 1.544s
18:43:27 snappi_api.info L1132 INFO | Captures configuration 0.161s
18:43:30 snappi_api.info L1132 INFO | Add location hosts [10.36.78.53] 2.285s
18:43:34 snappi_api.info L1132 INFO | Location hosts ready [10.36.78.53] 4.212s
18:43:35 snappi_api.info L1132 INFO | Speed conversion is not require for (port.name, speed) : [('Port 0', 'novusHundredGigNonFanOut'), ('Port 1', 'novusHundredGigNonFanOut'), ('Port 2', 'novusHundredGigNonFanOut')]
18:43:35 snappi_api.info L1132 INFO | Aggregation mode speed change 0.479s
18:43:42 snappi_api.info L1132 INFO | Location preemption [10.36.78.53;6;1, 10.36.78.53;6;2, 10.36.78.53;6;3] 0.111s
18:44:07 snappi_api.info L1132 INFO | Location connect [Port 0, Port 1, Port 2] 25.066s
18:44:07 snappi_api.warning L1138 WARNING| Port 0 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 1 connectedLinkDown
18:44:07 snappi_api.warning L1138 WARNING| Port 2 connectedLinkDown
18:44:07 snappi_api.info L1132 INFO | Location state check [Port 0, Port 1, Port 2] 0.245s
18:44:07 snappi_api.info L1132 INFO | Location configuration 39.389s
18:44:19 snappi_api.info L1132 INFO | Layer1 configuration 12.161s
18:44:19 snappi_api.info L1132 INFO | Lag Configuration 0.082s
18:44:19 snappi_api.info L1132 INFO | Convert device config : 0.224s
18:44:19 snappi_api.info L1132 INFO | Create IxNetwork device config : 0.000s
18:44:20 snappi_api.info L1132 INFO | Push IxNetwork device config : 0.641s
18:44:20 snappi_api.info L1132 INFO | Devices configuration 0.940s
18:44:25 snappi_api.info L1132 INFO | Flows configuration 5.128s
18:45:25 snappi_api.info L1132 INFO | Start interfaces 59.556s
18:45:25 snappi_api.info L1132 INFO | IxNet - The Traffic Item was modified. Please perform a Traffic Generate to update the associated traffic Flow Groups
18:45:30 traffic_generation.run_traffic L0322 INFO | Wait for Arp to Resolve ...
18:45:36 traffic_generation.run_traffic L0322 INFO | Starting transmit on all flows ...
18:48:41 snappi_api.info L1132 INFO | Flows generate/apply 184.474s
18:48:54 snappi_api.info L1132 INFO | Flows clear statistics 12.396s
18:48:54 snappi_api.info L1132 INFO | Captures start 0.000s
18:49:17 snappi_api.info L1132 INFO | Flows start 22.926s
18:49:17 traffic_generation.run_traffic L0322 INFO | Polling DUT for traffic statistics for 15 seconds ...
18:49:23 traffic_generation.run_traffic L0322 INFO | Polling TGEN for in-flight traffic statistics...
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight traffic statistics for flows: ['Test Flow 1 -> 0', 'Test Flow 2 -> 0', 'Background Flow 1 -> 0', 'Background Flow 2 -> 0']
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight TX frames: [6312174, 6312175, 6310775, 6310775]
18:49:25 traffic_generation.run_traffic L0322 INFO | In-flight RX frames: [6311444, 6311444, 6310765, 6310766]
18:49:29 traffic_generation.run_traffic L0322 INFO | DUT polling complete
18:49:29 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#1
18:49:30 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:31 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#2
18:49:32 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'started', 'started']
18:49:33 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#3
18:49:35 traffic_generation.run_traffic L0322 INFO | ['started', 'started', 'stopped', 'stopped']
18:49:36 traffic_generation.run_traffic L0322 INFO | Checking if all flows have stopped. Attempt sonic-net#4
18:49:37 traffic_generation.run_traffic L0322 INFO | ['stopped', 'stopped', 'stopped', 'stopped']
18:49:37 traffic_generation.run_traffic L0322 INFO | All test and background traffic flows stopped
18:49:39 traffic_generation.run_traffic L0322 INFO | Dumping per-flow statistics
18:49:40 traffic_generation.run_traffic L0322 INFO | Stopping transmit on all remaining flows
18:49:41 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet0 with ip :20.1.1.1/24
18:49:43 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet4 with ip :20.1.2.1/24
18:49:45 snappi_fixtures.cleanup_config L0952 INFO | Removing Configuration on Dut: sonic-s6100-dut1 with port Ethernet8 with ip :20.1.3.1/24
PASSED [100%]
------------------------------------------------------------ live log teardown -------------------------------------------------------------
18:49:47 init.pytest_runtest_teardown L0049 INFO | collect memory after test test_m2o_oversubscribe_lossless[multidut_port_info0]
18:49:48 init.pytest_runtest_teardown L0072 INFO | After test: collected memory_values {'before_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 13.9}}}, 'after_test': {'sonic-s6100-dut1': {'monit': {'memory_usage': 31.3}}}}
18:49:48 init._fixture_generator_decorator L0093 INFO | -------------------- fixture snappi_api teardown starts --------------------
18:50:03 init._fixture_generator_decorator L0102 INFO | -------------------- fixture snappi_api teardown ends --------------------
18:50:03 init._fixture_generator_decorator L0093 INFO | -------------------- fixture start_pfcwd_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture start_pfcwd_after_test teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossy_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossy_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture rand_lossless_prio teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture rand_lossless_prio teardown ends --------------------
18:50:05 init._fixture_generator_decorator L0093 INFO | -------------------- fixture enable_packet_aging_after_test teardown starts --------------------
18:50:05 init._fixture_generator_decorator L0102 INFO | -------------------- fixture enable_packet_aging_after_test teardown ends --------------------
18:50:05 conftest.core_dump_and_config_check L2203 INFO | Dumping Disk and Memory Space informataion after test on sonic-s6100-dut1
18:50:06 conftest.core_dump_and_config_check L2207 INFO | Collecting core dumps after test on sonic-s6100-dut1
18:50:07 conftest.core_dump_and_config_check L2224 INFO | Collecting running config after test on sonic-s6100-dut1
18:50:08 conftest.core_dump_and_config_check L2352 WARNING| Core dump or config check failed for test_m2o_oversubscribe_lossless.py, results: {"core_dump_check": {"pass": true, "new_core_dumps": {"sonic-s6100-dut1": []}}, "config_db_check": {"pass": false, "pre_only_config": {"sonic-s6100-dut1": {"null": {"INTERFACE": {"Ethernet0": {}, "Ethernet12": {}, "Ethernet4": {}, "Ethernet8": {}, "Ethernet0|21.1.1.1/24": {}, "Ethernet12|24.1.1.1/24": {}, "Ethernet4|22.1.1.1/24": {}, "Ethernet8|23.1.1.1/24": {}}}}}, "cur_only_config": {"sonic-s6100-dut1": {"null": {}}}, "inconsistent_config": {"sonic-s6100-dut1": {"null": {"PFC_WD": {"pre_value": {"GLOBAL": {"POLL_INTERVAL": "200"}}, "cur_value": {"Ethernet0": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet12": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet4": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "Ethernet8": {"action": "drop", "detection_time": "200", "restoration_time": "200"}, "GLOBAL": {"POLL_INTERVAL": "200"}}}}}}}}
18:50:08 conftest.__dut_reload L2091 INFO | dut reload called on sonic-s6100-dut1
18:50:10 parallel.on_terminate L0085 INFO | process __dut_reload-- terminated with exit code None
18:50:10 parallel.parallel_run L0221 INFO | Completed running processes for target "__dut_reload" in 0:00:01.443244 seconds
18:50:10 conftest.core_dump_and_config_check L2362 INFO | -----$$$$$$$$$$--------------- Executing config reload of config_db_bgp.json -------------$$$$$$$$$$$$$$

============================================================= warnings summary =============================================================
../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.loganalyzer
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.sanity_check
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.plugins.test_completeness
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755
/usr/local/lib/python3.8/dist-packages/_pytest/config/init.py:755: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: tests.common.dualtor
self.import_plugin(import_spec)

../../../../usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236
/usr/local/lib/python3.8/dist-packages/paramiko/transport.py:236: CryptographyDeprecationWarning: Blowfish has been deprecated
"class": algorithms.Blowfish,

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/pytest_ansible/module_dispatcher/v213.py:100: UserWarning: provided hosts list is empty, only localhost is available
warnings.warn("provided hosts list is empty, only localhost is available")

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/var/AzDevOps/.local/lib/python3.8/site-packages/snappi_ixnetwork/device/utils.py:2: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
from collections import namedtuple, Mapping

snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
snappi_tests/multidut/pfc/test_m2o_oversubscribe_lossless.py::test_m2o_oversubscribe_lossless[multidut_port_info0]
/usr/local/lib/python3.8/dist-packages/ixnetwork_restpy/testplatform/sessions/sessions.py:59: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
elif LooseVersion(build_number) < LooseVersion('8.52'):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------------------------------------------------------- live log sessionfinish ----------------------------------------------------------
18:50:41 init.pytest_terminal_summary L0067 INFO | Can not get Allure report URL. Please check logs
================================================ 1 passed, 13 warnings in 473.16s (0:07:53) ================================================

co-authorized by: [email protected]
yejianquan pushed a commit that referenced this pull request Jan 14, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR #13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
#13655
#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
mssonicbld pushed a commit to mssonicbld/sonic-mgmt that referenced this pull request Jan 14, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
sonic-net#13655
sonic-net#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
mssonicbld pushed a commit that referenced this pull request Jan 15, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR #13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
#13655
#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
yejianquan pushed a commit to yejianquan/sonic-mgmt that referenced this pull request Jan 17, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
sonic-net#13655
sonic-net#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
yejianquan added a commit to yejianquan/sonic-mgmt that referenced this pull request Jan 17, 2025
[Snappi] Infra changes for new PFC-ECN testcases. (sonic-net#13864)

Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary: Fixes # (issue) sonic-net#13655 sonic-net#13215

Approach
What is the motivation for this PR?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.
Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.
Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.
The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.
A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).
Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.
Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
wangxin pushed a commit to wangxin/sonic-mgmt that referenced this pull request Feb 21, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
sonic-net#13655
sonic-net#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
nnelluri-cisco pushed a commit to nnelluri-cisco/sonic-mgmt that referenced this pull request Mar 15, 2025
Description of PR
67989d1312b1778681d6575b12b66aa42fdf05a7

Please review the commit-ID given above.

Original PR13655 was raised to add the new testcases. However, manage the changes efficiently, it was decided to split the original into three PRs for ease in review process.

This PR tracks are the infrastructure related changes required for the execution of the testcases.

Note - PR sonic-net#13848 needs to be merged in first before this PR is merged.

Summary:
Fixes # (issue)
sonic-net#13655
sonic-net#13215

Type of change
 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?
This PR tracks only the infrastructure related changes needed for addition of the new testcases.

How did you do it?
Important changes are listed below:

Change directory - tests/common/snappi_tests/

Additional member variable 'base_flow_config_list' is added as list to class 'SnappiTestParams' in snappi_test_params.py file to accommodate for multiple base-flow-configs.

Existing functions - generate_test_flows, generate_background_flows, generate_pause_flows are modified to check if the base_flow_config_list exists. If it does, then base_flow_config is assigned snappi_extra_params.base_flow_config_list[flow_index]. Else existing code is used.

Existing function - 'verify_egress_queue_frame_count' is modified to check if base_flow_config_list exists. If yes, base_flow_config_list[0] is assigned to dut_port_config, else existing code is used.

The testcases calls 'run_traffic_and_collect_stats' function in traffic_generation file to run and gather IXIA+DUT statistics. Statistics are summarized in test_stats dictionary in return.

A function has been created to access the IXIA rest_py framework. This will in turn can be used to integrate MACSEC related changes in future. Currently, rest_py is used to generate the imix custom profile if the flag is set in the test_def dictionary (defined and passed by the test).

Depending upon the test_duration and test_interval defined in test_def of the test, the test-case will be executed.
At every test_interval, the statistics from IXIA and DUT are pulled in form of dictionary, where date-timestamp is primary key.

Important parameters from IXIA like Tx and Rx throughput, number of packets, latency etc are captured with each interval.

From DUT side, the Rx and Tx packets, loss packets (combination of failures, drops and errors), PFC count, queue counts are captured. Additional functions like - get_pfc_count, get_ingerface_stats etc are defined in the common/snappi_test helper files to assist with the same. The support for the above is added as part of the different pull-request.

At the end of the test, a CSV is created as raw data for the test-case execution. Summary of the test-case is generated in form of text file with same name. The run_sys_test also returns a dictionary test_stats with all the important parameters to be used for the verification of the test.
How did you verify/test it?
Test was executed on the local clone.

Any platform specific information?
These testcases are specifically meant for Broadcom-DNX multi-ASIC based platforms.

co-authorized by: [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants