THIS IS ONLY A TEST INSTANCE. DON'T DO IMPORTANT WORK HERE!

Unverified Commit 7156228b authored by Flavius Lacatusu's avatar Flavius Lacatusu
Browse files

Added exit trap to delete minishift Vm in case if one command failed.


Signed-off-by: default avatarFlavius Lacatusu <flacatus@redhat.com>
parent 8cac86e7
......@@ -11,7 +11,25 @@
# Red Hat, Inc. - initial API and implementation
# Exit on error
set -x
set -e -x
trap 'Catch_Finish $?' EXIT SIGINT
cleanup() {
echo "[INFO] Deleting minishift VM..."
yes | ./tmp/minishift delete && rm -rf ~/.minishift ${OPERATOR_REPO}/tmp
}
Catch_Finish() {
if [ $1 != 0 ]; then
echo "[ERROR] Please check the output error"
cleanup
else
echo "[INFO] Script executed successfully: $0!"
cleanup
fi
}
installStartDocker() {
if [ -x "$(command -v docker)" ]; then
......@@ -84,11 +102,7 @@ run_tests() {
echo "[INFO] Run tests..."
./tmp/run-tests
echo "[INFO] Deleting minishift VM..."
yes | ./tmp/minishift delete && rm -rf ~/.minishift ${OPERATOR_REPO}/tmp
echo "[INFO] Tests passed successfully!"
}
init
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment