Skip to content

Commit

Permalink
everflow test case fix (#6561)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
This PR #6225 introduced one issue for T0/T1. The pytest will be crashed when running everflow test.

The reason is because the implementation of one fixture, setup_recycle_port, which include the yield but not run into the yield for non t2 case, which will hit one known issue of pytest, which is fixed in newer version of pytest but not in what we are using now.
pytest-dev/pytest#7061

How did you do it?
Change the condition to make sure the yield would be executed

How did you verify/test it?
Run everflow test.

Any platform specific information?
Supported testbed topology if it's a new test case?
  • Loading branch information
StormLiangMS authored Oct 19, 2022
1 parent 5ead051 commit b497aa0
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/everflow/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
@pytest.fixture(autouse=True, scope="package")
def setup_recycle_port(duthosts, tbinfo):
"""Setup recycle port ip address on t2 topo"""
if "t2" not in tbinfo['topo']['name']:
return
for duthost in duthosts.frontend_nodes:
for asic in duthost.asics:
cmd = "sudo config interface -n {ns} ip add Ethernet-Rec{rec} 1.1.1.{an}/32".format(ns=asic.namespace,
rec=asic.asic_index,
an=asic.asic_index+1)
logging.info(cmd)
duthost.command(cmd)
duthost.command("sudo config save -y")
if "t2" in tbinfo['topo']['name']:
for duthost in duthosts.frontend_nodes:
for asic in duthost.asics:
cmd = "sudo config interface -n {ns} ip add Ethernet-Rec{rec} 1.1.1.{an}/32".format(ns=asic.namespace,
rec=asic.asic_index,
an=asic.asic_index+1)
logging.info(cmd)
duthost.command(cmd)
duthost.command("sudo config save -y")
yield
for duthost in duthosts.frontend_nodes:
for asic in duthost.asics:
cmd = "sudo config interface -n {ns} ip remove Ethernet-Rec{rec} 1.1.1.{an}/32".format(ns=asic.namespace,
rec=asic.asic_index,
an=asic.asic_index+1)
logging.info(cmd)
duthost.command(cmd)
duthost.command("sudo config save -y")
if "t2" in tbinfo['topo']['name']:
for duthost in duthosts.frontend_nodes:
for asic in duthost.asics:
cmd = "sudo config interface -n {ns} ip remove Ethernet-Rec{rec} 1.1.1.{an}/32".format(ns=asic.namespace,
rec=asic.asic_index,
an=asic.asic_index+1)
logging.info(cmd)
duthost.command(cmd)
duthost.command("sudo config save -y")

0 comments on commit b497aa0

Please sign in to comment.