blob: f784a7287601bfb7ba75fbd2ee92709824e574f5 [file] [log] [blame]
Jerry Flood775f59f2017-04-01 06:55:19 -04001*** Settings ***
2Documentation Initializes ONAP Test Web Page and Password
3
4Library Collections
5Library OperatingSystem
DR695Hd9794652019-07-19 18:20:40 -04006Library ONAPLibrary.Templating WITH NAME Templating
Jerry Flood775f59f2017-04-01 06:55:19 -04007Resource ../resources/openstack/keystone_interface.robot
8Resource ../resources/openstack/nova_interface.robot
9
10
Jerry Flood3fc36a32017-10-11 11:09:19 -040011Test Timeout 5 minutes
Jerry Flood775f59f2017-04-01 06:55:19 -040012
13*** Variables ***
Brian Freeman5a31ec12019-07-29 20:54:33 -050014${URLS_HTML_TEMPLATE} web/index.html.jinja
Jerry Flood775f59f2017-04-01 06:55:19 -040015
Jerry Flood8c636292017-10-30 13:03:31 -040016${HOSTS_PREFIX} vm
Jerry Flood775f59f2017-04-01 06:55:19 -040017${WEB_USER} test
18${WEB_PASSWORD}
19
20${URLS_HTML} html/index.html
21${CREDENTIALS_FILE} /etc/lighttpd/authorization
22#${CREDENTIALS_FILE} authorization
23
24*** Test Cases ***
25Update ONAP Page
26 [Tags] UpdateWebPage
27 Run Keyword If '${WEB_PASSWORD}' == '' Fail "WEB Password must not be empty"
28 Run Openstack Auth Request auth
29 ${server_map}= Get Openstack Servers auth
30 ${oam_ip_map}= Create Dictionary
31 Set To Dictionary ${oam_ip_map} 10.0.0.1=onapdns
DR695Hd0453b22019-07-31 17:28:14 -040032 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_AAI_IP_ADDR}=aai1
Jerry Floodc8bd4272017-10-19 13:43:43 -040033 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_APPC_IP_ADDR}=appc
34 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_DCAE_IP_ADDR}=dcae_controller
DR695Hc0cf6a42019-07-26 16:42:36 -040035 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SO_IP_ADDR}=so
Jerry Floodc8bd4272017-10-19 13:43:43 -040036 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MR_IP_ADDR}=message_router
pkaras2771fda2019-04-10 11:56:50 +020037 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_BC_IP_ADDR}=bus_controller
Jerry Floodc8bd4272017-10-19 13:43:43 -040038 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_POLICY_IP_ADDR}=policy
39 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_PORTAL_IP_ADDR}=portal
40 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SDC_IP_ADDR}=sdc
41 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SDNC_IP_ADDR}=sdnc
Gary Wu4d80cb72018-08-06 13:51:02 -070042 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MSB_IP_ADDR}=openo
Jerry Floodbfc7fcc2017-10-27 12:01:36 -040043 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_CLAMP_IP_ADDR}=clamp
Jerry Floodc8bd4272017-10-19 13:43:43 -040044 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_VID_IP_ADDR}=vid
Jerry Flood775f59f2017-04-01 06:55:19 -040045 Set To Dictionary ${oam_ip_map} 10.0.4.105=dcae_cdap
46 Set To Dictionary ${oam_ip_map} 10.0.4.102=dcae_coll
Jerry Flood775f59f2017-04-01 06:55:19 -040047 Set To Dictionary ${oam_ip_map} 10.0.10.1=robot
Jerry Flood775f59f2017-04-01 06:55:19 -040048
49 ${values}= Create Dictionary
50 ${keys}= Get Dictionary Keys ${oam_ip_map}
DR695H910097e2019-05-08 13:55:32 -040051 :FOR ${oam_ip} IN @{keys}
Jerry Flood775f59f2017-04-01 06:55:19 -040052 \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip}
53 \ Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values}
54 Log ${values}
55 Run Keyword If '${WEB_PASSWORD}' != '' Create File ${CREDENTIALS_FILE} ${WEB_USER}:${WEB_PASSWORD}
Jerry Floodc8bd4272017-10-19 13:43:43 -040056 Set To Dictionary ${values} GLOBAL_INJECTED_ARTIFACTS_VERSION=${GLOBAL_INJECTED_ARTIFACTS_VERSION}
57 Set To Dictionary ${values} GLOBAL_INJECTED_NETWORK=${GLOBAL_INJECTED_NETWORK}
58 Set To Dictionary ${values} GLOBAL_INJECTED_NEXUS_DOCKER_REPO=${GLOBAL_INJECTED_NEXUS_DOCKER_REPO}
Jerry Floodc8bd4272017-10-19 13:43:43 -040059 Set To Dictionary ${values} GLOBAL_INJECTED_OPENSTACK_TENANT_ID=${GLOBAL_INJECTED_OPENSTACK_TENANT_ID}
60 Set To Dictionary ${values} GLOBAL_INJECTED_REGION=${GLOBAL_INJECTED_REGION}
61 Set To Dictionary ${values} GLOBAL_INJECTED_KEYSTONE=${GLOBAL_INJECTED_KEYSTONE}
Jerry Floode80c1312017-10-31 08:16:53 -040062 Set To Dictionary ${values} GLOBAL_INJECTED_VM_FLAVOR=${GLOBAL_INJECTED_VM_FLAVOR}
63 Set To Dictionary ${values} GLOBAL_INJECTED_VM_IMAGE_NAME=${GLOBAL_INJECTED_VM_IMAGE_NAME}
64 Set To Dictionary ${values} GLOBAL_INJECTED_PUBLIC_NET_ID=${GLOBAL_INJECTED_PUBLIC_NET_ID}
Jerry Flood8c636292017-10-30 13:03:31 -040065 Set To Dictionary ${values} prefix=${HOSTS_PREFIX}
Jerry Flood775f59f2017-04-01 06:55:19 -040066 Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values}
67
68*** Keywords ***
69Create File From Template
70 [Arguments] ${template} ${file} ${values}
DR695Hd9794652019-07-19 18:20:40 -040071 Templating.Create Environment web ${GLOBAL_TEMPLATE_FOLDER}
72 ${data}= Templating.Apply Template web ${template} ${values}
Jerry Flood775f59f2017-04-01 06:55:19 -040073 Create File ${file} ${data}
74
75Set Public Ip
76 [Arguments] ${server_map} ${oam_ip} ${value_name} ${values}
77 ${status} ${public_ip}= Run Keyword And Ignore Error Get Public Ip ${server_map} ${oam_ip}
78 ${public_ip}= Set Variable If '${status}' == 'PASS' ${public_ip} ${oam_ip}
79 Set To Dictionary ${values} ${value_name} ${public_ip}
80
81Get Public Ip
82 [Arguments] ${server_map} ${oam_ip}
83 ${servers} Get Dictionary Values ${server_map}
DR695H910097e2019-05-08 13:55:32 -040084 :FOR ${server} IN @{servers}
Jerry Flood775f59f2017-04-01 06:55:19 -040085 \ ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -040086 \ Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -040087 Fail ${oam_ip} Server Not Found
88
89Search Addresses
90 [Arguments] ${server} ${oam_ip}
91 ${addresses} Get From Dictionary ${server} addresses
Jerry Flood3fc36a32017-10-11 11:09:19 -040092 ${status} ${public_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${oam_ip}
93 Return From Keyword If '${status}'=='PASS' ${public_ip}
94 ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${oam_ip}
95 Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Floodc8bd4272017-10-19 13:43:43 -040096 ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${oam_ip}
97 Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -040098 Fail ${oam_ip} Server Not Found
99
100Find Rackspace
101 [Arguments] ${addresses} ${oam_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -0400102 ${public_ips} Get From Dictionary ${addresses} public
103 ${public_ip}= Get V4 IP ${public_ips}
Jerry Floodb77b6972017-04-04 17:23:17 -0400104 ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
Jerry Flood775f59f2017-04-01 06:55:19 -0400105 ${this_oam_ip}= Get V4 IP ${oam_ips}
106 Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip}
107 Fail ${oam_ip} Server Not Found
108
Jerry Flood3fc36a32017-10-11 11:09:19 -0400109Find Openstack
Jerry Floodc8bd4272017-10-19 13:43:43 -0400110 [Arguments] ${addresses} ${oam_ip}
111 ${public_ip}= Get V4 IP Openstack ${addresses} external
112 ${this_oam_ip}= Get V4 IP Openstack ${addresses} ${GLOBAL_INJECTED_NETWORK}
113 Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip}
114 Fail ${oam_ip} Server Not Found
115
116Find Openstack 2
117 [Arguments] ${addresses} ${oam_ip}
118 ${ipmaps}= Get From DIctionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
119 ${public_ip}= Get V4 IP Openstack 2 ${ipmaps} floating
120 ${this_oam_ip}= Get V4 IP Openstack 2 ${ipmaps} fixed
Jerry Flood3fc36a32017-10-11 11:09:19 -0400121 Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip}
122 Fail ${oam_ip} Server Not Found
123
Jerry Flood775f59f2017-04-01 06:55:19 -0400124Get V4 IP
125 [Arguments] ${ipmaps}
DR695H910097e2019-05-08 13:55:32 -0400126 :FOR ${ipmap} IN @{ipmaps}
Jerry Flood775f59f2017-04-01 06:55:19 -0400127 \ ${ip} Get From Dictionary ${ipmap} addr
128 \ ${version} Get From Dictionary ${ipmap} version
129 \ Return from Keyword if '${version}' == '4' ${ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -0400130 Fail No Version 4 IP
131
132Get V4 IP Openstack
Jerry Floodc8bd4272017-10-19 13:43:43 -0400133 [Arguments] ${addresses} ${testtype}
134 ${ipmaps}= Get From Dictionary ${addresses} ${testtype}
DR695H910097e2019-05-08 13:55:32 -0400135 :FOR ${ipmap} IN @{ipmaps}
Jerry Floodc8bd4272017-10-19 13:43:43 -0400136 \ ${ip} Get From Dictionary ${ipmap} addr
137 \ ${version} Get From Dictionary ${ipmap} version
138 \ Return from Keyword if '${version}'=='4' ${ip}
139 Fail No Version 4 IP
140
141Get V4 IP Openstack 2
Jerry Flood3fc36a32017-10-11 11:09:19 -0400142 [Arguments] ${ipmaps} ${testtype}
DR695H910097e2019-05-08 13:55:32 -0400143 :FOR ${ipmap} IN @{ipmaps}
Jerry Flood3fc36a32017-10-11 11:09:19 -0400144 \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type
145 \ ${ip} Get From Dictionary ${ipmap} addr
146 \ ${version} Get From Dictionary ${ipmap} version
147 \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip}
Brian Freeman5a31ec12019-07-29 20:54:33 -0500148 Fail No Version 4 IP