Skip to content

Commit

Permalink
Add tests for headroom pool wm
Browse files Browse the repository at this point in the history
Signed-off-by: Neetha John <[email protected]>
  • Loading branch information
neethajohn committed Nov 17, 2020
1 parent a6e7c96 commit 250673a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
6 changes: 4 additions & 2 deletions tests/mock_tables/counters_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,8 @@
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "2000"
},
"USER_WATERMARKS:oid:0x18000000000b66": {
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "3000"
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "3000",
"SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES": "432640"
},
"PERSISTENT_WATERMARKS:oid:0x18000000000b64": {
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "2000"
Expand All @@ -999,7 +1000,8 @@
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "3000"
},
"PERSISTENT_WATERMARKS:oid:0x18000000000b66": {
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "4000"
"SAI_BUFFER_POOL_STAT_WATERMARK_BYTES": "4000",
"SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES": "863616"
},
"CRM:ACL_STATS:INGRESS:VLAN":{
"crm_stats_acl_table_used":"0",
Expand Down
6 changes: 6 additions & 0 deletions tests/watermarkstat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def test_show_queue_multicast_wm(self):
def test_show_buffer_pool_wm(self):
self.executor(testData['show_buffer_pool_wm'])

def test_show_headroom_pool_wm(self):
self.executor(testData['show_hdrm_pool_wm'])

def test_show_pg_shared_peristent_wm(self):
self.executor(testData['show_pg_pwm_shared'])

Expand All @@ -51,6 +54,9 @@ def test_show_queue_multicast_persistent_wm(self):
def test_show_buffer_pool_persistent_wm(self):
self.executor(testData['show_buffer_pool_pwm'])

def test_show_headroom_pool_persistent_wm(self):
self.executor(testData['show_hdrm_pool_pwm'])

def executor(self, testcase):
runner = CliRunner()

Expand Down
24 changes: 23 additions & 1 deletion tests/wm_input/wm_test_vectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@
ingress_lossless_pool 4000
"""

show_hdrm_pool_wm_output="""\
Headroom pool maximum occupancy:
Pool Bytes
--------------------- -------
ingress_lossless_pool 432640
"""

show_hdrm_pool_persistent_wm_output="""\
Headroom pool maximum occupancy:
Pool Bytes
--------------------- -------
ingress_lossless_pool 863616
"""

testData = {
'show_pg_wm_shared' : [ {'cmd' : ['priority-group', 'watermark', 'shared'],
'rc_output': show_pg_wm_shared_output
Expand Down Expand Up @@ -119,5 +133,13 @@
'show_buffer_pool_pwm' : [ {'cmd' : ['buffer_pool', 'persistent-watermark'],
'rc_output': show_buffer_pool_persistent_wm_output
}
]
],
'show_hdrm_pool_wm' : [ {'cmd' : ['headroom-pool', 'watermark'],
'rc_output': show_hdrm_pool_wm_output
}
],
'show_hdrm_pool_pwm' : [ {'cmd' : ['headroom-pool', 'persistent-watermark'],
'rc_output': show_hdrm_pool_persistent_wm_output
}
]
}

0 comments on commit 250673a

Please sign in to comment.