Modify fuel_baremetal pod config file 99/50699/3
authorting wu <ting.wu@enea.com>
Tue, 16 Jan 2018 12:27:28 +0000 (13:27 +0100)
committerting wu <ting.wu@enea.com>
Fri, 26 Jan 2018 09:15:39 +0000 (10:15 +0100)
The current HA testcases failed on fuel baremetal installer
with reason "SSHTimeout". This is due to incorrect ssh login
info in the pod config file. The change is to by running
'prepare_env.sh' script to

- read env vars 'USER_NAME' and 'SSH_KEY'
- replace the 'node_username' to env var 'USER_NAME'
- replace the "node_keyfile" to env var 'SSH_KEY'

JIRA: ARMBAND-317

Change-Id: I0239892f447ae99ab4025eedcd133e1b6f04e5a5
Signed-off-by: ting wu <ting.wu@enea.com>
etc/yardstick/nodes/fuel_baremetal/pod.yaml
tests/ci/prepare_env.sh

index acdb447..5ce5552 100644 (file)
@@ -23,29 +23,29 @@ nodes:
     name: node1
     role: Controller
     ip: ip1
-    user: root
-    key_filename: /root/.ssh/id_rsa
+    user: node_username
+    key_filename: node_keyfile
 -
     name: node2
     role: Controller
     ip: ip2
-    user: root
-    key_filename: /root/.ssh/id_rsa
+    user: node_username
+    key_filename: node_keyfile
 -
     name: node3
     role: Controller
     ip: ip3
-    user: root
-    key_filename: /root/.ssh/id_rsa
+    user: node_username
+    key_filename: node_keyfile
 -
     name: node4
     role: Compute
     ip: ip4
-    user: root
-    key_filename: /root/.ssh/id_rsa
+    user: node_username
+    key_filename: node_keyfile
 -
     name: node5
     role: Compute
     ip: ip5
-    user: root
-    key_filename: /root/.ssh/id_rsa
+    user: node_username
+    key_filename: node_keyfile
index 44e2694..262b74c 100755 (executable)
@@ -14,6 +14,8 @@
 : ${INSTALLER_TYPE:='unknown'}
 : ${NODE_NAME:='unknown'}
 : ${EXTERNAL_NETWORK:='admin_floating_net'}
+: ${USER_NAME:='ubuntu'}
+: ${SSH_KEY:='/root/.ssh/id_rsa'}
 
 # Extract network name from EXTERNAL_NETWORK
 #  e.g. EXTERNAL_NETWORK='ext-net;flat;192.168.0.2;192.168.0.253;192.168.0.1;192.168.0.0/24'
@@ -97,6 +99,9 @@ if [ "$INSTALLER_TYPE" == "fuel" ]; then
     node_line_num=($(grep -n node[1-5] $pod_yaml | awk -F: '{print $1}'))
     node_ID=0;
 
+    # update 'user' and 'key_filename' according to CI env
+    sed -i "s|node_username|${USER_NAME}|;s|node_keyfile|${SSH_KEY}|" $pod_yaml;
+
     if [[ ${controller_ips[0]} ]]; then
         sed -i "${node_line_num[0]}s/node1/node$((++node_ID))/;s/ip1/${controller_ips[0]}/" $pod_yaml;
     fi