-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathtest_buffer_profile.py
More file actions
51 lines (44 loc) · 1.65 KB
/
test_buffer_profile.py
File metadata and controls
51 lines (44 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 TestSaiBufferProfile:
# object with parent SAI_OBJECT_TYPE_BUFFER_POOL
def test_buffer_profile_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',
],
},
{
'name': 'buffer_profile_1',
'op': 'create',
'type': 'SAI_OBJECT_TYPE_BUFFER_PROFILE',
'attributes': [
'SAI_BUFFER_PROFILE_ATTR_POOL_ID',
'$buffer_pool_1',
'SAI_BUFFER_PROFILE_ATTR_RESERVED_BUFFER_SIZE',
'10',
'SAI_BUFFER_PROFILE_ATTR_THRESHOLD_MODE',
'SAI_BUFFER_PROFILE_THRESHOLD_MODE_STATIC',
'SAI_BUFFER_PROFILE_ATTR_SHARED_DYNAMIC_TH',
'1',
'SAI_BUFFER_PROFILE_ATTR_SHARED_STATIC_TH',
'10',
],
},
]
results = [*npu.process_commands(commands)]
print('======= SAI commands RETURN values create =======')
pprint(results)