summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2017-07-27 22:37:47 -0400
committerxudan <xudan16@huawei.com>2017-07-28 00:08:23 -0400
commitd3da23a9e665b25ad81fdcc212863bdc87076fee (patch)
treea03439288899da0f26f30fd12395a31b36cac212
parent638edb3eb22ace17c80852fa0d586f12595e2662 (diff)
support generating pod.yaml for HA test cases on Apex
JIRA: DOVETAIL-472 Now Dovetail can run on Apex pod. So it needs to support generating pod.yaml on this installer to guarantee HA test cases can run successfully. Change-Id: Idc3d457bf9f56ad2ea68d27921498f3060ec375f Signed-off-by: xudan <xudan16@huawei.com>
-rwxr-xr-xjjb/dovetail/dovetail-run.sh7
-rw-r--r--utils/create_pod_file.py15
2 files changed, 16 insertions, 6 deletions
diff --git a/jjb/dovetail/dovetail-run.sh b/jjb/dovetail/dovetail-run.sh
index bf96fd492..418d66fb1 100755
--- a/jjb/dovetail/dovetail-run.sh
+++ b/jjb/dovetail/dovetail-run.sh
@@ -83,6 +83,8 @@ 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."
@@ -115,6 +117,11 @@ if [ "$INSTALLER_TYPE" == "fuel" ]; then
sshpass -p r00tme sudo scp $ssh_options root@${INSTALLER_IP}:~/.ssh/id_rsa ${DOVETAIL_CONFIG}/id_rsa
fi
+if [ "$INSTALLER_TYPE" == "apex" ]; then
+ echo "Fetching id_rsa file from jump_server $INSTALLER_IP..."
+ scp $ssh_options stack@${INSTALLER_IP}:~/.ssh/id_rsa ${DOVETAIL_CONFIG}/id_rsa
+fi
+
# sdnvpn test case needs to download this image first before running
echo "Download image ubuntu-16.04-server-cloudimg-amd64-disk1.img ..."
wget -q -nc http://artifacts.opnfv.org/sdnvpn/ubuntu-16.04-server-cloudimg-amd64-disk1.img -P ${DOVETAIL_CONFIG}
diff --git a/utils/create_pod_file.py b/utils/create_pod_file.py
index 197e4933c..e2c57d23f 100644
--- a/utils/create_pod_file.py
+++ b/utils/create_pod_file.py
@@ -49,7 +49,7 @@ def get_with_passwd():
args.user, installer_pwd=args.password)
-def create_file(handler):
+def create_file(handler, INSTALLER_TYPE):
"""
Create the yaml file of nodes info.
As Yardstick required, node name must be node1, node2, ... and node1 must
@@ -62,27 +62,30 @@ def create_file(handler):
nodes = handler.nodes
node_list = []
index = 1
+ user = 'root'
+ if INSTALLER_TYPE == 'apex':
+ user = 'heat-admin'
for node in nodes:
try:
if node.roles[0].lower() == "controller":
node_info = {'name': "node%s" % index, 'role': node.roles[0],
- 'ip': node.ip, 'user': 'root'}
+ 'ip': node.ip, 'user': user}
node_list.append(node_info)
index += 1
except Exception:
node_info = {'name': node.name, 'role': 'unknown', 'ip': node.ip,
- 'user': 'root'}
+ 'user': user}
node_list.append(node_info)
for node in nodes:
try:
if node.roles[0].lower() == "compute":
node_info = {'name': "node%s" % index, 'role': node.roles[0],
- 'ip': node.ip, 'user': 'root'}
+ 'ip': node.ip, 'user': user}
node_list.append(node_info)
index += 1
except Exception:
node_info = {'name': node.name, 'role': 'unknown', 'ip': node.ip,
- 'user': 'root'}
+ 'user': user}
node_list.append(node_info)
if args.INSTALLER_TYPE == 'compass':
for item in node_list:
@@ -105,7 +108,7 @@ def main():
if not handler:
print("Error: failed to get the node's handler.")
return 1
- create_file(handler)
+ create_file(handler, args.INSTALLER_TYPE)
if __name__ == '__main__':