Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Initializes ONAP Test Web Page and Password |
| 3 | |
| 4 | Library Collections |
| 5 | Library OperatingSystem |
| 6 | Library StringTemplater |
| 7 | Resource ../resources/openstack/keystone_interface.robot |
| 8 | Resource ../resources/openstack/nova_interface.robot |
| 9 | |
| 10 | |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 11 | Test Timeout 5 minutes |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 12 | |
| 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 *** |
| 25 | Update 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 Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 32 | 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 |
| 42 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_VID_IP_ADDR}=vid |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 43 | Set To Dictionary ${oam_ip_map} 10.0.4.105=dcae_cdap |
| 44 | Set To Dictionary ${oam_ip_map} 10.0.4.102=dcae_coll |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 45 | Set To Dictionary ${oam_ip_map} 10.0.10.1=robot |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 46 | |
| 47 | ${values}= Create Dictionary |
| 48 | ${keys}= Get Dictionary Keys ${oam_ip_map} |
| 49 | :for ${oam_ip} in @{keys} |
| 50 | \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip} |
| 51 | \ Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values} |
| 52 | Log ${values} |
| 53 | Run Keyword If '${WEB_PASSWORD}' != '' Create File ${CREDENTIALS_FILE} ${WEB_USER}:${WEB_PASSWORD} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 54 | Set To Dictionary ${values} GLOBAL_INJECTED_ARTIFACTS_VERSION=${GLOBAL_INJECTED_ARTIFACTS_VERSION} |
| 55 | Set To Dictionary ${values} GLOBAL_INJECTED_NETWORK=${GLOBAL_INJECTED_NETWORK} |
| 56 | Set To Dictionary ${values} GLOBAL_INJECTED_NEXUS_DOCKER_REPO=${GLOBAL_INJECTED_NEXUS_DOCKER_REPO} |
| 57 | Set To Dictionary ${values} GLOBAL_INJECTED_NEXUS_REPO=${GLOBAL_INJECTED_NEXUS_REPO} |
| 58 | Set To Dictionary ${values} GLOBAL_INJECTED_OPENSTACK_TENANT_ID=${GLOBAL_INJECTED_OPENSTACK_TENANT_ID} |
| 59 | Set To Dictionary ${values} GLOBAL_INJECTED_REGION=${GLOBAL_INJECTED_REGION} |
| 60 | Set To Dictionary ${values} GLOBAL_INJECTED_KEYSTONE=${GLOBAL_INJECTED_KEYSTONE} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 61 | Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values} |
| 62 | |
| 63 | *** Keywords *** |
| 64 | Create File From Template |
| 65 | [Arguments] ${template} ${file} ${values} |
| 66 | ${data} OperatingSystem.Get File ${template} |
| 67 | ${data}= Template String ${data} ${values} |
| 68 | Create File ${file} ${data} |
| 69 | |
| 70 | Set Public Ip |
| 71 | [Arguments] ${server_map} ${oam_ip} ${value_name} ${values} |
| 72 | ${status} ${public_ip}= Run Keyword And Ignore Error Get Public Ip ${server_map} ${oam_ip} |
| 73 | ${public_ip}= Set Variable If '${status}' == 'PASS' ${public_ip} ${oam_ip} |
| 74 | Set To Dictionary ${values} ${value_name} ${public_ip} |
| 75 | |
| 76 | Get Public Ip |
| 77 | [Arguments] ${server_map} ${oam_ip} |
| 78 | ${servers} Get Dictionary Values ${server_map} |
| 79 | :for ${server} in @{servers} |
| 80 | \ ${status} ${public_ip} Run Keyword And Ignore Error Search Addresses ${server} ${oam_ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 81 | \ Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 82 | Fail ${oam_ip} Server Not Found |
| 83 | |
| 84 | Search Addresses |
| 85 | [Arguments] ${server} ${oam_ip} |
| 86 | ${addresses} Get From Dictionary ${server} addresses |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 87 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${oam_ip} |
| 88 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
| 89 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${oam_ip} |
| 90 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 91 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${oam_ip} |
| 92 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 93 | Fail ${oam_ip} Server Not Found |
| 94 | |
| 95 | Find Rackspace |
| 96 | [Arguments] ${addresses} ${oam_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 97 | ${public_ips} Get From Dictionary ${addresses} public |
| 98 | ${public_ip}= Get V4 IP ${public_ips} |
Jerry Flood | b77b697 | 2017-04-04 17:23:17 -0400 | [diff] [blame] | 99 | ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 100 | ${this_oam_ip}= Get V4 IP ${oam_ips} |
| 101 | Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip} |
| 102 | Fail ${oam_ip} Server Not Found |
| 103 | |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 104 | Find Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 105 | [Arguments] ${addresses} ${oam_ip} |
| 106 | ${public_ip}= Get V4 IP Openstack ${addresses} external |
| 107 | ${this_oam_ip}= Get V4 IP Openstack ${addresses} ${GLOBAL_INJECTED_NETWORK} |
| 108 | Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip} |
| 109 | Fail ${oam_ip} Server Not Found |
| 110 | |
| 111 | Find Openstack 2 |
| 112 | [Arguments] ${addresses} ${oam_ip} |
| 113 | ${ipmaps}= Get From DIctionary ${addresses} ${GLOBAL_INJECTED_NETWORK} |
| 114 | ${public_ip}= Get V4 IP Openstack 2 ${ipmaps} floating |
| 115 | ${this_oam_ip}= Get V4 IP Openstack 2 ${ipmaps} fixed |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 116 | Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip} |
| 117 | Fail ${oam_ip} Server Not Found |
| 118 | |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 119 | Get V4 IP |
| 120 | [Arguments] ${ipmaps} |
| 121 | :for ${ipmap} in @{ipmaps} |
| 122 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 123 | \ ${version} Get From Dictionary ${ipmap} version |
| 124 | \ Return from Keyword if '${version}' == '4' ${ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 125 | Fail No Version 4 IP |
| 126 | |
| 127 | Get V4 IP Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 128 | [Arguments] ${addresses} ${testtype} |
| 129 | ${ipmaps}= Get From Dictionary ${addresses} ${testtype} |
| 130 | :for ${ipmap} in @{ipmaps} |
| 131 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 132 | \ ${version} Get From Dictionary ${ipmap} version |
| 133 | \ Return from Keyword if '${version}'=='4' ${ip} |
| 134 | Fail No Version 4 IP |
| 135 | |
| 136 | Get V4 IP Openstack 2 |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 137 | [Arguments] ${ipmaps} ${testtype} |
| 138 | :for ${ipmap} in @{ipmaps} |
| 139 | \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type |
| 140 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 141 | \ ${version} Get From Dictionary ${ipmap} version |
| 142 | \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 143 | Fail No Version 4 IP |