forked from sonic-net/sonic-swss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Buffermgr]Graceful handling of buffer model change
- Loading branch information
1 parent
da49332
commit 8e87cd9
Showing
4 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
import pytest | ||
import time | ||
|
||
class TestBufferModel(object): | ||
def test_bufferModel(self, dvs, testlog): | ||
config_db = dvs.get_config_db() | ||
metadata = config_db.get_entry("DEVICE_METADATA", "localhost") | ||
assert metadata["buffer_model"] == "traditional" | ||
|
||
def test_update_bufferModel(self, dvs, testlog): | ||
config_db = dvs.get_config_db() | ||
app_db = dvs.get_app_db() | ||
keys = app_db.get_keys("BUFFER_POOL_TABLE") | ||
num_keys = len(keys) | ||
fvs = {'buffer_model' : 'dynamic'} | ||
config_db.update_entry("DEVICE_METADATA", "localhost", fvs) | ||
fvs = {'mode':'dynamic', 'type':'egress'} | ||
config_db.update_entry("BUFFER_POOL", "temp_pool", fvs) | ||
time.sleep(2) | ||
app_db.wait_for_n_keys("BUFFER_POOL_TABLE", num_keys) |