MXS-2481 Add Clustrix group change test skeleton

This commit is contained in:
Johan Wikman 2019-05-23 15:33:43 +03:00
parent 7b803f621c
commit 1bd82555d9
3 changed files with 109 additions and 0 deletions

View File

@ -1144,6 +1144,9 @@ set_tests_properties(clustrix_mon PROPERTIES TIMEOUT 7200)
add_test_executable(clustrix_basics.cpp clustrix_basics clustrix_basics LABELS CLUSTRIX_BACKEND)
set_tests_properties(clustrix_basics PROPERTIES TIMEOUT 7200)
add_test_executable(clustrix_group_change.cpp clustrix_group_change clustrix_group_change LABELS CLUSTRIX_BACKEND)
set_tests_properties(clustrix_group_change PROPERTIES TIMEOUT 7200)
############################################
# END: tests for Clustrix monitor #
############################################

View File

@ -0,0 +1,55 @@
/*
* Copyright (c) 2016 MariaDB Corporation Ab
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2022-01-01
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
#include <iostream>
#include "testconnections.h"
#include "maxrest.hh"
using namespace std;
namespace
{
const set<string> bootstrap_servers =
{
"clustrix_server1",
"clustrix_server2",
"clustrix_server3",
"clustrix_server4",
};
void run_test(TestConnections& test)
{
MaxRest maxrest(&test);
Maxscales* pMaxscales = test.maxscales;
test.add_result(pMaxscales->connect_rwsplit(), "Could not connect to RWS.");
}
}
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
try
{
run_test(test);
}
catch (const std::exception& x)
{
cout << "Exception: " << x.what() << endl;
}
return test.global_result;
}

View File

@ -0,0 +1,51 @@
[maxscale]
threads=###threads###
log_info=1
###clustrix_server###
[Clustrix-Monitor]
type=monitor
module=clustrixmon
servers=###clustrix_server_line###
user=maxskysql
password=skysql
[RWS]
type=service
router=readwritesplit
cluster=Clustrix-Monitor
user=maxskysql
password=skysql
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
max_slave_connections=1
[RCR]
type=service
router=readconnroute
router_options=master
cluster=Clustrix-Monitor
user=maxskysql
password=skysql
[RWS-Listener]
type=listener
service=RWS
protocol=MySQLClient
port=4006
[RCR-Listener]
type=listener
service=RCR
protocol=MySQLClient
port=4008
[CLI]
type=service
router=cli
[CLI-Listener]
type=listener
service=CLI
protocol=maxscaled
socket=default