Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä
2018-04-03 11:01:06 +03:00
17 changed files with 180 additions and 65 deletions

View File

@ -636,6 +636,10 @@ add_test_executable(mxs1713_lots_of_databases.cpp mxs1713_lots_of_databases mxs1
# https://jira.mariadb.org/browse/MXS-1731
add_test_executable(mxs1731_old_persisted_config.cpp mxs1731_old_persisted_config replication LABELS REPL_BACKEND)
# MXS-1751: Maxscale crashes when certain config is in play (with nodes down)
# https://jira.mariadb.org/browse/MXS-1751
add_test_executable(mxs1751_available_when_donor_crash.cpp mxs1751_available_when_donor_crash mxs1751_available_when_donor_crash LABELS GALERA_BACKEND)
# 'namedserverfilter' test
add_test_executable(namedserverfilter.cpp namedserverfilter namedserverfilter LABELS namedserverfilter LIGHT REPL_BACKEND)

View File

@ -15,6 +15,7 @@ module=mysqlmon
servers=server1
user=maxskysql
passwd=skysql
monitor_interval=1000
[Masking]
type=filter

View File

@ -0,0 +1,53 @@
[maxscale]
threads=###threads###
[Galera Monitor]
type=monitor
module=galeramon
servers=server1,server2,server3
user=maxskysql
passwd=skysql
monitor_interval=100
available_when_donor=true
[RW Split Router]
type=service
router=readwritesplit
servers=server1,server2,server3
user=maxskysql
passwd=skysql
master_accept_reads=true
[RW Split Listener]
type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
[CLI]
type=service
router=cli
[CLI Listener]
type=listener
service=CLI
protocol=maxscaled
socket=default
[server1]
type=server
address=###galera_server_IP_1###
port=###galera_server_port_1###
protocol=MySQLBackend
[server2]
type=server
address=###galera_server_IP_2###
port=###galera_server_port_2###
protocol=MySQLBackend
[server3]
type=server
address=###galera_server_IP_3###
port=###galera_server_port_3###
protocol=MySQLBackend

View File

@ -1,11 +1,11 @@
# Running Maxscale system tests on Virtual Machines with MDBCI
MDBCI is a tool to manage virtual machines (VMs).
MDBCI is a tool to manage virtual machines (VMs).
VMs can be described in the simple JSON format.
JSON templates for test configuration can be found in
[maxscale-system-test/mdbci/templates/](templates/)
'MDBCI_VM_PATH' have to be set before executing any MDBCI commands.
'MDBCI_VM_PATH' have to be set before executing any MDBCI commands.
This variable points to the directory to store 'Vagrantfile's
for all VMs as well as all additional files (e.g. *network_config)
@ -17,7 +17,7 @@ Installation instructions: [PREPARATION_FOR_MDBCI](https://github.com/mariadb-co
## Basics of test setup
Test setup is described in template. Templates are stored in
Test setup is described in template. Templates are stored in
[maxscale-system-test/mdbci/templates/](templates/)
Own template have to be put to the same directory.
@ -44,13 +44,13 @@ Template can contain references to any environmental variables - they all
will be replaced with values before VMs starting
The [maxscale-system-test/mdbci/run_test.sh](run_test.sh) script
brings test VMs configuration up and tries to execute
brings test VMs configuration up and tries to execute
```maxscale-system-test``` using 'ctest'.
Script can be executed without any parameters and without defining any
environmental variables.
Script can be executed without any parameters and without defining any
environmental variables.
In this case, tests will be executed for CentOS 7, MariaDB 10.2 and
Maxscale from current 'develop' repository
Maxscale from current 'develop' repository
[http://max-tst-01.mariadb.com/ci-repository/develop/mariadb-maxscale/](http://max-tst-01.mariadb.com/ci-repository/develop/mariadb-maxscale/)
VMs will not be destroyed after the tests.
@ -73,7 +73,7 @@ Variable name|Meaning
```name```|The name of test run - any string to identify VMs set|
For complete list of environmental variables see comments in
For complete list of environmental variables see comments in
[maxscale-system-test/mdbci/run_test.sh](run_test.sh)
and file [maxscale-system-test/mdbci/set_run_test_variables.sh](set_run_test_variables.sh)
@ -92,7 +92,7 @@ test_set|Meaning
If ```galera_version``` is not defined the value of ```version``` is used also for Galera backend
### Test execution
### Test execution
After execution of 'run_test.sh` by default VMs stay alive and other tests can be executed.
@ -100,7 +100,7 @@ Test use environmental variables to get all infio about test setup (about VMs).
The script [maxscale-system-test/mdbci/set_env.sh](set_env.sh)
loads all needed values (IPs, paths to ssh keyfiles,
user names, etc) into environmental variables. Script uses
user names, etc) into environmental variables. Script uses
data from ```${MDBCI_VM_PATH}/${name}_network_config``` file
and also calls MDBCI commands.
@ -168,7 +168,7 @@ To restore backend separatelly and for intial backend setup check_backend' can b
'run_test.sh' makes snapshot of all VMs before tests. The name of snapshot is 'clean'.
In case of problem, after 'snapshot revert' it is recommended to re-create
${name}_network_config file, re-load environmental variables and run
${name}_network_config file, re-load environmental variables and run
'check_backend'
```bash

View File

@ -67,6 +67,9 @@ int main(int argc, char* argv[])
{
if (test.maxscales->start() == 0)
{
// Give the monitor a few seconds to monitor the servers
sleep(5);
if (test.maxscales->connect_rwsplit() == 0)
{
run(test);

View File

@ -0,0 +1,30 @@
/*
* 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: 2020-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 "testconnections.h"
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
for (int i = 0; i < 2; i++)
{
test.galera->stop_node(0);
test.galera->stop_node(1);
test.galera->start_node(1);
test.galera->start_node(0);
test.galera->fix_replication();
}
return test.global_result;
}