Add tests from develop

Added tests from develop. The test results need to be modified for 2.0.
This commit is contained in:
Markus Mäkelä
2017-05-26 15:40:40 +03:00
parent ad109408b5
commit d7d4ec29bb
596 changed files with 48543 additions and 0 deletions

View File

@ -0,0 +1,33 @@
/**
* MXS-1111: Dbfwfilter COM_PING test
*
* Check that COM_PING is allowed with `action=allow`
*/
#include "testconnections.h"
const char *rules = "rule test1 deny regex '.*'\n"
"users %@% match any rules test1\n";
int main(int argc, char** argv)
{
/** Create the rule file */
FILE *file = fopen("rules.txt", "w");
fwrite(rules, 1, strlen(rules), file);
fclose(file);
TestConnections::skip_maxscale_start(true);
TestConnections test(argc, argv);
test.ssh_maxscale(true, "mkdir -p /home/vagrant/rules/; chown -R vagrant:vagrant /home/vagrant/rules/");
test.copy_to_maxscale((char*)"rules.txt", (char*)"~/rules/rules.txt");
test.ssh_maxscale(true, "chmod a+r /home/vagrant/rules/rules.txt;");
test.restart_maxscale();
test.connect_maxscale();
test.tprintf("Pinging MaxScale, expecting success");
test.add_result(mysql_ping(test.conn_rwsplit), "Ping should not fail: %s", mysql_error(test.conn_rwsplit));
test.close_maxscale_connections();
return test.global_result;
}