| 50 | |
| 51 | |
| 52 | static 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 | |
| 100 | int res_has_kv(const cdb_res_t *res, const cdb_pair_t *pair) |
no test coverage detected