From 3e6f490c383798df22c208e5bb92a06a4c906827 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Mon, 5 Oct 2015 09:30:41 +0200 Subject: Enable fuel daily runs on POD2 Change-Id: Iad31f257d1198e9730ea0db68a18737009c00a95 Signed-off-by: Fatih Degirmenci --- jjb/fuel/fuel-lab-reconfig.sh | 72 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 jjb/fuel/fuel-lab-reconfig.sh (limited to 'jjb/fuel/fuel-lab-reconfig.sh') diff --git a/jjb/fuel/fuel-lab-reconfig.sh b/jjb/fuel/fuel-lab-reconfig.sh new file mode 100755 index 000000000..a79bc2c51 --- /dev/null +++ b/jjb/fuel/fuel-lab-reconfig.sh @@ -0,0 +1,72 @@ +#!/bin/bash +set -o errexit +set -o nounset +set -o pipefail + +# check to see if ucs login info file exists +if [ -e ~/.ssh/ucs_creds ];then + source ~/.ssh/ucs_creds +else + echo "Unable to find UCS credentials for LF lab reconfiguration...Exiting" + exit 1 +fi + +# clone releng +echo "Cloning releng repo..." +if ! GIT_SSL_NO_VERIFY=true git clone https://gerrit.opnfv.org/gerrit/releng; then + echo "Unable to clone releng repo...Exiting" + exit 1 +fi + +# log info to console +echo "Starting the lab reconfiguration for $INSTALLER..." +echo "--------------------------------------------------------" +echo + +# create venv +$WORKSPACE/releng/utils/lab-reconfiguration/create_venv.sh + +# disable nounset because 'activate' script contains unbound variable(s) +set +o nounset +# enter venv +source $WORKSPACE/releng/utils/lab-reconfiguration/venv/bin/activate +# set nounset back again +set -o nounset + +# verify we are in venv +if [[ ! $(which python | grep venv) ]]; then + echo "Unable to activate venv...Exiting" + exit 1 +fi + +python $WORKSPACE/releng/utils/lab-reconfiguration/reconfigUcsNet.py -i $ucs_host -u $ucs_user -p $ucs_password -f $WORKSPACE/releng/utils/lab-reconfiguration/fuel.yaml + +# while undergoing reboot +sleep 30 + +# check to see if slave is back up +ping_counter=0 +ping_flag=0 +while [ "$ping_counter" -lt 20 ]; do + if [[ $(ping -c 5 172.30.10.72) ]]; then + ping_flag=1 + break + fi + ((ping_counter++)) + sleep 10 +done + +if [ "$ping_flag" -eq 1 ]; then + echo "Slave is pingable, now wait 180 seconds for services to start" + sleep 180 +else + echo "Slave did not come back up after reboot: please check opnfv-jump-2" + exit 1 +fi + +set +o nounset +deactivate + +echo +echo "--------------------------------------------------------" +echo "Done!" -- cgit 1.2.3-korg