refactored tests (#147)
This commit is contained in:
@ -64,12 +64,12 @@ int main(int argc, char *argv[])
|
||||
Test->repl->execute_query_all_nodes((char *) "set global max_connect_errors=1000;");
|
||||
Test->repl->execute_query_all_nodes((char *) "set global max_connections=1000;");
|
||||
|
||||
Test->connect_maxscale();
|
||||
Test->maxscales->connect_maxscale(0);
|
||||
Test->tprintf("Creating one user 'user@%%'");
|
||||
execute_query_silent(Test->conn_rwsplit, (char *) "DROP USER user@'%'");
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "CREATE USER user@'%%' identified by 'pass2'");
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "GRANT SELECT ON test.* TO user@'%%';");
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "FLUSH PRIVILEGES;");
|
||||
execute_query_silent(Test->maxscales->conn_rwsplit[0], (char *) "DROP USER user@'%'");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "CREATE USER user@'%%' identified by 'pass2'");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "GRANT SELECT ON test.* TO user@'%%';");
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "FLUSH PRIVILEGES;");
|
||||
|
||||
Test->tprintf("Starting parallel thread which opens/closes session in the loop");
|
||||
|
||||
@ -82,10 +82,10 @@ int main(int argc, char *argv[])
|
||||
for (int i = 0; i < iterations; i++)
|
||||
{
|
||||
Test->set_timeout(15);
|
||||
Test->add_result(mysql_change_user(Test->conn_rwsplit, "user", "pass2", (char *) "test"),
|
||||
"change_user failed! %", mysql_error(Test->conn_rwsplit));
|
||||
Test->add_result(mysql_change_user(Test->conn_rwsplit, Test->maxscale_user, Test->maxscale_password,
|
||||
(char *) "test"), "change_user failed! %s", mysql_error(Test->conn_rwsplit));
|
||||
Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], "user", "pass2", (char *) "test"),
|
||||
"change_user failed! %", mysql_error(Test->maxscales->conn_rwsplit[0]));
|
||||
Test->add_result(mysql_change_user(Test->maxscales->conn_rwsplit[0], Test->maxscales->user_name, Test->maxscales->password,
|
||||
(char *) "test"), "change_user failed! %s", mysql_error(Test->maxscales->conn_rwsplit[0]));
|
||||
}
|
||||
|
||||
Test->tprintf("Waiting for all threads to finish");
|
||||
@ -98,13 +98,13 @@ int main(int argc, char *argv[])
|
||||
Test->tprintf("All threads are finished");
|
||||
Test->repl->flush_hosts();
|
||||
|
||||
Test->tprintf("Change user to '%s' in order to be able to DROP user", Test->maxscale_user);
|
||||
Test->tprintf("Change user to '%s' in order to be able to DROP user", Test->maxscales->user_name);
|
||||
Test->set_timeout(30);
|
||||
mysql_change_user(Test->conn_rwsplit, Test->maxscale_user, Test->maxscale_password, NULL);
|
||||
mysql_change_user(Test->maxscales->conn_rwsplit[0], Test->maxscales->user_name, Test->maxscales->password, NULL);
|
||||
|
||||
Test->tprintf("Dropping user", Test->maxscale_user);
|
||||
Test->try_query(Test->conn_rwsplit, (char *) "DROP USER user@'%%';");
|
||||
Test->check_maxscale_alive();
|
||||
Test->tprintf("Dropping user", Test->maxscales->user_name);
|
||||
Test->try_query(Test->maxscales->conn_rwsplit[0], (char *) "DROP USER user@'%%';");
|
||||
Test->check_maxscale_alive(0);
|
||||
|
||||
int rval = Test->global_result;
|
||||
delete Test;
|
||||
@ -116,7 +116,7 @@ void *parall_traffic( void *ptr )
|
||||
MYSQL * conn;
|
||||
while (exit_flag == 0)
|
||||
{
|
||||
conn = Test->open_rwsplit_connection();
|
||||
conn = Test->maxscales->open_rwsplit_connection(0);
|
||||
mysql_close(conn);
|
||||
if (Test->backend_ssl)
|
||||
{
|
||||
|
Reference in New Issue
Block a user