refactored tests (#147)
This commit is contained in:
@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user