diff --git a/BUILD/mdbci/build.sh b/BUILD/mdbci/build.sh index abdb0f4b2..a18c16f92 100755 --- a/BUILD/mdbci/build.sh +++ b/BUILD/mdbci/build.sh @@ -66,9 +66,7 @@ $(<${script_dir}/templates/build.json.template) # destroying existing box if [ -d "$MDBCI_VM_PATH/${name}" ]; then - cd $MDBCI_VM_PATH/${name} - vagrant destroy -f - cd ${dir} + ${mdbci_dir}/mdbci destroy $name fi # starting VM for build @@ -78,9 +76,7 @@ $(<${script_dir}/templates/build.json.template) ${mdbci_dir}/mdbci up --attempts=1 $name if [ $? != 0 ] ; then echo "Error starting VM" - cd $MDBCI_VM_PATH/${name} rm ~/vagrant_lock - cd $dir exit 1 fi echo "copying public keys to VM" @@ -122,11 +118,7 @@ if [ "$try_already_running" == "yes" ] ; then fi if [[ "$do_not_destroy_vm" != "yes" && "$try_already_running" != "yes" ]] ; then echo "Destroying VM" - vagrant destroy -f - cd .. - rm -rf $name - rm -rf ${name}.json - rm -rf ${name}_netwotk_config + ${mdbci_dir}/mdbci destroy $name fi cd $dir diff --git a/BUILD/mdbci/upgrade_test.sh b/BUILD/mdbci/upgrade_test.sh index 9ac3efe1f..c30069dcb 100755 --- a/BUILD/mdbci/upgrade_test.sh +++ b/BUILD/mdbci/upgrade_test.sh @@ -30,9 +30,7 @@ echo $JOB_NAME-$BUILD_NUMBER >> ~/vagrant_lock # destroying existing box if [ -d "install_$box" ]; then - cd $MDBCI_VM_PATH/$name - vagrant destroy -f - cd $dir + ${mdbci_dir}/mdbci destroy $name fi ${mdbci_dir}/repository-config/generate_all.sh repo.d @@ -44,11 +42,9 @@ ${mdbci_dir}/mdbci up $name --attempts=1 if [ $? != 0 ] ; then if [ $? != 0 ] ; then echo "Error starting VM" - cd ${MDBCI_VM_PATH}/$name if [ "x$do_not_destroy_vm" != "xyes" ] ; then - vagrant destroy -f + ${mdbci_dir}/mdbci destroy $name fi - cd $dir rm ~/vagrant_lock exit 1 fi @@ -126,9 +122,7 @@ scp $scpopt $sshuser@$IP:/var/log/maxscale/* $logs_publish_dir chmod a+r $logs_publish_dir/* if [ "x$do_not_destroy_vm" != "xyes" ] ; then - cd $MDBCI_VM_PATH/$name - vagrant destroy -f - cd $dir + ${mdbci_dir}/mdbci destroy $name fi kill $pid_to_kill exit $res diff --git a/maxscale-system-test/mdbci/create_config.sh b/maxscale-system-test/mdbci/create_config.sh index 6f176e92f..12f899323 100755 --- a/maxscale-system-test/mdbci/create_config.sh +++ b/maxscale-system-test/mdbci/create_config.sh @@ -20,10 +20,8 @@ if [ "$product" == "mysql" ] ; then export cnf_path=${script_dir}/cnf/mysql56 fi +${mdbci_dir}/mdbci destroy $name mkdir -p ${MDBCI_VM_PATH}/$name -cd ${MDBCI_VM_PATH}/$name -vagrant destroy -f -cd $dir mkdir ${MDBCI_VM_PATH}/$name/cnf cp -r ${cnf_path}/* ${MDBCI_VM_PATH}/$name/cnf/ diff --git a/maxscale-system-test/mdbci/destroy.sh b/maxscale-system-test/mdbci/destroy.sh deleted file mode 100755 index d12ec0764..000000000 --- a/maxscale-system-test/mdbci/destroy.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -dir=`pwd` -cd ${MDBCI_VM_PATH}/${name} -vagrant destroy -f -cd $dir - -rm -rf ${MDBCI_VM_PATH}/${name} -rm -rf ${MDBCI_VM_PATH}/${name}.json -rm -rf ${MDBCI_VM_PATH}/${name}_network_config diff --git a/maxscale-system-test/mdbci/run_test.sh b/maxscale-system-test/mdbci/run_test.sh index c74ab8dc9..609d35e7c 100755 --- a/maxscale-system-test/mdbci/run_test.sh +++ b/maxscale-system-test/mdbci/run_test.sh @@ -63,7 +63,6 @@ res=$? ulimit -c unlimited if [ $res == 0 ] ; then -# . ${script_dir}/configure_backend.sh . ${script_dir}/set_env.sh $name cd ${script_dir}/.. cmake . -DBUILDNAME=$name -DCMAKE_BUILD_TYPE=Debug @@ -76,7 +75,7 @@ if [ $res == 0 ] ; then if [ $? != 0 ]; then echo "Backend broken!" if [ "${do_not_destroy_vm}" != "yes" ] ; then - ${script_dir}/destroy.sh + ${mdbci_dir}/mdbci destroy $name fi rm ~/vagrant_lock exit 1 @@ -90,13 +89,13 @@ if [ $res == 0 ] ; then else echo "Failed to create VMs, exiting" if [ "${do_not_destroy_vm}" != "yes" ] ; then - ${script_dir}/destroy.sh + ${mdbci_dir}/mdbci destroy $name fi rm ~/vagrant_lock exit 1 fi if [ "${do_not_destroy_vm}" != "yes" ] ; then - ${script_dir}/destroy.sh + ${mdbci_dir}/mdbci destroy $name echo "clean up done!" fi diff --git a/maxscale-system-test/mdbci/run_test_snapshot.sh b/maxscale-system-test/mdbci/run_test_snapshot.sh index 77d319121..cff4ce3fe 100755 --- a/maxscale-system-test/mdbci/run_test_snapshot.sh +++ b/maxscale-system-test/mdbci/run_test_snapshot.sh @@ -48,15 +48,14 @@ export repo_dir=$dir/repo.d/ ${mdbci_dir}/mdbci snapshot revert --path-to-nodes $name --snapshot-name $snapshot_name if [ $? != 0 ]; then - ${script_dir}/destroy.sh + ${mdbci_dir}/mdbci destroy $name ${MDBCI_VM_PATH}/scripts/clean_vms.sh $name ${script_dir}/create_config.sh - checkExitStatus $? "Error creating configuration" $snapshot_lock_file - . ${script_dir}/configure_backend.sh - + checkExitStatus $? "Error creating configuration" $snapshot_lock_file + echo "Creating snapshot from new config" - $HOME/mdbci/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name + ${mdbci_dir}/mdbci snapshot take --path-to-nodes $name --snapshot-name $snapshot_name fi . ${script_dir}/set_env.sh "$name"