Files
MaxScale/system-test/Documentation/RUN_TEST.md
Esa Korhonen 08f5174915 MXS-2900 Rename maxscale-system-test directory to system-test
A link with the old directory name is provided.
2020-07-28 15:24:27 +03:00

3.8 KiB

How to run test

Prerequirements

Installed MDBCI (with dependencies, see MDBCI doc), build-scripts

Componets should be in the following directories:

build-scripts - in ~/build-scripts/

mdbci - in ~/mdbci/

Creating test environment and running tests

run_test.sh generates MDBCI description of configuration, bring all VMs up, setup DB on all backends, prapare DB for creating Master/Slave and Galera setups, build maxscale-system-test package, execute ctest. Source code of maxscale-system-test have to be in current directory before execution run_test.sh

Environmental variables have to be defined before executing run_test.sh For details see description

Example:

export export MDBCI_VM_PATH=$HOME/vms
export name="my-centos7-release-1.3.0-test"
export box="centos7"
export product="mariadb"
export version="5.5"
export target="develop"
export ci_url="http://max-tst-01.mariadb.com/ci-repository/"
export do_not_destroy_vm="yes"
export test_set="1,10,,20,30,95"
~/build-scripts/test/run_test.sh

After the test, all machines can be accessed:

cd $MDBCI_VM_PATH/$name
vagrant ssh \

where <machine_name> is 'maxscale', 'node0', ..., 'node3', ..., 'nodeN', 'galera0', ..., 'galera3', ..., 'galeraN'

http://max-tst-01.mariadb.com/ci-repository/develop/mariadb-maxscale/ have to contain Maxscale repository

Running tests with existing test environment

set_env_vagrant.sh script sets all needed environmental variables for maxscale-system-test

See maxscale-system-test documentation for details regarding variables.

Example:

export name="running_conf_name"
. ../build-scripts/test/set_env_vagrant.sh $name
set +x
git clone https://github.com/mariadb-corporation/maxscale.git
cd MaxScale/maxscale-system-test
cmake .
make
./test_executable_name

or use ctest to run several tests

Creating environment for Maxscale debugging

create_env.sh script generates MDBCI description of configuration, bring all VMs up, setup DB on all backends, prapare DB for creating Master/Slave and Galera setups, copy source code of Maxscale to 'maxscale' VM and build it.

Note: script does not install Maxscale, it have to be done manually.

Following variables have to be defined:

'name', 'box', 'product', 'version' (see run_test.sh documentation)

'source', 'value' (see prepare_and_build.sh documentation)

Example:

export MDBCI_VM_PATH=$HOME/vms
export name="my-centos7-release-1.3.0-test"
export box="centos7"
export product="mariadb"
export version="5.5"
export source="BRANCH"
export value="develop"
~/build-scripts/test/create_env.sh

Note: do not forget to destroy test environment by vagrant destroy:

cd $MDBCI_VM_PATH/$name/
vagrant destroy -f