-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Read full config with gnmi get (#143)
Why I did it Need to read full config for SONiC How I did it Read CONFIG DB and convert to json. How to verify it Verified with unit test and end2end test.
- Loading branch information
Showing
5 changed files
with
183 additions
and
6 deletions.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
import os | ||
import time | ||
from utils import gnmi_set, gnmi_get, gnmi_dump | ||
|
||
import pytest | ||
|
||
|
||
class TestGNMICountersDb: | ||
|
||
def test_gnmi_get_full_01(self): | ||
get_list = ['/sonic-db:COUNTERS_DB/'] | ||
|
||
ret, msg_list = gnmi_get(get_list) | ||
assert ret != 0, 'Does not support to read all table in COUNTERS_DB' | ||
|
||
def test_gnmi_get_table_01(self): | ||
get_list = ['/sonic-db:COUNTERS_DB/COUNTERS'] | ||
|
||
ret, msg_list = gnmi_get(get_list) | ||
assert ret == 0, 'Fail to read COUNTERS table, ' + msg_list[0] |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"DEVICE_METADATA|localhost": { | ||
"bgp_asn": "65100", | ||
"cloudtype":"Public" | ||
}, | ||
"DHCP_SERVER|192.0.0.1": { | ||
"NULL": "NULL" | ||
}, | ||
"DHCP_SERVER|192.0.0.2": { | ||
"NULL": "NULL" | ||
} | ||
} |