blob: d4b409f8f44873d0af9b1f064e21fb7739eecd81 [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
6Library StringTemplater
7Resource ../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 ***
14${URLS_HTML_TEMPLATE} robot/assets/templates/web/index.html.template
15
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
Jerry Floodc8bd4272017-10-19 13:43:43 -040032 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_AAI1_IP_ADDR}=aai1
33 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_AAI2_IP_ADDR}=aai2
34 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_APPC_IP_ADDR}=appc
35 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_DCAE_IP_ADDR}=dcae_controller
36 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SO_IP_ADDR}=mso
37 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MR_IP_ADDR}=message_router
38 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
Jerry Floodbfc7fcc2017-10-27 12:01:36 -040042 Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_OPENO_IP_ADDR}=openo
43 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}
51 :for ${oam_ip} in @{keys}
52 \ ${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}
59 Set To Dictionary ${values} GLOBAL_INJECTED_NEXUS_REPO=${GLOBAL_INJECTED_NEXUS_REPO}
60 Set To Dictionary ${values} GLOBAL_INJECTED_OPENSTACK_TENANT_ID=${GLOBAL_INJECTED_OPENSTACK_TENANT_ID}
61 Set To Dictionary ${values} GLOBAL_INJECTED_REGION=${GLOBAL_INJECTED_REGION}
62 Set To Dictionary ${values} GLOBAL_INJECTED_KEYSTONE=${GLOBAL_INJECTED_KEYSTONE}
Jerry Flood8c636292017-10-30 13:03:31 -040063 Set To Dictionary ${values} prefix=${HOSTS_PREFIX}
Jerry Flood775f59f2017-04-01 06:55:19 -040064 Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values}
65
66*** Keywords ***
67Create File From Template
68 [Arguments] ${template} ${file} ${values}
69 ${data} OperatingSystem.Get File ${template}
70 ${data}= Template String ${data} ${values}
71 Create File ${file} ${data}
72
73Set Public Ip
74 [Arguments] ${server_map} ${oam_ip} ${value_name} ${values}
75 ${status} ${public_ip}= Run Keyword And Ignore Error Get Public Ip ${server_map} ${oam_ip}
76 ${public_ip}= Set Variable If '${status}' == 'PASS' ${public_ip} ${oam_ip}
77 Set To Dictionary ${values} ${value_name} ${public_ip}
78
79Get Public Ip
80 [Arguments] ${server_map} ${oam_ip}
81 ${servers} Get Dictionary Values ${server_map}
82 :for ${server} in @{servers}
83 \ ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -040084 \ Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -040085 Fail ${oam_ip} Server Not Found
86
87Search Addresses
88 [Arguments] ${server} ${oam_ip}
89 ${addresses} Get From Dictionary ${server} addresses
Jerry Flood3fc36a32017-10-11 11:09:19 -040090 ${status} ${public_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${oam_ip}
91 Return From Keyword If '${status}'=='PASS' ${public_ip}
92 ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${oam_ip}
93 Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Floodc8bd4272017-10-19 13:43:43 -040094 ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${oam_ip}
95 Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -040096 Fail ${oam_ip} Server Not Found
97
98Find Rackspace
99 [Arguments] ${addresses} ${oam_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -0400100 ${public_ips} Get From Dictionary ${addresses} public
101 ${public_ip}= Get V4 IP ${public_ips}
Jerry Floodb77b6972017-04-04 17:23:17 -0400102 ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
Jerry Flood775f59f2017-04-01 06:55:19 -0400103 ${this_oam_ip}= Get V4 IP ${oam_ips}
104 Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip}
105 Fail ${oam_ip} Server Not Found
106
Jerry Flood3fc36a32017-10-11 11:09:19 -0400107Find Openstack
Jerry Floodc8bd4272017-10-19 13:43:43 -0400108 [Arguments] ${addresses} ${oam_ip}
109 ${public_ip}= Get V4 IP Openstack ${addresses} external
110 ${this_oam_ip}= Get V4 IP Openstack ${addresses} ${GLOBAL_INJECTED_NETWORK}
111 Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip}
112 Fail ${oam_ip} Server Not Found
113
114Find Openstack 2
115 [Arguments] ${addresses} ${oam_ip}
116 ${ipmaps}= Get From DIctionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
117 ${public_ip}= Get V4 IP Openstack 2 ${ipmaps} floating
118 ${this_oam_ip}= Get V4 IP Openstack 2 ${ipmaps} fixed
Jerry Flood3fc36a32017-10-11 11:09:19 -0400119 Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip}
120 Fail ${oam_ip} Server Not Found
121
Jerry Flood775f59f2017-04-01 06:55:19 -0400122Get V4 IP
123 [Arguments] ${ipmaps}
124 :for ${ipmap} in @{ipmaps}
125 \ ${ip} Get From Dictionary ${ipmap} addr
126 \ ${version} Get From Dictionary ${ipmap} version
127 \ Return from Keyword if '${version}' == '4' ${ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -0400128 Fail No Version 4 IP
129
130Get V4 IP Openstack
Jerry Floodc8bd4272017-10-19 13:43:43 -0400131 [Arguments] ${addresses} ${testtype}
132 ${ipmaps}= Get From Dictionary ${addresses} ${testtype}
133 :for ${ipmap} in @{ipmaps}
134 \ ${ip} Get From Dictionary ${ipmap} addr
135 \ ${version} Get From Dictionary ${ipmap} version
136 \ Return from Keyword if '${version}'=='4' ${ip}
137 Fail No Version 4 IP
138
139Get V4 IP Openstack 2
Jerry Flood3fc36a32017-10-11 11:09:19 -0400140 [Arguments] ${ipmaps} ${testtype}
141 :for ${ipmap} in @{ipmaps}
142 \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type
143 \ ${ip} Get From Dictionary ${ipmap} addr
144 \ ${version} Get From Dictionary ${ipmap} version
145 \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip}
Jerry Floodc8bd4272017-10-19 13:43:43 -0400146 Fail No Version 4 IP