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 *** |
DR695H | f1621de | 2019-06-20 15:37:57 -0400 | [diff] [blame] | 14 | ${URLS_HTML_TEMPLATE} 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 |
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 |
DR695H | c0cf6a4 | 2019-07-26 16:42:36 -0400 | [diff] [blame^] | 36 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SO_IP_ADDR}=so |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 37 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MR_IP_ADDR}=message_router |
pkaras | 2771fda | 2019-04-10 11:56:50 +0200 | [diff] [blame] | 38 | 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] | 39 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_POLICY_IP_ADDR}=policy |
| 40 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_PORTAL_IP_ADDR}=portal |
| 41 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SDC_IP_ADDR}=sdc |
| 42 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_SDNC_IP_ADDR}=sdnc |
Gary Wu | 4d80cb7 | 2018-08-06 13:51:02 -0700 | [diff] [blame] | 43 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_MSB_IP_ADDR}=openo |
Jerry Flood | bfc7fcc | 2017-10-27 12:01:36 -0400 | [diff] [blame] | 44 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_CLAMP_IP_ADDR}=clamp |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 45 | Set To Dictionary ${oam_ip_map} ${GLOBAL_INJECTED_VID_IP_ADDR}=vid |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 46 | Set To Dictionary ${oam_ip_map} 10.0.4.105=dcae_cdap |
| 47 | Set To Dictionary ${oam_ip_map} 10.0.4.102=dcae_coll |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 48 | Set To Dictionary ${oam_ip_map} 10.0.10.1=robot |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 49 | |
| 50 | ${values}= Create Dictionary |
| 51 | ${keys}= Get Dictionary Keys ${oam_ip_map} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 52 | :FOR ${oam_ip} IN @{keys} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 53 | \ ${value_name}= Get From Dictionary ${oam_ip_map} ${oam_ip} |
| 54 | \ Set Public Ip ${server_map} ${oam_ip} ${value_name} ${values} |
| 55 | Log ${values} |
| 56 | 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] | 57 | Set To Dictionary ${values} GLOBAL_INJECTED_ARTIFACTS_VERSION=${GLOBAL_INJECTED_ARTIFACTS_VERSION} |
| 58 | Set To Dictionary ${values} GLOBAL_INJECTED_NETWORK=${GLOBAL_INJECTED_NETWORK} |
| 59 | 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] | 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 Flood | e80c131 | 2017-10-31 08:16:53 -0400 | [diff] [blame] | 63 | Set To Dictionary ${values} GLOBAL_INJECTED_VM_FLAVOR=${GLOBAL_INJECTED_VM_FLAVOR} |
| 64 | Set To Dictionary ${values} GLOBAL_INJECTED_VM_IMAGE_NAME=${GLOBAL_INJECTED_VM_IMAGE_NAME} |
| 65 | 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] | 66 | Set To Dictionary ${values} prefix=${HOSTS_PREFIX} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 67 | Create File From Template ${URLS_HTML_TEMPLATE} ${URLS_HTML} ${values} |
| 68 | |
| 69 | *** Keywords *** |
| 70 | Create File From Template |
| 71 | [Arguments] ${template} ${file} ${values} |
DR695H | d979465 | 2019-07-19 18:20:40 -0400 | [diff] [blame] | 72 | Templating.Create Environment web ${GLOBAL_TEMPLATE_FOLDER} |
| 73 | ${data}= Templating.Apply Template web ${template} ${values} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 74 | Create File ${file} ${data} |
| 75 | |
| 76 | Set Public Ip |
| 77 | [Arguments] ${server_map} ${oam_ip} ${value_name} ${values} |
| 78 | ${status} ${public_ip}= Run Keyword And Ignore Error Get Public Ip ${server_map} ${oam_ip} |
| 79 | ${public_ip}= Set Variable If '${status}' == 'PASS' ${public_ip} ${oam_ip} |
| 80 | Set To Dictionary ${values} ${value_name} ${public_ip} |
| 81 | |
| 82 | Get Public Ip |
| 83 | [Arguments] ${server_map} ${oam_ip} |
| 84 | ${servers} Get Dictionary Values ${server_map} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 85 | :FOR ${server} IN @{servers} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 86 | \ ${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] | 87 | \ Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 88 | Fail ${oam_ip} Server Not Found |
| 89 | |
| 90 | Search Addresses |
| 91 | [Arguments] ${server} ${oam_ip} |
| 92 | ${addresses} Get From Dictionary ${server} addresses |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 93 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Rackspace ${addresses} ${oam_ip} |
| 94 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
| 95 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack ${addresses} ${oam_ip} |
| 96 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 97 | ${status} ${public_ip}= Run Keyword And Ignore Error Find Openstack 2 ${addresses} ${oam_ip} |
| 98 | Return From Keyword If '${status}'=='PASS' ${public_ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 99 | Fail ${oam_ip} Server Not Found |
| 100 | |
| 101 | Find Rackspace |
| 102 | [Arguments] ${addresses} ${oam_ip} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 103 | ${public_ips} Get From Dictionary ${addresses} public |
| 104 | ${public_ip}= Get V4 IP ${public_ips} |
Jerry Flood | b77b697 | 2017-04-04 17:23:17 -0400 | [diff] [blame] | 105 | ${oam_ips} Get From Dictionary ${addresses} ${GLOBAL_INJECTED_NETWORK} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 106 | ${this_oam_ip}= Get V4 IP ${oam_ips} |
| 107 | Return From Keyword If '${this_oam_ip}' == '${oam_ip}' ${public_ip} |
| 108 | Fail ${oam_ip} Server Not Found |
| 109 | |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 110 | Find Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 111 | [Arguments] ${addresses} ${oam_ip} |
| 112 | ${public_ip}= Get V4 IP Openstack ${addresses} external |
| 113 | ${this_oam_ip}= Get V4 IP Openstack ${addresses} ${GLOBAL_INJECTED_NETWORK} |
| 114 | Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip} |
| 115 | Fail ${oam_ip} Server Not Found |
| 116 | |
| 117 | Find Openstack 2 |
| 118 | [Arguments] ${addresses} ${oam_ip} |
| 119 | ${ipmaps}= Get From DIctionary ${addresses} ${GLOBAL_INJECTED_NETWORK} |
| 120 | ${public_ip}= Get V4 IP Openstack 2 ${ipmaps} floating |
| 121 | ${this_oam_ip}= Get V4 IP Openstack 2 ${ipmaps} fixed |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 122 | Return From Keyword If '${this_oam_ip}'=='${oam_ip}' ${public_ip} |
| 123 | Fail ${oam_ip} Server Not Found |
| 124 | |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 125 | Get V4 IP |
| 126 | [Arguments] ${ipmaps} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 127 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | 775f59f | 2017-04-01 06:55:19 -0400 | [diff] [blame] | 128 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 129 | \ ${version} Get From Dictionary ${ipmap} version |
| 130 | \ Return from Keyword if '${version}' == '4' ${ip} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 131 | Fail No Version 4 IP |
| 132 | |
| 133 | Get V4 IP Openstack |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 134 | [Arguments] ${addresses} ${testtype} |
| 135 | ${ipmaps}= Get From Dictionary ${addresses} ${testtype} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 136 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 137 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 138 | \ ${version} Get From Dictionary ${ipmap} version |
| 139 | \ Return from Keyword if '${version}'=='4' ${ip} |
| 140 | Fail No Version 4 IP |
| 141 | |
| 142 | Get V4 IP Openstack 2 |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 143 | [Arguments] ${ipmaps} ${testtype} |
DR695H | 910097e | 2019-05-08 13:55:32 -0400 | [diff] [blame] | 144 | :FOR ${ipmap} IN @{ipmaps} |
Jerry Flood | 3fc36a3 | 2017-10-11 11:09:19 -0400 | [diff] [blame] | 145 | \ ${type} Get From Dictionary ${ipmap} OS-EXT-IPS:type |
| 146 | \ ${ip} Get From Dictionary ${ipmap} addr |
| 147 | \ ${version} Get From Dictionary ${ipmap} version |
| 148 | \ Return from Keyword if '${version}'=='4' and '${type}'=='${testtype}' ${ip} |
Jerry Flood | c8bd427 | 2017-10-19 13:43:43 -0400 | [diff] [blame] | 149 | Fail No Version 4 IP |