Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chassis][pytest fails] test_snmp_interfaces failed because of Interface not found in SNMP facts #5156

Open
ysmanman opened this issue Feb 16, 2022 · 2 comments

Comments

@ysmanman
Copy link
Contributor

ysmanman commented Feb 16, 2022

Topo: t2
Failure: AssertionError: Interface not found in SNMP facts

@pytest.mark.bsl
def test_snmp_interfaces(localhost, creds_all_duts, duthosts, enum_rand_one_per_hwsku_hostname, enum_asic_index):
    """compare the snmp facts between observed states and target state"""
    duthost = duthosts[enum_rand_one_per_hwsku_hostname]
    if duthost.is_supervisor_node():
        pytest.skip("interfaces not present on supervisor node")
    hostip = duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host']

    namespace = duthost.get_namespace_from_asic_id(enum_asic_index)
    config_facts  = duthost.config_facts(host=duthost.hostname, source="persistent", namespace=namespace)['ansible_facts']
    snmp_facts = get_snmp_facts(localhost, host=hostip, version="v2c", community=creds_all_duts[duthost]["snmp_rocommunity"], wait=True)['ansible_facts']

    snmp_ifnames = [ v['name'] for k, v in snmp_facts['snmp_interfaces'].items() ]
    print snmp_ifnames

    # Verify all physical ports in snmp interface list
    for _, alias in config_facts['port_name_to_alias_map'].items():

> assert alias in snmp_ifnames, "Interface not found in SNMP facts."
E AssertionError: Interface not found in SNMP facts.

_ = 'Ethernet-Rec0'
alias = u'Recirc0/0'
config_facts = {'BGP_NEIGHBOR': {'10.0.0.101': {'admin_status': u'up', 'asn': u'65011', 'holdtime': u'10', 'keepalive': u'3', ...}, '...alhost': {'asic_name': u'Asic0', 'bgp_asn': u'65100', 'buffer_model': u'traditional', 'cloudt
ype': u'None', ...}}, ...}
creds_all_duts = {<MultiAsicSonicHost> cmp210: {'ansible_become_pass': 'password', 'ansible_ssh_pass': 'arastra', 'ansible_ssh_user': '... &a
pos;password', 'ansible_ssh_pass': 'arastra', 'ansible_ssh_user': 'root', 'bgp_slb_passive_range': '10.255.0.0/25', ...}}
duthost = <MultiAsicSonicHost> cmp210-4
duthosts = <tests.common.devices.duthosts.DutHosts object at 0x7f36027f8510>
enum_asic_index = None
enum_rand_one_per_hwsku_hostname = 'cmp210-4'
hostip = '10.240.76.58'
k = '125'
localhost = <tests.common.devices.local.Localhost object at 0x7f36014a10d0>
namespace = None
snmp_facts = {'ansible_all_ipv4_addresses': [], 'ansible_sysCachedMemory': 1024424, 'ansible_sysTotalBuffMemory': 169208, 'ansible_sysTotalFreeMemery': 11132844,
...}
snmp_ifnames = [u'Ethernet39/1', u'eth0', u'Ethernet40/1', u'Ethernet34/1', u'Ethernet16/1', u'Ethernet30/1', ...]
v = {'adminstatus': u'up', 'cpfcIfIndications': u'0', 'cpfcIfRequests': u'0', 'description': u'ARISTA22T1:Ethernet1&ap
os;, ...}

Description

Steps to reproduce the issue:
1.
2.
3.

Describe the results you received:

Describe the results you expected:

Additional information you deem important:

**Output of `show version`:**

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

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

```
(paste your output here)
```
@abdosi
Copy link
Contributor

abdosi commented Feb 28, 2022

cc @SuvarnaMeenakshi

@sanmalho-git
Copy link
Contributor

FYI - similar to #5157 this might be because of sonic-net/sonic-snmpagent#242

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

No branches or pull requests

3 participants