Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library OperatingSystem |
| 3 | Library RequestsLibrary |
| 4 | |
| 5 | *** Variables *** |
| 6 | ${MESSAGE} Hello, world! |
| 7 | ${DBC_URI} /webapi |
| 8 | |
| 9 | *** Test Cases *** |
| 10 | String Equality Test |
| 11 | Should Be Equal ${MESSAGE} Hello, world! |
| 12 | |
| 13 | Dir Test |
| 14 | [Documentation] Check if /tmp exists |
| 15 | Log ${MESSAGE} |
| 16 | CheckDir /tmp |
| 17 | |
| 18 | Url Test |
| 19 | [Documentation] Check if www.onap.org can be reached |
| 20 | Create Session openo http://www.onap.org |
| 21 | CheckUrl openo / 200 |
| 22 | |
| 23 | Mock Hello Server Test |
| 24 | [Documentation] Check /hello endpoint |
| 25 | Create Session hello http://${AAF_IP}:1080 |
| 26 | CheckUrl hello /hello 200 |
| 27 | |
| 28 | Heartbeat Test |
| 29 | [Documentation] Check ${DBC_URI}/info endpoint |
| 30 | Create Session heartbeat http://${DMAAPBC_IP}:8080 |
| 31 | CheckUrl heartbeat ${DBC_URI}/info 204 |
| 32 | |
| 33 | *** Keywords *** |
| 34 | CheckDir |
| 35 | [Arguments] ${path} |
| 36 | Directory Should Exist ${path} |
| 37 | |
| 38 | CheckUrl |
| 39 | [Arguments] ${session} ${path} ${expect} |
| 40 | ${resp}= Get Request ${session} ${path} |
| 41 | Should Be Equal As Integers ${resp.status_code} ${expect} |
| 42 | |