From 8d4888f0e085675d1df1c36b5094044467d93af0 Mon Sep 17 00:00:00 2001 From: selldinesh Date: Thu, 21 Sep 2023 18:47:06 +0000 Subject: [PATCH] adding skip all function --- tests/api/test_acl_counter.py | 10 +++++++++ tests/api/test_acl_entry.py | 10 +++++++++ tests/api/test_acl_range.py | 10 +++++++++ tests/api/test_acl_table.py | 10 +++++++++ tests/api/test_acl_table_group.py | 10 +++++++++ tests/api/test_acl_table_group_member.py | 10 +++++++++ tests/api/test_ars.py | 10 +++++++++ tests/api/test_ars_profile.py | 10 +++++++++ tests/api/test_bridge.py | 26 ------------------------ tests/api/test_buffer_pool.py | 10 +++++++++ tests/api/test_counter.py | 10 +++++++++ tests/api/test_debug_counter.py | 10 +++++++++ tests/api/test_dtel.py | 10 +++++++++ tests/api/test_dtel_event.py | 10 +++++++++ tests/api/test_dtel_int_session.py | 10 +++++++++ tests/api/test_dtel_report_session.py | 10 +++++++++ tests/api/test_generic_programmable.py | 10 +++++++++ tests/api/test_hash.py | 10 +++++++++ tests/api/test_hostif_trap.py | 10 +++++++++ tests/api/test_hostif_trap_group.py | 10 +++++++++ tests/api/test_ipmc_group.py | 10 +++++++++ tests/api/test_isolation_group.py | 10 +++++++++ tests/api/test_isolation_group_member.py | 10 +++++++++ tests/api/test_l2mc_group.py | 10 +++++++++ tests/api/test_lag.py | 10 +++++++++ tests/api/test_macsec.py | 10 +++++++++ tests/api/test_macsec_flow.py | 10 +++++++++ tests/api/test_nat_zone_counter.py | 10 +++++++++ tests/api/test_next_hop_group_map.py | 10 +++++++++ tests/api/test_policer.py | 10 +++++++++ tests/api/test_rpf_group.py | 10 +++++++++ tests/api/test_samplepacket.py | 10 +++++++++ tests/api/test_scheduler.py | 10 +++++++++ tests/api/test_stp.py | 10 +++++++++ tests/api/test_switch_tunnel.py | 10 +++++++++ tests/api/test_tam.py | 10 +++++++++ tests/api/test_tam_collector.py | 10 +++++++++ tests/api/test_tunnel_map.py | 10 +++++++++ tests/api/test_udf.py | 10 +++++++++ tests/api/test_udf_group.py | 10 +++++++++ tests/api/test_udf_match.py | 10 +++++++++ tests/api/test_wred.py | 9 ++++++++ 42 files changed, 409 insertions(+), 26 deletions(-) delete mode 100644 tests/api/test_bridge.py diff --git a/tests/api/test_acl_counter.py b/tests/api/test_acl_counter.py index fb65afe3..713a51d9 100644 --- a/tests/api/test_acl_counter.py +++ b/tests/api/test_acl_counter.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclCounter: # object with parent SAI_OBJECT_TYPE_ACL_TABLE diff --git a/tests/api/test_acl_entry.py b/tests/api/test_acl_entry.py index 3bef4673..9fa514e5 100644 --- a/tests/api/test_acl_entry.py +++ b/tests/api/test_acl_entry.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclEntry: # object with parent SAI_OBJECT_TYPE_ACL_TABLE diff --git a/tests/api/test_acl_range.py b/tests/api/test_acl_range.py index 3bdc5779..711fba0e 100644 --- a/tests/api/test_acl_range.py +++ b/tests/api/test_acl_range.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclRange: # object with no parents diff --git a/tests/api/test_acl_table.py b/tests/api/test_acl_table.py index 707d1919..e847598a 100644 --- a/tests/api/test_acl_table.py +++ b/tests/api/test_acl_table.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclTable: # object with no parents diff --git a/tests/api/test_acl_table_group.py b/tests/api/test_acl_table_group.py index 27d0928b..54598f98 100644 --- a/tests/api/test_acl_table_group.py +++ b/tests/api/test_acl_table_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclTableGroup: # object with no parents diff --git a/tests/api/test_acl_table_group_member.py b/tests/api/test_acl_table_group_member.py index e1f717b6..bfe678a0 100644 --- a/tests/api/test_acl_table_group_member.py +++ b/tests/api/test_acl_table_group_member.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiAclTableGroupMember: # object with parent SAI_OBJECT_TYPE_ACL_TABLE_GROUP SAI_OBJECT_TYPE_ACL_TABLE diff --git a/tests/api/test_ars.py b/tests/api/test_ars.py index 1a0d22da..e41ac075 100644 --- a/tests/api/test_ars.py +++ b/tests/api/test_ars.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiArs: # object with no attributes diff --git a/tests/api/test_ars_profile.py b/tests/api/test_ars_profile.py index 0d45f96e..0bcf31a0 100644 --- a/tests/api/test_ars_profile.py +++ b/tests/api/test_ars_profile.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiArsProfile: # object with no attributes diff --git a/tests/api/test_bridge.py b/tests/api/test_bridge.py deleted file mode 100644 index 2f6115b7..00000000 --- a/tests/api/test_bridge.py +++ /dev/null @@ -1,26 +0,0 @@ -from pprint import pprint - - -class TestSaiBridge: - # object with no parents - - def test_bridge_create(self, npu): - commands = [ - { - 'name': 'bridge_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_BRIDGE', - 'attributes': ['SAI_BRIDGE_ATTR_TYPE', 'SAI_BRIDGE_TYPE_1Q'], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_bridge_remove(self, npu): - commands = [{'name': 'bridge_1', 'op': 'remove'}] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_buffer_pool.py b/tests/api/test_buffer_pool.py index 9584ee11..2114394e 100644 --- a/tests/api/test_buffer_pool.py +++ b/tests/api/test_buffer_pool.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiBufferPool: # object with no parents diff --git a/tests/api/test_counter.py b/tests/api/test_counter.py index 2e3ac1c5..c01c951c 100644 --- a/tests/api/test_counter.py +++ b/tests/api/test_counter.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiCounter: # object with no attributes diff --git a/tests/api/test_debug_counter.py b/tests/api/test_debug_counter.py index d4c566a3..1f41734d 100644 --- a/tests/api/test_debug_counter.py +++ b/tests/api/test_debug_counter.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiDebugCounter: # object with no parents diff --git a/tests/api/test_dtel.py b/tests/api/test_dtel.py index fdd5b268..2e884cb4 100644 --- a/tests/api/test_dtel.py +++ b/tests/api/test_dtel.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiDtel: # object with no attributes diff --git a/tests/api/test_dtel_event.py b/tests/api/test_dtel_event.py index 2b6b2778..da60b056 100644 --- a/tests/api/test_dtel_event.py +++ b/tests/api/test_dtel_event.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiDtelEvent: # object with no parents diff --git a/tests/api/test_dtel_int_session.py b/tests/api/test_dtel_int_session.py index 0a2b9651..50e0baec 100644 --- a/tests/api/test_dtel_int_session.py +++ b/tests/api/test_dtel_int_session.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiDtelIntSession: # object with no attributes diff --git a/tests/api/test_dtel_report_session.py b/tests/api/test_dtel_report_session.py index 6369606c..458cc124 100644 --- a/tests/api/test_dtel_report_session.py +++ b/tests/api/test_dtel_report_session.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiDtelReportSession: # object with no attributes diff --git a/tests/api/test_generic_programmable.py b/tests/api/test_generic_programmable.py index 8dbccde9..de4b322a 100644 --- a/tests/api/test_generic_programmable.py +++ b/tests/api/test_generic_programmable.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiGenericProgrammable: # object with no parents diff --git a/tests/api/test_hash.py b/tests/api/test_hash.py index 38b9e658..f6140f0a 100644 --- a/tests/api/test_hash.py +++ b/tests/api/test_hash.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiHash: # object with no attributes diff --git a/tests/api/test_hostif_trap.py b/tests/api/test_hostif_trap.py index 78f1def6..fbc8e33d 100644 --- a/tests/api/test_hostif_trap.py +++ b/tests/api/test_hostif_trap.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiHostifTrap: # object with no parent objects diff --git a/tests/api/test_hostif_trap_group.py b/tests/api/test_hostif_trap_group.py index ce6db62f..24a21f1c 100644 --- a/tests/api/test_hostif_trap_group.py +++ b/tests/api/test_hostif_trap_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiHostifTrapGroup: # object with no attributes diff --git a/tests/api/test_ipmc_group.py b/tests/api/test_ipmc_group.py index 7879ac80..520b329a 100644 --- a/tests/api/test_ipmc_group.py +++ b/tests/api/test_ipmc_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiIpmcGroup: # object with no attributes diff --git a/tests/api/test_isolation_group.py b/tests/api/test_isolation_group.py index f8fd750f..9db00002 100644 --- a/tests/api/test_isolation_group.py +++ b/tests/api/test_isolation_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiIsolationGroup: # object with no parents diff --git a/tests/api/test_isolation_group_member.py b/tests/api/test_isolation_group_member.py index 7fa6b50d..9ba07047 100644 --- a/tests/api/test_isolation_group_member.py +++ b/tests/api/test_isolation_group_member.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiIsolationGroupMember: # object with parent SAI_OBJECT_TYPE_ISOLATION_GROUP SAI_OBJECT_TYPE_PORT SAI_OBJECT_TYPE_BRIDGE_PORT diff --git a/tests/api/test_l2mc_group.py b/tests/api/test_l2mc_group.py index 1f05f0f4..2c9d0614 100644 --- a/tests/api/test_l2mc_group.py +++ b/tests/api/test_l2mc_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiL2McGroup: # object with no attributes diff --git a/tests/api/test_lag.py b/tests/api/test_lag.py index 2b231d62..893da9bf 100644 --- a/tests/api/test_lag.py +++ b/tests/api/test_lag.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiLag: # object with no attributes diff --git a/tests/api/test_macsec.py b/tests/api/test_macsec.py index b1b66dd7..22989449 100644 --- a/tests/api/test_macsec.py +++ b/tests/api/test_macsec.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiMacsec: # object with no parents diff --git a/tests/api/test_macsec_flow.py b/tests/api/test_macsec_flow.py index acb9b49c..e550a4fd 100644 --- a/tests/api/test_macsec_flow.py +++ b/tests/api/test_macsec_flow.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiMacsecFlow: # object with no parents diff --git a/tests/api/test_nat_zone_counter.py b/tests/api/test_nat_zone_counter.py index 7c17626e..7b5f6eaf 100644 --- a/tests/api/test_nat_zone_counter.py +++ b/tests/api/test_nat_zone_counter.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiNatZoneCounter: # object with no attributes diff --git a/tests/api/test_next_hop_group_map.py b/tests/api/test_next_hop_group_map.py index 0d65717e..1d4b1dfb 100644 --- a/tests/api/test_next_hop_group_map.py +++ b/tests/api/test_next_hop_group_map.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiNextHopGroupMap: # object with no parents diff --git a/tests/api/test_policer.py b/tests/api/test_policer.py index 4c6f3352..3ca7abd6 100644 --- a/tests/api/test_policer.py +++ b/tests/api/test_policer.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiPolicer: # object with no parents diff --git a/tests/api/test_rpf_group.py b/tests/api/test_rpf_group.py index 31fb3f48..79a8bfa9 100644 --- a/tests/api/test_rpf_group.py +++ b/tests/api/test_rpf_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiRpfGroup: # object with no attributes diff --git a/tests/api/test_samplepacket.py b/tests/api/test_samplepacket.py index 79c404c8..0101f777 100644 --- a/tests/api/test_samplepacket.py +++ b/tests/api/test_samplepacket.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiSamplepacket: # object with no parents diff --git a/tests/api/test_scheduler.py b/tests/api/test_scheduler.py index 34fe9acc..299c0109 100644 --- a/tests/api/test_scheduler.py +++ b/tests/api/test_scheduler.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiScheduler: # object with no attributes diff --git a/tests/api/test_stp.py b/tests/api/test_stp.py index 15ec7d21..531b7c43 100644 --- a/tests/api/test_stp.py +++ b/tests/api/test_stp.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiStp: # object with no attributes diff --git a/tests/api/test_switch_tunnel.py b/tests/api/test_switch_tunnel.py index a70f896b..e9b1e620 100644 --- a/tests/api/test_switch_tunnel.py +++ b/tests/api/test_switch_tunnel.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiSwitchTunnel: # object with no parents diff --git a/tests/api/test_tam.py b/tests/api/test_tam.py index 94aa30fe..68806e51 100644 --- a/tests/api/test_tam.py +++ b/tests/api/test_tam.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiTam: # object with no attributes diff --git a/tests/api/test_tam_collector.py b/tests/api/test_tam_collector.py index 6e5eb428..6ee6c239 100644 --- a/tests/api/test_tam_collector.py +++ b/tests/api/test_tam_collector.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiTamCollector: # object with parent SAI_OBJECT_TYPE_TAM_TRANSPORT diff --git a/tests/api/test_tunnel_map.py b/tests/api/test_tunnel_map.py index dfd174bc..e697a647 100644 --- a/tests/api/test_tunnel_map.py +++ b/tests/api/test_tunnel_map.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiTunnelMap: # object with no parents diff --git a/tests/api/test_udf.py b/tests/api/test_udf.py index bc66c284..9a9dbc90 100644 --- a/tests/api/test_udf.py +++ b/tests/api/test_udf.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiUdf: # object with parent SAI_OBJECT_TYPE_UDF_MATCH SAI_OBJECT_TYPE_UDF_GROUP diff --git a/tests/api/test_udf_group.py b/tests/api/test_udf_group.py index 3ad0303b..93bafed3 100644 --- a/tests/api/test_udf_group.py +++ b/tests/api/test_udf_group.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiUdfGroup: # object with no parents diff --git a/tests/api/test_udf_match.py b/tests/api/test_udf_match.py index 53fa01fc..7796e924 100644 --- a/tests/api/test_udf_match.py +++ b/tests/api/test_udf_match.py @@ -1,6 +1,16 @@ from pprint import pprint +import pytest + +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiUdfMatch: # object with no attributes diff --git a/tests/api/test_wred.py b/tests/api/test_wred.py index 5a809f14..f9c90853 100644 --- a/tests/api/test_wred.py +++ b/tests/api/test_wred.py @@ -1,6 +1,15 @@ from pprint import pprint +import pytest +@pytest.fixture(scope='module', autouse=True) +def skip_all(testbed_instance): + testbed = testbed_instance + if testbed is not None and len(testbed.npu) != 1: + pytest.skip('invalid for {} testbed'.format(testbed.name)) + + +@pytest.mark.npu class TestSaiWred: # object with no attributes