sonic-net / sonic-mgmt

Configuration management examples for SONiC
Other
201 stars 727 forks source link

[ drop_packets/test_drop_counters.py ] - Fails due to ValueError in T0 Physical Topology #8501

Open Vickyni2 opened 1 year ago

Vickyni2 commented 1 year ago

Description

The test case drop_packets/test_drop_counters.py fails due to Value Error in T0 topology with a physical DUT

Steps to reproduce the issue:

  1. Run the test case in a physical DUT.

Describe the results you received: All the below mentioned cases are failed the same value Error.

Error : 1 def _get_drops_across_all_duthosts(): drop_list = [] for duthost in duthosts.frontend_nodes: pkt_drops = get_pkt_drops(duthost, get_cnt_cli_cmd, asic_index)

we cannot assume the iface name will be same on all the devices for SONiC chassis

        # if the dut_iface is not found ignore this device
        if dut_iface not in pkt_drops:
            continue
      drop_list.append(int(pkt_drops[dut_iface][column_key].replace(",", "")))

E ValueError: invalid literal for int() with base 10: 'N/A'

asic_index = None column_key = 'RX_ERR' drop_list = [] dut_iface = 'Vlan1000' duthost = duthosts = [] get_cnt_cli_cmd = 'intfstat -j ' pkt_drops = {'PortChannel101': {'RX_BPS': 'N/A', 'RX_ERR': 'N/A', 'RX_OK': 'N/A', 'RX_PPS': 'N/A', ...}, 'PortChannel102': {'RX_BP...K': 'N/A', 'RX_PPS': 'N/A', ...}, 'Vlan1000': {'RX_BPS': 'N/A', 'RX_ERR': 'N/A', 'RX_OK': 'N/A', 'RX_PPS': 'N/A', ...}}

common/helpers/drop_counters/drop_counters.py:100: ValueError

Error 2:

def _get_drops_across_all_duthosts():
    drop_list = []
    for duthost in duthosts.frontend_nodes:
        pkt_drops = get_pkt_drops(duthost, get_cnt_cli_cmd, asic_index)
        # we cannot assume the iface name will be same on all the devices for SONiC chassis
        # if the dut_iface is not found ignore this device
        if dut_iface not in pkt_drops:
            continue
      drop_list.append(int(pkt_drops[dut_iface][column_key].replace(",", "")))

E ValueError: invalid literal for int() with base 10: 'N/A'

asic_index = None column_key = 'RX_ERR' drop_list = [] dut_iface = 'Vlan1000' duthost = duthosts = [] get_cnt_cli_cmd = 'intfstat -j ' pkt_drops = {'PortChannel101': {'RX_BPS': 'N/A', 'RX_ERR': 'N/A', 'RX_OK': 'N/A', 'RX_PPS': 'N/A', ...}, 'PortChannel102': {'RX_BP...K': 'N/A', 'RX_PPS': 'N/A', ...}, 'Vlan1000': {'RX_BPS': 'N/A', 'RX_ERR': 'N/A', 'RX_OK': 'N/A', 'RX_PPS': 'N/A', ...}}

common/helpers/drop_counters/drop_counters.py:100: ValueError

FAILED drop_packets/test_drop_counters.py::test_dst_ip_is_loopback_addr[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_dst_ip_is_loopback_addr[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_loopback_addr[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_loopback_addr[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_dst_ip_absent[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_dst_ip_absent[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[port_channel_members-dev-msn2700-01-ipv4] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[port_channel_members-dev-msn2700-01-ipv6] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[vlan_members-dev-msn2700-01-ipv4] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[vlan_members-dev-msn2700-01-ipv6] FAILED drop_packets/test_drop_counters.py::test_dst_ip_absent[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_dst_ip_absent[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[port_channel_members-dev-msn2700-01-ipv4] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[port_channel_members-dev-msn2700-01-ipv6] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[vlan_members-dev-msn2700-01-ipv4] FAILED drop_packets/test_drop_counters.py::test_src_ip_is_multicast_addr[vlan_members-dev-msn2700-01-ipv6] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[port_channel_members-dev-msn2700-01-ipv4-src] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[port_channel_members-dev-msn2700-01-ipv6-src] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[port_channel_members-dev-msn2700-01-ipv4-dst] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[port_channel_members-dev-msn2700-01-ipv6-dst] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[vlan_members-dev-msn2700-01-ipv4-src] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[vlan_members-dev-msn2700-01-ipv6-src] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[vlan_members-dev-msn2700-01-ipv4-dst] FAILED drop_packets/test_drop_counters.py::test_ip_is_zero_addr[vlan_members-dev-msn2700-01-ipv6-dst] FAILED drop_packets/test_drop_counters.py::test_ip_pkt_with_expired_ttl[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_ip_pkt_with_expired_ttl[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[port_channel_members-dev-msn2700-01-version-1] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[port_channel_members-dev-msn2700-01-chksum-10] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[port_channel_members-dev-msn2700-01-ihl-1] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[vlan_members-dev-msn2700-01-version-1] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[vlan_members-dev-msn2700-01-chksum-10] FAILED drop_packets/test_drop_counters.py::test_broken_ip_header[vlan_members-dev-msn2700-01-ihl-1] FAILED drop_packets/test_drop_counters.py::test_absent_ip_header[port_channel_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_absent_ip_header[vlan_members-dev-msn2700-01] FAILED drop_packets/test_drop_counters.py::test_unicast_ip_incorrect_eth_dst[port_channel_members-dev-msn2700-01-01:00:5e:00:01:02] FAILED drop_packets/test_drop_counters.py::test_unicast_ip_incorrect_eth_dst[port_channel_members-dev-msn2700-01-ff:ff:ff:ff:ff:ff] FAILED drop_packets/test_drop_counters.py::test_ip_pkt_with_exceeded_mtu[port_channel_members-dev-msn2700-01] ========= 31 failed, 3 passed, 68 skipped, 27 error in 3096.32 seconds =========

Describe the results you expected:

The test case should pass.

Additional information you deem important:

**Output of `show version`:**

SONiC Software Version: SONiC.202211.269499-59c7d39ef SONiC OS Version: 11 Distribution: Debian 11.6 Kernel: 5.10.0-18-2-amd64 Build commit: 59c7d39ef Build date: Tue May 9 17:58:15 UTC 2023 Built by: AzDevOps@vmss-soni00118K

Platform: x86_64-accton_as7716_32x-r0 HwSKU: Accton-AS7716-32X ASIC: broadcom ASIC Count: 1 Serial Number: N/A Model Number: N/A Hardware Revision: N/A Uptime: 20:09:00 up 7 min, 1 user, load average: 0.85, 0.48, 0.22 Date: Sun 07 Aug 2022 20:09:00

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

```
(paste your output here)
```
bingwang-ms commented 1 year ago

It's because the command intfstat -j returns N/A. Please manually run the command and check the output.

Vickyni2 commented 1 year ago

Hello @bingwang-ms,

I've checked the above command for all the ports return N/A.

admin@dev-msn2700-01:~$ intfstat -j { "Ethernet0": { "RX_BPS": "N/A", "RX_ERR": "N/A", "RX_OK": "N/A", "RX_PPS": "N/A", "TX_BPS": "N/A", "TX_ERR": "N/A", "TX_OK": "N/A", "TX_PPS": "N/A" },