From dd828d005c9a5c3c9bf2e9fdff104b6391286425 Mon Sep 17 00:00:00 2001 From: judyjoseph <53951155+judyjoseph@users.noreply.github.com> Date: Mon, 15 Jun 2020 22:55:48 -0700 Subject: [PATCH] Updates to the namespace API's for test_moduleLoad.py (#77) * Updates to the namespace API's for test_moduleLoad.py --- test/config/database_config.json | 57 ++++++++++++++++++++++++++++++++ test/config/database_global.json | 4 +-- test/test_moduleLoad.py | 2 +- 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 test/config/database_config.json diff --git a/test/config/database_config.json b/test/config/database_config.json new file mode 100644 index 000000000000..b86ae11bba98 --- /dev/null +++ b/test/config/database_config.json @@ -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" +} diff --git a/test/config/database_global.json b/test/config/database_global.json index c4fa84eb85eb..c08caddd4dd6 100644 --- a/test/config/database_global.json +++ b/test/config/database_global.json @@ -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", diff --git a/test/test_moduleLoad.py b/test/test_moduleLoad.py index 937ae3f79d05..5f6c9e339b3d 100644 --- a/test/test_moduleLoad.py +++ b/test/test_moduleLoad.py @@ -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')