blob: 8cf9f2119132e094d8ba220e8c5846b59dafb648 [file] [log] [blame]
DR695Hccff30b2017-02-17 18:44:24 -05001*** Settings ***
2Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields
3Library RequestsLibrary
Jerry Flood5db693b2017-05-24 08:52:39 -04004Library UUID
DR695Hccff30b2017-02-17 18:44:24 -05005Library OperatingSystem
6Library Collections
7Resource global_properties.robot
8
9*** Variables ***
Jerry Floodbfc7fcc2017-10-27 12:01:36 -040010${DCAE_HEALTH_CHECK_PATH} /healthcheck
DR695Hbf5a3a32017-06-30 13:09:57 -040011${DCAE_ENDPOINT} ${GLOBAL_DCAE_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DCAE_IP_ADDR}:${GLOBAL_DCAE_SERVER_PORT}
DR695Hccff30b2017-02-17 18:44:24 -050012
13*** Keywords ***
14Run DCAE Health Check
15 [Documentation] Runs a DCAE health check
16 ${auth}= Create List ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
DR695Hbf5a3a32017-06-30 13:09:57 -040017 Log Creating session ${DCAE_ENDPOINT}
18 ${session}= Create Session dcae ${DCAE_ENDPOINT} auth=${auth}
DR695Hccff30b2017-02-17 18:44:24 -050019 ${uuid}= Generate UUID
Jerry Flood171c8652017-05-23 13:12:43 -040020 ${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 Floodbfc7fcc2017-10-27 12:01:36 -040021 ${resp}= Get Request dcae ${DCAE_HEALTH_CHECK_PATH} headers=${headers}
DR695Hccff30b2017-02-17 18:44:24 -050022 Log Received response from dcae ${resp.json()}
23 Should Be Equal As Strings ${resp.status_code} 200
24 Check DCAE Results ${resp.json()}
Jerry Flood5db693b2017-05-24 08:52:39 -040025
DR695Hccff30b2017-02-17 18:44:24 -050026Check DCAE Results
Jerry Floodcf7d7462017-06-02 15:25:36 -040027 [Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN (except for the exceptions ;-)
DR695Hccff30b2017-02-17 18:44:24 -050028 [Arguments] ${json}
Gary Wu56d962f2017-11-02 16:15:54 -070029 # ${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 Floodbfc7fcc2017-10-27 12:01:36 -040044 [Return] ${service_names}
Jerry Flood5db693b2017-05-24 08:52:39 -040045