diff --git a/disown_child.sh b/disown_child.sh new file mode 100755 index 0000000..63ef3d8 --- /dev/null +++ b/disown_child.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +THISDIR=$(dirname $(readlink -f $0)) +$THISDIR/$1 run_tests.log 2>&1 + set -ex #REPLACE_ENV @@ -59,8 +61,8 @@ export SKIP_DEVSTACK_GATE_PROJECT=1 sudo pip install -i https://pypi.python.org/simple/ XenAPI # These came from the Readme -export REPO_URL=https://review.openstack.org/p -export ZUUL_URL=/home/jenkins/workspace-cache +export ZUUL_URL=https://review.openstack.org/p +export REPO_URL=/home/jenkins/workspace-cache export WORKSPACE=/home/jenkins/workspace/testing # Check out a custom branch @@ -107,4 +109,21 @@ git clone https://github.com/matelakat/devstack-gate -b xenserver-integration #( sudo mkdir -p /opt/stack/new && sudo chown -R jenkins:jenkins /opt/stack/new && cd /opt/stack/new && git clone https://github.com/matelakat/devstack-gate -b xenserver-integration ) cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh -./safe-devstack-vm-gate-wrap.sh \ No newline at end of file + +# Trap the exit code + log a final message +function trapexit { + exit_code=$? + if [ $exit_code -eq 0 ]; then + echo "Final result: Tests passed" + else + echo "Final result: Tests failed" + fi + + # Do not use 'exit' - bash will preserve the status +} + +trap trapexit EXIT + +# OpenStack doesn't care much about unset variables... +set +ue +source ./safe-devstack-vm-gate-wrap.sh