Fix internal test suite
The tests were broken by changes to the core.
This commit is contained in:
@ -20,6 +20,7 @@
|
|||||||
#include <maxscale/housekeeper.h>
|
#include <maxscale/housekeeper.h>
|
||||||
#include <maxscale/maxscale_test.h>
|
#include <maxscale/maxscale_test.h>
|
||||||
#include <maxscale/log_manager.h>
|
#include <maxscale/log_manager.h>
|
||||||
|
#include <maxscale/config.h>
|
||||||
#include "../maxscale/statistics.h"
|
#include "../maxscale/statistics.h"
|
||||||
|
|
||||||
void init_test_env(char *path)
|
void init_test_env(char *path)
|
||||||
@ -28,8 +29,11 @@ void init_test_env(char *path)
|
|||||||
|
|
||||||
const char* logdir = path ? path : TEST_LOG_DIR;
|
const char* logdir = path ? path : TEST_LOG_DIR;
|
||||||
|
|
||||||
|
config_get_global_options()->n_threads = 1;
|
||||||
|
|
||||||
ts_stats_init();
|
ts_stats_init();
|
||||||
mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT);
|
mxs_log_init(NULL, logdir, MXS_LOG_TARGET_DEFAULT);
|
||||||
|
dcb_global_init();
|
||||||
poll_init();
|
poll_init();
|
||||||
hkinit();
|
hkinit();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,11 +61,13 @@ test1()
|
|||||||
printAllDCBs();
|
printAllDCBs();
|
||||||
ss_info_dassert(true, "Something is true");
|
ss_info_dassert(true, "Something is true");
|
||||||
ss_dfprintf(stderr, "\t..done\n");
|
ss_dfprintf(stderr, "\t..done\n");
|
||||||
|
dcb->state = DCB_STATE_POLLING;
|
||||||
dcb_close(dcb);
|
dcb_close(dcb);
|
||||||
ss_dfprintf(stderr, "Freed original dcb");
|
ss_dfprintf(stderr, "Freed original dcb");
|
||||||
ss_info_dassert(!dcb_isvalid(dcb), "Freed DCB must not be valid");
|
ss_info_dassert(!dcb_isvalid(dcb), "Freed DCB must not be valid");
|
||||||
ss_dfprintf(stderr, "\t..done\nMake clone DCB a zombie");
|
ss_dfprintf(stderr, "\t..done\nMake clone DCB a zombie");
|
||||||
clone->state = DCB_STATE_NOPOLLING;
|
clone->state = DCB_STATE_NOPOLLING;
|
||||||
|
dcb_add_to_list(clone);
|
||||||
dcb_close(clone);
|
dcb_close(clone);
|
||||||
ss_dfprintf(stderr, "\t..done\nProcess the zombies list");
|
ss_dfprintf(stderr, "\t..done\nProcess the zombies list");
|
||||||
dcb_process_zombies(0);
|
dcb_process_zombies(0);
|
||||||
@ -79,6 +81,7 @@ test1()
|
|||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
dcb_global_init();
|
||||||
|
|
||||||
result += test1();
|
result += test1();
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ test1()
|
|||||||
|
|
||||||
/* Server tests */
|
/* 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/"));
|
set_libdir(MXS_STRDUP_A("../../modules/authenticator/NullAuthAllow/"));
|
||||||
server = server_alloc("uniquename", "127.0.0.1", 9876, "HTTPD", "NullAuthAllow", NULL);
|
server = server_alloc("uniquename", "127.0.0.1", 9876, "HTTPD", "NullAuthAllow", NULL);
|
||||||
ss_info_dassert(server, "Allocating the server should not fail");
|
ss_info_dassert(server, "Allocating the server should not fail");
|
||||||
mxs_log_flush_sync();
|
mxs_log_flush_sync();
|
||||||
|
|||||||
Reference in New Issue
Block a user