refactored tests (#147)
This commit is contained in:
@ -51,29 +51,29 @@ int main(int argc, char *argv[])
|
||||
int res_d;
|
||||
Test->set_timeout(10);
|
||||
|
||||
Test->get_maxadmin_param((char *) "show server server1", (char *) "Current no. of conns:", res);
|
||||
Test->maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Current no. of conns:", res);
|
||||
sscanf(res, "%d", &res_d);
|
||||
Test->tprintf("Before: Current num of conn %d\n", res_d);
|
||||
Test->add_result(res_d, "curr num of conn is not 0\n");
|
||||
Test->get_maxadmin_param((char *) "show server server1", (char *) "Number of connections:", res);
|
||||
Test->maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Number of connections:", res);
|
||||
sscanf(res, "%d", &res_d);
|
||||
Test->tprintf("Before: num of conn %d\n", res_d);
|
||||
Test->add_result(res_d, "num of conn is not 0");
|
||||
|
||||
Test->connect_rwsplit();
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "select 1");
|
||||
Test->close_rwsplit();
|
||||
Test->maxscales->connect_rwsplit(0);
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "select 1");
|
||||
Test->maxscales->close_rwsplit(0);
|
||||
|
||||
Test->stop_timeout();
|
||||
sleep(10);
|
||||
|
||||
Test->set_timeout(10);
|
||||
|
||||
Test->get_maxadmin_param((char *) "show server server1", (char *) "Current no. of conns:", res);
|
||||
Test->maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Current no. of conns:", res);
|
||||
sscanf(res, "%d", &res_d);
|
||||
Test->tprintf("After: Current num of conn %d\n", res_d);
|
||||
Test->add_result(res_d, "curr num of conn is not 0\n");
|
||||
Test->get_maxadmin_param((char *) "show server server1", (char *) "Number of connections:", res);
|
||||
Test->maxscales->get_maxadmin_param(0, (char *) "show server server1", (char *) "Number of connections:", res);
|
||||
sscanf(res, "%d", &res_d);
|
||||
Test->tprintf("After: num of conn %d\n", res_d);
|
||||
if (res_d != 1)
|
||||
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
||||
Test->add_result(1, "num of conn is not 1");
|
||||
}
|
||||
|
||||
Test->check_maxscale_alive();
|
||||
Test->check_maxscale_alive(0);
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
|
Reference in New Issue
Block a user