Skip to content

Convert neighbor-mac ansible testcase to pytest#1984

Merged
yxieca merged 2 commits intosonic-net:masterfrom
judyjoseph:neigh_mac_pytest
Jul 29, 2020
Merged

Convert neighbor-mac ansible testcase to pytest#1984
yxieca merged 2 commits intosonic-net:masterfrom
judyjoseph:neigh_mac_pytest

Conversation

@judyjoseph
Copy link
Contributor

Description of PR

Convert the ansible test neighbour-mac.yml to pytest (test_neighbor_mac.py)

Summary:
Fixes # (issue)

Type of change

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

Approach

What is the motivation for this PR?

How did you do it?

How did you verify/test it?

Here is the output of running the test
pytest arp/test_neighbor_mac.py --testbed=vms6-t0-7060 --inventory=../ansible/str --testbed_file=../ansible/testbed.csv --host-pattern=str-a7060cx-acs-1 --module-path=../ansible/library --skip_sanity -vvvvvv

platform linux2 -- Python 2.7.12, pytest-4.6.5, py-1.8.1, pluggy-0.13.1 -- /usr/bin/python
cachedir: .pytest_cache
ansible: 2.8.7
rootdir: /var/mgmt/tests, inifile: pytest.ini
plugins: forked-1.1.3, xdist-1.28.0, ansible-2.2.2, repeat-0.8.0
collected 2 items

arp/test_neighbor_mac.py::TestNeighborMac::testNeighborMac[0] PASSED [ 50%]
arp/test_neighbor_mac.py::TestNeighborMac::testNeighborMac[1] PASSED [100%]

========================== 2 passed in 31.35 seconds ===========================

Any platform specific information?

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

ptf-32, ptf-64

Documentation

@judyjoseph judyjoseph changed the title Convert ansible/roles/test/tasks/neighbour-mac.yml to pytest (test_ne… Convert ansible (neighbour-mac.yml) to pytest (test_neighbor_mac.py) Jul 28, 2020
@judyjoseph judyjoseph changed the title Convert ansible (neighbour-mac.yml) to pytest (test_neighbor_mac.py) Convert ansible testcase <neighbour-mac.yml> to pytest Jul 28, 2020
@judyjoseph judyjoseph changed the title Convert ansible testcase <neighbour-mac.yml> to pytest Convert neighbor-mac ansible testcase to pytest Jul 28, 2020
@judyjoseph judyjoseph requested review from tahmed-dev and yxieca July 28, 2020 23:57
Retruns:
macIndex (int): index of the mac address used from TEST_MAC
"""
yield request.param

Choose a reason for hiding this comment

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

Why use here yield in case of any teardown is not perform. Return could be used instead

])

@pytest.fixture(autouse=True)
def configureNeighborIpAndPing(self, duthost, ptfhost, macIndex):

Choose a reason for hiding this comment

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

Are we using camel case not only in Class naming but also in function arguments naming (macIndex -> mac_index)?


time.sleep(2)

yield

Choose a reason for hiding this comment

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

Why do we need yield here?

"interface",
"startup",
self.DUT_ETH_IF
])

Choose a reason for hiding this comment

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

Could it be done as one-line command?

import time

from tests.common.helpers.assertions import pytest_assert
from tests.common.config_reload import config_reload
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed. remove

@yxieca yxieca merged commit 7eb4058 into sonic-net:master Jul 29, 2020
@judyjoseph judyjoseph deleted the neigh_mac_pytest branch August 2, 2022 16:06
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
Commits:
f147d9e - 2021-10-27 : [Mux orch] Handle setting unknown mux state (sonic-net#1984) [Prince Sunny]
4618b2b - 2021-10-28 : Change tunnel orch order (sonic-net#1990) [Prince Sunny]
505d52d - 2021-10-20 : Fix the option missing in kernel config issue (sonic-net#1973) [xumia]
7bf4dfb - 2021-10-18 : SAI_REDIS_SWITCH_ATTR_CONTEXT shouldbe the last attribute. This is what sairedis library expects (sonic-net#1935) [judyjoseph]
c58919e - 2021-10-08 : [logfile][202012]: Add option to specify swss rec file name (sonic-net#1946) [judyjoseph]
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
sonic-snmpagent
7e46eb1 [201911][RFC1213]: Initialize lag oid map in reinit_data (sonic-net#234)
aa98ded CPU Spike because of redundant and flooded keyspace notifis handled (sonic-net#230)

sonic-swss
bc4e334 [Mux orch] Handle setting unknown mux state (sonic-net#1984)
bd3630b [tunnel decap] Change tunnel orch order (sonic-net#1977)
87a673a Fix the option missing in kernel config issue (sonic-net#1973)
57967a1 [orchagent] Fix group name of port-buffer-drop in flexcounterorch.cpp (sonic-net#1967)

sonic-utilities
181e8b0 Fix the option missing in kernel config issue (sonic-net#1888)
21c0cc0 [watermarkstat] Fix for error in processing empty array from couters db (sonic-net#1810)
7f15755 [chassis][supervisor][show][interfaces]show interfaces command warning on Supervisor card (sonic-net#1771)
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.

5 participants