diff --git a/system-test/maxtest/include/maxtest/testconnections.h b/system-test/maxtest/include/maxtest/testconnections.h index 5b71a073c..ad27681d8 100644 --- a/system-test/maxtest/include/maxtest/testconnections.h +++ b/system-test/maxtest/include/maxtest/testconnections.h @@ -144,6 +144,12 @@ public: */ bool binlog_slave_gtid {false}; + /** + * @brief maxscale_product 'maxscale' - use production version of Maxscale, + * 'maxscale_ci' - CI + */ + char * maxscale_product; + /** * @brief timeout seconds until test termination */ diff --git a/system-test/maxtest/src/testconnections.cc b/system-test/maxtest/src/testconnections.cc index 6a2d7fe5a..f6d3f0e9b 100644 --- a/system-test/maxtest/src/testconnections.cc +++ b/system-test/maxtest/src/testconnections.cc @@ -664,6 +664,7 @@ void TestConnections::read_env() "revert_snapshot_command", "mdbci snapshot revert --path-to-nodes %s --snapshot-name ", m_mdbci_config_name.c_str()); no_vm_revert = readenv_bool("no_vm_revert", true); + maxscale_product = readenv("maxscale_product", "maxscale_ci"); } void TestConnections::print_env() @@ -2231,6 +2232,7 @@ int TestConnections::process_mdbci_template() envvar_get_set("backend_box", "%s", box.c_str()); envvar_get_set("target", "develop"); envvar_get_set("vm_memory", "2048"); + envvar_get_set("maxscale_product", "maxscale_ci"); string version = envvar_get_set("version", "10.3"); envvar_get_set("galera_version", "%s", version.c_str()); diff --git a/system-test/mdbci/mdbci_wrapper b/system-test/mdbci/mdbci_wrapper index 05006df2d..00a455f19 100644 --- a/system-test/mdbci/mdbci_wrapper +++ b/system-test/mdbci/mdbci_wrapper @@ -4,5 +4,5 @@ export host=$user@$ip 2>&1 >/dev/null sshopt="-q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=120 " rsync -avz --progress -e "ssh $sshopt" ${MDBCI_VM_PATH}/ $host:${MDBCI_VM_PATH}/ 2>&1 >/dev/null -ssh $sshopt $host "MDBCI_VM_PATH=$MDBCI_VM_PATH /home/$user/mdbci/mdbci $*" 2>/dev/null +ssh $sshopt $host "MDBCI_VM_PATH=${MDBCI_VM_PATH} ${MDBCI_EXECUTABLE} $*" 2>/dev/null rsync -avz --progress -e "ssh $sshopt" $host:${MDBCI_VM_PATH}/ ${MDBCI_VM_PATH}/ 2>&1 >/dev/null diff --git a/system-test/mdbci/run_test.sh b/system-test/mdbci/run_test.sh index d750d82df..f641a410c 100755 --- a/system-test/mdbci/run_test.sh +++ b/system-test/mdbci/run_test.sh @@ -37,6 +37,9 @@ # the value of $test_set after 'NAME#' is used as bash command # line # example: '#NAME long_test_time=3600 ./long_test' +# +# $maxscale_product - use CI or production version of Maxscale +# 'maxscale_ci' or 'maxscale' export vm_memory=${vm_memory:-"2048"} export dir=`pwd` @@ -53,6 +56,7 @@ export mdbci_config_name=`echo ${mdbci_config_name} | sed "s/?//g"` export provider=`mdbci show provider $box --silent 2> /dev/null` export backend_box=${backend_box:-"centos_7_"$provider} +export maxscale_product=${maxscale_product:-"maxscale_ci"} mdbci destroy --force ${mdbci_config_name} @@ -61,6 +65,7 @@ mdbci destroy --force ${mdbci_config_name} ulimit -c unlimited cd ${script_dir}/../../ +rm -rf build mkdir build && cd build cmake .. -DBUILD_SYSTEM_TESTS=Y -DBUILDNAME=${mdbci_config_name} -DCMAKE_BUILD_TYPE=Debug cd system-test diff --git a/system-test/mdbci/run_test_vm.sh b/system-test/mdbci/run_test_vm.sh index 657ca8b09..5ade57af0 100755 --- a/system-test/mdbci/run_test_vm.sh +++ b/system-test/mdbci/run_test_vm.sh @@ -1,5 +1,7 @@ #!/bin/bash +# $HOME/.config/mdbci/max-tst.key file should contain private key to access host + # read the name of build scripts directory export script_dir="$(dirname $(readlink -f $0))" @@ -10,6 +12,7 @@ export mdbci_config_name=${name:-$box-${curr_date}} export mdbci_config_name=`echo ${mdbci_config_name} | sed "s/?//g"` export MDBCI_VM_PATH=$HOME/${mdbci_config_name}_vms export PATH=$PATH:$HOME/mdbci +export MDBCI_EXECUTABLE=`which mdbci` . ${script_dir}/set_run_test_variables.sh @@ -57,6 +60,7 @@ test_env_list=( "JOB_NAME" "BUILD_NUMBER" "BUILD_TIMESTAMP" + "MDBCI_EXECUTABLE" "name" "target" "box" @@ -75,6 +79,7 @@ test_env_list=( "test_branch" "use_valgrind" "use_callgrind" + "maxscale_product" ) for s in ${test_env_list[@]} ; do diff --git a/system-test/mdbci/templates/default.json.template b/system-test/mdbci/templates/default.json.template index d0af854e6..3025caded 100644 --- a/system-test/mdbci/templates/default.json.template +++ b/system-test/mdbci/templates/default.json.template @@ -354,7 +354,7 @@ "MAXSCALE" ], "product" : { - "name" : "maxscale_ci", + "name" : "${maxscale_product}", "version" : "${target}" } @@ -370,7 +370,7 @@ "SECOND_MAXSCALE" ], "product" : { - "name" : "maxscale_ci", + "name" : "${maxscale_product}", "version" : "${target}" }