blob: 2f8ca167bf762522f2dde66991df7c91a075087e [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
16
17${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
32 Set To Dictionary ${oam_ip_map} 10.0.1.1=aai
33 Set To Dictionary ${oam_ip_map} 10.0.2.1=appc
34 Set To Dictionary ${oam_ip_map} 10.0.3.1=sdc
35 Set To Dictionary ${oam_ip_map} 10.0.4.1=dcae_controller
36 Set To Dictionary ${oam_ip_map} 10.0.4.105=dcae_cdap
37 Set To Dictionary ${oam_ip_map} 10.0.4.102=dcae_coll
38 Set To Dictionary ${oam_ip_map} 10.0.5.1=mso
39 Set To Dictionary ${oam_ip_map} 10.0.6.1=policy
40 Set To Dictionary ${oam_ip_map} 10.0.7.1=sdnc
41 Set To Dictionary ${oam_ip_map} 10.0.8.1=vid
42 Set To Dictionary ${oam_ip_map} 10.0.9.1=portal
43 Set To Dictionary ${oam_ip_map} 10.0.10.1=robot
44 Set To Dictionary ${oam_ip_map} 10.0.11.1=message_router
45
46 ${values}= Create Dictionary
47 ${keys}= Get Dictionary Keys ${oam_ip_map}
48 :for ${oam_ip} in @{keys}
49 \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip}
50 \ Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values}
51 Log ${values}
52 Run Keyword If '${WEB_PASSWORD}' != '' Create File ${CREDENTIALS_FILE} ${WEB_USER}:${WEB_PASSWORD}
53 Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values}
54
55*** Keywords ***
56Create File From Template
57 [Arguments] ${template} ${file} ${values}
58 ${data} OperatingSystem.Get File ${template}
59 ${data}= Template String ${data} ${values}
60 Create File ${file} ${data}
61
62Set Public Ip
63 [Arguments] ${server_map} ${oam_ip} ${value_name} ${values}
64 ${status} ${public_ip}= Run Keyword And Ignore Error Get Public Ip ${server_map} ${oam_ip}
65 ${public_ip}= Set Variable If '${status}' == 'PASS' ${public_ip} ${oam_ip}
66 Set To Dictionary ${values} ${value_name} ${public_ip}
67
68Get Public Ip
69 [Arguments] ${server_map} ${oam_ip}
70 ${servers} Get Dictionary Values ${server_map}
71 :for ${server} in @{servers}
72 \ ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -040073 \ Return From Keyword If '${status}'=='PASS' ${public_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -040074 Fail ${oam_ip} Server Not Found
75
76Search Addresses
77 [Arguments] ${server} ${oam_ip}
78 ${addresses} Get From Dictionary ${server} addresses
Jerry Flood3fc36a32017-10-11 11:09:19 -040079 ${status} ${public_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${oam_ip}
80 Return From Keyword If '${status}'=='PASS' ${public_ip}
81 ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${oam_ip}
82 Return From Keyword If '${status}'=='PASS' ${public_ip}
83 Fail ${oam_ip} Server Not Found
84
85Find Rackspace
86 [Arguments] ${addresses} ${oam_ip}
Jerry Flood775f59f2017-04-01 06:55:19 -040087 ${public_ips} Get From Dictionary ${addresses} public
88 ${public_ip}= Get V4 IP ${public_ips}
Jerry Floodb77b6972017-04-04 17:23:17 -040089 ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
Jerry Flood775f59f2017-04-01 06:55:19 -040090 ${this_oam_ip}= Get V4 IP ${oam_ips}
91 Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip}
92 Fail ${oam_ip} Server Not Found
93
Jerry Flood3fc36a32017-10-11 11:09:19 -040094Find Openstack
95 [Arguments] ${addresses} ${oam_ip}
96 ${ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
97 ${public_ip}= Get V4 IP Openstack ${ips} floating
98 ##${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK}
99 ${this_oam_ip}= Get V4 IP Openstack ${ips} fixed
100 Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip}
101 Fail ${oam_ip} Server Not Found
102
Jerry Flood775f59f2017-04-01 06:55:19 -0400103Get V4 IP
104 [Arguments] ${ipmaps}
105 :for ${ipmap} in @{ipmaps}
106 \ ${ip} Get From Dictionary ${ipmap} addr
107 \ ${version} Get From Dictionary ${ipmap} version
108 \ Return from Keyword if '${version}' == '4' ${ip}
Jerry Flood3fc36a32017-10-11 11:09:19 -0400109 Fail No Version 4 IP
110
111Get V4 IP Openstack
112 [Arguments] ${ipmaps} ${testtype}
113 :for ${ipmap} in @{ipmaps}
114 \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type
115 \ ${ip} Get From Dictionary ${ipmap} addr
116 \ ${version} Get From Dictionary ${ipmap} version
117 \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip}
118 Fail No Version 4 IP