refactored tests (#147)
This commit is contained in:
@ -19,15 +19,17 @@ int check_max_conn(int router, int max_conn, TestConnections * Test)
|
||||
int i;
|
||||
for (i = 0; i < max_conn; i++)
|
||||
{
|
||||
conn[i] = open_conn(Test->ports[router], Test->maxscale_IP, Test->maxscale_user, Test->maxscale_password,
|
||||
conn[i] = open_conn(Test->maxscales->ports[0][router], Test->maxscales->IP[0], Test->maxscales->user_name,
|
||||
Test->maxscales->password,
|
||||
Test->ssl);
|
||||
if (mysql_errno(conn[i]) != 0)
|
||||
{
|
||||
Test->add_result(1, "Connection %d failed, error is %s\n", i, mysql_error(conn[i]));
|
||||
}
|
||||
}
|
||||
conn[max_conn] = open_conn(Test->ports[router], Test->maxscale_IP, Test->maxscale_user,
|
||||
Test->maxscale_password, Test->ssl);
|
||||
conn[max_conn] = open_conn(Test->maxscales->ports[0][router], Test->maxscales->IP[0],
|
||||
Test->maxscales->user_name,
|
||||
Test->maxscales->password, Test->ssl);
|
||||
if (mysql_errno(conn[i]) != 1040)
|
||||
{
|
||||
Test->add_result(1, "Max_xonnections reached, but error is not 1040, it is %d %s\n", mysql_errno(conn[i]),
|
||||
@ -52,9 +54,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
sleep(10);
|
||||
|
||||
Test->check_maxscale_alive();
|
||||
Test->check_maxscale_alive(0);
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user