diff options
author | 2015-10-05 09:30:41 +0200 | |
---|---|---|
committer | 2015-10-05 09:31:49 +0200 | |
commit | 3e6f490c383798df22c208e5bb92a06a4c906827 (patch) | |
tree | 85ea96c3df1398158ff67ee6bf7c3d3b4f354b58 /jjb/fuel/fuel-lab-reconfig.sh | |
parent | 2f1767a3c0467237761ebe0b26697297ec51b0c2 (diff) |
Enable fuel daily runs on POD2
Change-Id: Iad31f257d1198e9730ea0db68a18737009c00a95
Signed-off-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com>
Diffstat (limited to 'jjb/fuel/fuel-lab-reconfig.sh')
-rwxr-xr-x | jjb/fuel/fuel-lab-reconfig.sh | 72 |
1 files changed, 72 insertions, 0 deletions
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!" |