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;
}
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;
}
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;
}
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;
}
int main(int argc, char *argv[])
{
    TestConnections * Test = new TestConnections(argc, argv);
    Test->set_timeout(100);

    Test->repl->connect();

    Test->tprintf("Connecting to ReadConnnRouter in 'master' mode\n");
    Test->connect_readconn_master();
    printf("Sleeping 10 seconds\n");
    Test->stop_timeout();
    sleep(10);
    Test->set_timeout(50);
    Test->add_result(check_connnections_only_to_master(Test, 0), "connections are not only to Master\n");
    Test->close_readconn_master();
    Test->tprintf("Changing master to node 1\n");
    Test->set_timeout(50);
    Test->repl->change_master(1, 0);
    printf("Sleeping 10 seconds\n");
    Test->stop_timeout();
    sleep(10);
    Test->set_timeout(50);
    printf("Connecting to ReadConnnRouter in 'master' mode\n");
    Test->connect_readconn_master();
    printf("Sleeping 10 seconds\n");
    Test->stop_timeout();
    sleep(10);
    Test->set_timeout(50);
    Test->add_result(check_connnections_only_to_master(Test, 1), "connections are not only to master");
    Test->close_readconn_master();
    Test->set_timeout(50);
    printf("Changing master back to node 0\n");
    Test->repl->change_master(0, 1);

    Test->check_log_err((char *) "The service 'CLI' is missing a definition of the servers", false);

    int rval = Test->global_result;
    delete Test;
    return rval;
}