sonic-mgmt icon indicating copy to clipboard operation
sonic-mgmt copied to clipboard

Snappi API does not identify port configuration for IXIA 4x100Gbps breakout links

Open amitpawar12 opened this issue 1 year ago • 5 comments

Description

We have following configuration in ansible/files/sonic_lab_links.csv:

StartDevice,StartPort,EndDevice,EndPort,BandWidth,VlanID,VlanMode dut-card,dut-port,sonic-API,Card1/Port9.1,100000,,Access

The snappi-API crashes when it reads the file info.

Steps to reproduce the issue:

  1. Add the end-port as card/Port.1 in the lab_links.csv

Describe the results you received: The snappi_api crashes.

Describe the results you expected: The snappi_api should be able to read the breakout link configuration.

@kamalsahu0001

Additional information you deem important:

**Output of `show version`:**

```
(paste your output here)
```

**Attach debug file `sudo generate_dump`:**

```
(paste your output here)
```

amitpawar12 avatar Apr 12 '24 20:04 amitpawar12

Workaround is provided to support breakout ports. Will implement and fix will be available in later snappi versions

kamalsahu0001 avatar Jul 03 '24 22:07 kamalsahu0001

keysight team working on this issue.

arlakshm avatar Jul 10 '24 17:07 arlakshm

Workaround:

Replace below fixture in snappi_helpers.py

def get_ports(self, peer_device=None): """This function returns list of ports that are (1) associated with a chassis (selected earlier using get_fanout_device_details() function) and (2) connected to a peer device (SONiC DUT) as a list of dictionary.

    Note: If you have not used get_fanout_device_details(), by default 0th
        (first) chassis remains selected. If you do not specify peer_device,
        this function will return all the ports of the chassis.

    Args:
        peer_device (str): hostname of the peer device

    Returns:
        Dictionary of chassis card port information.
    """
    retval = []
    for port in self.current_snappi_port_list:
        info_list = port.split('/')
        if 'Card' in port:
            dict_element = {
                'ip': info_list[0],
                'card_id': info_list[1].replace('Card', ''),
                'port_id': info_list[2].replace('Port', ''),
                'peer_port': info_list[3],
                'peer_device': info_list[4],
                'speed': info_list[5]
            }

            if peer_device is None or info_list[4] == peer_device:
                retval.append(dict_element)
        else:
            dict_element = {
                'ip': info_list[0],
                'port_id': info_list[1].replace('Port', ''),
                'peer_port': info_list[2],
                'peer_device': info_list[3],
                'speed': info_list[4]
            }

            if peer_device is None or info_list[3] == peer_device:
                retval.append(dict_element)

    return retval

And change the csv file to <DeviceInterfaceLink BandWidth="100000" EndDevice="snappi-sonic" EndPort="Port8.1" StartDevice="sonic-s6100-dut" StartPort="Ethernet24"/>

Here under EndPort instead of "Card1/Port53", replace it with Port8.1

kamalsahu0001 avatar Jul 10 '24 19:07 kamalsahu0001

DeviceInterfaceLink BandWidth="100000" EndDevice="snapp-sonic" EndPort="Port8.1" StartDevice="sonic-s6100-dut" StartPort="Ethernet0"/

kamalsahu0001 avatar Jul 10 '24 19:07 kamalsahu0001

@sdszhang @rraghav-cisco @kenneth-arista @ysmanman for viz.

abdosi avatar Jul 10 '24 23:07 abdosi

@kamalsahu0001 Do we need to raise a new PR to change the fixture, or okay to close this one?

sdszhang avatar Jul 17 '24 23:07 sdszhang