refactored tests (#147)

This commit is contained in:
Timofey Turenko
2017-12-08 12:23:04 +02:00
committed by GitHub
parent c6daf8c26b
commit 3c88bf1ec6
253 changed files with 5265 additions and 3649 deletions

View File

@ -17,15 +17,15 @@ int main(int argc, char *argv[])
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(60);
Test->connect_maxscale();
Test->maxscales->connect_maxscale(0);
Test->tprintf("Create user with only SELECT priviledge to a table");
execute_query_silent(Test->conn_rwsplit, "DROP USER 'table_privilege'@'%'");
execute_query_silent(Test->conn_rwsplit, "DROP TABLE test.t1");
execute_query(Test->conn_rwsplit, "CREATE TABLE test.t1 (id INT)");
execute_query(Test->conn_rwsplit, "CREATE USER 'table_privilege'@'%%' IDENTIFIED BY 'pass'");
execute_query(Test->conn_rwsplit, "GRANT SELECT ON test.t1 TO 'table_privilege'@'%%'");
execute_query_silent(Test->maxscales->conn_rwsplit[0], "DROP USER 'table_privilege'@'%'");
execute_query_silent(Test->maxscales->conn_rwsplit[0], "DROP TABLE test.t1");
execute_query(Test->maxscales->conn_rwsplit[0], "CREATE TABLE test.t1 (id INT)");
execute_query(Test->maxscales->conn_rwsplit[0], "CREATE USER 'table_privilege'@'%%' IDENTIFIED BY 'pass'");
execute_query(Test->maxscales->conn_rwsplit[0], "GRANT SELECT ON test.t1 TO 'table_privilege'@'%%'");
Test->stop_timeout();
Test->repl->sync_slaves();
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
*/
for (int i = 0; i < 5; i++)
{
MYSQL *conn = open_conn_db(Test->rwsplit_port, Test->maxscale_IP, (char *) "test",
MYSQL *conn = open_conn_db(Test->maxscales->rwsplit_port[0], Test->maxscales->IP[0], (char *) "test",
(char *) "table_privilege", (char *) "pass", Test->ssl);
if (mysql_errno(conn) != 0)
{
@ -70,10 +70,10 @@ int main(int argc, char *argv[])
}
Test->set_timeout(20);
execute_query_silent(Test->conn_rwsplit, "DROP USER 'table_privilege'@'%'");
execute_query_silent(Test->conn_rwsplit, "DROP TABLE test.t1");
execute_query_silent(Test->maxscales->conn_rwsplit[0], "DROP USER 'table_privilege'@'%'");
execute_query_silent(Test->maxscales->conn_rwsplit[0], "DROP TABLE test.t1");
Test->check_maxscale_alive();
Test->check_maxscale_alive(0);
int rval = Test->global_result;
delete Test;