Rename Clustrix to Xpand in the tests

This commit is contained in:
Timofey Turenko
2020-10-22 15:28:10 +03:00
parent 3546b716c5
commit 7680c9ce11
18 changed files with 134 additions and 534 deletions

View File

@ -1125,23 +1125,23 @@ set_tests_properties(bug471_big PROPERTIES TIMEOUT 3600)
############################################ ############################################
############################################ ############################################
# BEGIN: tests for Clustrix monitor # # BEGIN: tests for Xpand monitor #
############################################ ############################################
# creates Clustrix cluster and connect Maxscale to it # creates Xpand cluster and connect Maxscale to it
add_test_executable(clustrix_mon.cpp clustrix_mon clustrix_mon LABELS CLUSTRIX_BACKEND UNSTABLE) add_test_executable(xpand_mon.cpp xpand_mon xpand_mon LABELS XPAND_BACKEND UNSTABLE)
set_tests_properties(clustrix_mon PROPERTIES TIMEOUT 7200) set_tests_properties(xpand_mon PROPERTIES TIMEOUT 7200)
add_test_executable(clustrix_basics.cpp clustrix_basics clustrix_basics LABELS CLUSTRIX_BACKEND) add_test_executable(xpand_basics.cpp xpand_basics xpand_basics LABELS XPAND_BACKEND)
set_tests_properties(clustrix_basics PROPERTIES TIMEOUT 7200) set_tests_properties(xpand_basics PROPERTIES TIMEOUT 7200)
add_test_executable(clustrix_transaction_replay.cpp clustrix_transaction_replay clustrix_transaction_replay LABELS CLUSTRIX_BACKEND) add_test_executable(xpand_transaction_replay.cpp xpand_transaction_replay xpand_transaction_replay LABELS XPAND_BACKEND)
set_tests_properties(clustrix_transaction_replay PROPERTIES TIMEOUT 7200) set_tests_properties(xpand_transaction_replay PROPERTIES TIMEOUT 7200)
add_test_executable(clustrix_distribution.cpp clustrix_distribution clustrix_distribution LABELS CLUSTRIX_BACKEND) add_test_executable(xpand_distribution.cpp xpand_distribution xpand_distribution LABELS XPAND_BACKEND)
############################################ ############################################
# END: tests for Clustrix monitor # # END: tests for Xpand monitor #
############################################ ############################################
############################### ###############################

View File

@ -2,19 +2,19 @@
threads=###threads### threads=###threads###
log_info=1 log_info=1
###clustrix_server### ###xpand_server###
[Clustrix-Monitor] [Xpand-Monitor]
type=monitor type=monitor
module=clustrixmon module=xpandmon
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
[RWS] [RWS]
type=service type=service
router=readwritesplit router=readwritesplit
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
@ -24,7 +24,7 @@ max_slave_connections=1
type=service type=service
router=readconnroute router=readconnroute
router_options=master router_options=master
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql

View File

@ -2,19 +2,19 @@
threads=###threads### threads=###threads###
log_info=1 log_info=1
###clustrix_server### ###xpand_server###
[Clustrix-Monitor] [Xpand-Monitor]
type=monitor type=monitor
module=clustrixmon module=xpandmon
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
[RWS] [RWS]
type=service type=service
router=readwritesplit router=readwritesplit
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
@ -23,7 +23,7 @@ slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
type=service type=service
router=readconnroute router=readconnroute
#router_options=running #router_options=running
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql

View File

@ -2,17 +2,17 @@
threads=###threads### threads=###threads###
#log_info=1 #log_info=1
[Clusterix-Monitor] [Xpand-Monitor]
type=monitor type=monitor
module=clustrixmon module=xpandmon
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
[RW-Split-Router] [RW-Split-Router]
type=service type=service
router=readwritesplit router=readwritesplit
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
@ -22,7 +22,7 @@ max_slave_connections=1
type=service type=service
router=readconnroute router=readconnroute
router_options=slave router_options=slave
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
@ -30,7 +30,7 @@ password=skysql
type=service type=service
router=readconnroute router=readconnroute
router_options=master router_options=master
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
@ -62,4 +62,4 @@ service=CLI
protocol=maxscaled protocol=maxscaled
socket=default socket=default
###clustrix_server### ###xpand_server###

View File

