Skip to content

Change ipv4 to udp streams in traffic_generation.py for background traffic as well.#15035

Closed
rraghav-cisco wants to merge 9 commits intosonic-net:masterfrom
rraghav-cisco:ipv4_udp
Closed

Change ipv4 to udp streams in traffic_generation.py for background traffic as well.#15035
rraghav-cisco wants to merge 9 commits intosonic-net:masterfrom
rraghav-cisco:ipv4_udp

Conversation

@rraghav-cisco
Copy link
Contributor

Description of PR

Summary:
Fixes the udp part mentioned in (issue)

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?

pls see the udp problem mentioned in the bug above.

How did you do it?

I changed the ipv4 streams to UDP streams, and also added more than one stream for cisco platforms.

How did you verify/test it?

Ran it on my T2 TB.

Any platform specific information?

This change is for the cisco-8000, but applies to all platforms.

@wsycqyz
Copy link
Contributor

wsycqyz commented Oct 21, 2024

The PR test stuck. Try to close the PR and re-open the PR.

@wsycqyz wsycqyz closed this Oct 21, 2024
@wsycqyz wsycqyz reopened this Oct 21, 2024
@rraghav-cisco
Copy link
Contributor Author

@sdszhang : Pls review.

@sdszhang
Copy link
Contributor

sdszhang commented Oct 26, 2024

@rraghav-cisco could you please attach the test result for T0/T1 to make sure no regression? Thanks.

@rraghav-cisco
Copy link
Contributor Author

@sdszhang : I encountered a different issue in single dut run, which I have seen without my changes as well, most likely due to the fact that the multidut entries in variables.py are not applicable to single-dut:

                            if snappi_port['peer_port'] == phy_intf]
                if len(port_ids) != 1:
>                   raise RuntimeError(f"Couldn't find port_ids for matching intf:{phy_intf}. snappi_ports:{snappi_ports}")
E                   RuntimeError: Couldn't find port_ids for matching intf:Ethernet32. snappi_ports:[{'ip': '172.27.145.51', 'card_id': '5', 'port_id': 0, 'peer_port': 'Ethernet0', 'peer_device': 'rdma-m64', 'speed': '100000', 'intf_config_changed': False, 'location': '172.27.145.51;5;4', 'api_server_ip': '172.27.145.51', 'asic_type': 'cisco-8000', 'duthost': <MultiAsicSonicHost rdma-m64>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}, {'ip': '172.27.145.51', 'card_id': '5', 'port_id': 1, 'peer_port': 'Ethernet192', 'peer_device': 'rdma-m64', 'speed': '100000', 'intf_config_changed': False, 'location': '172.27.145.51;5;8', 'api_server_ip': '172.27.145.51', 'asic_type': 'cisco-8000', 'duthost': <MultiAsicSonicHost rdma-m64>, 'snappi_speed_type': 'speed_100_gbps', 'asic_value': None}]

