TODO: abstract the snmp OID by SKU
"""
duthost = duthosts[enum_rand_one_per_hwsku_hostname]
hostip = duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host']
host_facts = duthost.setup()['ansible_facts']
if host_facts.has_key("ansible_processor_vcpus"):
host_vcpus = int(host_facts['ansible_processor_vcpus'])
else:
res = duthost.shell("nproc")
host_vcpus = int(res['stdout'])
logger.info("found {} cpu on the dut".format(host_vcpus))
# Gather facts with SNMP version 2
snmp_facts = get_snmp_facts(localhost, host=hostip, version="v2c", community=creds_all_duts[duthost]["snmp_rocommunity"], is_dell=True, wait=True)['ansible_facts']
assert int(snmp_facts['ansible_ChStackUnitCpuUtil5sec'])
try:
for i in range(host_vcpus):
duthost.shell("nohup yes > /dev/null 2>&1 & sleep 1")
# Wait for load to reflect in SNMP
time.sleep(20)
# Gather facts with SNMP version 2
Hi @SuvarnaMeenakshi , @abdosi , we are seeing this issue on CHassis as well. Is someone looking into this? I see get_snmp_facts has this param hardcoded is_dell = True. Is this correct?
Description Pipelines - Run NightlyTest_vmsvc1-t1-nmasic-acs-1.201911_ptest-azp_68453_20220128.1 (azure.com)
pytest snmp/test_snmp_cpu.py --testbed=vmsvc1-t1-nmasic-acs-1 --inventory=../ansible/strsvc,../ansible/veos --testbed_file=../ansible/testbed.csv --host-pattern=svcstr-nmasic-acs-1 --module-path=../ansible/library -s -k test_snmp_cpu
snmp/test_snmp_cpu.py:51:
localhost = <tests.common.devices.local.Localhost object at 0x7f4aca1c1810>, host = u'10.206.144.15', version = 'v2c', community = 'msft', is_dell = True, module_ignore_errors = False, wait = True, timeout = 300, interval = 10
common/helpers/snmp_helpers.py:39: Failed
Steps to reproduce the issue: 1. 2. 3.
Describe the results you received:
Describe the results you expected:
Additional information you deem important: