diff --git a/tests/api/test_acl_counter.py b/tests/api/test_acl_counter.py deleted file mode 100644 index fb65afe3..00000000 --- a/tests/api/test_acl_counter.py +++ /dev/null @@ -1,41 +0,0 @@ -from pprint import pprint - - -class TestSaiAclCounter: - # object with parent SAI_OBJECT_TYPE_ACL_TABLE - - def test_acl_counter_create(self, npu): - commands = [ - { - 'name': 'acl_table_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE', - 'attributes': ['SAI_ACL_TABLE_ATTR_ACL_STAGE', 'SAI_ACL_STAGE_INGRESS'], - }, - { - 'name': 'acl_counter_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_COUNTER', - 'attributes': ['SAI_ACL_COUNTER_ATTR_TABLE_ID', '$acl_table_1'], - }, - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_counter_remove(self, npu): - commands = [ - { - 'name': 'acl_counter_1', - 'op': 'remove', - }, - { - 'name': 'acl_table_1', - 'op': 'remove', - }, - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_acl_entry.py b/tests/api/test_acl_entry.py deleted file mode 100644 index 3bef4673..00000000 --- a/tests/api/test_acl_entry.py +++ /dev/null @@ -1,41 +0,0 @@ -from pprint import pprint - - -class TestSaiAclEntry: - # object with parent SAI_OBJECT_TYPE_ACL_TABLE - - def test_acl_entry_create(self, npu): - commands = [ - { - 'name': 'acl_table_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE', - 'attributes': ['SAI_ACL_TABLE_ATTR_ACL_STAGE', 'SAI_ACL_STAGE_INGRESS'], - }, - { - 'name': 'acl_entry_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_ENTRY', - 'attributes': ['SAI_ACL_ENTRY_ATTR_TABLE_ID', '$acl_table_1'], - }, - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_entry_remove(self, npu): - commands = [ - { - 'name': 'acl_entry_1', - 'op': 'remove', - }, - { - 'name': 'acl_table_1', - 'op': 'remove', - }, - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_acl_range.py b/tests/api/test_acl_range.py deleted file mode 100644 index 3bdc5779..00000000 --- a/tests/api/test_acl_range.py +++ /dev/null @@ -1,36 +0,0 @@ -from pprint import pprint - - -class TestSaiAclRange: - # object with no parents - - def test_acl_range_create(self, npu): - commands = [ - { - 'name': 'acl_range_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_RANGE', - 'attributes': [ - 'SAI_ACL_RANGE_ATTR_TYPE', - 'SAI_ACL_RANGE_TYPE_L4_SRC_PORT_RANGE', - 'SAI_ACL_RANGE_ATTR_LIMIT', - '10,20', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_range_remove(self, npu): - commands = [ - { - 'name': 'acl_range_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_acl_table.py b/tests/api/test_acl_table.py deleted file mode 100644 index 707d1919..00000000 --- a/tests/api/test_acl_table.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiAclTable: - # object with no parents - - def test_acl_table_create(self, npu): - commands = [ - { - 'name': 'acl_table_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE', - 'attributes': ['SAI_ACL_TABLE_ATTR_ACL_STAGE', 'SAI_ACL_STAGE_INGRESS'], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_table_remove(self, npu): - commands = [ - { - 'name': 'acl_table_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_acl_table_group.py b/tests/api/test_acl_table_group.py deleted file mode 100644 index 27d0928b..00000000 --- a/tests/api/test_acl_table_group.py +++ /dev/null @@ -1,34 +0,0 @@ -from pprint import pprint - - -class TestSaiAclTableGroup: - # object with no parents - - def test_acl_table_group_create(self, npu): - commands = [ - { - 'name': 'acl_table_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE_GROUP', - 'attributes': [ - 'SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE', - 'SAI_ACL_STAGE_INGRESS', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_table_group_remove(self, npu): - commands = [ - { - 'name': 'acl_table_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_acl_table_group_member.py b/tests/api/test_acl_table_group_member.py deleted file mode 100644 index e1f717b6..00000000 --- a/tests/api/test_acl_table_group_member.py +++ /dev/null @@ -1,61 +0,0 @@ -from pprint import pprint - - -class TestSaiAclTableGroupMember: - # object with parent SAI_OBJECT_TYPE_ACL_TABLE_GROUP SAI_OBJECT_TYPE_ACL_TABLE - - def test_acl_table_group_member_create(self, npu): - commands = [ - { - 'name': 'acl_table_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE_GROUP', - 'attributes': [ - 'SAI_ACL_TABLE_GROUP_ATTR_ACL_STAGE', - 'SAI_ACL_STAGE_INGRESS', - ], - }, - { - 'name': 'acl_table_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE', - 'attributes': ['SAI_ACL_TABLE_ATTR_ACL_STAGE', 'SAI_ACL_STAGE_INGRESS'], - }, - { - 'name': 'acl_table_group_member_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ACL_TABLE_GROUP_MEMBER', - 'attributes': [ - 'SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_GROUP_ID', - '$acl_table_group_1', - 'SAI_ACL_TABLE_GROUP_MEMBER_ATTR_ACL_TABLE_ID', - '$acl_table_1', - 'SAI_ACL_TABLE_GROUP_MEMBER_ATTR_PRIORITY', - '10', - ], - }, - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_acl_table_group_member_remove(self, npu): - commands = [ - { - 'name': 'acl_table_group_member_1', - 'op': 'remove', - }, - { - 'name': 'acl_table_1', - 'op': 'remove', - }, - { - 'name': 'acl_table_group_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 deleted file mode 100644 index 9584ee11..00000000 --- a/tests/api/test_buffer_pool.py +++ /dev/null @@ -1,36 +0,0 @@ -from pprint import pprint - - -class TestSaiBufferPool: - # object with no parents - - def test_buffer_pool_create(self, npu): - commands = [ - { - 'name': 'buffer_pool_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_BUFFER_POOL', - 'attributes': [ - 'SAI_BUFFER_POOL_ATTR_TYPE', - 'SAI_BUFFER_POOL_TYPE_INGRESS', - 'SAI_BUFFER_POOL_ATTR_SIZE', - '10', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_buffer_pool_remove(self, npu): - commands = [ - { - 'name': 'buffer_pool_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_debug_counter.py b/tests/api/test_debug_counter.py deleted file mode 100644 index d4c566a3..00000000 --- a/tests/api/test_debug_counter.py +++ /dev/null @@ -1,34 +0,0 @@ -from pprint import pprint - - -class TestSaiDebugCounter: - # object with no parents - - def test_debug_counter_create(self, npu): - commands = [ - { - 'name': 'debug_counter_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_DEBUG_COUNTER', - 'attributes': [ - 'SAI_DEBUG_COUNTER_ATTR_TYPE', - 'SAI_DEBUG_COUNTER_TYPE_PORT_IN_DROP_REASONS', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_debug_counter_remove(self, npu): - commands = [ - { - 'name': 'debug_counter_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_dtel.py b/tests/api/test_dtel.py new file mode 100644 index 00000000..cf65eef1 --- /dev/null +++ b/tests/api/test_dtel.py @@ -0,0 +1,332 @@ +from pprint import pprint + +import pytest + + +class TestSaiDtel: + # object with no attributes + + def test_dtel_create(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_DTEL', + 'attributes': [], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_dtel_attr_int_endpoint_enable_set') + def test_sai_dtel_attr_int_endpoint_enable_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_INT_ENDPOINT_ENABLE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_int_endpoint_enable_set']) + def test_sai_dtel_attr_int_endpoint_enable_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_INT_ENDPOINT_ENABLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_int_transit_enable_set') + def test_sai_dtel_attr_int_transit_enable_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_INT_TRANSIT_ENABLE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_int_transit_enable_set']) + def test_sai_dtel_attr_int_transit_enable_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_INT_TRANSIT_ENABLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_postcard_enable_set') + def test_sai_dtel_attr_postcard_enable_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_POSTCARD_ENABLE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_postcard_enable_set']) + def test_sai_dtel_attr_postcard_enable_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_POSTCARD_ENABLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_drop_report_enable_set') + def test_sai_dtel_attr_drop_report_enable_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_DROP_REPORT_ENABLE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_drop_report_enable_set']) + def test_sai_dtel_attr_drop_report_enable_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_DROP_REPORT_ENABLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_queue_report_enable_set') + def test_sai_dtel_attr_queue_report_enable_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_QUEUE_REPORT_ENABLE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_queue_report_enable_set']) + def test_sai_dtel_attr_queue_report_enable_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_QUEUE_REPORT_ENABLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_switch_id_set') + def test_sai_dtel_attr_switch_id_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_SWITCH_ID', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_switch_id_set']) + def test_sai_dtel_attr_switch_id_get(self, npu): + commands = [ + {'name': 'dtel_1', 'op': 'get', 'attributes': ['SAI_DTEL_ATTR_SWITCH_ID']} + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_flow_state_clear_cycle_set') + def test_sai_dtel_attr_flow_state_clear_cycle_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_FLOW_STATE_CLEAR_CYCLE', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_flow_state_clear_cycle_set']) + def test_sai_dtel_attr_flow_state_clear_cycle_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_FLOW_STATE_CLEAR_CYCLE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_latency_sensitivity_set') + def test_sai_dtel_attr_latency_sensitivity_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_LATENCY_SENSITIVITY', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_latency_sensitivity_set']) + def test_sai_dtel_attr_latency_sensitivity_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_LATENCY_SENSITIVITY'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_sink_port_list_set') + def test_sai_dtel_attr_sink_port_list_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_SINK_PORT_LIST', 'empty'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_sink_port_list_set']) + def test_sai_dtel_attr_sink_port_list_get(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_ATTR_SINK_PORT_LIST'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'empty', 'Get error, expected empty but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_attr_int_l4_dscp_set') + def test_sai_dtel_attr_int_l4_dscp_set(self, npu): + commands = [ + { + 'name': 'dtel_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_ATTR_INT_L4_DSCP', 'disabled'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_attr_int_l4_dscp_set']) + def test_sai_dtel_attr_int_l4_dscp_get(self, npu): + commands = [ + {'name': 'dtel_1', 'op': 'get', 'attributes': ['SAI_DTEL_ATTR_INT_L4_DSCP']} + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'disabled', ( + 'Get error, expected disabled but got %s' % r_value + ) + + def test_dtel_remove(self, npu): + commands = [{'name': 'dtel_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_dtel_event.py b/tests/api/test_dtel_event.py new file mode 100644 index 00000000..212e8abb --- /dev/null +++ b/tests/api/test_dtel_event.py @@ -0,0 +1,98 @@ +from pprint import pprint + +import pytest + + +class TestSaiDtelEvent: + # object with no parents + + def test_dtel_event_create(self, npu): + commands = [ + { + 'name': 'dtel_event_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_DTEL_EVENT', + 'attributes': [ + 'SAI_DTEL_EVENT_ATTR_TYPE', + 'SAI_DTEL_EVENT_TYPE_FLOW_STATE', + ], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_dtel_event_attr_report_session_set') + def test_sai_dtel_event_attr_report_session_set(self, npu): + commands = [ + { + 'name': 'dtel_event_1', + 'op': 'set', + 'attributes': [ + 'SAI_DTEL_EVENT_ATTR_REPORT_SESSION', + 'SAI_NULL_OBJECT_ID', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_event_attr_report_session_set']) + def test_sai_dtel_event_attr_report_session_get(self, npu): + commands = [ + { + 'name': 'dtel_event_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_EVENT_ATTR_REPORT_SESSION'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_dtel_event_attr_dscp_value_set') + def test_sai_dtel_event_attr_dscp_value_set(self, npu): + commands = [ + { + 'name': 'dtel_event_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_EVENT_ATTR_DSCP_VALUE', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_event_attr_dscp_value_set']) + def test_sai_dtel_event_attr_dscp_value_get(self, npu): + commands = [ + { + 'name': 'dtel_event_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_EVENT_ATTR_DSCP_VALUE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + def test_dtel_event_remove(self, npu): + commands = [{'name': 'dtel_event_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_dtel_int_session.py b/tests/api/test_dtel_int_session.py new file mode 100644 index 00000000..864c2aa6 --- /dev/null +++ b/tests/api/test_dtel_int_session.py @@ -0,0 +1,243 @@ +from pprint import pprint + +import pytest + + +class TestSaiDtelIntSession: + # object with no attributes + + def test_dtel_int_session_create(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_DTEL_INT_SESSION', + 'attributes': [], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_dtel_int_session_attr_max_hop_count_set') + def test_sai_dtel_int_session_attr_max_hop_count_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_MAX_HOP_COUNT', '8'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_max_hop_count_set'] + ) + def test_sai_dtel_int_session_attr_max_hop_count_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_MAX_HOP_COUNT'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '8', 'Get error, expected 8 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_int_session_attr_collect_switch_id_set') + def test_sai_dtel_int_session_attr_collect_switch_id_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_SWITCH_ID', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_collect_switch_id_set'] + ) + def test_sai_dtel_int_session_attr_collect_switch_id_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_SWITCH_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_int_session_attr_collect_switch_ports_set' + ) + def test_sai_dtel_int_session_attr_collect_switch_ports_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': [ + 'SAI_DTEL_INT_SESSION_ATTR_COLLECT_SWITCH_PORTS', + 'false', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_collect_switch_ports_set'] + ) + def test_sai_dtel_int_session_attr_collect_switch_ports_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_SWITCH_PORTS'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_int_session_attr_collect_ingress_timestamp_set' + ) + def test_sai_dtel_int_session_attr_collect_ingress_timestamp_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': [ + 'SAI_DTEL_INT_SESSION_ATTR_COLLECT_INGRESS_TIMESTAMP', + 'false', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_collect_ingress_timestamp_set'] + ) + def test_sai_dtel_int_session_attr_collect_ingress_timestamp_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_INGRESS_TIMESTAMP'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_int_session_attr_collect_egress_timestamp_set' + ) + def test_sai_dtel_int_session_attr_collect_egress_timestamp_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': [ + 'SAI_DTEL_INT_SESSION_ATTR_COLLECT_EGRESS_TIMESTAMP', + 'false', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_collect_egress_timestamp_set'] + ) + def test_sai_dtel_int_session_attr_collect_egress_timestamp_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_EGRESS_TIMESTAMP'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_int_session_attr_collect_queue_info_set' + ) + def test_sai_dtel_int_session_attr_collect_queue_info_set(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_QUEUE_INFO', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_int_session_attr_collect_queue_info_set'] + ) + def test_sai_dtel_int_session_attr_collect_queue_info_get(self, npu): + commands = [ + { + 'name': 'dtel_int_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_INT_SESSION_ATTR_COLLECT_QUEUE_INFO'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + def test_dtel_int_session_remove(self, npu): + commands = [{'name': 'dtel_int_session_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_dtel_queue_report.py b/tests/api/test_dtel_queue_report.py new file mode 100644 index 00000000..f0c363f3 --- /dev/null +++ b/tests/api/test_dtel_queue_report.py @@ -0,0 +1,206 @@ +from pprint import pprint + +import pytest + + +class TestSaiDtelQueueReport: + # object with parent SAI_OBJECT_TYPE_QUEUE + + def test_dtel_queue_report_create(self, npu): + commands = [ + { + 'name': 'port_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_PORT', + 'attributes': [ + 'SAI_PORT_ATTR_HW_LANE_LIST', + '2:10,11', + 'SAI_PORT_ATTR_SPEED', + '10', + ], + }, + { + 'name': 'scheduler_group_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_SCHEDULER_GROUP', + 'attributes': [ + 'SAI_SCHEDULER_GROUP_ATTR_PORT_ID', + '$port_1', + 'SAI_SCHEDULER_GROUP_ATTR_LEVEL', + '1', + 'SAI_SCHEDULER_GROUP_ATTR_MAX_CHILDS', + '1', + 'SAI_SCHEDULER_GROUP_ATTR_PARENT_NODE', + 'TODO_circular parent reference', + ], + }, + { + 'name': 'queue_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_QUEUE', + 'attributes': [ + 'SAI_QUEUE_ATTR_TYPE', + 'SAI_QUEUE_TYPE_ALL', + 'SAI_QUEUE_ATTR_PORT', + '$port_1', + 'SAI_QUEUE_ATTR_INDEX', + '1', + 'SAI_QUEUE_ATTR_PARENT_SCHEDULER_NODE', + '$scheduler_group_1', + ], + }, + { + 'name': 'dtel_queue_report_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_DTEL_QUEUE_REPORT', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_QUEUE_ID', '$queue_1'], + }, + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_dtel_queue_report_attr_depth_threshold_set') + def test_sai_dtel_queue_report_attr_depth_threshold_set(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_DEPTH_THRESHOLD', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_queue_report_attr_depth_threshold_set'] + ) + def test_sai_dtel_queue_report_attr_depth_threshold_get(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_DEPTH_THRESHOLD'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_queue_report_attr_latency_threshold_set' + ) + def test_sai_dtel_queue_report_attr_latency_threshold_set(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_LATENCY_THRESHOLD', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_queue_report_attr_latency_threshold_set'] + ) + def test_sai_dtel_queue_report_attr_latency_threshold_get(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_LATENCY_THRESHOLD'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_queue_report_attr_breach_quota_set') + def test_sai_dtel_queue_report_attr_breach_quota_set(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_BREACH_QUOTA', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_queue_report_attr_breach_quota_set'] + ) + def test_sai_dtel_queue_report_attr_breach_quota_get(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_BREACH_QUOTA'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_queue_report_attr_tail_drop_set') + def test_sai_dtel_queue_report_attr_tail_drop_set(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_TAIL_DROP', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_queue_report_attr_tail_drop_set']) + def test_sai_dtel_queue_report_attr_tail_drop_get(self, npu): + commands = [ + { + 'name': 'dtel_queue_report_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_QUEUE_REPORT_ATTR_TAIL_DROP'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + def test_dtel_queue_report_remove(self, npu): + commands = [ + {'name': 'dtel_queue_report_1', 'op': 'remove'}, + {'name': 'queue_1', 'op': 'remove'}, + {'name': 'scheduler_group_1', 'op': 'remove'}, + {'name': 'port_1', 'op': 'remove'}, + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_dtel_report_session.py b/tests/api/test_dtel_report_session.py new file mode 100644 index 00000000..c6ebd508 --- /dev/null +++ b/tests/api/test_dtel_report_session.py @@ -0,0 +1,198 @@ +from pprint import pprint + +import pytest + + +class TestSaiDtelReportSession: + # object with no attributes + + def test_dtel_report_session_create(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_DTEL_REPORT_SESSION', + 'attributes': [], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_dtel_report_session_attr_src_ip_set') + def test_sai_dtel_report_session_attr_src_ip_set(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_SRC_IP', '0.0.0.0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_dtel_report_session_attr_src_ip_set']) + def test_sai_dtel_report_session_attr_src_ip_get(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_SRC_IP'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0.0.0.0', 'Get error, expected 0.0.0.0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_report_session_attr_dst_ip_list_set') + def test_sai_dtel_report_session_attr_dst_ip_list_set(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_DST_IP_LIST', 'empty'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_report_session_attr_dst_ip_list_set'] + ) + def test_sai_dtel_report_session_attr_dst_ip_list_get(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_DST_IP_LIST'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'empty', 'Get error, expected empty but got %s' % r_value + + @pytest.mark.dependency( + name='test_sai_dtel_report_session_attr_virtual_router_id_set' + ) + def test_sai_dtel_report_session_attr_virtual_router_id_set(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'set', + 'attributes': [ + 'SAI_DTEL_REPORT_SESSION_ATTR_VIRTUAL_ROUTER_ID', + 'SAI_NULL_OBJECT_ID', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_report_session_attr_virtual_router_id_set'] + ) + def test_sai_dtel_report_session_attr_virtual_router_id_get(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_VIRTUAL_ROUTER_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_dtel_report_session_attr_truncate_size_set') + def test_sai_dtel_report_session_attr_truncate_size_set(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_TRUNCATE_SIZE', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_report_session_attr_truncate_size_set'] + ) + def test_sai_dtel_report_session_attr_truncate_size_get(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_TRUNCATE_SIZE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_dtel_report_session_attr_udp_dst_port_set') + def test_sai_dtel_report_session_attr_udp_dst_port_set(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'set', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_UDP_DST_PORT', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_dtel_report_session_attr_udp_dst_port_set'] + ) + def test_sai_dtel_report_session_attr_udp_dst_port_get(self, npu): + commands = [ + { + 'name': 'dtel_report_session_1', + 'op': 'get', + 'attributes': ['SAI_DTEL_REPORT_SESSION_ATTR_UDP_DST_PORT'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + def test_dtel_report_session_remove(self, npu): + commands = [{'name': 'dtel_report_session_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_stp.py b/tests/api/test_extensions_range_end.py similarity index 59% rename from tests/api/test_stp.py rename to tests/api/test_extensions_range_end.py index 15ec7d21..95412504 100644 --- a/tests/api/test_stp.py +++ b/tests/api/test_extensions_range_end.py @@ -1,15 +1,15 @@ from pprint import pprint -class TestSaiStp: +class TestSaiExtensionsRangeEnd: # object with no attributes - def test_stp_create(self, npu): + def test_extensions_range_end_create(self, npu): commands = [ { - 'name': 'stp_1', + 'name': 'extensions_range_end_1', 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_STP', + 'type': 'SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END', 'attributes': [], } ] @@ -18,13 +18,8 @@ def test_stp_create(self, npu): print('======= SAI commands RETURN values create =======') pprint(results) - def test_stp_remove(self, npu): - commands = [ - { - 'name': 'stp_1', - 'op': 'remove', - } - ] + def test_extensions_range_end_remove(self, npu): + commands = [{'name': 'extensions_range_end_1', 'op': 'remove'}] results = [*npu.process_commands(commands)] print('======= SAI commands RETURN values remove =======') diff --git a/tests/api/test_ipmc_group.py b/tests/api/test_extensions_range_start.py similarity index 58% rename from tests/api/test_ipmc_group.py rename to tests/api/test_extensions_range_start.py index 7879ac80..9871912f 100644 --- a/tests/api/test_ipmc_group.py +++ b/tests/api/test_extensions_range_start.py @@ -1,15 +1,15 @@ from pprint import pprint -class TestSaiIpmcGroup: +class TestSaiExtensionsRangeStart: # object with no attributes - def test_ipmc_group_create(self, npu): + def test_extensions_range_start_create(self, npu): commands = [ { - 'name': 'ipmc_group_1', + 'name': 'extensions_range_start_1', 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_IPMC_GROUP', + 'type': 'SAI_OBJECT_TYPE_EXTENSIONS_RANGE_START', 'attributes': [], } ] @@ -18,13 +18,8 @@ def test_ipmc_group_create(self, npu): print('======= SAI commands RETURN values create =======') pprint(results) - def test_ipmc_group_remove(self, npu): - commands = [ - { - 'name': 'ipmc_group_1', - 'op': 'remove', - } - ] + def test_extensions_range_start_remove(self, npu): + commands = [{'name': 'extensions_range_start_1', 'op': 'remove'}] results = [*npu.process_commands(commands)] print('======= SAI commands RETURN values remove =======') diff --git a/tests/api/test_fdb_entry.py b/tests/api/test_fdb_entry.py new file mode 100644 index 00000000..324f907f --- /dev/null +++ b/tests/api/test_fdb_entry.py @@ -0,0 +1,305 @@ +from pprint import pprint + +import pytest + + +class TestSaiFdbEntry: + # object with no parents + + def test_fdb_entry_create(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_FDB_ENTRY', + 'attributes': ['SAI_FDB_ENTRY_ATTR_TYPE', 'SAI_FDB_ENTRY_TYPE_DYNAMIC'], + 'key': { + 'switch_id': '$SWITCH_ID', + 'mac_address': 'TODO', + 'bv_id': 'TODO', + }, + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_type_set') + def test_sai_fdb_entry_attr_type_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_TYPE', 'TODO'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_type_set']) + def test_sai_fdb_entry_attr_type_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_TYPE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'TODO', 'Get error, expected TODO but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_packet_action_set') + def test_sai_fdb_entry_attr_packet_action_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': [ + 'SAI_FDB_ENTRY_ATTR_PACKET_ACTION', + 'SAI_PACKET_ACTION_FORWARD', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_packet_action_set']) + def test_sai_fdb_entry_attr_packet_action_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_PACKET_ACTION'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_PACKET_ACTION_FORWARD', ( + 'Get error, expected SAI_PACKET_ACTION_FORWARD but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_user_trap_id_set') + def test_sai_fdb_entry_attr_user_trap_id_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_USER_TRAP_ID', 'SAI_NULL_OBJECT_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_user_trap_id_set']) + def test_sai_fdb_entry_attr_user_trap_id_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_USER_TRAP_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_bridge_port_id_set') + def test_sai_fdb_entry_attr_bridge_port_id_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': [ + 'SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID', + 'SAI_NULL_OBJECT_ID', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_bridge_port_id_set']) + def test_sai_fdb_entry_attr_bridge_port_id_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_BRIDGE_PORT_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_meta_data_set') + def test_sai_fdb_entry_attr_meta_data_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_META_DATA', '0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_meta_data_set']) + def test_sai_fdb_entry_attr_meta_data_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_META_DATA'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0', 'Get error, expected 0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_endpoint_ip_set') + def test_sai_fdb_entry_attr_endpoint_ip_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_ENDPOINT_IP', '0.0.0.0'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_endpoint_ip_set']) + def test_sai_fdb_entry_attr_endpoint_ip_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_ENDPOINT_IP'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == '0.0.0.0', 'Get error, expected 0.0.0.0 but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_counter_id_set') + def test_sai_fdb_entry_attr_counter_id_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_COUNTER_ID', 'SAI_NULL_OBJECT_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_counter_id_set']) + def test_sai_fdb_entry_attr_counter_id_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_COUNTER_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + @pytest.mark.dependency(name='test_sai_fdb_entry_attr_allow_mac_move_set') + def test_sai_fdb_entry_attr_allow_mac_move_set(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'set', + 'attributes': ['SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE', 'false'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_fdb_entry_attr_allow_mac_move_set']) + def test_sai_fdb_entry_attr_allow_mac_move_get(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'op': 'get', + 'attributes': ['SAI_FDB_ENTRY_ATTR_ALLOW_MAC_MOVE'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'false', 'Get error, expected false but got %s' % r_value + + def test_fdb_entry_remove(self, npu): + commands = [ + { + 'name': 'fdb_entry_1', + 'key': { + 'switch_id': '$SWITCH_ID', + 'mac_address': 'TODO', + 'bv_id': 'TODO', + }, + 'op': 'remove', + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_lag.py b/tests/api/test_fdb_flush.py similarity index 61% rename from tests/api/test_lag.py rename to tests/api/test_fdb_flush.py index 2b231d62..db8a655e 100644 --- a/tests/api/test_lag.py +++ b/tests/api/test_fdb_flush.py @@ -1,15 +1,15 @@ from pprint import pprint -class TestSaiLag: +class TestSaiFdbFlush: # object with no attributes - def test_lag_create(self, npu): + def test_fdb_flush_create(self, npu): commands = [ { - 'name': 'lag_1', + 'name': 'fdb_flush_1', 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_LAG', + 'type': 'SAI_OBJECT_TYPE_FDB_FLUSH', 'attributes': [], } ] @@ -18,13 +18,8 @@ def test_lag_create(self, npu): print('======= SAI commands RETURN values create =======') pprint(results) - def test_lag_remove(self, npu): - commands = [ - { - 'name': 'lag_1', - 'op': 'remove', - } - ] + def test_fdb_flush_remove(self, npu): + commands = [{'name': 'fdb_flush_1', 'op': 'remove'}] results = [*npu.process_commands(commands)] print('======= SAI commands RETURN values remove =======') diff --git a/tests/api/test_fine_grained_hash_field.py b/tests/api/test_fine_grained_hash_field.py new file mode 100644 index 00000000..b9c482e5 --- /dev/null +++ b/tests/api/test_fine_grained_hash_field.py @@ -0,0 +1,31 @@ +from pprint import pprint + + +class TestSaiFineGrainedHashField: + # object with no parents + + def test_fine_grained_hash_field_create(self, npu): + commands = [ + { + 'name': 'fine_grained_hash_field_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_FINE_GRAINED_HASH_FIELD', + 'attributes': [ + 'SAI_FINE_GRAINED_HASH_FIELD_ATTR_IPV4_MASK', + '255.0.0.0', + 'SAI_FINE_GRAINED_HASH_FIELD_ATTR_IPV6_MASK', + 'FF::0', + ], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + def test_fine_grained_hash_field_remove(self, npu): + commands = [{'name': 'fine_grained_hash_field_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_generic_programmable.py b/tests/api/test_generic_programmable.py new file mode 100644 index 00000000..4ab67302 --- /dev/null +++ b/tests/api/test_generic_programmable.py @@ -0,0 +1,97 @@ +from pprint import pprint + +import pytest + + +class TestSaiGenericProgrammable: + # object with no parents + + def test_generic_programmable_create(self, npu): + commands = [ + { + 'name': 'generic_programmable_1', + 'op': 'create', + 'type': 'SAI_OBJECT_TYPE_GENERIC_PROGRAMMABLE', + 'attributes': ['SAI_GENERIC_PROGRAMMABLE_ATTR_OBJECT_NAME', '2:10,11'], + } + ] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values create =======') + pprint(results) + + @pytest.mark.dependency(name='test_sai_generic_programmable_attr_entry_set') + def test_sai_generic_programmable_attr_entry_set(self, npu): + commands = [ + { + 'name': 'generic_programmable_1', + 'op': 'set', + 'attributes': ['SAI_GENERIC_PROGRAMMABLE_ATTR_ENTRY', 'vendor'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency(depends=['test_sai_generic_programmable_attr_entry_set']) + def test_sai_generic_programmable_attr_entry_get(self, npu): + commands = [ + { + 'name': 'generic_programmable_1', + 'op': 'get', + 'attributes': ['SAI_GENERIC_PROGRAMMABLE_ATTR_ENTRY'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'vendor', 'Get error, expected vendor but got %s' % r_value + + @pytest.mark.dependency(name='test_sai_generic_programmable_attr_counter_id_set') + def test_sai_generic_programmable_attr_counter_id_set(self, npu): + commands = [ + { + 'name': 'generic_programmable_1', + 'op': 'set', + 'attributes': [ + 'SAI_GENERIC_PROGRAMMABLE_ATTR_COUNTER_ID', + 'SAI_NULL_OBJECT_ID', + ], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + pprint(results) + + @pytest.mark.dependency( + depends=['test_sai_generic_programmable_attr_counter_id_set'] + ) + def test_sai_generic_programmable_attr_counter_id_get(self, npu): + commands = [ + { + 'name': 'generic_programmable_1', + 'op': 'get', + 'attributes': ['SAI_GENERIC_PROGRAMMABLE_ATTR_COUNTER_ID'], + } + ] + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values get =======') + for command in results: + for attribute in command: + pprint(attribute.raw()) + r_value = results[0][0].value() + print(r_value) + assert r_value == 'SAI_NULL_OBJECT_ID', ( + 'Get error, expected SAI_NULL_OBJECT_ID but got %s' % r_value + ) + + def test_generic_programmable_remove(self, npu): + commands = [{'name': 'generic_programmable_1', 'op': 'remove'}] + + results = [*npu.process_commands(commands)] + print('======= SAI commands RETURN values remove =======') + pprint(results) diff --git a/tests/api/test_hostif_trap.py b/tests/api/test_hostif_trap.py deleted file mode 100644 index 78f1def6..00000000 --- a/tests/api/test_hostif_trap.py +++ /dev/null @@ -1,36 +0,0 @@ -from pprint import pprint - - -class TestSaiHostifTrap: - # object with no parent objects - - def test_hostif_trap_create(self, npu): - commands = [ - { - 'name': 'hostif_trap_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_HOSTIF_TRAP', - 'attributes': [ - 'SAI_HOSTIF_TRAP_ATTR_TRAP_TYPE', - 'SAI_HOSTIF_TRAP_TYPE_STP', - 'SAI_HOSTIF_TRAP_ATTR_PACKET_ACTION', - 'SAI_PACKET_ACTION_DROP', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_hostif_trap_remove(self, npu): - commands = [ - { - 'name': 'hostif_trap_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_hostif_trap_group.py b/tests/api/test_hostif_trap_group.py deleted file mode 100644 index ce6db62f..00000000 --- a/tests/api/test_hostif_trap_group.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiHostifTrapGroup: - # object with no attributes - - def test_hostif_trap_group_create(self, npu): - commands = [ - { - 'name': 'hostif_trap_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_HOSTIF_TRAP_GROUP', - 'attributes': [], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_hostif_trap_group_remove(self, npu): - commands = [ - { - 'name': 'hostif_trap_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_isolation_group.py b/tests/api/test_isolation_group.py deleted file mode 100644 index f8fd750f..00000000 --- a/tests/api/test_isolation_group.py +++ /dev/null @@ -1,34 +0,0 @@ -from pprint import pprint - - -class TestSaiIsolationGroup: - # object with no parents - - def test_isolation_group_create(self, npu): - commands = [ - { - 'name': 'isolation_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_ISOLATION_GROUP', - 'attributes': [ - 'SAI_ISOLATION_GROUP_ATTR_TYPE', - 'SAI_ISOLATION_GROUP_TYPE_PORT', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_isolation_group_remove(self, npu): - commands = [ - { - 'name': 'isolation_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_next_hop_group.py b/tests/api/test_next_hop_group.py deleted file mode 100644 index d20c3c58..00000000 --- a/tests/api/test_next_hop_group.py +++ /dev/null @@ -1,34 +0,0 @@ -from pprint import pprint - - -class TestSaiNextHopGroup: - # object with no parents - - def test_next_hop_group_create(self, npu): - commands = [ - { - 'name': 'next_hop_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_NEXT_HOP_GROUP', - 'attributes': [ - 'SAI_NEXT_HOP_GROUP_ATTR_TYPE', - 'SAI_NEXT_HOP_GROUP_TYPE_DYNAMIC_UNORDERED_ECMP', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_next_hop_group_remove(self, npu): - commands = [ - { - 'name': 'next_hop_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_policer.py b/tests/api/test_policer.py deleted file mode 100644 index 4c6f3352..00000000 --- a/tests/api/test_policer.py +++ /dev/null @@ -1,36 +0,0 @@ -from pprint import pprint - - -class TestSaiPolicer: - # object with no parents - - def test_policer_create(self, npu): - commands = [ - { - 'name': 'policer_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_POLICER', - 'attributes': [ - 'SAI_POLICER_ATTR_METER_TYPE', - 'SAI_METER_TYPE_PACKETS', - 'SAI_POLICER_ATTR_MODE', - 'SAI_POLICER_MODE_SR_TCM', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_policer_remove(self, npu): - commands = [ - { - 'name': 'policer_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_rpf_group.py b/tests/api/test_rpf_group.py deleted file mode 100644 index 31fb3f48..00000000 --- a/tests/api/test_rpf_group.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiRpfGroup: - # object with no attributes - - def test_rpf_group_create(self, npu): - commands = [ - { - 'name': 'rpf_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_RPF_GROUP', - 'attributes': [], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_rpf_group_remove(self, npu): - commands = [ - { - 'name': 'rpf_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_samplepacket.py b/tests/api/test_samplepacket.py deleted file mode 100644 index 79c404c8..00000000 --- a/tests/api/test_samplepacket.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiSamplepacket: - # object with no parents - - def test_samplepacket_create(self, npu): - commands = [ - { - 'name': 'samplepacket_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_SAMPLEPACKET', - 'attributes': ['SAI_SAMPLEPACKET_ATTR_SAMPLE_RATE', '10'], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_samplepacket_remove(self, npu): - commands = [ - { - 'name': 'samplepacket_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_scheduler.py b/tests/api/test_scheduler.py deleted file mode 100644 index 34fe9acc..00000000 --- a/tests/api/test_scheduler.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiScheduler: - # object with no attributes - - def test_scheduler_create(self, npu): - commands = [ - { - 'name': 'scheduler_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_SCHEDULER', - 'attributes': [], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_scheduler_remove(self, npu): - commands = [ - { - 'name': 'scheduler_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_tunnel_map.py b/tests/api/test_tunnel_map.py deleted file mode 100644 index dfd174bc..00000000 --- a/tests/api/test_tunnel_map.py +++ /dev/null @@ -1,34 +0,0 @@ -from pprint import pprint - - -class TestSaiTunnelMap: - # object with no parents - - def test_tunnel_map_create(self, npu): - commands = [ - { - 'name': 'tunnel_map_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_TUNNEL_MAP', - 'attributes': [ - 'SAI_TUNNEL_MAP_ATTR_TYPE', - 'SAI_TUNNEL_MAP_TYPE_OECN_TO_UECN', - ], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_tunnel_map_remove(self, npu): - commands = [ - { - 'name': 'tunnel_map_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_udf_group.py b/tests/api/test_udf_group.py deleted file mode 100644 index 3ad0303b..00000000 --- a/tests/api/test_udf_group.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiUdfGroup: - # object with no parents - - def test_udf_group_create(self, npu): - commands = [ - { - 'name': 'udf_group_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_UDF_GROUP', - 'attributes': ['SAI_UDF_GROUP_ATTR_LENGTH', '10'], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_udf_group_remove(self, npu): - commands = [ - { - 'name': 'udf_group_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_virtual_router.py b/tests/api/test_virtual_router.py deleted file mode 100644 index 285e9cee..00000000 --- a/tests/api/test_virtual_router.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiVirtualRouter: - # object with no attributes - - def test_virtual_router_create(self, npu): - commands = [ - { - 'name': 'virtual_router_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_VIRTUAL_ROUTER', - 'attributes': [], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_virtual_router_remove(self, npu): - commands = [ - { - 'name': 'virtual_router_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_vlan.py b/tests/api/test_vlan.py deleted file mode 100644 index 8dac7c9e..00000000 --- a/tests/api/test_vlan.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiVlan: - # object with no parents - - def test_vlan_create(self, npu): - commands = [ - { - 'name': 'vlan_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_VLAN', - 'attributes': ['SAI_VLAN_ATTR_VLAN_ID', '10'], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_vlan_remove(self, npu): - commands = [ - { - 'name': 'vlan_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results) diff --git a/tests/api/test_wred.py b/tests/api/test_wred.py deleted file mode 100644 index 5a809f14..00000000 --- a/tests/api/test_wred.py +++ /dev/null @@ -1,31 +0,0 @@ -from pprint import pprint - - -class TestSaiWred: - # object with no attributes - - def test_wred_create(self, npu): - commands = [ - { - 'name': 'wred_1', - 'op': 'create', - 'type': 'SAI_OBJECT_TYPE_WRED', - 'attributes': [], - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values create =======') - pprint(results) - - def test_wred_remove(self, npu): - commands = [ - { - 'name': 'wred_1', - 'op': 'remove', - } - ] - - results = [*npu.process_commands(commands)] - print('======= SAI commands RETURN values remove =======') - pprint(results)