2 Documentation Initializes ONAP Test Web Page and Password
5 Library OperatingSystem
6 Library StringTemplater
7 Resource ../resources/openstack/keystone_interface.robot
8 Resource ../resources/openstack/nova_interface.robot
11 Test Timeout 1 minutes
14 ${URLS_HTML_TEMPLATE} robot/assets/templates/web/index.html.template
20 ${URLS_HTML} html/index.html
21 ${CREDENTIALS_FILE} /etc/lighttpd/authorization
22 #${CREDENTIALS_FILE} authorization
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} aai-service.onap-aai=aai
33 Set To Dictionary ${oam_ip_map} sdnhost.onap-appc=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} mso.onap-mso=mso
39 Set To Dictionary ${oam_ip_map} drools.onap-policy=policy
40 Set To Dictionary ${oam_ip_map} sdnhost.onap-sdnc=sdnc
41 Set To Dictionary ${oam_ip_map} vid-server.onap-vid=vid
42 Set To Dictionary ${oam_ip_map} portalapps.onap-portal=portal
43 Set To Dictionary ${oam_ip_map} robot-openecompete.onap-robot=robot
44 Set To Dictionary ${oam_ip_map} dmaap.onap-message-router=message_router
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}
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}
56 Create 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}
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}
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}
73 \ Return From Keyword If '${status}' == 'PASS' ${public_ip}
74 Fail ${oam_ip} Server Not Found
77 [Arguments] ${server} ${oam_ip}
78 ${addresses} Get From Dictionary ${server} addresses
79 ${public_ips} Get From Dictionary ${addresses} public
80 ${public_ip}= Get V4 IP ${public_ips}
81 ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_VM_PROPERTIES['network']}
82 ${this_oam_ip}= Get V4 IP ${oam_ips}
83 Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip}
84 Fail ${oam_ip} Server Not Found
88 :for ${ipmap} in @{ipmaps}
89 \ ${ip} Get From Dictionary ${ipmap} addr
90 \ ${version} Get From Dictionary ${ipmap} version
91 \ Return from Keyword if '${version}' == '4' ${ip}