Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | |
| 7 | |
| 8 | *** Test Cases *** |
| 9 | Check service up/non existent namespace |
| 10 | CreateSession checkerservice http://localhost:8080 |
| 11 | &{headers}= Create Dictionary Accept=application/json |
| 12 | ${resp}= Get Request checkerservice /check_template/nosuchcatalog headers=${headers} |
| 13 | Should Be Equal As Strings ${resp.status_code} 404 |
| 14 | |
| 15 | Check standalone template |
| 16 | CreateSession checkerservice http://localhost:8080 |
| 17 | ${data}= Get Binary File ${CURDIR}${/}data${/}standalone.yaml |
| 18 | &{headers}= Create Dictionary Accept=application/json |
| 19 | ${resp}= Post Request checkerservice /check_template/ data=${data} headers=${headers} |
| 20 | Log Response received from checker ${resp.text} |
| 21 | Should Be Equal As Strings ${resp.status_code} 200 |
| 22 | Should Be Equal As Strings ${resp.text} [] |
| 23 | |
| 24 | Check standalone template with errors |
| 25 | CreateSession checkerservice http://localhost:8080 |
| 26 | ${data}= Get Binary File ${CURDIR}${/}data${/}standalone_with_errors.yaml |
| 27 | &{headers}= Create Dictionary Accept=application/json |
| 28 | ${resp}= Post Request checkerservice /check_template/ data=${data} headers=${headers} |
| 29 | Log Response received from checker ${resp.text} |
| 30 | Should Be Equal As Strings ${resp.status_code} 200 |
| 31 | Should Not Be Equal As Strings ${resp.text} [] |
| 32 | |
| 33 | Check schema new namespace |
| 34 | CreateSession checkerservice http://localhost:8080 |
| 35 | ${data}= Get Binary File ${CURDIR}${/}data${/}test_schema.yaml |
| 36 | &{headers}= Create Dictionary Accept=application/json |
| 37 | ${resp}= Post Request checkerservice /check_template/test/schema.yaml data=${data} headers=${headers} |
| 38 | Log Response received from checker ${resp.text} |
| 39 | Should Be Equal As Strings ${resp.status_code} 200 |
| 40 | Should Be Equal As Strings ${resp.text} [] |
| 41 | |
| 42 | Check template in namespace |
| 43 | CreateSession checkerservice http://localhost:8080 |
| 44 | ${data}= Get Binary File ${CURDIR}${/}data${/}test_template.yaml |
| 45 | &{headers}= Create Dictionary Accept=application/json |
| 46 | ${resp}= Post Request checkerservice /check_template/test/ data=${data} headers=${headers} |
| 47 | Log Response received from checker ${resp.text} |
| 48 | Should Be Equal As Strings ${resp.status_code} 200 |
| 49 | Should Be Equal As Strings ${resp.text} [] |
| 50 | |
| 51 | Check named template does not exist |
| 52 | CreateSession checkerservice http://localhost:8080 |
| 53 | &{headers}= Create Dictionary Accept=application/json |
| 54 | ${resp}= Get Request checkerservice /check_template/test/nosuchtemplate.yaml headers=${headers} |
| 55 | Should Be Equal As Strings ${resp.status_code} 404 |
| 56 | |
| 57 | Check delete existing namespace |
| 58 | CreateSession checkerservice http://localhost:8080 |
| 59 | &{headers}= Create Dictionary Accept=application/json |
| 60 | ${resp}= Delete Request checkerservice /check_template/test/ headers=${headers} |
| 61 | Log Response received from checker ${resp.text} |
| 62 | Should Be Equal As Strings ${resp.status_code} 200 |