Skip to content

Commit

Permalink
Updates to the namespace API's for test_moduleLoad.py (sonic-net#77)
Browse files Browse the repository at this point in the history
* Updates to the namespace API's for test_moduleLoad.py
  • Loading branch information
judyjoseph committed Jun 16, 2020
1 parent a83366e commit dd828d0
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
57 changes: 57 additions & 0 deletions test/config/database_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"INSTANCES": {
"redis":{
"hostname" : "127.0.0.1",
"port" : 6379,
"unix_socket_path" : "/var/run/redis/redis.sock"
}
},
"DATABASES" : {
"APPL_DB" : {
"id" : 0,
"separator": ":",
"instance" : "redis"
},
"ASIC_DB" : {
"id" : 1,
"separator": ":",
"instance" : "redis"
},
"COUNTERS_DB" : {
"id" : 2,
"separator": ":",
"instance" : "redis"
},
"LOGLEVEL_DB" : {
"id" : 3,
"separator": ":",
"instance" : "redis"
},
"CONFIG_DB" : {
"id" : 4,
"separator": "|",
"instance" : "redis"
},
"PFC_WD_DB" : {
"id" : 5,
"separator": ":",
"instance" : "redis"
},
"FLEX_COUNTER_DB" : {
"id" : 5,
"separator": ":",
"instance" : "redis"
},
"STATE_DB" : {
"id" : 6,
"separator": "|",
"instance" : "redis"
},
"SNMP_OVERLAY_DB" : {
"id" : 7,
"separator": "|",
"instance" : "redis"
}
},
"VERSION" : "1.0"
}
4 changes: 2 additions & 2 deletions test/config/database_global.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
},
{
"namespace" : "asic0",
"include" : "database_config.json"
"include" : "../config/database_config.json"
},
{
"namespace" : "asic1",
"include" : "database_config.json"
"include" : "../config/database_config.json"
},
{
"namespace" : "asic2",
Expand Down
2 changes: 1 addition & 1 deletion test/test_moduleLoad.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test__namespace_list(self):
self.assertEqual(ns_input, ns_list)

# This is the test to check if the global config file and get the correct DB in a namespace
def test__namespace_list(self):
def test__dbConfig(self):
import swsssdk
dbConfig = swsssdk.SonicDBConfig()
filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), './config', 'database_global.json')
Expand Down

0 comments on commit dd828d0

Please sign in to comment.