-
Notifications
You must be signed in to change notification settings - Fork 740
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
[Multiasic]: Update Interfaces MIB testcase to test multiasic platform #1635
[Multiasic]: Update Interfaces MIB testcase to test multiasic platform #1635
Conversation
platform. Signed-off-by: SuvarnaMeenakshi <[email protected]>
tests/snmp/test_snmp_interfaces.py
Outdated
@@ -9,20 +9,30 @@ def test_snmp_interfaces(ansible_adhoc, duthost, creds): | |||
|
|||
hostip = duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host'] | |||
|
|||
npus = duthost.num_npus() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
num_npus [](start = 20, length = 8)
Is it working for single ASIC SKU? #Closed
tests/snmp/test_snmp_interfaces.py
Outdated
# Verify all port channels in snmp interface list | ||
for po_name in config_facts.get('PORTCHANNEL', {}): | ||
assert po_name in snmp_ifnames | ||
|
||
# Verify management port in snmp interface list | ||
for name in config_facts.get('MGMT_INTERFACE', {}): | ||
assert name in snmp_ifnames |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert name in snmp_ifnames [](start = 8, length = 27)
You can add some string as second parameter for easy troubleshooting. ref: https://www.w3schools.com/python/ref_keyword_assert.asp #Closed
tests/snmp/test_snmp_interfaces.py
Outdated
for po_name in config_facts.get('PORTCHANNEL', {}): | ||
assert po_name in snmp_ifnames | ||
else: | ||
config_facts = duthost.config_facts(host=duthost.hostname, source="persistent")['ansible_facts'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config_facts = duthost.config_facts(host=duthost.hostname, source="persistent")['ansible_facts'] [](start = 8, length = 97)
For single ASIC, you run this twice. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As comments
namespace for multi-asic testbed. Add change to config_facts to retrieve port alias infomration only if alias key exists in PORT table in config_db. Signed-off-by: SuvarnaMeenakshi <[email protected]>
Signed-off-by: SuvarnaMeenakshi <[email protected]>
@@ -6,26 +6,39 @@ | |||
] | |||
|
|||
@pytest.mark.bsl | |||
def test_snmp_interfaces(duthosts, rand_one_dut_hostname, localhost, creds): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_snmp_interfaces [](start = 4, length = 20)
You changed function name, but it is used in several places already. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed function name to as it was before.
Signed-off-by: SuvarnaMeenakshi <[email protected]>
Signed-off-by: SuvarnaMeenakshi <[email protected]>
platform.
Signed-off-by: SuvarnaMeenakshi [email protected]
Description of PR
Multiasic platform will have config_db for each ASIC.
Update test_interfaces test case to work for multi asic platform.
Summary:
Fixes # (issue)
Type of change
Approach
How did you do it?
Updated test case to run snmp interfaces test case for each namespace.
How did you verify/test it?
Tested it on multi-asic platform.
pytest --testbed=vms-kvm-multi-asic-t1-lag --inventory=veos_vtb --testbed_file=vtestbed.csv --host-pattern=vlab-07 --module-path=../ansible/library "snmp/test_snmp_interfaces.py" --show-capture=no --disable_loganalyzer --skip_sanity -v
/usr/local/lib/python2.7/dist-packages/ansible/parsing/vault/init.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.
from cryptography.exceptions import InvalidSignature
=============================================================================== test session starts ===============================================================================
platform linux2 -- Python 2.7.17, pytest-4.6.5, py-1.9.0, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
metadata: {'Python': '2.7.17', 'Platform': 'Linux-5.4.0-1031-azure-x86_64-with-Ubuntu-18.04-bionic', 'Packages': {'py': '1.9.0', 'pytest': '4.6.5', 'pluggy': '0.13.1'}, 'Plugins': {u'repeat': u'0.9.1', u'ansible': u'2.2.2', u'xdist': u'1.28.0', u'html': u'1.22.1', u'forked': u'1.3.0', u'metadata': u'1.10.0'}}
ansible: 2.8.12
rootdir: /data/sonic-mgmt/tests, inifile: pytest.ini
plugins: metadata-1.10.0, forked-1.3.0, html-1.22.1, repeat-0.9.1, xdist-1.28.0, ansible-2.2.2
collected 7 items
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-0] PASSED [ 14%]
snmp/test_snmp_interfaces.py::test_snmp_mgmt_interface[vlab-07]
PASSED [28%]
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-1] PASSED [ 42%]
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-2] PASSED [ 57%]
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-3] PASSED [ 71%]
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-4] PASSED [ 85%]
snmp/test_snmp_interfaces.py::test_snmp_interface[vlab-07-5] PASSED [100%]
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation