DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields |
| 3 | Library RequestsLibrary |
Jerry Flood | 5db693b | 2017-05-24 08:52:39 -0400 | [diff] [blame] | 4 | Library UUID |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 5 | Library OperatingSystem |
| 6 | Library Collections |
| 7 | Resource global_properties.robot |
| 8 | |
| 9 | *** Variables *** |
Jerry Flood | bfc7fcc | 2017-10-27 12:01:36 -0400 | [diff] [blame] | 10 | ${DCAE_HEALTH_CHECK_PATH} /healthcheck |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 11 | ${DCAE_ENDPOINT} ${GLOBAL_DCAE_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DCAE_IP_ADDR}:${GLOBAL_DCAE_SERVER_PORT} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 12 | |
| 13 | *** Keywords *** |
| 14 | Run DCAE Health Check |
| 15 | [Documentation] Runs a DCAE health check |
| 16 | ${auth}= Create List ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} |
DR695H | bf5a3a3 | 2017-06-30 13:09:57 -0400 | [diff] [blame] | 17 | Log Creating session ${DCAE_ENDPOINT} |
| 18 | ${session}= Create Session dcae ${DCAE_ENDPOINT} auth=${auth} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 19 | ${uuid}= Generate UUID |
Jerry Flood | 171c865 | 2017-05-23 13:12:43 -0400 | [diff] [blame] | 20 | ${headers}= Create Dictionary X-ECOMP-Client-Version=ONAP-R2 action=getTable Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Jerry Flood | bfc7fcc | 2017-10-27 12:01:36 -0400 | [diff] [blame] | 21 | ${resp}= Get Request dcae ${DCAE_HEALTH_CHECK_PATH} headers=${headers} |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 22 | Log Received response from dcae ${resp.json()} |
| 23 | Should Be Equal As Strings ${resp.status_code} 200 |
| 24 | Check DCAE Results ${resp.json()} |
Jerry Flood | 5db693b | 2017-05-24 08:52:39 -0400 | [diff] [blame] | 25 | |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 26 | Check DCAE Results |
Jerry Flood | cf7d746 | 2017-06-02 15:25:36 -0400 | [diff] [blame] | 27 | [Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN (except for the exceptions ;-) |
DR695H | ccff30b | 2017-02-17 18:44:24 -0500 | [diff] [blame] | 28 | [Arguments] ${json} |
Gary Wu | 56d962f | 2017-11-02 16:15:54 -0700 | [diff] [blame^] | 29 | # ${service_names} to contain only the names of services that are passing |
| 30 | ${service_names}= Evaluate map( lambda s: s['ServiceName'], filter(lambda s: s['Status'] == 'passing', ${json} )) |
| 31 | Should Contain Match ${service_names} cdap |
| 32 | Should Contain Match ${service_names} cdap_broker |
| 33 | Should Contain Match ${service_names} config_binding_service |
| 34 | Should Contain Match ${service_names} deployment_handler |
| 35 | Should Contain Match ${service_names} inventory |
| 36 | Should Contain Match ${service_names} service_change_handler |
| 37 | Should Contain Match ${service_names} policy_handler |
| 38 | Should Contain Match ${service_names} platform_dockerhost |
| 39 | Should Contain Match ${service_names} component_dockerhost |
| 40 | Should Contain Match ${service_names} cloudify_manager |
| 41 | Should Contain Match ${service_names} VES |
| 42 | Should Contain Match ${service_names} TCA |
| 43 | Should Contain Match ${service_names} regexp=.*holmes |
Jerry Flood | bfc7fcc | 2017-10-27 12:01:36 -0400 | [diff] [blame] | 44 | [Return] ${service_names} |
Jerry Flood | 5db693b | 2017-05-24 08:52:39 -0400 | [diff] [blame] | 45 | |