Eric Debeau | 2ed7feb | 2018-04-17 07:11:57 +0000 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation The main interface for interacting with External API/NBI |
| 3 | Library RequestsLibrary |
Eric Debeau | a09ce2b | 2018-04-18 20:53:01 +0000 | [diff] [blame] | 4 | Library Collections |
Eric Debeau | 2ed7feb | 2018-04-17 07:11:57 +0000 | [diff] [blame] | 5 | |
| 6 | *** Variables *** |
| 7 | ${GLOBAL_NBI_SERVER_PROTOCOL} http |
| 8 | ${GLOBAL_INJECTED_NBI_IP_ADDR} localhost |
| 9 | ${GLOBAL_NBI_SERVER_PORT} 8080 |
| 10 | ${NBI_HEALTH_CHECK_PATH} /nbi/api/v1/status |
| 11 | ${NBI_ENDPOINT} ${GLOBAL_NBI_SERVER_PROTOCOL}://${GLOBAL_INJECTED_NBI_IP_ADDR}:${GLOBAL_NBI_SERVER_PORT} |
| 12 | |
Eric Debeau | a09ce2b | 2018-04-18 20:53:01 +0000 | [diff] [blame] | 13 | *** Test Cases *** |
| 14 | NBI Health Check |
| 15 | Run NBI Health Check |
Eric Debeau | 2ed7feb | 2018-04-17 07:11:57 +0000 | [diff] [blame] | 16 | |
| 17 | *** Keywords *** |
| 18 | Run NBI Health Check |
| 19 | [Documentation] Runs NBI Health check |
| 20 | ${resp}= Run NBI Get Request ${NBI_HEALTH_CHECK_PATH} |
| 21 | Should Be Equal As Integers ${resp.status_code} 200 |
| 22 | |
| 23 | Run NBI Get Request |
| 24 | [Documentation] Runs NBI Get request |
| 25 | [Arguments] ${data_path} |
| 26 | ${session}= Create Session session ${NBI_ENDPOINT} |
| 27 | ${resp}= Get Request session ${data_path} |
| 28 | Should Be Equal As Integers ${resp.status_code} 200 |
| 29 | Log Received response from NBI ${resp.text} |
| 30 | ${json}= Set Variable ${resp.json()} |
| 31 | ${status}= Get From Dictionary ${json} status |
| 32 | Should Be Equal ${status} ok |
Eric Debeau | a09ce2b | 2018-04-18 20:53:01 +0000 | [diff] [blame] | 33 | [Return] ${resp} |