本文整理汇总了C++中TestConnections类的典型用法代码示例。如果您正苦于以下问题:C++ TestConnections类的具体用法?C++ TestConnections怎么用?C++ TestConnections使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TestConnections类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
int OldMaster;
int NewMaster;
if (argc != 3)
{
printf("Usage: change_master NewMasterNode OldMasterNode\n");
exit(1);
}
TestConnections * Test = new TestConnections(argc, argv);
sscanf(argv[1], "%d", &NewMaster);
sscanf(argv[2], "%d", &OldMaster);
Test->tprintf("Changing master from node %d (%s) to node %d (%s)\n", OldMaster, Test->repl->IP[OldMaster],
NewMaster, Test->repl->IP[NewMaster]);
Test->repl->connect();
Test->repl->change_master(NewMaster, OldMaster);
Test->repl->close_connections();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:26,代码来源:change_master.cpp
示例2: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->read_env();
Test->print_env();
Test->binlog_cmd_option = 2;
Test->start_binlog();
Test->repl->connect();
create_t1(Test->repl->nodes[0]);
global_result += insert_into_t1(Test->repl->nodes[0], 4);
printf("Sleeping to let replication happen\n"); fflush(stdout);
sleep(30);
for (int i = 0; i < Test->repl->N; i++) {
printf("Checking data from node %d (%s)\n", i, Test->repl->IP[i]); fflush(stdout);
global_result += select_from_t1(Test->repl->nodes[i], 4);
}
Test->repl->close_connections();
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:29,代码来源:setup_binlog_crc_none.cpp
示例3: main
int main(int argc, char *argv[])
{
int global_result = 0;
int OldMaster;
int NewMaster;
if (argc !=3) {
printf("Usage: change_master NewMasterNode OldMasterNode\n");
exit(1);
}
TestConnections * Test = new TestConnections(argc, argv);
Test->read_env();
Test->print_env();
sscanf(argv[1], "%d", &NewMaster);
sscanf(argv[2], "%d", &OldMaster);
printf("Changing master from node %d (%s) to node %d (%s)\n", OldMaster, Test->repl->IP[OldMaster], NewMaster, Test->repl->IP[NewMaster]);
Test->repl->connect();
Test->repl->change_master(NewMaster, OldMaster);
Test->repl->close_connections();
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:25,代码来源:change_master.cpp
示例4: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->print_env();
global_result += execute_maxadmin_command_print(Test->maxscale_IP, (char *) "admin", Test->maxadmin_password, (char *) "show servers");
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:10,代码来源:binlog_incompl.cpp
示例5: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(30);
Test->check_log_err((char *) "Unexpected parameter 'укпоукц'", true);
Test->check_log_err((char *) "Unexpected parameter 'hren'", true);
Test->check_maxscale_processes(0);
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:12,代码来源:mxs720_wierd_line.cpp
示例6: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->read_env();
Test->print_env();
printf("Connecting to RWSplit %s\n", Test->maxscale_IP);
Test->connect_rwsplit();
printf("Setup firewall to block mysql on master\n"); fflush(stdout);
Test->repl->block_node(0);
printf("Trying query to RWSplit, expecting failure, but not a crash\n"); fflush(stdout);
execute_query(Test->conn_rwsplit, (char *) "show processlist;");
printf("Setup firewall back to allow mysql\n"); fflush(stdout);
Test->repl->unblock_node(0);
sleep(10);
global_result += check_maxscale_alive();
Test->close_rwsplit();
printf("Reconnecting and trying query to RWSplit\n"); fflush(stdout);
Test->connect_rwsplit();
global_result += execute_query(Test->conn_rwsplit, (char *) "show processlist;");
Test->close_rwsplit();
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:34,代码来源:kill_master.cpp
示例7: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->connect_maxscale();
Test->set_timeout(10);
Test->tprintf("Trying SHOW GLOBAL STATUS against RWSplit\n");
Test->try_query(Test->conn_rwsplit, (char *) "SHOW GLOBAL STATUS;");
Test->tprintf("Trying SHOW GLOBAL STATUS against ReadConn master\n");
Test->try_query(Test->conn_master, (char *) "SHOW GLOBAL STATUS;");
Test->tprintf("Trying SHOW GLOBAL STATUS against ReadConn slave\n");
Test->try_query(Test->conn_slave, (char *) "SHOW GLOBAL STATUS;");
Test->check_maxscale_alive();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:16,代码来源:bug711.cpp
示例8: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(30);
Test->ssh_maxscale(true, "maxkeys");
Test->ssh_maxscale(true, "sudo chown maxscale:maxscale /var/lib/maxscale/.secrets");
try_password(Test, (char *) "aaa$aaa");
try_password(Test, (char *) "#¤&");
try_password(Test, (char *) "пароль");
Test->check_maxscale_alive();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:17,代码来源:mxs822_maxpasswd.cpp
示例9: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(30);
Test->galera->connect();
tolerance = 0;
// connect to the MaxScale server (rwsplit)
Test->connect_rwsplit();
Test->execute_maxadmin_command((char *) "shutdown monitor \"Galera Monitor\"");
if (Test->conn_rwsplit == NULL )
{
Test->add_result(1, "Can't connect to MaxScale\n");
int rval = Test->global_result;
delete Test;
exit(1);
}
else
{
Test->try_query(Test->conn_rwsplit, "DROP TABLE IF EXISTS t1;");
Test->try_query(Test->conn_rwsplit, "create table t1 (x1 int);");
get_global_status_allnodes(&selects[0], &inserts[0], Test->galera, silent);
Test->try_query(Test->conn_rwsplit, "select * from t1;");
get_global_status_allnodes(&new_selects[0], &new_inserts[0], Test->galera, silent);
print_delta(&new_selects[0], &new_inserts[0], &selects[0], &inserts[0], Test->galera->N);
Test->try_query(Test->conn_rwsplit, "insert into t1 values(1);");
get_global_status_allnodes(&new_selects[0], &new_inserts[0], Test->galera, silent);
print_delta(&new_selects[0], &new_inserts[0], &selects[0], &inserts[0], Test->galera->N);
// close connections
Test->close_rwsplit();
}
Test->galera->close_connections();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:45,代码来源:rw_galera_select_insert.cpp
示例10: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->tprintf("Trying 11 connections with RWSplit\n");
check_max_conn(0, 10, Test);
Test->tprintf("Trying 21 connections with Readconn master\n");
check_max_conn(1, 20, Test);
Test->tprintf("Trying 26 connections with Readconnn slave\n");
check_max_conn(2, 25, Test);
sleep(10);
Test->check_maxscale_alive();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:18,代码来源:connection_limit.cpp
示例11: main
int main(int argc, char *argv[])
{
TestConnections *test = new TestConnections(argc, argv);
Config config(test);
config.create_all_listeners();
config.create_all_listeners();
test->check_maxscale_processes(1);
config.create_monitor("mysql-monitor", "mysqlmon", 500);
config.reset();
sleep(1);
test->check_maxscale_alive();
int rval = test->global_result;
delete test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:19,代码来源:mxs922_double_listener.cpp
示例12: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(3000);
int options_set = 3;
if (Test->smoke)
{
options_set = 1;
}
Test->repl->connect();
execute_query(Test->repl->nodes[0], (char *) "DROP TABLE IF EXISTS t1;");
Test->repl->close_connections();
sleep(5);
for (int option = 0; option < options_set; option++)
{
Test->binlog_cmd_option = option;
Test->start_binlog();
test_binlog(Test);
}
Test->check_log_err("SET NAMES utf8mb4", false);
Test->check_log_err("set autocommit=1", false);
Test->check_log_err("select USER()", false);
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:31,代码来源:setup_binlog.cpp
示例13: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->read_env();
Test->print_env();
Test->connect_maxscale();
printf("Trying SELECT @a:[email protected]+1 as a, test.b FROM test\n"); fflush(stdout);
global_result += execute_query(Test->conn_rwsplit, "DROP TABLE IF EXISTS test; CREATE TABLE test (b integer);");
for (int i=0; i<10000;i++) {execute_query(Test->conn_rwsplit, "insert into test value(2);");}
if (execute_query(Test->conn_rwsplit, "SELECT @a:[email protected]+1 as a, test.b FROM test;") == 0) {
printf("Query succeded, but expected to fail. Test FAILED!\n"); fflush(stdout);
global_result++;
}
printf("Trying USE test\n"); fflush(stdout);
global_result += execute_query(Test->conn_rwsplit, "USE test");
global_result += execute_query(Test->conn_rwsplit, "DROP TABLE IF EXISTS test;");
printf("Checking if MaxScale alive\n"); fflush(stdout);
Test->close_maxscale_connections();
printf("Checking logs\n"); fflush(stdout);
global_result += check_log_err((char *) "Warning : The query can't be routed to all backend servers because it includes SELECT and SQL variable modifications which is not supported", TRUE);
global_result += check_log_err((char *) "SELECT with session data modification is not supported if configuration parameter use_sql_variables_in=all", TRUE);
global_result += check_maxscale_alive();
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:33,代码来源:bug694.cpp
示例14: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
int i;
Test->read_env();
Test->print_env();
printf("Connecting to all MaxScale services\n");
fflush(stdout);
global_result += Test->connect_maxscale();
printf("executing show status 1000 times\n");
fflush(stdout);
for (i = 0; i < 1000; i++) {
global_result += execute_query(Test->conn_rwsplit, (char *) "show status");
}
for (i = 0; i < 1000; i++) {
global_result += execute_query(Test->conn_slave, (char *) "show status");
}
for (i = 0; i < 1000; i++) {
global_result += execute_query(Test->conn_master, (char *) "show status");
}
Test->close_maxscale_connections();
check_maxscale_alive();
Test->copy_all_logs();
return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:34,代码来源:bug422.cpp
示例15: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->print_env();
Test->connect_maxscale();
printf("RWSplit: \n"); fflush(stdout);
global_result = execute_query(Test->conn_rwsplit, (char *) "SET OPTION SQL_QUOTE_SHOW_CREATE = 1;");
printf("ReadConn master: \n"); fflush(stdout);
global_result = execute_query(Test->conn_master, (char *) "SET OPTION SQL_QUOTE_SHOW_CREATE = 1;");
printf("readConn slave: \n"); fflush(stdout);
global_result = execute_query(Test->conn_slave, (char *) "SET OPTION SQL_QUOTE_SHOW_CREATE = 1;");
Test->close_maxscale_connections();
global_result += check_maxscale_alive();
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:22,代码来源:bug730.cpp
示例16: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(20);
Test->connect_maxscale();
Test->tprintf("Trying query to ReadConn master\n");
fflush(stdout);
Test->try_query(Test->conn_master, "show processlist;");
Test->tprintf("Trying query to ReadConn slave\n");
Test->try_query(Test->conn_slave, "show processlist;");
Test->close_maxscale_connections();
Test->check_log_err((char *) "Creating client session for Tee filter failed. Terminating session.", true);
Test->check_log_err((char *) "Failed to create filter 'DuplicaFilter' for service 'RW_Router'", true);
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:23,代码来源:bug664.cpp
示例17: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
int i;
int N=4;
Test->read_env();
Test->print_env();
for (i = 0; i < 4; i++) {
Test->repl->connect();
if (Test->connect_maxscale() !=0 ) {
printf("Error connecting to MaxScale\n");
exit(1);
}
global_result += insert_select(Test, N);
printf("Creating database test1\n"); fflush(stdout);
global_result += execute_query(Test->conn_rwsplit, "DROP TABLE t1");
global_result += execute_query(Test->conn_rwsplit, "DROP DATABASE IF EXISTS test1;");
global_result += execute_query(Test->conn_rwsplit, "CREATE DATABASE test1;");
sleep(5);
printf("Testing with database 'test1'\n");fflush(stdout);
global_result += use_db(Test, (char *) "test1");
global_result += insert_select(Test, N);
global_result += check_t1_table(Test, FALSE, (char *) "test");
global_result += check_t1_table(Test, TRUE, (char *) "test1");
printf("Trying queries with syntax errors\n");fflush(stdout);
execute_query(Test->conn_rwsplit, "DROP DATABASE I EXISTS test1;");
execute_query(Test->conn_rwsplit, "CREATE TABLE ");
execute_query(Test->conn_master, "DROP DATABASE I EXISTS test1;");
execute_query(Test->conn_master, "CREATE TABLE ");
execute_query(Test->conn_slave, "DROP DATABASE I EXISTS test1;");
execute_query(Test->conn_slave, "CREATE TABLE ");
// close connections
Test->close_maxscale_connections();
Test->repl->close_connections();
}
global_result += check_maxscale_alive();
if (global_result == 0) {printf("PASSED!!\n");} else {printf("FAILED!!\n");}
Test->copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:56,代码来源:sql_queries.cpp
示例18: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(100);
Test->execute_maxadmin_command((char *) "show monitors");
sleep(5);
Test->check_log_err((char *) "Failed to start monitor", true);
Test->check_log_err((char *) "fatal signal 11", false);
Test->check_maxscale_processes(1);
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:15,代码来源:show_monitor_crash.cpp
示例19: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
Test->set_timeout(20);
int i, j;
MYSQL * conn;
int N_cmd = 2;
char * fail_cmd[N_cmd - 1];
int N_ports = 3;
int ports[N_ports];
fail_cmd[0] = (char *) "fail backendfd";
fail_cmd[1] = (char *) "fail clientfd";
ports[0] = Test->rwsplit_port;
ports[1] = Test->readconn_master_port;
ports[2] = Test->readconn_slave_port;
for (i = 0; i < N_cmd; i++)
{
for (j = 0; j < N_ports; j++)
{
Test->tprintf("Executing MaxAdmin command '%s'\n", fail_cmd[i]);
if (execute_maxadmin_command(Test->maxscale_IP, (char *) "admin", Test->maxadmin_password, fail_cmd[i]) != 0)
{
Test->add_result(1, "MaxAdmin command failed\n");
}
else
{
printf("Trying query against %d\n", ports[j]);
conn = open_conn(ports[j], Test->maxscale_IP, Test->maxscale_user, Test->maxscale_user, Test->ssl);
Test->try_query(conn, (char *) "show processlist;");
}
}
}
Test->check_maxscale_alive();
int rval = Test->global_result;
delete Test;
return rval;
}
开发者ID:mariadb-corporation,项目名称:maxscale-system-test,代码行数:43,代码来源:bug539.cpp
示例20: main
int main(int argc, char *argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
int global_result = 0;
Test->ReadEnv();
Test->PrintIP();
Test->ConnectMaxscale();
execute_query(Test->conn_rwsplit, (char *) "select @@server_id; -- max_slave_replication_lag=120");
Test->CloseMaxscaleConn();
global_result += CheckMaxscaleAlive();
Test->Copy_all_logs(); return(global_result);
}
开发者ID:Robert-Xie,项目名称:maxscale-system-test,代码行数:23,代码来源:bug466.cpp
注:本文中的TestConnections类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论