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
Modified SNMP, LLDP and PC testcases for T2 topology #2935
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@wangxin would you know what the root cause is? These are dhcp failures unrelated to the test cases modified in this commit. Could you help resolve this? |
@wangxin Could you please run again, the failure is not from the code change. Thanks |
The pipeline checks have passed. |
tests/snmp/test_snmp_interfaces.py
Outdated
"""compare the snmp facts between observed states and target state""" | ||
|
||
duthost = duthosts[enum_dut_hostname] | ||
duthost = duthosts[enum_rand_one_per_hwsku_hostname] | ||
hostip = duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host'] | ||
|
||
snmp_facts = localhost.snmp_facts(host=hostip, version="v2c", community=creds["snmp_rocommunity"])['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.
Should the last case in this file be updated from
def test_snmp_interfaces_mibs(duthosts, rand_one_dut_hostname, localhost, creds):
to
def test_snmp_interfaces_mibs(duthosts, enum_rand_one_per_hwsku_hostname, localhost, creds):
?
tests/snmp/test_snmp_interfaces.py
Outdated
@@ -120,9 +120,9 @@ def verify_snmp_speed(facts, snmp_facts, results): | |||
return results | |||
|
|||
@pytest.mark.bsl | |||
def test_snmp_interfaces(localhost, creds, duthosts, enum_dut_hostname, enum_asic_index): | |||
def test_snmp_interfaces(localhost, creds, duthosts, enum_rand_one_per_hwsku_hostname, enum_asic_index): |
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.
This will check interfaces on supervisor node too, right? Was the original intention to use fixture enum_rand_one_per_hwsku_frontend_hostname
?
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.
@wangxin the reason on doing enum_rand_one_per_hwsku_hostname
is because the other test test_snmp_mgmt_interface is applicable to both supervisor and front end node and we found if you have both enum_rand_one_per_hwsku_hostname
and enum_rand_one_per_hwsku_frontend_hostname
in same module correct nodes are not selected, I will add and if condition to skip this test for supervisor for now
tests/snmp/test_snmp_memory.py
Outdated
host_ip = duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host'] | ||
snmp_facts = localhost.snmp_facts(host=host_ip, version="v2c", | ||
community=creds["snmp_rocommunity"])['ansible_facts'] | ||
facts = collect_memory(duthosts, rand_one_dut_hostname) | ||
facts = collect_memory(duthosts, enum_rand_one_per_hwsku_hostname) |
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.
Suggest to change the arguments definition of collect_memory
to:
def collect_memory(duthost):
Then it would be unnecessary to get duthost using code like duthost = duthosts[enum_rand_one_per_hwsku_hostname]
.
And the code here can be just:
facts = collect_memory(duthost)
tests/snmp/test_snmp_phy_entity.py
Outdated
@@ -428,7 +441,7 @@ def _get_transceiver_sensor_data(duthost, name): | |||
|
|||
|
|||
@pytest.mark.disable_loganalyzer | |||
def test_turn_off_pdu_and_check_psu_info(duthost, localhost, creds, pdu_controller): | |||
def test_turn_off_psu_and_check_psu_info(duthosts, enum_rand_one_per_hwsku_hostname, snmp_physical_entity_info, localhost, creds, pdu_controller): |
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.
Currently the pdu_controller
definition is like below:
@pytest.fixture(scope="module")
def pdu_controller(duthosts, rand_one_dut_hostname, conn_graph_facts, pdu):
So, the pdu_controller
object used by this test case could be a PDU controller for other node in current test bed. How to address this issue?
tests/snmp/test_snmp_cpu.py
Outdated
@@ -5,12 +5,12 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
pytestmark = [ | |||
pytest.mark.topology('any'), | |||
pytest.mark.topology('any', 't2'), |
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.
The supported topology is already any
. It's unnecessary to add t2
here.
tests/snmp/test_snmp_lldp.py
Outdated
|
||
pytestmark = [ | ||
pytest.mark.topology('t0', 't1'), | ||
pytest.mark.topology('t0', 't1', 't2'), |
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.
Change the topology mark to any
instead of 't0', 't1', 't2'
?
@@ -4,22 +4,22 @@ | |||
logger = logging.getLogger(__name__) | |||
|
|||
pytestmark = [ | |||
pytest.mark.topology('t0', 't1'), | |||
pytest.mark.topology('t0', 't1', 't2'), |
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.
Change the topology mark to any
instead of 't0', 't1', 't2'
?
tests/snmp/test_snmp_pfc_counters.py
Outdated
@@ -1,12 +1,12 @@ | |||
import pytest | |||
|
|||
pytestmark = [ | |||
pytest.mark.topology('any'), | |||
pytest.mark.topology('any', 't2'), |
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.
The supported topology is already any
. It's unnecessary to add t2
here.
49f8e1d
to
7c20e70
Compare
…present, changing pdu_controller to use enum_rand_one_per_hwsku_hostname, replace rand_one_hostname to enum_rand_one_per_hwsku_hostname in tests
…s as testcase is using.
def test_snmp_psu_status(duthosts, rand_one_dut_hostname, localhost, creds): | ||
duthost = duthosts[rand_one_dut_hostname] | ||
def test_snmp_psu_status(duthosts, enum_supervisor_dut_hostname, localhost, creds): | ||
duthost = duthosts[enum_supervisor_dut_hostname] |
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.
I see. Thanks!
What is the motivation for this PR? Modified testcases to run on multi-dut How did you do it? Replaced 'rand_one_dut_hostname' with 'enum_rand_one_per_hwsku_frontend_hostname' Co-authored-by: falodiya <renu.falodiy@nokia.com>
What is the motivation for this PR? Modified testcases to run on multi-dut How did you do it? Replaced 'rand_one_dut_hostname' with 'enum_rand_one_per_hwsku_frontend_hostname' Co-authored-by: falodiya <renu.falodiy@nokia.com>
Description of PR
Modified testcases for T2 topology, these are very small changes mainly replaced 'rand_one_dut_hostname' with 'enum_rand_one_per_hwsku_frontend_hostname' for multi-dut.
Summary:
Fixes # (issue)
Type of change
Approach
What is the motivation for this PR?
Modified testcases to run on multi-dut
How did you do it?
Replaced 'rand_one_dut_hostname' with 'enum_rand_one_per_hwsku_frontend_hostname'
How did you verify/test it?
Modified and ran on T2 topology
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation