Skip to content

[snmp_interfaces] add snmp interface counters check#1796

Merged
wangxin merged 3 commits intosonic-net:masterfrom
mykolaf:snmp_count
Jul 7, 2020
Merged

[snmp_interfaces] add snmp interface counters check#1796
wangxin merged 3 commits intosonic-net:masterfrom
mykolaf:snmp_count

Conversation

@mykolaf
Copy link
Contributor

@mykolaf mykolaf commented Jun 19, 2020

Description of PR

Summary:
Update test_snmp_interfaces.py

Depends on snmpagent#133

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

SNMP Interface MIB was updated recently, with vlan interface support.

How did you do it?

How did you verify/test it?

Run the test

Any platform specific information?

Vlan interface counters will be present only if RIF counters are supported. Test this only on Mellanox.

Supported testbed topology if it's a new test case?

Documentation

Mykola Faryma added 2 commits June 17, 2020 17:41
Change-Id: Iead56ba71845ee90a65f521d8a1069102cc59112
Signed-off-by: Mykola Faryma <[email protected]>
Change-Id: Iaccb49c13e9b2260fee6f5a1e78dbd30311c2c80
Signed-off-by: Mykola Faryma <[email protected]>
@mykolaf mykolaf marked this pull request as ready for review June 24, 2020 17:40
def test_snmp_l3vlan_counters(duthost, localhost, creds):
"""Make sure Interface MIB has counters available for l3vlan"""
if duthost.facts["asic_type"] not in ["mellanox"]:
pytest.skip("Skip test due to RIF counter not supported{}".format(duthost.facts["platform"]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not supported{} => not supported on {}

for k, v in snmp_facts['snmp_interfaces'].items():
if "Ethernet" in v['name'] or "PortChannel" in v['name']:
if not v.has_key('ifInErrors') or \
not v.has_key('ifOutErrors') or \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is weird. Please check examples in https://legacy.python.org/dev/peps/pep-0008/#indentation

Change-Id: Ie64d0e856ff94bdbc30c73ba610643ba5126bc2d
Signed-off-by: Mykola Faryma <[email protected]>
@wangxin wangxin merged commit 6907a5e into sonic-net:master Jul 7, 2020
daall added a commit that referenced this pull request Jul 7, 2020
lguohan pushed a commit that referenced this pull request Jul 7, 2020
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.

4 participants