Skip to content

Commit dd828d0

Browse files
authored
Updates to the namespace API's for test_moduleLoad.py (#77)
* Updates to the namespace API's for test_moduleLoad.py
1 parent a83366e commit dd828d0

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

test/config/database_config.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"INSTANCES": {
3+
"redis":{
4+
"hostname" : "127.0.0.1",
5+
"port" : 6379,
6+
"unix_socket_path" : "/var/run/redis/redis.sock"
7+
}
8+
},
9+
"DATABASES" : {
10+
"APPL_DB" : {
11+
"id" : 0,
12+
"separator": ":",
13+
"instance" : "redis"
14+
},
15+
"ASIC_DB" : {
16+
"id" : 1,
17+
"separator": ":",
18+
"instance" : "redis"
19+
},
20+
"COUNTERS_DB" : {
21+
"id" : 2,
22+
"separator": ":",
23+
"instance" : "redis"
24+
},
25+
"LOGLEVEL_DB" : {
26+
"id" : 3,
27+
"separator": ":",
28+
"instance" : "redis"
29+
},
30+
"CONFIG_DB" : {
31+
"id" : 4,
32+
"separator": "|",
33+
"instance" : "redis"
34+
},
35+
"PFC_WD_DB" : {
36+
"id" : 5,
37+
"separator": ":",
38+
"instance" : "redis"
39+
},
40+
"FLEX_COUNTER_DB" : {
41+
"id" : 5,
42+
"separator": ":",
43+
"instance" : "redis"
44+
},
45+
"STATE_DB" : {
46+
"id" : 6,
47+
"separator": "|",
48+
"instance" : "redis"
49+
},
50+
"SNMP_OVERLAY_DB" : {
51+
"id" : 7,
52+
"separator": "|",
53+
"instance" : "redis"
54+
}
55+
},
56+
"VERSION" : "1.0"
57+
}

test/config/database_global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
},
66
{
77
"namespace" : "asic0",
8-
"include" : "database_config.json"
8+
"include" : "../config/database_config.json"
99
},
1010
{
1111
"namespace" : "asic1",
12-
"include" : "database_config.json"
12+
"include" : "../config/database_config.json"
1313
},
1414
{
1515
"namespace" : "asic2",

test/test_moduleLoad.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def test__namespace_list(self):
2626
self.assertEqual(ns_input, ns_list)
2727

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

0 commit comments

Comments
 (0)