MXS-2008 Update gateway and tests to initialize maxbase
Update gateway and tests to initialize maxbase using maxbase::init(); instead of initializing individual components.
This commit is contained in:
parent
e852dcacdd
commit
3576780f78
@ -30,7 +30,7 @@ if (BUILD_QC_MYSQLEMBEDDED)
|
||||
add_executable(version_sensitivity version_sensitivity.cc)
|
||||
target_link_libraries(version_sensitivity maxscale-common)
|
||||
|
||||
add_executable(crash_qc_sqlite crash_qc_sqlite.c)
|
||||
add_executable(crash_qc_sqlite crash_qc_sqlite.cc)
|
||||
target_link_libraries(crash_qc_sqlite maxscale-common)
|
||||
|
||||
add_test(TestQC_Crash_qcsqlite crash_qc_sqlite)
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <maxbase/maxbase.hh>
|
||||
#include <maxscale/buffer.h>
|
||||
#include <maxscale/paths.h>
|
||||
#include <maxscale/query_classifier.h>
|
||||
@ -39,6 +40,8 @@ int main()
|
||||
{
|
||||
int rv = EXIT_FAILURE;
|
||||
|
||||
maxbase::MaxBase init(MXB_LOG_TARGET_FS);
|
||||
|
||||
set_libdir(strdup("../qc_sqlite"));
|
||||
|
||||
if (qc_setup(NULL, QC_SQL_MODE_DEFAULT, "qc_sqlite", NULL) &&
|
@ -39,7 +39,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <maxbase/messagequeue.hh>
|
||||
#include <maxbase/maxbase.hh>
|
||||
#include <maxbase/stacktrace.hh>
|
||||
#include <maxscale/alloc.h>
|
||||
#include <maxscale/adminusers.h>
|
||||
@ -1941,16 +1941,9 @@ int main(int argc, char **argv)
|
||||
MXS_NOTICE("Module directory: %s", get_libdir());
|
||||
MXS_NOTICE("Service cache: %s", get_cachedir());
|
||||
|
||||
if (!mxb::MessageQueue::init())
|
||||
if (!maxbase::init())
|
||||
{
|
||||
MXS_ERROR("Failed to initialize message queue.");
|
||||
rc = MAXSCALE_INTERNALERROR;
|
||||
goto return_main;
|
||||
}
|
||||
|
||||
if (!mxb::Worker::init())
|
||||
{
|
||||
MXS_ERROR("Failed to initialize workers.");
|
||||
MXS_ERROR("Failed to initialize MaxScale base library.");
|
||||
rc = MAXSCALE_INTERNALERROR;
|
||||
goto return_main;
|
||||
}
|
||||
@ -2193,8 +2186,7 @@ int main(int argc, char **argv)
|
||||
service_destroy_instances();
|
||||
|
||||
RoutingWorker::finish();
|
||||
mxb::Worker::finish();
|
||||
mxb::MessageQueue::finish();
|
||||
maxbase::finish();
|
||||
|
||||
/*< Call finish on all modules. */
|
||||
modules_process_finish();
|
||||
|
@ -15,7 +15,7 @@
|
||||
* Test modulecmd.h functionality
|
||||
*/
|
||||
|
||||
#include <maxbase/messagequeue.hh>
|
||||
#include <maxbase/maxbase.hh>
|
||||
#include <maxscale/alloc.h>
|
||||
#include <maxscale/dcb.h>
|
||||
#include <maxscale/paths.h>
|
||||
@ -466,7 +466,7 @@ int main(int argc, char **argv)
|
||||
int rc = 0;
|
||||
|
||||
mxs_log_init(NULL, NULL, MXS_LOG_TARGET_STDOUT);
|
||||
mxb::MessageQueue::init();
|
||||
maxbase::init();
|
||||
|
||||
rc += test_arguments();
|
||||
rc += test_optional_arguments();
|
||||
@ -477,6 +477,7 @@ int main(int argc, char **argv)
|
||||
rc += test_domain_matching("mariadbmon", "mysqlmon", "test_domain_matching2");
|
||||
rc += test_output();
|
||||
|
||||
maxbase::finish();
|
||||
mxs_log_finish();
|
||||
return rc;
|
||||
}
|
||||
|
@ -15,8 +15,7 @@
|
||||
*/
|
||||
|
||||
#include <maxscale/cdefs.h>
|
||||
#include <maxbase/messagequeue.hh>
|
||||
#include <maxbase/worker.hh>
|
||||
#include <maxbase/maxbase.hh>
|
||||
#include <maxscale/dcb.h>
|
||||
#include <maxscale/housekeeper.h>
|
||||
#include <maxscale/maxscale_test.h>
|
||||
@ -48,8 +47,7 @@ void init_test_env(char *path)
|
||||
qc_setup(NULL, QC_SQL_MODE_DEFAULT, NULL, NULL);
|
||||
qc_process_init(QC_INIT_BOTH);
|
||||
poll_init();
|
||||
mxb::MessageQueue::init();
|
||||
mxb::Worker::init();
|
||||
maxbase::init();
|
||||
maxscale::RoutingWorker::init();
|
||||
hkinit();
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <maxbase/messagequeue.hh>
|
||||
#include <maxbase/maxbase.hh>
|
||||
#include <maxscale/alloc.h>
|
||||
#include <set>
|
||||
|
||||
@ -70,7 +70,7 @@ private:
|
||||
|
||||
int main()
|
||||
{
|
||||
mxb::MessageQueue::init();
|
||||
maxbase::init();
|
||||
|
||||
MariaDBMonitor::Test tester;
|
||||
return tester.run_tests();
|
||||
|
Loading…
x
Reference in New Issue
Block a user