MXS-1451: Add test case

Added test case for MXS-1451 that reproduces the problem.
This commit is contained in:
Markus Mäkelä
2017-09-25 13:27:36 +03:00
parent f5b329a0a3
commit 6601f15ff8
3 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,34 @@
/**
* MXS-1451: Password is not stored with skip_authentication=true
*
* Check that connection through MaxScale work even if authentication is disabled
*/
#include "testconnections.h"
int main(int argc, char *argv[])
{
TestConnections test(argc, argv);
test.set_timeout(60);
test.tprintf("Creating user...");
test.repl->connect();
execute_query(test.repl->nodes[0], "CREATE USER 'auth_test'@'%s' IDENTIFIED BY 'test'", test.maxscale_ip());
execute_query(test.repl->nodes[0], "GRANT ALL ON *.* to 'auth_test'@'%s'", test.maxscale_ip());
test.repl->sync_slaves();
test.repl->close_connections();
test.set_timeout(60);
test.tprintf("Trying to connect through MaxScale");
MYSQL* conn = open_conn_db(test.rwsplit_port, test.maxscale_ip(), "test", "auth_test", "test", false);
test.try_query(conn, "SHOW DATABASES");
mysql_close(conn);
test.set_timeout(60);
test.tprintf("Dropping user");
test.repl->connect();
execute_query(test.repl->nodes[0], "DROP USER 'auth_test'@'%s'", test.maxscale_ip());
test.repl->close_connections();
return test.global_result;
}