Skip to content

Commit

Permalink
adding additional create remove cases (#14) (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
selldinesh authored Sep 15, 2023
1 parent 40e09a6 commit babf7d4
Show file tree
Hide file tree
Showing 23 changed files with 685 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/api/test_ars.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiArs:
# object with no attributes

def test_ars_create(self, npu):
commands = [
{
'name': 'ars_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_ARS',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_ars_remove(self, npu):
commands = [{'name': 'ars_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
26 changes: 26 additions & 0 deletions tests/api/test_ars_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiArsProfile:
# object with no attributes

def test_ars_profile_create(self, npu):
commands = [
{
'name': 'ars_profile_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_ARS_PROFILE',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_ars_profile_remove(self, npu):
commands = [{'name': 'ars_profile_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
26 changes: 26 additions & 0 deletions tests/api/test_bridge.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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)
26 changes: 26 additions & 0 deletions tests/api/test_counter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiCounter:
# object with no attributes

def test_counter_create(self, npu):
commands = [
{
'name': 'counter_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_COUNTER',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_counter_remove(self, npu):
commands = [{'name': 'counter_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
26 changes: 26 additions & 0 deletions tests/api/test_dash_acl_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiDashAclGroup:
# object with no attributes

def test_dash_acl_group_create(self, npu):
commands = [
{
'name': 'dash_acl_group_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_DASH_ACL_GROUP',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_dash_acl_group_remove(self, npu):
commands = [{'name': 'dash_acl_group_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
26 changes: 26 additions & 0 deletions tests/api/test_dtel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


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)

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)
29 changes: 29 additions & 0 deletions tests/api/test_dtel_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from pprint import pprint


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)

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)
26 changes: 26 additions & 0 deletions tests/api/test_dtel_int_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


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)

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)
26 changes: 26 additions & 0 deletions tests/api/test_dtel_report_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


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)

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)
26 changes: 26 additions & 0 deletions tests/api/test_eni.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiEni:
# object with no attributes

def test_eni_create(self, npu):
commands = [
{
'name': 'eni_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_ENI',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_eni_remove(self, npu):
commands = [{'name': 'eni_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
26 changes: 26 additions & 0 deletions tests/api/test_generic_programmable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


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)

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)
26 changes: 26 additions & 0 deletions tests/api/test_hash.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pprint import pprint


class TestSaiHash:
# object with no attributes

def test_hash_create(self, npu):
commands = [
{
'name': 'hash_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_HASH',
'attributes': [],
}
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_hash_remove(self, npu):
commands = [{'name': 'hash_1', 'op': 'remove'}]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
54 changes: 54 additions & 0 deletions tests/api/test_isolation_group_member.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from pprint import pprint


class TestSaiIsolationGroupMember:
# object with parent SAI_OBJECT_TYPE_ISOLATION_GROUP SAI_OBJECT_TYPE_PORT SAI_OBJECT_TYPE_BRIDGE_PORT

def test_isolation_group_member_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',
],
},
{
'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': 'isolation_group_member_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_ISOLATION_GROUP_MEMBER',
'attributes': [
'SAI_ISOLATION_GROUP_MEMBER_ATTR_ISOLATION_GROUP_ID',
'$isolation_group_1',
'SAI_ISOLATION_GROUP_MEMBER_ATTR_ISOLATION_OBJECT',
'$port_1',
],
},
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)

def test_isolation_group_member_remove(self, npu):
commands = [
{'name': 'isolation_group_member_1', 'op': 'remove'},
{'name': 'isolation_group_1', 'op': 'remove'},
]

results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values remove =======')
pprint(results)
Loading

0 comments on commit babf7d4

Please sign in to comment.