diff --git a/common/schema.h b/common/schema.h index ea9383b12..47ca1253d 100644 --- a/common/schema.h +++ b/common/schema.h @@ -98,6 +98,11 @@ namespace swss { #define APP_SFLOW_SESSION_TABLE_NAME "SFLOW_SESSION_TABLE" #define APP_SFLOW_SAMPLE_RATE_TABLE_NAME "SFLOW_SAMPLE_RATE_TABLE" +#define APP_DEBUGFM_CONFIG_TABLE_NAME "DEBUGFM_CONFIG_TABLE" +#define APP_DEBUG_RCOMPONENT_TABLE_NAME "DEBUG_RCOMPONENT_TABLE" +#define APP_DEBUG_COMPONENT_TABLE_NAME "DEBUG_COMPONENT_TABLE" +#define APP_DEBUG_COMP_DONE_TABLE_NAME "DEBUG_COMP_DONE_TABLE" + #define APP_NAT_TABLE_NAME "NAT_TABLE" #define APP_NAPT_TABLE_NAME "NAPT_TABLE" #define APP_NAT_TWICE_TABLE_NAME "NAT_TWICE_TABLE" @@ -123,6 +128,12 @@ namespace swss { #define APP_STP_MST_PORT_TABLE_NAME "STP_MST_PORT_TABLE" #define APP_STP_INST_PORT_FLUSH_TABLE_NAME "STP_INST_PORT_FLUSH_TABLE" +/* Multicast related APP_DB Tables */ +#define APP_L2MC_VLAN_TABLE_NAME "L2MC_VLAN_TABLE" +#define APP_L2MC_SUPPRESS_TABLE_NAME "L2MC_SUPPRESS_TABLE" +#define APP_L2MC_MEMBER_TABLE_NAME "L2MC_MEMBER_TABLE" +#define APP_L2MC_MROUTER_TABLE_NAME "L2MC_MROUTER_TABLE" + #define APP_SAG_TABLE_NAME "SAG_TABLE" @@ -401,6 +412,17 @@ after libswsscommon deb make. #define CHASSIS_APP_SYSTEM_NEIGH_TABLE_NAME "SYSTEM_NEIGH" #define CHASSIS_APP_LAG_TABLE_NAME "SYSTEM_LAG_TABLE" #define CHASSIS_APP_LAG_MEMBER_TABLE_NAME "SYSTEM_LAG_MEMBER_TABLE" + +#define CFG_L2MC_TABLE_NAME "L2MC" +#define CFG_L2MC_SUPPRESS_TABLE_NAME "L2MC_SUPPRESS" +#define CFG_L2MC_MROUTER_TABLE_NAME "L2MC_MROUTER" +#define CFG_L2MC_STATIC_TABLE_NAME "L2MC_STATIC_MEMBER" +#define CFG_L2MC_STATIC_GROUP_TABLE_NAME "L2MC_STATIC_GROUP" + +#define CFG_MLD_L2MC_TABLE_NAME "MLD_L2MC" +#define CFG_MLD_L2MC_MROUTER_TABLE_NAME "MLD_L2MC_MROUTER" +#define CFG_MLD_L2MC_STATIC_TABLE_NAME "MLD_L2MC_STATIC_MEMBER" +#define CFG_MLD_L2MC_STATIC_GROUP_TABLE_NAME "MLD_L2MC_STATIC_GROUP" /***** STATE DATABASE *****/ #define STATE_SWITCH_CAPABILITY_TABLE_NAME "SWITCH_CAPABILITY" @@ -499,6 +521,9 @@ after libswsscommon deb make. #define STATE_BGP_PEER_CONFIGURED_TABLE_NAME "BGP_PEER_CONFIGURED_TABLE" +#define STATE_L2MC_MEMBER_TABLE_NAME "L2MC_MEMBER_TABLE" +#define STATE_L2MC_MROUTER_TABLE_NAME "L2MC_MROUTER_TABLE" + // ACL table and ACL rule table #define STATE_ACL_TABLE_TABLE_NAME "ACL_TABLE_TABLE" #define STATE_ACL_RULE_TABLE_NAME "ACL_RULE_TABLE" diff --git a/sonic-db-cli/main.cpp b/sonic-db-cli/main.cpp index 1ddf101d6..cff20900f 100755 --- a/sonic-db-cli/main.cpp +++ b/sonic-db-cli/main.cpp @@ -7,16 +7,6 @@ using namespace std; int main(int argc, char** argv) { - auto initializeGlobalConfig = []() - { - SonicDBConfig::initializeGlobalConfig(SonicDBConfig::DEFAULT_SONIC_DB_GLOBAL_CONFIG_FILE); - }; - - auto initializeConfig = []() - { - SonicDBConfig::initialize(SonicDBConfig::DEFAULT_SONIC_DB_CONFIG_FILE); - }; - return cli_exception_wrapper( argc, argv, diff --git a/sonic-db-cli/sonic-db-cli.cpp b/sonic-db-cli/sonic-db-cli.cpp index 8f9711506..7060e489a 100755 --- a/sonic-db-cli/sonic-db-cli.cpp +++ b/sonic-db-cli/sonic-db-cli.cpp @@ -1,18 +1,38 @@ #include +#include #include #include #include #include #include #include "common/redisreply.h" +#include #include "sonic-db-cli.h" using namespace swss; using namespace std; +void initializeGlobalConfig() +{ + SonicDBConfig::initializeGlobalConfig(SonicDBConfig::DEFAULT_SONIC_DB_GLOBAL_CONFIG_FILE); +} + +void initializeConfig(const string& container_name = "") +{ + if(container_name.empty()) + { + SonicDBConfig::initialize(SonicDBConfig::DEFAULT_SONIC_DB_CONFIG_FILE); + } + else + { + auto path = getContainerFilePath(container_name, SONIC_DB_CONFIG_DIR, SonicDBConfig::DEFAULT_SONIC_DB_GLOBAL_CONFIG_FILE); + SonicDBConfig::initialize(path); + } +}; + void printUsage() { - cout << "usage: sonic-db-cli [-h] [-s] [-n NAMESPACE] db_or_op [cmd [cmd ...]]" << endl; + cout << "usage: sonic-db-cli [-h] [-s] [-n NAMESPACE] [-c CONTAINER_NAME] db_or_op [cmd [cmd ...]]" << endl; cout << endl; cout << "SONiC DB CLI:" << endl; cout << endl; @@ -25,6 +45,8 @@ void printUsage() cout << " -s, --unixsocket Override use of tcp_port and use unixsocket" << endl; cout << " -n NAMESPACE, --namespace NAMESPACE" << endl; cout << " Namespace string to use asic0/asic1.../asicn" << endl; + cout << " -c CONTAINER_NAME, --container_name CONTAINER_NAME" << endl; + cout << " Container name for accessing container database instead of default dpu0/dpu1.../dpu3" << endl; cout << endl; cout << "**sudo** needed for commands accesing a different namespace [-n], or using unixsocket connection [-s]" << endl; cout << endl; @@ -116,7 +138,7 @@ int handleAllInstances( { return 1; } - + if (operation == "PING") { cout << "PONG" << endl; @@ -186,15 +208,16 @@ void parseCliArguments( Options &options) { // Parse argument with getopt https://man7.org/linux/man-pages/man3/getopt.3.html - const char* short_options = "hsn"; + const char* short_options = "hsnc"; static struct option long_options[] = { {"help", optional_argument, NULL, 'h' }, {"unixsocket", optional_argument, NULL, 's' }, {"namespace", optional_argument, NULL, 'n' }, + {"container_name", optional_argument, NULL, 'c' }, // The last element of the array has to be filled with zeros. {0, 0, 0, 0 } }; - + // prevent getopt_long print "invalid option" message. opterr = 0; while(optind < argc) @@ -223,10 +246,31 @@ void parseCliArguments( } break; + case 'c': + if (optind < argc) + { + options.m_container_name = argv[optind]; + optind++; + } + else + { + throw invalid_argument("container_name value option used but container name is missing."); + } + break; + default: // argv contains unknown argument throw invalid_argument("Unknown argument:" + string(argv[optind])); } + + if(!options.m_namespace.empty() && !options.m_container_name.empty()) + { + throw invalid_argument("container_name and namespace flags cannot be used together."); + } + else if(options.m_unixsocket && !options.m_container_name.empty()) + { + throw invalid_argument("container_name and unixsocket flags cannot be used together."); + } } else { @@ -248,7 +292,7 @@ int sonic_db_cli( int argc, char** argv, function initializeGlobalConfig, - function initializeConfig) + function initializeConfig) { Options options; try @@ -275,6 +319,9 @@ int sonic_db_cli( return 0; } + // Need to reset SonicDBConfig to remove information from other database config files + SonicDBConfig::reset(); + if (!options.m_db_or_op.empty()) { auto dbOrOperation = options.m_db_or_op; @@ -293,10 +340,7 @@ int sonic_db_cli( { auto commands = options.m_cmd; - if (netns.empty()) - { - initializeConfig(); - } + initializeConfig(options.m_container_name); return executeCommands(dbOrOperation, commands, netns, useUnixSocket); } @@ -308,11 +352,9 @@ int sonic_db_cli( // sonic-db-cli catch all possible exceptions and handle it as a failure case which not return 'OK' or 'PONG' try { - if (netns.empty()) - { - // When database_config.json does not exist, sonic-db-cli will ignore exception and return 1. - initializeConfig(); - } + + // When database_config.json does not exist, sonic-db-cli will ignore exception and return 1. + initializeConfig(options.m_container_name); return handleAllInstances(netns, dbOrOperation, useUnixSocket); } @@ -345,7 +387,7 @@ int cli_exception_wrapper( int argc, char** argv, function initializeGlobalConfig, - function initializeConfig) + function initializeConfig) { try { @@ -381,3 +423,31 @@ string getCommandName(vector& commands) return boost::to_upper_copy(commands[0]); } + +string getContainerFilePath(const string& container_name, const string& config_directory, const string& global_config_file) +{ + using json = nlohmann::json; + ifstream i(global_config_file); + json global_config = json::parse(i); + for (auto& element : global_config["INCLUDES"]) + { + if (element["container_name"] == container_name) + { + auto relative_path = to_string(element["include"]); + + // remove the trailing " from the relative path (JSON string quotes) + if (relative_path.front() == '"' && relative_path.back() == '"') { + relative_path = relative_path.substr(1, relative_path.size() - 2); + } + + // remove all preceding "../" sequences from the relative path + while (relative_path.substr(0, 3) == "../") { + relative_path = relative_path.substr(3); + } + std::stringstream path_stream; + path_stream << config_directory << "/" << relative_path; + return path_stream.str(); + } + } + throw invalid_argument("container name " + container_name + " not found in global config file"); +} \ No newline at end of file diff --git a/sonic-db-cli/sonic-db-cli.h b/sonic-db-cli/sonic-db-cli.h index d1d874f8d..df19336d5 100755 --- a/sonic-db-cli/sonic-db-cli.h +++ b/sonic-db-cli/sonic-db-cli.h @@ -8,15 +8,22 @@ #include "common/dbinterface.h" #include "common/redisreply.h" +static constexpr const char *SONIC_DB_CONFIG_DIR = "/var/run"; + struct Options { bool m_help = false; bool m_unixsocket = false; + std::string m_container_name = ""; std::string m_namespace; std::string m_db_or_op; std::vector m_cmd; }; +void initializeGlobalConfig(); + +void initializeConfig(const std::string& container_name); + void printUsage(); void printRedisReply(swss::RedisReply& reply); @@ -52,12 +59,14 @@ int sonic_db_cli( int argc, char** argv, std::function initializeGlobalConfig, - std::function initializeConfig); + std::function initializeConfig); int cli_exception_wrapper( int argc, char** argv, std::function initializeGlobalConfig, - std::function initializeConfig); + std::function initializeConfig); + +std::string getCommandName(std::vector& command); -std::string getCommandName(std::vector& command); \ No newline at end of file +std::string getContainerFilePath(const std::string& container_name, const std::string& config_directory, const std::string& global_config_file); \ No newline at end of file diff --git a/tests/Makefile.am b/tests/Makefile.am index 2724e2e3c..6c985763f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,6 +33,7 @@ tests_tests_SOURCES = tests/redis_ut.cpp \ tests/saiaclschema_ut.cpp \ tests/countertable_ut.cpp \ tests/timer_ut.cpp \ + tests/config_ut.cpp \ tests/cli_ut.cpp \ tests/events_common_ut.cpp \ tests/events_service_ut.cpp \ diff --git a/tests/c_api_ut.cpp b/tests/c_api_ut.cpp index b4877b001..9b876fca8 100644 --- a/tests/c_api_ut.cpp +++ b/tests/c_api_ut.cpp @@ -28,6 +28,13 @@ static char LOG_LEVEL_FOR_TEST[32] = ""; static char LOG_OUTPUT_FOR_TEST[32] = ""; static const char* LOG_NAME_FOR_TEST = "test"; +const string config_file = "./tests/redis_multi_db_ut_config/database_config.json"; +const string global_config_file = "./tests/redis_multi_db_ut_config/database_global.json"; +static void reloadConfig() { + SonicDBConfig::reset(); + SonicDBConfig::initializeGlobalConfig(global_config_file); +} + static void clearDB() { DBConnector db("TEST_DB", 0, true); RedisReply r(&db, "FLUSHALL", REDIS_REPLY_STATUS); @@ -99,6 +106,7 @@ struct SWSSStringManager { }; TEST(c_api, ConfigDBConnector) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -231,6 +239,7 @@ void logOutputNotify(const char* component, const char* outputStr) } TEST(c_api, DBConnector) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -299,6 +308,7 @@ TEST(c_api, DBConnector) { } TEST(c_api, Table) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -359,6 +369,7 @@ TEST(c_api, Table) { } TEST(c_api, ConsumerProducerStateTables) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -445,6 +456,7 @@ TEST(c_api, ConsumerProducerStateTables) { } TEST(c_api, SubscriberStateTable) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -486,6 +498,7 @@ TEST(c_api, SubscriberStateTable) { } TEST(c_api, ZmqConsumerProducerStateTable) { + reloadConfig(); clearDB(); SWSSStringManager sm; @@ -615,6 +628,7 @@ TEST(c_api, ZmqConsumerProducerStateTable) { } TEST(c_api, EventPublisher) { + reloadConfig(); SWSSStringManager sm; // Test EventPublisher creation @@ -684,7 +698,7 @@ TEST(c_api, exceptions) { } TEST(c_api, Logger) { - + reloadConfig(); clearDB(); SWSSStringManager sm; diff --git a/tests/cli_test_data/cli_help_output.txt b/tests/cli_test_data/cli_help_output.txt index 1d286df17..d17b13d63 100755 --- a/tests/cli_test_data/cli_help_output.txt +++ b/tests/cli_test_data/cli_help_output.txt @@ -1,4 +1,4 @@ -usage: sonic-db-cli [-h] [-s] [-n NAMESPACE] db_or_op [cmd [cmd ...]] +usage: sonic-db-cli [-h] [-s] [-n NAMESPACE] [-c CONTAINER_NAME] db_or_op [cmd [cmd ...]] SONiC DB CLI: @@ -11,6 +11,8 @@ optional arguments: -s, --unixsocket Override use of tcp_port and use unixsocket -n NAMESPACE, --namespace NAMESPACE Namespace string to use asic0/asic1.../asicn + -c CONTAINER_NAME, --container_name CONTAINER_NAME + Container name for accessing container database instead of default dpu0/dpu1.../dpu3 **sudo** needed for commands accesing a different namespace [-n], or using unixsocket connection [-s] diff --git a/tests/cli_ut.cpp b/tests/cli_ut.cpp index bde4e3ebf..e858f110b 100755 --- a/tests/cli_ut.cpp +++ b/tests/cli_ut.cpp @@ -14,6 +14,7 @@ using namespace std; const string not_exist_config_file = "./tests/redis_multi_db_ut_config/database_config_not_exist.json"; const string config_file = "./tests/redis_multi_db_ut_config/database_config.json"; const string global_config_file = "./tests/redis_multi_db_ut_config/database_global.json"; +const string container_config_file = "./tests/redis_multi_db_ut_config/database_config6.json"; int sonic_db_cli(int argc, char** argv) { @@ -25,8 +26,12 @@ int sonic_db_cli(int argc, char** argv) } }; - auto initializeConfig = []() + auto initializeConfig = [](const string& container_name = "") { + if (!container_name.empty()){ + SonicDBConfig::initialize(container_config_file); + } + if (!SonicDBConfig::isInit()) { SonicDBConfig::initialize(config_file); @@ -79,7 +84,7 @@ void generateTestData(char* ns, char* database) args[1] = "-n"; args[2] = ns; args[3] = database; - + args[4] = "EVAL"; args[5] = "local i=0 while (i<100000) do i=i+1 redis.call('SET', i, i) end"; args[6] = "0"; @@ -105,13 +110,13 @@ TEST(sonic_db_cli, test_cli_hscan_commands) args[5] = "testvalue"; output = runCli(6, args); EXPECT_EQ("1\n", output); - + // hgetall from test db args[2] = "HGETALL"; args[3] = "testkey"; output = runCli(4, args); EXPECT_EQ("{'testfield': 'testvalue'}\n", output); - + // hscan from test db args[2] = "HSCAN"; args[3] = "testkey"; @@ -124,7 +129,7 @@ TEST(sonic_db_cli, test_cli_hscan_commands) args[3] = "notexistkey"; output = runCli(4, args); EXPECT_EQ("{}\n", output); - + // hscan from test db args[2] = "HSCAN"; args[3] = "notexistkey"; @@ -168,7 +173,7 @@ TEST(sonic_db_cli, test_cli_pop_commands) args[8] = "e"; output = runCli(9, args); EXPECT_EQ("5\n", output); - + // pop from test db args[2] = "blpop"; args[3] = "list1"; @@ -195,7 +200,7 @@ TEST(sonic_db_cli, test_cli_expire_commands) args[4] = "test"; output = runCli(5, args); EXPECT_EQ("True\n", output); - + // pop from test db args[2] = "expire"; args[3] = "testkey"; @@ -292,7 +297,7 @@ TEST(sonic_db_cli, test_cli_ping_cmd_no_config) SonicDBConfig::initializeGlobalConfig(not_exist_config_file); }; - auto initializeConfig = []() + auto initializeConfig = [](const string& container_name = "") { SonicDBConfig::initialize(not_exist_config_file); }; @@ -354,20 +359,20 @@ TEST(sonic_db_cli, test_cli_run_cmd) char *args[5]; args[0] = "sonic-db-cli"; args[1] = "TEST_DB"; - + // set key to test DB args[2] = "SET"; args[3] = "testkey"; args[4] = "testvalue"; auto output = runCli(5, args); EXPECT_EQ("True\n", output); - + // get key from test db args[2] = "GET"; args[3] = "testkey"; output = runCli(4, args); EXPECT_EQ("testvalue\n", output); - + // get keys from test db args[2] = "keys"; args[3] = "*"; @@ -382,20 +387,20 @@ TEST(sonic_db_cli, test_cli_multi_ns_cmd) args[1] = "-n"; args[2] = "asic2"; args[3] = "TEST_DB"; - + // set key to test DB args[4] = "SET"; args[5] = "testkey"; args[6] = "testvalue"; auto output = runCli(7, args); EXPECT_EQ("True\n", output); - + // get key from test db args[4] = "GET"; args[5] = "testkey"; output = runCli(6, args); EXPECT_EQ("testvalue\n", output); - + // get keys from test db args[4] = "keys"; args[5] = "*"; @@ -411,14 +416,14 @@ TEST(sonic_db_cli, test_cli_unix_socket_cmd) args[2] = "-n"; args[3] = "asic2"; args[4] = "TEST_DB"; - + // set key to test DB args[5] = "SET"; args[6] = "testkey"; args[7] = "testvalue"; auto output = runCli(8, args); EXPECT_EQ("True\n", output); - + // get key from test db args[5] = "GET"; args[6] = "testkey"; @@ -433,7 +438,7 @@ TEST(sonic_db_cli, test_cli_eval_cmd) args[1] = "-n"; args[2] = "asic2"; args[3] = "TEST_DB"; - + // run eval command: EVAL "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}" 2 k1 k2 v1 v2 args[4] = "EVAL"; args[5] = "return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}"; @@ -509,12 +514,50 @@ TEST(sonic_db_cli, test_parallel_cmd) { EXPECT_TRUE(parallen_time < sequential_time); } +TEST(sonic_db_cli, test_cli_run_dpu_cmd) +{ + char *args[7]; + args[0] = "sonic-db-cli"; + args[1] = "-c"; + args[2] = "dpu0"; + args[3] = "DPU_TEST_DB"; + + // set key to dpu test DB + args[4] = "SET"; + args[5] = "testkey"; + args[6] = "testvalue"; + auto output = runCli(7, args); + EXPECT_EQ("True\n", output); + + // get key from dpu test db + args[4] = "GET"; + args[5] = "testkey"; + output = runCli(6, args); + EXPECT_EQ("testvalue\n", output); + + // dpu and namespace flags are used together, should return -1 exit code + args[1] = "-n"; + args[2] = "asic2"; + args[3] = "-c"; + args[4] = "dpu0"; + args[5] = "DPU_TEST_DB"; + output = runCli(6, args, -1); + + // dpu and unixsocket flags are used together, should return -1 exit code + args[1] = "-s"; + args[2] = "asic2"; + args[3] = "-c"; + args[4] = "dpu0"; + args[5] = "DPU_TEST_DB"; + output = runCli(6, args, -1); +} + TEST(sonic_db_cli, test_cli_not_throw_exception) { char *args[5]; args[0] = "sonic-db-cli"; args[1] = "TEST_DB"; - + // set key to test DB args[2] = "SET"; args[3] = "testkey"; @@ -526,7 +569,7 @@ TEST(sonic_db_cli, test_cli_not_throw_exception) throw std::system_error(); }; - auto initializeConfig = []() + auto initializeConfig = [](const string& container_name = "") { throw std::system_error(); }; diff --git a/tests/config_ut.cpp b/tests/config_ut.cpp new file mode 100644 index 000000000..f4adfc35f --- /dev/null +++ b/tests/config_ut.cpp @@ -0,0 +1,39 @@ +#include "gtest/gtest.h" +#include "sonic-db-cli/sonic-db-cli.h" + +using namespace swss; +using namespace std; + +TEST(sonic_db_cli, test_cli_initialize_default_config) +{ + initializeGlobalConfig(); + try{ + initializeConfig(""); + } + catch(const std::exception& e) + { + } + + EXPECT_EQ(1, 1); +} + +TEST(sonic_db_cli, test_cli_initialize_dpu_config) +{ + initializeGlobalConfig(); + try{ + initializeConfig("dpu0"); + } + catch(const std::exception& e) + { + } + + EXPECT_EQ(1, 1); +} + +TEST(sonic_db_cli, test_get_container_file_path) +{ + const string global_config_file = "./tests/redis_multi_db_ut_config/database_global.json"; + const string config_directory = "./tests"; + auto path = getContainerFilePath("dpu0", config_directory, global_config_file); + EXPECT_EQ(path, "./tests/redis_multi_db_ut_config/database_config4.json"); +} \ No newline at end of file diff --git a/tests/profileprovider_ut.cpp b/tests/profileprovider_ut.cpp index 098ff8cb2..3bc7b8aca 100644 --- a/tests/profileprovider_ut.cpp +++ b/tests/profileprovider_ut.cpp @@ -11,6 +11,14 @@ static string profile_key = "TEST_INTERFACE"; static string profile_field = "profile"; static string profile_value = "value"; +const string config_file = "./tests/redis_multi_db_ut_config/database_config.json"; +const string global_config_file = "./tests/redis_multi_db_ut_config/database_global.json"; + +static void reloadConfig() { + SonicDBConfig::reset(); + SonicDBConfig::initializeGlobalConfig(global_config_file); +} + void clearDB(const string &dbName) { DBConnector db(dbName, 0, true); @@ -36,6 +44,7 @@ void initializeProfileDB() TEST(DECORATOR, GetConfigs) { + reloadConfig(); initializeProfileDB(); DBConnector db("CONFIG_DB", 0, true); @@ -56,6 +65,7 @@ TEST(DECORATOR, GetConfigs) TEST(DECORATOR, DeleteAndRevertProfile) { + reloadConfig(); initializeProfileDB(); DBConnector db("CONFIG_DB", 0, true); diff --git a/tests/redis_multi_db_ut_config/database_config6.json b/tests/redis_multi_db_ut_config/database_config6.json new file mode 100644 index 000000000..5dea86318 --- /dev/null +++ b/tests/redis_multi_db_ut_config/database_config6.json @@ -0,0 +1,22 @@ +{ + "INSTANCES": { + "redis":{ + "hostname" : "127.0.0.1", + "port": 6379, + "unix_socket_path": "/var/run/redis/redis.sock" + }, + "remote-redis":{ + "hostname" : "127.0.0.1", + "port": 6379, + "unix_socket_path": "" + } + }, + "DATABASES" : { + "DPU_TEST_DB" : { + "id" : 0, + "separator": ":", + "instance" : "redis" + } + }, + "VERSION" : "1.0" +} diff --git a/tests/zmq_state_ut.cpp b/tests/zmq_state_ut.cpp index 509c1f753..c571e9300 100644 --- a/tests/zmq_state_ut.cpp +++ b/tests/zmq_state_ut.cpp @@ -695,7 +695,7 @@ TEST_P(ZmqConsumerStateTablePopSize, test) } } -INSTANTIATE_TEST_SUITE_P( +INSTANTIATE_TEST_CASE_P( BatchSizeTests, ZmqConsumerStateTablePopSize, ::testing::Values(