Skip to content

Commit 42a9248

Browse files
committed
adding back acl counter with skip all
1 parent a3262f2 commit 42a9248

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

tests/api/test_acl_counter.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from pprint import pprint
2+
3+
import pytest
4+
5+
@pytest.fixture(scope='module', autouse=True)
6+
def skip_all(testbed_instance):
7+
testbed = testbed_instance
8+
if testbed is not None and len(testbed.npu) != 1:
9+
pytest.skip('invalid for {} testbed'.format(testbed.name))
10+
11+
12+
@pytest.mark.npu
13+
class TestSaiAclCounter:
14+
# object with parent SAI_OBJECT_TYPE_ACL_TABLE
15+
16+
def test_acl_counter_create(self, npu):
17+
commands = [
18+
{
19+
'name': 'acl_table_1',
20+
'op': 'create',
21+
'type': 'SAI_OBJECT_TYPE_ACL_TABLE',
22+
'attributes': ['SAI_ACL_TABLE_ATTR_ACL_STAGE', 'SAI_ACL_STAGE_INGRESS'],
23+
},
24+
{
25+
'name': 'acl_counter_1',
26+
'op': 'create',
27+
'type': 'SAI_OBJECT_TYPE_ACL_COUNTER',
28+
'attributes': ['SAI_ACL_COUNTER_ATTR_TABLE_ID', '$acl_table_1'],
29+
},
30+
]
31+
results = [*npu.process_commands(commands)]
32+
print('======= SAI commands RETURN values create =======')
33+
pprint(results)
34+
35+
36+
@pytest.mark.dependency(name='test_sai_acl_counter_attr_label_set')
37+
def test_sai_acl_counter_attr_label_set(self, npu):
38+
commands = [
39+
{
40+
'name': 'acl_counter_1',
41+
'op': 'set',
42+
'attributes': ['SAI_ACL_COUNTER_ATTR_LABEL', '""'],
43+
}
44+
]
45+
results = [*npu.process_commands(commands)]
46+
print('======= SAI commands RETURN values get =======')
47+
pprint(results)
48+
49+
50+
def test_acl_counter_remove(self, npu):
51+
commands = [
52+
{'name': 'acl_counter_1', 'op': 'remove'},
53+
{'name': 'acl_table_1', 'op': 'remove'},
54+
]
55+
results = [*npu.process_commands(commands)]
56+
print('======= SAI commands RETURN values remove =======')
57+
pprint(results)

0 commit comments

Comments
 (0)