From 945a4802c9ff00b0b5cbd2a04f3f17e40e158b82 Mon Sep 17 00:00:00 2001 From: xudan Date: Wed, 22 Nov 2017 03:32:40 -0500 Subject: Bugfix: HA failed on Compass master because of lacking pod.yaml The module in releng which used to get all the pod info of each installer can't work on Compass master. Create a pod.yaml file for Compass master to ensure HA test cases can be executed successfully. JIRA: DOVETAIL-565 Change-Id: I86cbb4fb07b87b99bf1465d57a76b23e1159ec9f Signed-off-by: xudan --- jjb/dovetail/dovetail-run.sh | 66 +++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh index 2cbb94766..35a61f23b 100755 --- a/jjb/dovetail/dovetail-run.sh +++ b/jjb/dovetail/dovetail-run.sh @@ -69,37 +69,51 @@ else exit 1 fi -set +e - -sudo pip install virtualenv - -cd ${releng_repo}/modules -sudo virtualenv venv -source venv/bin/activate -sudo pip install -e ./ >/dev/null -sudo pip install netaddr - -if [[ ${INSTALLER_TYPE} == compass ]]; then - options="-u root -p root" -elif [[ ${INSTALLER_TYPE} == fuel ]]; then - options="-u root -p r00tme" -elif [[ ${INSTALLER_TYPE} == apex ]]; then - options="-u stack -k /root/.ssh/id_rsa" -else - echo "Don't support to generate pod.yaml on ${INSTALLER_TYPE} currently." - echo "HA test cases may not run properly." +if [[ ! "${SUT_BRANCH}" =~ "danube" && ${INSTALLER_TYPE} == "compass" ]]; then + cat << EOF >${DOVETAIL_CONFIG}/pod.yaml +nodes: +- {ip: 10.1.0.52, name: node1, password: root, role: controller, user: root} +- {ip: 10.1.0.51, name: node2, password: root, role: controller, user: root} +- {ip: 10.1.0.50, name: node3, password: root, role: controller, user: root} +- {ip: 10.1.0.54, name: node4, password: root, role: compute, user: root} +- {ip: 10.1.0.53, name: node5, password: root, role: compute, user: root} + +EOF fi -cmd="sudo python ${releng_repo}/utils/create_pod_file.py -t ${INSTALLER_TYPE} \ - -i ${INSTALLER_IP} ${options} -f ${DOVETAIL_CONFIG}/pod.yaml" -echo ${cmd} -${cmd} +if [[ ! -f ${DOVETAIL_CONFIG}/pod.yaml ]]; then + set +e + + sudo pip install virtualenv + + cd ${releng_repo}/modules + sudo virtualenv venv + source venv/bin/activate + sudo pip install -e ./ >/dev/null + sudo pip install netaddr + + if [[ ${INSTALLER_TYPE} == compass ]]; then + options="-u root -p root" + elif [[ ${INSTALLER_TYPE} == fuel ]]; then + options="-u root -p r00tme" + elif [[ ${INSTALLER_TYPE} == apex ]]; then + options="-u stack -k /root/.ssh/id_rsa" + else + echo "Don't support to generate pod.yaml on ${INSTALLER_TYPE} currently." + echo "HA test cases may not run properly." + fi -deactivate + cmd="sudo python ${releng_repo}/utils/create_pod_file.py -t ${INSTALLER_TYPE} \ + -i ${INSTALLER_IP} ${options} -f ${DOVETAIL_CONFIG}/pod.yaml" + echo ${cmd} + ${cmd} -set -e + deactivate -cd ${WORKSPACE} + set -e + + cd ${WORKSPACE} +fi if [ -f ${DOVETAIL_CONFIG}/pod.yaml ]; then echo "file ${DOVETAIL_CONFIG}/pod.yaml:" -- cgit 1.2.3-korg