sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
173 stars 689 forks source link

[Bug]: [Snappi] wrong duthost may be chosen for rx/tx port for multidut snappi tests. #13443

Open sdszhang opened 2 weeks ago

sdszhang commented 2 weeks ago

Issue Description

In pfcwd_multidut_multi_node_helper.py,

def run_pfcwd_multi_node_test(
......
    duthost1 = snappi_extra_params.multi_dut_params.duthost1
    rx_port = snappi_extra_params.multi_dut_params.multi_dut_ports[0]
    rx_port_id_list = [rx_port["port_id"]]
......
    detect_time_sec = get_pfcwd_detect_time(host_ans=duthost1, intf=dut_port,
                                            asic_value=rx_port['asic_value']) / 1000.0
......

Here the duthost1 may not be the same device used in rx_port['peer_device'], therefore will cause failure.

If there are three ports in snappi_extra_params.multi_dut_params.multi_dut_ports: port 1: duthost2, Eth256 port 2: duthost1, Eth264 port 3: duthost2, Eth272

Calling get_pfcwd_detect_time may pass in the wrong port information, such as: get_pfcwd_detect_time( duthost1, Eth256, ...)

Issue seems to be existing in multiple files under multidut folder, not just run_pfcwd_multi_node_test function.

Results you see

        poll_interval_sec = get_pfcwd_poll_interval(duthost1, rx_port['asic_value']) / 1000.0
>       detect_time_sec = get_pfcwd_detect_time(host_ans=duthost1, intf=dut_port,
                                                asic_value=rx_port['asic_value']) / 1000.0
E       TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'

api        = <snappi_ixnetwork.snappi_api.Api object at 0x7f4a933e3190>

Results you expected to see

correct dut and port should be chosen.

Is it platform specific

generic

Relevant log output

No response

Output of show version

No response

Attach files (if any)

No response

sdszhang commented 2 weeks ago

one solution could be save duthost into snappi_extra_params.multi_dut_params.multi_dut_ports. another one maybe find the matched duthost object for each port based on port['peer_device'].