config     = <snappi.snappi.Config object at 0x7f32ea41fc80>
device     = <snappi.snappi.Device object at 0x7f32e9b0cdc0>
dut_mac    = '80:27:6c:de:ae:b8'
duthost    = <MultiAsicSonicHost rdma-m64>
ethernet   = <snappi.snappi.DeviceEthernet object at 0x7f32e9b0cfc0>
gw_addr    = '192.168.0.1'
i          = 1
ip_stack   = <snappi.snappi.DeviceIpv4 object at 0x7f32e9b8af80>
k          = 'Vlan1000'
mac        = '00:11:22:33:44:00'
mg_facts   = {'deployment_id': '1', 'dhcp_servers': ['192.0.0.1', '192.0.0.2', '192.0.0.3', '192.0.0.4'], 'dhcpv6_servers': ['fc02:2000::1', 'fc02:2000::2', 'fc02:2000::3', 'fc02:2000::4'], 'forced_mgmt_routes': ['172.17.0.1/24'], ...}
phy_intf   = 'Ethernet32'
phy_intfs  = ['Ethernet0', 'Ethernet32', 'Ethernet56', 'Ethernet192']
port_config = <SnappiPortConfig id: 0, ip: 192.168.0.2, mac: 00:11:22:33:44:00, gw: 192.168.0.1, gw_mac: 80:27:6c:de:ae:b8,                 prefix_len: 21, type: SnappiPortType.VlanMember, peer_port: Ethernet0>
port_config_list = [<SnappiPortConfig id: 0, ip: 192.168.0.2, mac: 00:11:22:33:44:00, gw: 192.168.0.1, gw_mac: 80:27:6c:de:ae:b8,                 prefix_len: 21, type: SnappiPortType.VlanMember, peer_port: Ethernet0>]
port_id    = 0
port_ids   = []
prefix     = '21'
snappi_ports = [{'api_server_ip': '172.27.145.51', 'asic_type': 'cisco-8000', 'asic_value': None, 'card_id': '5', ...}, {'api_server_ip': '172.27.145.51', 'asic_type': 'cisco-8000', 'asic_value': None, 'card_id': '5', ...}]
v          = {'addr': 'fc02:1000::1', 'attachto': 'Vlan1000', 'mask': '64', 'peer_addr': 'fc02:1000::2', ...}
vlan       = 'Vlan1000'
vlan_facts = {'Vlan1000': {'members': ['Ethernet0', 'Ethernet32', 'Ethernet56', 'Ethernet192'], 'name': 'Vlan1000', 'vlanid': '1000'}}
vlan_intf  = {'Vlan1000': {'addr': '192.168.0.1', 'attachto': 'Vlan1000', 'mask': '255.255.248.0', 'peer_addr': '192.168.0.2', ...}}
vlan_intf_facts = [{'addr': '192.168.0.1', 'attachto': 'Vlan1000', 'mask': '255.255.248.0', 'peer_addr': '192.168.0.2', ...}, {'addr': 'fc02:1000::1', 'attachto': 'Vlan1000', 'mask': '64', 'peer_addr': 'fc02:1000::2', ...}]
vlan_ip_addr = '192.168.0.3'
vlan_ip_addrs = ['192.168.0.2', '192.168.0.3', '192.168.0.4', '192.168.0.5']
vlan_member = {'Vlan1000': ['Ethernet0', 'Ethernet32', 'Ethernet56', 'Ethernet192']}
vlan_subnet = '192.168.0.1/21'

common/snappi_tests/snappi_fixtures.py:233: RuntimeError</failure></testcase></testsuite></testsuites>

After fixing this, it passed:

=========================================================================================================================== PASSES ===========================================================================================================================
______________________________________________________________________________________________________________ test_snappi[multidut_port_info0] ______________________________________________________________________________________________________________
------------------------------------------------------------------------------- generated xml file: /run_logs/ixia/verify-15035/2024-10-29-04-03-10/tr_2024-10-29-04-03-10.xml -------------------------------------------------------------------------------
INFO:root:Can not get Allure report URL. Please check logs
------------------------------------------------------------------------------------------------------------------- live log sessionfinish -------------------------------------------------------------------------------------------------------------------
04:06:39 __init__.pytest_terminal_summary         L0067 INFO   | Can not get Allure report URL. Please check logs
================================================================================================================== short test summary info ===================================================================================================================
PASSED snappi_tests/test_multidut_snappi.py::test_snappi[multidut_port_info0]
========================================================================================================= 1 passed, 4 warnings in 206.54s (0:03:26) ==========================================================================================================
sonic@snappi-m64-202405-sonic-mgmt:/data/tests$ 

@sdszhang
Copy link
Contributor

I just realized that we have skipped the global pause on cisco platform. Do we still need this change in this case?

@rraghav-cisco
Copy link
Contributor Author

I just realized that we have skipped the global pause on cisco platform. Do we still need this change in this case?

@sdszhang , Yes, this PR is independent of the skip for global pause.

@rraghav-cisco
Copy link
Contributor Author

@sdszhang : Any comments?

@sdszhang
Copy link
Contributor

I'm not clear on which test case failure will this PR address? Previously it was global pause test case. However global pause is skipped now, any other test case failed because of this issue?

@rraghav-cisco
Copy link
Contributor Author

Closing this for now, will revisit if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants