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 |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 6 | Library ONAPLibrary.Templating WITH NAME Templating |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 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 *** |
Brian Freeman | 5a31ec1 | 2019-07-29 20:54:33 -0500 | [diff] [blame] | 14 | ${URLS_HTML_TEMPLATE} web/index.html.jinja |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 15 | |
Jerry Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 16 | ${HOSTS_PREFIX} vm |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 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 |
DR695H | d0453b2 | 2019-07-31 17:28:14 -0400 | [diff] [blame] | 32 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_AAI_IP_ADDR}=aai1 |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 33 | 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 |
DR695H | c0cf6a4 | 2019-07-26 16:42:36 -0400 | [diff] [blame] | 35 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SO_IP_ADDR}=so |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 36 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MR_IP_ADDR}=message_router |
pkaras | 2771fda | 2019-04-10 11:56:50 +0200 | [diff] [blame] | 37 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_BC_IP_ADDR}=bus_controller |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 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 |
Gary Wu | 4d80cb7 | 2018-08-06 13:51:02 -0700 | [diff] [blame] | 42 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MSB_IP_ADDR}=openo |
Jerry Flood | bfc7fcc | 2017-10-27 12:01:36 -0400 | [diff] [blame] | 43 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_CLAMP_IP_ADDR}=clamp |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 44 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_VID_IP_ADDR}=vid |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 45 | 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 Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 47 | Set To Dictionary ${oam_ip_map} 10.0.10.1=robot |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 48 | |
| 49 | ${values}= Create Dictionary |
| 50 | ${keys}= Get Dictionary Keys ${oam_ip_map} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 51 | :FOR ${oam_ip} IN @{keys} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 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 Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 56 | 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 Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 59 | 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 Flood | e80c131 | 2017-10-31 08:16:53 -0400 | [diff] [blame] | 62 | 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 Flood | 8c63629 | 2017-10-30 13:03:31 -0400 | [diff] [blame] | 65 | Set To Dictionary ${values} prefix=${HOSTS_PREFIX} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 66 | Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values} |
| 67 | |
| 68 | *** Keywords *** |
| 69 | Create File From Template |
| 70 | [Arguments] ${template} ${file} ${values} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 71 | Templating.Create Environment web ${GLOBAL_TEMPLATE_FOLDER} |
| 72 | ${data}= Templating.Apply Template web ${template} ${values} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 73 | Create File ${file} ${data} |
| 74 | |
| 75 | Set 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 | |
| 81 | Get Public Ip |
| 82 | [Arguments] ${server_map} ${oam_ip} |
| 83 | ${servers} Get Dictionary Values ${server_map} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 84 | :FOR ${server} IN @{servers} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 85 | \ ${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] | 86 | \ Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 87 | Fail ${oam_ip} Server Not Found |
| 88 | |
| 89 | Search Addresses |
| 90 | [Arguments] ${server} ${oam_ip} |
| 91 | ${addresses} Get From Dictionary ${server} addresses |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 92 | ${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 Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 96 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${oam_ip} |
| 97 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 98 | Fail ${oam_ip} Server Not Found |
| 99 | |
| 100 | Find Rackspace |
| 101 | [Arguments] ${addresses} ${oam_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 102 | ${public_ips} Get From Dictionary ${addresses} public |
| 103 | ${public_ip}= Get V4 IP ${public_ips} |
Jerry Flood | b77b697 | 2017-04-04 17:23:17 -0400 | [diff] [blame] | 104 | ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 105 | ${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 Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 109 | Find Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 110 | [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 | |
| 116 | Find 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 Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 121 | Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip} |
| 122 | Fail ${oam_ip} Server Not Found |
| 123 | |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 124 | Get V4 IP |
| 125 | [Arguments] ${ipmaps} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 126 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 127 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 128 | \ ${version} Get From Dictionary ${ipmap} version |
| 129 | \ Return from Keyword if '${version}' == '4' ${ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 130 | Fail No Version 4 IP |
| 131 | |
| 132 | Get V4 IP Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 133 | [Arguments] ${addresses} ${testtype} |
| 134 | ${ipmaps}= Get From Dictionary ${addresses} ${testtype} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 135 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 136 | \ ${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 | |
| 141 | Get V4 IP Openstack 2 |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 142 | [Arguments] ${ipmaps} ${testtype} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 143 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 144 | \ ${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 Freeman | 5a31ec1 | 2019-07-29 20:54:33 -0500 | [diff] [blame] | 148 | Fail No Version 4 IP |