Bugfix: HA failed on Compass master because of lacking pod.yaml 41/47641/3
authorxudan <xudan16@huawei.com>
Wed, 22 Nov 2017 08:32:40 +0000 (03:32 -0500)
committerxudan <xudan16@huawei.com>
Wed, 22 Nov 2017 09:40:01 +0000 (04:40 -0500)
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 <xudan16@huawei.com>
jjb/dovetail/dovetail-run.sh

index 2cbb947..35a61f2 100755 (executable)
@@ -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:"