@ -2,19 +2,19 @@
threads=###threads### threads=###threads###
log_info=1 log_info=1
###clustrix_server### ###xpad_server###
[Clustrix-Monitor] [Xpand-Monitor]
type=monitor type=monitor
module=clustrixmon module=xpandmon
servers=###clustrix_server_line### servers=###xpand_server_line###
user=maxskysql user=maxskysql
password=skysql password=skysql
[RWS] [RWS]
type=service type=service
router=readwritesplit router=readwritesplit
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql
transaction_replay=true transaction_replay=true
@ -23,7 +23,7 @@ transaction_replay=true
type=service type=service
router=readconnroute router=readconnroute
router_options=master router_options=master
cluster=Clustrix-Monitor cluster=Xpand-Monitor
user=maxskysql user=maxskysql
password=skysql password=skysql

View File

@ -1,25 +0,0 @@
#!/bin/bash
# Start 4 AWS instances and put info into _network_config
# $1 - path to MDBCI configuration
sg=`cat ~/.config/mdbci/config.yaml | grep security_group | sed "s/security_group://" | tr -d " "`
i_ids=`aws ec2 run-instances --image ami-65fa5c16 --instance-type m3.large --security-groups turenko-home_1547635960 --key-name maxscale --count 4 | grep InstanceId | tr -d ' ' | tr -d ',' | tr -d '"' | sed "s/InstanceId://" | sed ':a;N;$!ba;s/\n/ /g'`
#i_ids=`aws ec2 run-instances --image ami-0ff760d16d9497662 --instance-type i3.large --security-groups turenko-home_1547635960 --key-name maxscale --count 4 | grep InstanceId | tr -d ' ' | tr -d ',' | tr -d '"' | sed "s/InstanceId://" | sed ':a;N;$!ba;s/\n/ /g'`
aws ec2 wait instance-running --instance-ids ${i_ids}
j=0
for i in ${i_ids}
do
ip=`aws ec2 describe-instances --instance-id $i | grep "PublicIpAddress" | tr -d ' ' | tr -d ',' | tr -d '"' | sed "s/PublicIpAddress://"`
pip=`aws ec2 describe-instances --instance-id $i | grep "PrivateIpAddress" | tr -d ' ' | tr -d ',' | tr -d '"' | sed "s/PrivateIpAddress://"`
num=`printf "%03d" $j`
j=`expr $j + 1`
echo "clustrix_${num}_network=$ip" >> $1_network_config
echo "clustrix_${num}_private=$pip" >> $1_network_config
echo "clustrix_${num}_keyfile=~/.config/mdbci/maxscale.pem" >> $1_network_config
echo "clustrix_${num}_hostname=clusterix${num}" >> $1_network_config
echo "clustrix_${num}_whoami=ec2-user" >> $1_network_config
done
labels=`cat $1_configured_labels`
echo "$labels,CLUSTRIX_BACKEND" > $1_configured_labels

View File

