MXS-1451: Add test case
Added test case for MXS-1451 that reproduces the problem.
This commit is contained in:
34
maxscale-system-test/mxs1451_skip_auth.cpp
Normal file
34
maxscale-system-test/mxs1451_skip_auth.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user