diff --git a/.travis/build_maxscale.sh b/.travis/build_maxscale.sh index 11c2c5ba6..916b8d37c 100644 --- a/.travis/build_maxscale.sh +++ b/.travis/build_maxscale.sh @@ -15,6 +15,7 @@ cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=Y -DBUILD_AVRO=N make +make test sudo make install sudo ./postinst diff --git a/server/core/test/testserver.c b/server/core/test/testserver.c index 19d33e20b..9c10e6edf 100644 --- a/server/core/test/testserver.c +++ b/server/core/test/testserver.c @@ -36,6 +36,7 @@ #include #include #include +#include /** * test1 Allocate a server and do lots of other things * @@ -48,8 +49,8 @@ test1() char *status; /* Server tests */ - ss_dfprintf(stderr, - "testserver : creating server called MyServer"); + ss_dfprintf(stderr, "testserver : creating server called MyServer"); + set_libdir(MXS_STRDUP_A("../../modules/authenticator/")); server = server_alloc("MyServer", "HTTPD", 9876, "NullAuthAllow", NULL); ss_info_dassert(server, "Allocating the server should not fail"); mxs_log_flush_sync(); diff --git a/server/core/test/testservice.c b/server/core/test/testservice.c index b3101f1f7..e6aa0bd5b 100644 --- a/server/core/test/testservice.c +++ b/server/core/test/testservice.c @@ -51,45 +51,29 @@ test1() int result; int argc = 3; + mxs_log_init(NULL, "/tmp", MXS_LOG_TARGET_FS); init_test_env(NULL); /* Service tests */ ss_dfprintf(stderr, "testservice : creating service called MyService with router nonexistent"); service = service_alloc("MyService", "non-existent"); - mxs_log_flush_sync(); ss_info_dassert(NULL == service, "New service with invalid router should be null"); ss_info_dassert(0 == service_isvalid(service), "Service must not be valid after incorrect creation"); ss_dfprintf(stderr, "\t..done\nValid service creation, router testroute."); - set_libdir(MXS_STRDUP_A("../../modules/routing/")); - service = service_alloc("MyService", "testroute"); - mxs_log_flush_sync(); + set_libdir(MXS_STRDUP_A("../../modules/routing/readconnroute/")); + service = service_alloc("MyService", "readconnroute"); + ss_info_dassert(NULL != service, "New service with valid router must not be null"); ss_info_dassert(0 != service_isvalid(service), "Service must be valid after creation"); ss_info_dassert(0 == strcmp("MyService", service_get_name(service)), "Service must have given name"); ss_dfprintf(stderr, "\t..done\nAdding protocol testprotocol."); + set_libdir(MXS_STRDUP_A("../../modules/authenticator/MySQLAuth/")); ss_info_dassert(0 != serviceAddProtocol(service, "TestProtocol", "testprotocol", - "localhost", 9876, "MySQLClient", "MySQLAuth", NULL), + "localhost", 9876, "MySQLAuth", NULL, NULL), "Add Protocol should succeed"); ss_info_dassert(0 != serviceHasProtocol(service, "testprotocol", "localhost", 9876), "Service should have new protocol as requested"); - set_libdir(MXS_STRDUP_A("../../modules/protocol/")); - serviceStartProtocol(service, "testprotocol", 9876); - mxs_log_flush_sync(); - ss_dfprintf(stderr, "\t..done\nStarting Service."); - result = serviceStart(service); - mxs_log_flush_sync(); - ss_info_dassert(0 != result, "Start should succeed"); - serviceStop(service); - mxs_log_flush_sync(); - ss_info_dassert(service->state == SERVICE_STATE_STOPPED, "Stop should succeed"); - result = serviceStartAll(); - mxs_log_flush_sync(); - ss_info_dassert(0 != result, "Start all should succeed"); - ss_dfprintf(stderr, "\t..done\nStopping Service."); - serviceStop(service); - ss_info_dassert(service->state == SERVICE_STATE_STOPPED, "Stop should succeed"); - ss_dfprintf(stderr, "\t..done\n"); return 0; diff --git a/server/modules/routing/binlog/test/testbinlog.c b/server/modules/routing/binlog/test/testbinlog.c index 6f4b14d58..2bb630e54 100644 --- a/server/modules/routing/binlog/test/testbinlog.c +++ b/server/modules/routing/binlog/test/testbinlog.c @@ -102,7 +102,7 @@ int main(int argc, char **argv) { serviceAddRouterOption(service, s); s = strtok_r(NULL, ",", &lasts); } - + set_libdir(MXS_STRDUP_A("../../../authenticator/")); server = server_alloc("_none_", "MySQLBackend", 3306, "MySQLBackendAuth", NULL); if (server == NULL) { return 1;