Skip to content

Commit

Permalink
skip_all fixture
Browse files Browse the repository at this point in the history
To avoid accidental TCs execution without -m "not dpu", we should add a fixture that validates target device type.
  • Loading branch information
vikumarks committed Sep 15, 2023
1 parent 4a46548 commit 219fe01
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/api/test_dash_acl_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiDashAclGroup:
# object with no attributes
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_direction_lookup_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiDirectionLookupEntry:
# object with no attributes
Expand Down
5 changes: 5 additions & 0 deletions tests/api/test_eni.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiEni:
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_inbound_routing_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiInboundRoutingEntry:
# object with no attributes
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_outbound_ca_to_pa_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiOutboundCaToPaEntry:
# object with no attributes
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_pa_validation_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiPaValidationEntry:
# object with no attributes
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_vip_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiVipEntry:
# object with no attributes
Expand Down
6 changes: 6 additions & 0 deletions tests/api/test_vnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@

import pytest

@pytest.fixture(scope="module", autouse=True)
def skip_all(testbed_instance):
testbed = testbed_instance
if testbed is not None and len(testbed.dpu) != 1:
pytest.skip("invalid for \"{}\" testbed".format(testbed.name))

@pytest.mark.dpu
class TestSaiVnet:
# object with no attributes
Expand Down

0 comments on commit 219fe01

Please sign in to comment.