Uncrustify maxscale

See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
This commit is contained in:
Niclas Antti
2018-09-09 22:26:19 +03:00
parent fa7ec95069
commit c447e5cf15
849 changed files with 35002 additions and 27238 deletions

View File

@ -6,18 +6,20 @@
#include "testconnections.h"
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.set_timeout(60);
test.tprintf("Creating users");
test.repl->connect();
execute_query(test.repl->nodes[0], "CREATE USER 'auth_test'@'%s' IDENTIFIED BY 'test'",
execute_query(test.repl->nodes[0],
"CREATE USER 'auth_test'@'%s' IDENTIFIED BY 'test'",
test.maxscales->ip(0));
execute_query(test.repl->nodes[0], "GRANT ALL ON *.* to 'auth_test'@'%s'", test.maxscales->ip(0));
execute_query(test.repl->nodes[0], "CREATE USER 'auth_test_nopw'@'%s'", test.maxscales->ip(0));
execute_query(test.repl->nodes[0], "GRANT ALL ON *.* to 'auth_test_nopw'@'%s'",
execute_query(test.repl->nodes[0],
"GRANT ALL ON *.* to 'auth_test_nopw'@'%s'",
test.maxscales->ip(0));
test.repl->sync_slaves();
test.repl->close_connections();
@ -26,36 +28,56 @@ int main(int argc, char *argv[])
test.set_timeout(60);
test.tprintf("... with correct credentials");
MYSQL* conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->ip(0), "test", "auth_test",
"test", false);
MYSQL* conn = open_conn_db(test.maxscales->rwsplit_port[0],
test.maxscales->ip(0),
"test",
"auth_test",
"test",
false);
test.try_query(conn, "SHOW DATABASES");
mysql_close(conn);
test.set_timeout(60);
test.tprintf("... without a password");
conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->ip(0), "test", "auth_test_nopw", "",
conn = open_conn_db(test.maxscales->rwsplit_port[0],
test.maxscales->ip(0),
"test",
"auth_test_nopw",
"",
false);
test.try_query(conn, "SHOW DATABASES");
mysql_close(conn);
test.set_timeout(60);
test.tprintf("... with wrong password");
conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->ip(0), "test", "auth_test",
"wrong_password", false);
conn = open_conn_db(test.maxscales->rwsplit_port[0],
test.maxscales->ip(0),
"test",
"auth_test",
"wrong_password",
false);
test.add_result(mysql_errno(conn) == 0, "Connection with wrong password should fail");
mysql_close(conn);
test.set_timeout(60);
test.tprintf("... with a password for user without a password");
conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->ip(0), "test", "auth_test_nopw", "test",
conn = open_conn_db(test.maxscales->rwsplit_port[0],
test.maxscales->ip(0),
"test",
"auth_test_nopw",
"test",
false);
test.add_result(mysql_errno(conn) == 0,
"Connection with wrong password to user without a password should fail");
mysql_close(conn);
test.tprintf("... with bad credentials");
conn = open_conn_db(test.maxscales->rwsplit_port[0], test.maxscales->ip(0), "test", "wrong_user",
"wrong_password", false);
conn = open_conn_db(test.maxscales->rwsplit_port[0],
test.maxscales->ip(0),
"test",
"wrong_user",
"wrong_password",
false);
test.add_result(mysql_errno(conn) == 0, "Connection with bad credentials should fail");
mysql_close(conn);