MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / load_cachedb_modules

Function load_cachedb_modules

cachedb/test/test_cachedb.c:52–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51
52static void load_cachedb_modules(void)
53{
54#ifdef CACHEDB_SKIP_BACKEND_TESTS
55 return;
56#endif
57
58 if (load_module("cachedb_mongodb.so") != 0) {
59 printf("failed to load mongo\n");
60 exit(-1);
61 }
62
63 if (load_module("cachedb_cassandra.so") != 0) {
64 printf("failed to load cassandra\n");
65 exit(-1);
66 }
67
68 if (load_module("cachedb_redis.so") != 0) {
69 printf("failed to load redis\n");
70 exit(-1);
71 }
72
73 if (set_mod_param_regex("cachedb_mongodb", "cachedb_url", STR_PARAM,
74 "mongodb://10.0.0.177:27017/OpensipsTests.OpensipsTests") != 0) {
75 printf("failed to set mongo url\n");
76 exit(-1);
77 }
78
79 if (set_mod_param_regex("cachedb_cassandra", "cachedb_url", STR_PARAM,
80 "cassandra:test1://10.0.0.178/testcass1.osstest1.osscnttest1") != 0) {
81 printf("failed to set cassandra url\n");
82 exit(-1);
83 }
84
85 /* for Cassandra we need a different table schema for the col-oriented ops tests */
86 if (set_mod_param_regex("cachedb_cassandra", "cachedb_url", STR_PARAM,
87 "cassandra:test2://10.0.0.178/testcass1.osstest2.osscnttest1") != 0) {
88 printf("failed to set cassandra url\n");
89 exit(-1);
90 }
91
92 if (set_mod_param_regex("cachedb_redis", "cachedb_url", STR_PARAM,
93 "redis://localhost:6379/") != 0) {
94 printf("failed to set Redis url\n");
95 exit(-1);
96 }
97}
98
99
100int res_has_kv(const cdb_res_t *res, const cdb_pair_t *pair)

Callers 1

init_cachedb_testsFunction · 0.85

Calls 2

load_moduleFunction · 0.85
set_mod_param_regexFunction · 0.85

Tested by

no test coverage detected