@ -10,7 +10,7 @@
#include <sys/time.h> #include <sys/time.h>
#include <maxbase/ccdefs.hh> #include <maxbase/ccdefs.hh>
#include <maxtest/clustrix_nodes.hh> #include <maxtest/xpand_nodes.hh>
#include <maxtest/mariadb_nodes.hh> #include <maxtest/mariadb_nodes.hh>
#include <maxtest/maxscales.hh> #include <maxtest/maxscales.hh>
#include <maxtest/test_dir.hh> #include <maxtest/test_dir.hh>
@ -95,7 +95,7 @@ public:
*/ */
Mariadb_nodes* repl {nullptr}; Mariadb_nodes* repl {nullptr};
Clustrix_nodes * clustrix; Xpand_nodes * xpand;
/** /**
* @brief maxscales Maxscale object containing referebces to all Maxscale machines * @brief maxscales Maxscale object containing referebces to all Maxscale machines
@ -148,9 +148,9 @@ public:
bool binlog_slave_gtid {false}; bool binlog_slave_gtid {false};
/** /**
* @brief no_clustrix Do not check, restart and use Clustrix setup * @brief no_xpand Do not check, restart and use Xpand setup
*/ */
bool no_clustrix; bool no_xpand;
/** /**
* @brief timeout seconds until test termination * @brief timeout seconds until test termination

View File

@ -13,7 +13,7 @@
#pragma once #pragma once
/** /**
* @file clustrix_nodes.h - work with Clustrix setup * @file xpand_nodes.h - work with Xpand setup
* *
*/ */
@ -23,35 +23,35 @@
#include <maxtest/nodes.hh> #include <maxtest/nodes.hh>
class Clustrix_nodes : public Mariadb_nodes class Xpand_nodes : public Mariadb_nodes
{ {
public: public:
Clustrix_nodes(const char* pref, const char* test_cwd, bool verbose, std::string network_config) Xpand_nodes(const char* pref, const char* test_cwd, bool verbose, std::string network_config)
: Mariadb_nodes(pref, test_cwd, verbose, network_config) : Mariadb_nodes(pref, test_cwd, verbose, network_config)
{ {
} }
/** /**
* @brief start_cluster Intstalls Clustrix on all nodes, configure license, form cluster * @brief start_cluster Intstalls Xpand on all nodes, configure license, form cluster
* @return 0 in case of success * @return 0 in case of success
*/ */
int start_replication(); int start_replication();
/** /**
* @brief cnf_servers Generate Clustrix servers description for maxscale.cnf * @brief cnf_servers Generate Xpand servers description for maxscale.cnf
* @return text for maxscale.cnf * @return text for maxscale.cnf
*/ */
std::string cnf_servers(); std::string cnf_servers();
/** /**
* @brief check_replication Checks if Clustrix Cluster is up and running * @brief check_replication Checks if Xpand Cluster is up and running
* @return 0 if Clustrix Cluster is ok * @return 0 if Xpand Cluster is ok
*/ */
int check_replication(); int check_replication();
/** /**
* @brief install_clustrix * @brief perpare_server configurs Xpand on the node
* @param m node index * @param m node index
* @return 0 in case of success * @return 0 in case of success
*/ */

View File

@ -1,7 +1,7 @@
add_library(maxtest SHARED add_library(maxtest SHARED
big_load.cc big_load.cc
blob_test.cc blob_test.cc
clustrix_nodes.cpp xpand_nodes.cpp
config_operations.cc config_operations.cc
different_size.cc different_size.cc
envv.cc envv.cc

View File

@ -37,7 +37,7 @@ const string label_galera_be = "GALERA_BACKEND";
const string label_big_be = "BIG_REPL_BACKEND"; const string label_big_be = "BIG_REPL_BACKEND";
const string label_2nd_mxs = "SECOND_MAXSCALE"; const string label_2nd_mxs = "SECOND_MAXSCALE";
const string label_cs_be = "COLUMNSTORE_BACKEND"; const string label_cs_be = "COLUMNSTORE_BACKEND";
const string label_clx_be = "CLUSTRIX_BACKEND"; const string label_clx_be = "XPAND_BACKEND";
const StringSet recognized_mdbci_labels = const StringSet recognized_mdbci_labels =
{label_repl_be, label_big_be, label_galera_be, label_2nd_mxs, label_cs_be, label_clx_be}; {label_repl_be, label_big_be, label_galera_be, label_2nd_mxs, label_cs_be, label_clx_be};
@ -143,7 +143,7 @@ void TestConnections::restart_galera(bool value)
bool TestConnections::verbose = false; bool TestConnections::verbose = false;
TestConnections::TestConnections(int argc, char* argv[]) TestConnections::TestConnections(int argc, char* argv[])
: no_clustrix(false) : no_xpand(false)
{ {
std::ios::sync_with_stdio(true); std::ios::sync_with_stdio(true);
signal_set(SIGSEGV, sigfatal_handler); signal_set(SIGSEGV, sigfatal_handler);
@ -338,10 +338,10 @@ TestConnections::TestConnections(int argc, char* argv[])
if (m_required_mdbci_labels.count(label_clx_be) == 0) if (m_required_mdbci_labels.count(label_clx_be) == 0)
{ {
no_clustrix = true; no_xpand = true;
if (verbose) if (verbose)
{ {
tprintf("No need to use Clustrix"); tprintf("No need to use Xpand");
} }
} }
@ -387,18 +387,18 @@ TestConnections::TestConnections(int argc, char* argv[])
galera = NULL; galera = NULL;
} }
if (!no_clustrix) if (!no_xpand)
{ {
clustrix = new Clustrix_nodes("clustrix", test_dir, verbose, m_network_config); xpand = new Xpand_nodes("xpand", test_dir, verbose, m_network_config);
clustrix->setup(); xpand->setup();
clustrix->use_ipv6 = false; xpand->use_ipv6 = false;
clustrix->take_snapshot_command = m_take_snapshot_command.c_str(); xpand->take_snapshot_command = m_take_snapshot_command.c_str();
clustrix->revert_snapshot_command = m_revert_snapshot_command.c_str(); xpand->revert_snapshot_command = m_revert_snapshot_command.c_str();
clustrix->fix_replication(); xpand->fix_replication();
} }
else else
{ {
clustrix = NULL; xpand = NULL;
} }
maxscales = new Maxscales("maxscale", test_dir, verbose, m_network_config); maxscales = new Maxscales("maxscale", test_dir, verbose, m_network_config);
@ -825,7 +825,7 @@ void TestConnections::process_template(int m, const string& cnf_template_path, c
char* IPcnf; char* IPcnf;
mdn[0] = repl; mdn[0] = repl;
mdn[1] = galera; mdn[1] = galera;
mdn[2] = clustrix; mdn[2] = xpand;
int i, j; int i, j;
int mdn_n = 3; int mdn_n = 3;
@ -2265,7 +2265,7 @@ int TestConnections::process_mdbci_template()
{ {
string box = envvar_get_set("box", "centos_7_libvirt"); string box = envvar_get_set("box", "centos_7_libvirt");
string backend_box = envvar_get_set("backend_box", "%s", box.c_str()); string backend_box = envvar_get_set("backend_box", "%s", box.c_str());
envvar_get_set("clustrix_box", "%s", backend_box.c_str()); envvar_get_set("xpand_box", "%s", backend_box.c_str());
envvar_get_set("target", "develop"); envvar_get_set("target", "develop");
envvar_get_set("vm_memory", "2048"); envvar_get_set("vm_memory", "2048");

View File

@ -14,9 +14,9 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <regex> #include <regex>
#include <maxtest/clustrix_nodes.hh> #include <maxtest/xpand_nodes.hh>
int Clustrix_nodes::prepare_server(int m) int Xpand_nodes::prepare_server(int m)
{ {
int rv = 1; int rv = 1;
int ec; int ec;
@ -27,7 +27,7 @@ int Clustrix_nodes::prepare_server(int m)
if (ec == 0) if (ec == 0)
{ {
printf("Clustrix running on node %d.\n", m); printf("Xpand running on node %d.\n", m);
ec = ssh_node(m, "mysql -e 'SELECT @@server_id'", true); ec = ssh_node(m, "mysql -e 'SELECT @@server_id'", true);
if (ec == 0) if (ec == 0)
@ -36,35 +36,35 @@ int Clustrix_nodes::prepare_server(int m)
} }
else else
{ {
printf("Could not connect as root to Clustrix on node %d, restarting.\n", m); printf("Could not connect as root to Xpand on node %d, restarting.\n", m);
ec = ssh_node(m, "systemctl restart clustrix", true); ec = ssh_node(m, "systemctl restart clustrix", true);
if (ec == 0) if (ec == 0)
{ {
printf("Successfully restarted Clustrix on node %d.\n", m); printf("Successfully restarted Xpand on node %d.\n", m);
running = true; running = true;
} }
else else
{ {
printf("Could not restart Clustrix on node %d.\n", m); printf("Could not restart Xpand on node %d.\n", m);
} }
} }
} }
else else
{ {
printf("Clustrix not running on node %d, starting.\n", m); printf("Xpand not running on node %d, starting.\n", m);
ec = ssh_node(m, "systemctl start clustrix", true); ec = ssh_node(m, "systemctl start clustrix", true);
if (ec == 0) if (ec == 0)
{ {
printf("Successfully started Clustrix on node %d.\n", m); printf("Successfully started Xpand on node %d.\n", m);
running = true; running = true;
} }
else else
{ {
printf("Could not start Clustrix on node %d.\n", m); printf("Could not start Xpand on node %d.\n", m);
} }
} }
@ -82,7 +82,7 @@ int Clustrix_nodes::prepare_server(int m)
if (ec != 0) if (ec != 0)
{ {
printf("Could not connect to Clustrix as root on node %d, " printf("Could not connect to Xpand as root on node %d, "
"sleeping a while (totally at most ~1 minute) and retrying.\n", m); "sleeping a while (totally at most ~1 minute) and retrying.\n", m);
sleep(10); sleep(10);
} }
@ -91,12 +91,12 @@ int Clustrix_nodes::prepare_server(int m)
if (ec == 0) if (ec == 0)
{ {
printf("Could connect as root to Clustrix on node %d.\n", m); printf("Could connect as root to Xpand on node %d.\n", m);
check_users = true; check_users = true;
} }
else else
{ {
printf("Could not connect as root to Clustrix on node %d within given timeframe.\n", m); printf("Could not connect as root to Xpand on node %d within given timeframe.\n", m);
} }
} }
@ -113,12 +113,12 @@ int Clustrix_nodes::prepare_server(int m)
if (ec == 0) if (ec == 0)
{ {
printf("Can access Clustrix using user '%s'.\n", this->user_name); printf("Can access Xpand using user '%s'.\n", this->user_name);
rv = 0; rv = 0;
} }
else else
{ {
printf("Cannot access Clustrix using user '%s', creating users.\n", this->user_name); printf("Cannot access Xpand using user '%s', creating users.\n", this->user_name);
// TODO: We need an return code here. // TODO: We need an return code here.
create_users(m); create_users(m);
rv = 0; rv = 0;
@ -129,7 +129,7 @@ int Clustrix_nodes::prepare_server(int m)
} }
int Clustrix_nodes::start_replication() int Xpand_nodes::start_replication()
{ {
int rv = 1; int rv = 1;
@ -154,7 +154,7 @@ int Clustrix_nodes::start_replication()
return rv; return rv;
} }
std::string Clustrix_nodes::cnf_servers() std::string Xpand_nodes::cnf_servers()
{ {
std::string s; std::string s;
for (int i = 0; i < N; i++) for (int i = 0; i < N; i++)
@ -171,7 +171,7 @@ std::string Clustrix_nodes::cnf_servers()
return s; return s;
} }
int Clustrix_nodes::check_replication() int Xpand_nodes::check_replication()
{ {
int res = 0; int res = 0;
if (connect() == 0) if (connect() == 0)
@ -194,7 +194,7 @@ int Clustrix_nodes::check_replication()
return res; return res;
} }
std::string Clustrix_nodes::block_command(int node) const std::string Xpand_nodes::block_command(int node) const
{ {
std::string command = Mariadb_nodes::block_command(node); std::string command = Mariadb_nodes::block_command(node);
@ -207,7 +207,7 @@ std::string Clustrix_nodes::block_command(int node) const
return command; return command;
} }
std::string Clustrix_nodes::unblock_command(int node) const std::string Xpand_nodes::unblock_command(int node) const
{ {
std::string command = Mariadb_nodes::unblock_command(node); std::string command = Mariadb_nodes::unblock_command(node);

View File

@ -61,7 +61,7 @@ test_env_list=(
"target" "target"
"box" "box"
"backend_box" "backend_box"
"clustrix_box" "xpand_box"
"product" "product"
"version" "version"
"do_not_destroy_vm" "do_not_destroy_vm"

View File

@ -1,375 +0,0 @@
{
"node_000" :
{
"hostname" : "node000",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server1.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_001" :
{
"hostname" : "node001",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server2.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_002" :
{
"hostname" : "node002",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server3.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_003" :
{
"hostname" : "node003",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server4.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_004" :
{
"hostname" : "node004",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server5.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_005" :
{
"hostname" : "node005",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server6.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_006" :
{
"hostname" : "node006",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server7.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_007" :
{
"hostname" : "node007",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server8.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_008" :
{
"hostname" : "node008",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server9.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_009" :
{
"hostname" : "node009",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server10.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_010" :
{
"hostname" : "node010",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server11.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_011" :
{
"hostname" : "node011",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server12.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_012" :
{
"hostname" : "node012",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server13.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_013" :
{
"hostname" : "node013",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server14.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"node_014" :
{
"hostname" : "node013",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"BIG_REPL_BACKEND"
],
"product" : {
"name": "${product}",
"version": "${version}",
"cnf_template" : "server15.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_000" :
{
"hostname" : "galera000",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"GALERA_BACKEND"
],
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server1.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_001" :
{
"hostname" : "galera001",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"GALERA_BACKEND"
],
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server2.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_002" :
{
"hostname" : "galera002",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"GALERA_BACKEND"
],
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server3.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"galera_003" :
{
"hostname" : "galera003",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"GALERA_BACKEND"
],
"product" : {
"name": "galera",
"version": "${galera_version}",
"cnf_template" : "galera_server4.cnf",
"cnf_template_path": "${cnf_path}"
}
},
"maxscale_000" :
{
"hostname" : "maxscale",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"MAXSCALE"
],
"product" : {
"name" : "maxscale_ci",
"version" : "${target}"
}
},
"maxscale_001" :
{
"hostname" : "maxscale2",
"box" : "centos_7_aws_large",
"memory_size" : "${vm_memory}",
"labels" : [
"SECOND_MAXSCALE"
],
"product" : {
"name" : "maxscale_ci",
"version" : "${target}"
}
},
"clustrix_000" :
{
"hostname" : "clustrix000",
"box" : "centos_7_aws_large",
"memory_size" : "16192",
"labels" : [
"CLUSTRIX_BACKEND"
]
},
"clustrix_001" :
{
"hostname" : "clustrix001",
"box" : "centos_7_aws_large",
"memory_size" : "16192",
"labels" : [
"CLUSTRIX_BACKEND"
]
},
"clustrix_002" :
{
"hostname" : "clustrix002",
"box" : "centos_7_aws_large",
"memory_size" : "16192",
"labels" : [
"CLUSTRIX_BACKEND"
]
},
"clustrix_003" :
{
"hostname" : "clustrix003",
"memory_size" : "16192",
"box" : "centos_7_aws_large",
"labels" : [
"CLUSTRIX_BACKEND"
]
}
}

View File

@ -356,13 +356,13 @@
}, },
"clustrix_000" : "xpand_000" :
{ {
"hostname" : "clustrix000", "hostname" : "xpand000",
"box" : "${clustrix_box}", "box" : "${xpand_box}",
"memory_size" : "16192", "memory_size" : "16192",
"labels" : [ "labels" : [
"CLUSTRIX_BACKEND" "XPAND_BACKEND"
], ],
"product" : { "product" : {
"name" : "clustrix", "name" : "clustrix",
@ -370,13 +370,13 @@
} }
}, },
"clustrix_001" : "xpand_001" :
{ {
"hostname" : "clustrix001", "hostname" : "xpand001",
"box" : "${clustrix_box}", "box" : "${xpand_box}",
"memory_size" : "16192", "memory_size" : "16192",
"labels" : [ "labels" : [
"CLUSTRIX_BACKEND" "XPAND_BACKEND"
], ],
"product" : { "product" : {
"name" : "clustrix", "name" : "clustrix",
@ -384,13 +384,13 @@
} }
}, },
"clustrix_002" : "xpand_002" :
{ {
"hostname" : "clustrix002", "hostname" : "xpandx002",
"box" : "${clustrix_box}", "box" : "${xpand_box}",
"memory_size" : "16192", "memory_size" : "16192",
"labels" : [ "labels" : [
"CLUSTRIX_BACKEND" "XPAND_BACKEND"
], ],
"product" : { "product" : {
"name" : "clustrix", "name" : "clustrix",
@ -398,13 +398,13 @@
} }
}, },
"clustrix_003" : "xpand_003" :
{ {
"hostname" : "clustrix003", "hostname" : "xpand003",
"memory_size" : "16192", "memory_size" : "16192",
"box" : "${clustrix_box}", "box" : "${xpand_box}",
"labels" : [ "labels" : [
"CLUSTRIX_BACKEND" "XPAND_BACKEND"
], ],
"product" : { "product" : {
"name" : "clustrix", "name" : "clustrix",

View File

@ -24,13 +24,13 @@ namespace
const set<string> bootstrap_servers = const set<string> bootstrap_servers =
{ {
"clustrix_server1", "xpand_server1",
"clustrix_server2", "xpand_server2",
"clustrix_server3", "xpand_server3",
"clustrix_server4", "xpand_server4",
}; };
const std::string monitor_name = "Clustrix-Monitor"; const std::string monitor_name = "Xpand-Monitor";
void expect_all_servers_to_be(const MaxRest& maxrest, const std::string& state) void expect_all_servers_to_be(const MaxRest& maxrest, const std::string& state)
{ {
@ -91,7 +91,7 @@ void check_for_servers(const MaxRest& maxrest)
if (name.find(prefix) != 0) if (name.find(prefix) != 0)
{ {
test.expect(false, "The name of a dynamic Clustrix node does not start with \"%s\": %s", test.expect(false, "The name of a dynamic Xpand node does not start with \"%s\": %s",
prefix.c_str(), name.c_str()); prefix.c_str(), name.c_str());
} }
@ -119,10 +119,10 @@ void check_state_change(const MaxRest& maxrest)
cout << endl; cout << endl;
int node = 0; int node = 0;
string address = test.clustrix->IP_private[node]; string address = test.xpand->IP_private[node];
cout << "Blocking node: " << node << endl; cout << "Blocking node: " << node << endl;
test.clustrix->block_node(node); test.xpand->block_node(node);
int cycles = 3; int cycles = 3;
cout << "Waiting for " << cycles << " monitor cycles." << endl; cout << "Waiting for " << cycles << " monitor cycles." << endl;
@ -142,7 +142,7 @@ void check_state_change(const MaxRest& maxrest)
cout << endl; cout << endl;
test.clustrix->unblock_node(node); test.xpand->unblock_node(node);
cout << "Waiting for " << cycles << " monitor cycles." << endl; cout << "Waiting for " << cycles << " monitor cycles." << endl;
test.maxscales->wait_for_monitor(cycles); test.maxscales->wait_for_monitor(cycles);
@ -154,19 +154,19 @@ void check_softfailing(const MaxRest& maxrest)
{ {
TestConnections& test = maxrest.test(); TestConnections& test = maxrest.test();
string id("@@Clustrix-Monitor:node-2"); // Just an arbitrary dynamic node. string id("@@Xpand-Monitor:node-2"); // Just an arbitrary dynamic node.
MaxRest::Server before = maxrest.show_server(id); MaxRest::Server before = maxrest.show_server(id);
expect_server_to_be(maxrest, before, "Master, Running"); expect_server_to_be(maxrest, before, "Master, Running");
cout << "Softfailing " << id << "." << endl; cout << "Softfailing " << id << "." << endl;
maxrest.call_command("clustrixmon", "softfail", monitor_name, { "@@Clustrix-Monitor:node-2" }); maxrest.call_command("xpandmon", "softfail", monitor_name, { "@@Xpand-Monitor:node-2" });
MaxRest::Server during = maxrest.show_server(id); MaxRest::Server during = maxrest.show_server(id);
expect_server_to_be(maxrest, during, "Drained"); expect_server_to_be(maxrest, during, "Drained");
cout << "Unsoftfailing " << id << "." << endl; cout << "Unsoftfailing " << id << "." << endl;
maxrest.call_command("clustrixmon", "unsoftfail", monitor_name, { "@@Clustrix-Monitor:node-2" }); maxrest.call_command("xpandrixmon", "unsoftfail", monitor_name, { "@@Xpand-Monitor:node-2" });
MaxRest::Server after = maxrest.show_server(id); MaxRest::Server after = maxrest.show_server(id);
expect_server_to_be(maxrest, after, "Master, Running"); expect_server_to_be(maxrest, after, "Master, Running");

View File

@ -12,11 +12,11 @@
*/ */
/** /**
* @file clustrix_mon.cpp - simple Clustrix monitor test * @file xpan_mon.cpp - simple Xpand monitor test
* Just creates Clustrix cluster and connect Maxscale to it * Just creates Xpand cluster and connect Maxscale to it
* It can be used as a template for clustrix tests * It can be used as a template for Xpand tests
* *
* See Clustrix_nodes.h for details about configiration * See xpand_nodes.h for details about configiration
*/ */
#include <maxtest/testconnections.hh> #include <maxtest/testconnections.hh>

View File

@ -21,7 +21,7 @@ using namespace std;
namespace namespace
{ {
const std::string monitor_name = "Clustrix-Monitor"; const std::string monitor_name = "Xpand-Monitor";
map<string, MaxRest::Server> static_by_address; map<string, MaxRest::Server> static_by_address;
map<string, MaxRest::Server> dynamic_by_address; map<string, MaxRest::Server> dynamic_by_address;
@ -50,11 +50,11 @@ void collect_information(TestConnections& test)
if (node_by_address.count(server.address) == 0) if (node_by_address.count(server.address) == 0)
{ {
Clustrix_nodes* pClustrix = test.clustrix; Xpand_nodes* pXpand = test.xpand;
for (auto i = 0; i < pClustrix->N; ++i) for (auto i = 0; i < pXpand->N; ++i)
{ {
if (pClustrix->IP_private[i] == server.address) if (pXpand->IP_private[i] == server.address)
{ {
cout << server.address << " IS NODE " << i << endl; cout << server.address << " IS NODE " << i << endl;
node_by_address[server.address] = i; node_by_address[server.address] = i;
@ -67,13 +67,13 @@ void collect_information(TestConnections& test)
void drop_table(TestConnections& test, MYSQL* pMysql) void drop_table(TestConnections& test, MYSQL* pMysql)
{ {
test.try_query(pMysql, "DROP TABLE IF EXISTS test.clustrix_tr"); test.try_query(pMysql, "DROP TABLE IF EXISTS test.xpand_tr");
} }
void create_table(TestConnections& test, MYSQL* pMysql) void create_table(TestConnections& test, MYSQL* pMysql)
{ {
test.try_query(pMysql, "CREATE TABLE test.clustrix_tr (a INT)"); test.try_query(pMysql, "CREATE TABLE test.xpand_tr (a INT)");
test.try_query(pMysql, "INSERT INTO test.clustrix_tr VALUES (42)"); test.try_query(pMysql, "INSERT INTO test.xpand_tr VALUES (42)");
} }
void setup_database(TestConnections& test) void setup_database(TestConnections& test)
@ -110,7 +110,7 @@ bool wait_for_state(TestConnections& test, const std::string& name, int timeout,
while ((server.state.find(state) == string::npos) && (end - start < timeout)); while ((server.state.find(state) == string::npos) && (end - start < timeout));
test.expect(server.state.find(state) != string::npos, test.expect(server.state.find(state) != string::npos,
"Clustrix node %s did not change state to %s within timeout of %d.", "Xpand node %s did not change state to %s within timeout of %d.",
name.c_str(), state.c_str(), timeout); name.c_str(), state.c_str(), timeout);
return server.state.find(state) != string::npos; return server.state.find(state) != string::npos;
@ -120,16 +120,16 @@ bool stop_server(TestConnections& test, const std::string& name, int node, int t
{ {
bool stopped = false; bool stopped = false;
Clustrix_nodes* pClustrix = test.clustrix; Xpand_nodes* pXpand = test.xpand;
auto rv = pClustrix->ssh_output("service clustrix stop", node, true); auto rv = pXpand->ssh_output("service clustrix stop", node, true);
test.expect(rv.first == 0, "Could not stop Clustrix on node %d.", node); test.expect(rv.first == 0, "Could not stop Xpand on node %d.", node);
if (rv.first == 0) if (rv.first == 0)
{ {
if (wait_for_state(test, name, timeout, "Down")) if (wait_for_state(test, name, timeout, "Down"))
{ {
cout << "Clustrix on node " << node << " is down." << endl; cout << "Xpand on node " << node << " is down." << endl;
stopped = true; stopped = true;
} }
} }
@ -141,16 +141,16 @@ bool start_server(TestConnections& test, const std::string& name, int node, int
{ {
bool started = false; bool started = false;
Clustrix_nodes* pClustrix = test.clustrix; Xpand_nodes* pXpand = test.xpand;
auto rv = pClustrix->ssh_output("service clustrix start", node, true); auto rv = pXpand->ssh_output("service clustrix start", node, true);
test.expect(rv.first == 0, "Could not start Clustrix on node %d.", node); test.expect(rv.first == 0, "Could not start Xpand on node %d.", node);
if (rv.first == 0) if (rv.first == 0)
{ {
if (wait_for_state(test, name, timeout, "Master")) if (wait_for_state(test, name, timeout, "Master"))
{ {
cout << "Clustrix on node " << node << " is up." << endl; cout << "Xpand on node " << node << " is up." << endl;
started = true; started = true;
} }
} }
@ -173,7 +173,7 @@ void test_transaction_replay(TestConnections& test, MYSQL* pMysql, const std::st
{ {
cout << "Beginning transaction..." << endl; cout << "Beginning transaction..." << endl;
test.try_query(pMysql, "BEGIN"); test.try_query(pMysql, "BEGIN");
test.try_query(pMysql, "SELECT * FROM test.clustrix_tr"); test.try_query(pMysql, "SELECT * FROM test.xpand_tr");
cout << "Stopping server " << name << "(node " << node << ")." << endl; cout << "Stopping server " << name << "(node " << node << ")." << endl;
int timeout; int timeout;
@ -183,10 +183,10 @@ void test_transaction_replay(TestConnections& test, MYSQL* pMysql, const std::st
// The server we were connected to is now down. If the following // The server we were connected to is now down. If the following
// succeeds, then reconnect + transaction replay worked as specified. // succeeds, then reconnect + transaction replay worked as specified.
cout << "Continuing transaction..." << endl; cout << "Continuing transaction..." << endl;
test.try_query(pMysql, "SELECT * FROM test.clustrix_tr"); test.try_query(pMysql, "SELECT * FROM test.xpand_tr");
test.try_query(pMysql, "COMMIT"); test.try_query(pMysql, "COMMIT");
cout << "Bring Clustrix " << name << "(node " << node << ") up again." << endl; cout << "Bring Xpand " << name << "(node " << node << ") up again." << endl;
timeout = 3 * 60; // Coming up takes time... timeout = 3 * 60; // Coming up takes time...
start_server(test, name, node, timeout); start_server(test, name, node, timeout);
@ -238,7 +238,7 @@ void run_test(TestConnections& test)
node = node_by_address[server2.address]; node = node_by_address[server2.address];
// SECOND TEST: Take down another node but than the one we are connected to. // SECOND TEST: Take down another node but than the one we are connected to.
// That will cause a Clustrix Group Change event. // That will cause a Xpand Group Change event.
// //
// This requires MaxScale to detect the error and replay the transaction. // This requires MaxScale to detect the error and replay the transaction.
cout << "\nTESTING transaction replay when group change error occurs." << endl; cout << "\nTESTING transaction replay when group change error occurs." << endl;