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

[snmp_interfaces] add snmp interface counters check #1796

Merged
merged 3 commits into from
Jul 7, 2020

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 <mykolaf@mellanox.com>
Change-Id: Iaccb49c13e9b2260fee6f5a1e78dbd30311c2c80
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
@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 <mykolaf@mellanox.com>
@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