Skip to content

Commit

Permalink
[test_bgp_speaker] Skip for dualtor testbeds (sonic-net#3852)
Browse files Browse the repository at this point in the history
Approach
What is the motivation for this PR?
Skip test_bgp_speaker for dualtor testbeds.
Signed-off-by: Longxiang Lyu [email protected]

How did you do it?
Define an autouse fixture skip_dualtor to check the testbed name.
  • Loading branch information
lolyu authored and vmittal-msft committed Sep 28, 2021
1 parent d2d62fe commit 449767d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/bgp/test_bgp_speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from tests.common.dualtor.mux_simulator_control import mux_server_url # lgtm[py/unused-import]
from tests.common.dualtor.mux_simulator_control import toggle_all_simulator_ports
from tests.common.dualtor.dual_tor_utils import map_hostname_to_tor_side
from tests.common.helpers.assertions import pytest_require


pytestmark = [
pytest.mark.topology('t0'),
Expand Down Expand Up @@ -55,6 +57,13 @@ def change_route(operation, ptfip, neighbor, route, nexthop, port):
r = requests.post(url, data=data)
assert r.status_code == 200


@pytest.fixture(scope="module", autouse=True)
def skip_dualtor(tbinfo):
"""Skip running `test_bgp_speaker` over dualtor."""
pytest_require("dualtor" not in tbinfo["topo"]["name"], "Skip 'test_bgp_speaker over dualtor.'")


@pytest.fixture(scope="module")
def common_setup_teardown(duthosts, rand_one_dut_hostname, ptfhost, localhost, tbinfo, toggle_all_simulator_ports):

Expand Down

0 comments on commit 449767d

Please sign in to comment.