Neal Chatterley | e908d99 | 2018-04-18 18:19:39 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Tests the health of the log containers: Elasticsearch, Logstash and Kibana. |
| 3 | Library Collections |
| 4 | Library String |
| 5 | Library RequestsLibrary |
| 6 | Resource global_properties.robot |
| 7 | |
| 8 | *** Variables *** |
| 9 | ${LOG_PATH} / |
| 10 | ${LOG_ELASTICSEARCH_ENDPOINT} ${GLOBAL_LOG_SERVER_PROTOCOL}://${GLOBAL_INJECTED_LOG_ELASTICSEARCH_IP_ADDR}:${GLOBAL_LOG_ELASTICSEARCH_PORT} |
| 11 | ${LOG_LOGSTASH_ENDPOINT} ${GLOBAL_LOG_SERVER_PROTOCOL}://${GLOBAL_INJECTED_LOG_LOGSTASH_IP_ADDR}:${GLOBAL_LOG_LOGSTASH_PORT} |
| 12 | ${LOG_KIBANA_ENDPOINT} ${GLOBAL_LOG_SERVER_PROTOCOL}://${GLOBAL_INJECTED_LOG_KIBANA_IP_ADDR}:${GLOBAL_LOG_KIBANA_PORT} |
| 13 | |
| 14 | *** Keywords *** |
| 15 | Run Log Elasticsearch Health Check |
| 16 | [Documentation] Tests Elasticsearch interface |
| 17 | ${resp}= Run Log Elasticsearch Get Request ${LOG_PATH} |
| 18 | Should Be Equal As Strings ${resp.status_code} 200 |
| 19 | |
| 20 | Run Log Elasticsearch Get Request |
| 21 | [Documentation] Runs an Elasticsearch request |
| 22 | [Arguments] ${data_path} |
| 23 | Log Creating session ${LOG_ELASTICSEARCH_ENDPOINT} |
| 24 | ${session}= Create Session log-elasticsearch ${LOG_ELASTICSEARCH_ENDPOINT} |
| 25 | ${resp}= Get Request log-elasticsearch ${data_path} |
| 26 | Log Received response from log-elasticsearch ${resp.text} |
| 27 | [Return] ${resp} |
| 28 | |
| 29 | Run Log Logstash Health Check |
| 30 | [Documentation] Tests Logstash interface |
| 31 | ${resp}= Run Log Logstash Get Request ${LOG_PATH} |
| 32 | Should Be Equal As Strings ${resp.status_code} 200 |
| 33 | |
| 34 | Run Log Logstash Get Request |
| 35 | [Documentation] Runs a Logstash request |
| 36 | [Arguments] ${data_path} |
| 37 | Log Creating session ${LOG_LOGSTASH_ENDPOINT} |
| 38 | ${session}= Create Session log-logstash ${LOG_LOGSTASH_ENDPOINT} |
| 39 | ${resp}= Get Request log-logstash ${data_path} |
| 40 | Log Received response from log-logstash ${resp.text} |
| 41 | [Return] ${resp} |
| 42 | |
| 43 | Run Log Kibana Health Check |
| 44 | [Documentation] Tests Kibana interface |
| 45 | ${resp}= Run Log Kibana Get Request ${LOG_PATH} |
| 46 | Should Be Equal As Strings ${resp.status_code} 200 |
| 47 | |
| 48 | Run Log Kibana Get Request |
| 49 | [Documentation] Runs a Kibana request |
| 50 | [Arguments] ${data_path} |
| 51 | Log Creating session ${LOG_KIBANA_ENDPOINT} |
| 52 | ${session}= Create Session log-kibana ${LOG_KIBANA_ENDPOINT} |
| 53 | ${resp}= Get Request log-kibana ${data_path} |
| 54 | Log Received response from log-kibana ${resp.text} |
| 55 | [Return] ${resp} |
| 56 | |