Skip to content

Commit

Permalink
tests fixes for zero ports setups
Browse files Browse the repository at this point in the history
Signed-off-by: Sharon Lutati <slutati@nvidia.com>
  • Loading branch information
slutati1536 committed Jun 28, 2021
1 parent 7e699c1 commit b392c01
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions tests/snmp/test_snmp_default_route.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import pytest
from tests.common.platform.interface_utils import get_port_map

pytestmark = [
pytest.mark.topology('any'),
pytest.mark.device_type('vs')
]

@pytest.fixture(scope='function')
def skip_if_no_ports(duthosts, enum_rand_one_per_hwsku_frontend_hostname):
"""
Fixture that skips test execution in case dut doesn't have data ports
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
for asic_index in duthost.get_frontend_asic_ids():
interface_list = get_port_map(duthost, asic_index)
if not interface_list:
pytest.skip("This test is not supported as there are no data ports in dut")

@pytest.mark.bsl
def test_snmp_default_route(duthosts, enum_rand_one_per_hwsku_frontend_hostname, skip_if_no_ports, localhost, creds_all_duts):
Expand Down

0 comments on commit b392c01

Please sign in to comment.