eh552t | 9c0b468 | 2017-08-21 11:10:11 +0200 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Library Collections |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library json |
| 6 | Library HttpLibrary.HTTP |
| 7 | |
| 8 | |
| 9 | *** Test Cases *** |
| 10 | Get Requests health check ok |
| 11 | CreateSession clamp http://localhost:8080 |
| 12 | ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck |
| 13 | Should Be Equal As Strings ${resp.status_code} 200 |
| 14 | |
| 15 | Put Requests to add template1 with yaml properties |
| 16 | ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 |
| 17 | Create Session clamp http://localhost:8080 auth=${auth} |
| 18 | ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate1.json |
| 19 | &{headers}= Create Dictionary Content-Type=application/json |
| 20 | ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template1 data=${data} headers=${headers} |
| 21 | Should Be Equal As Strings ${resp.status_code} 200 |
| 22 | |
| 23 | Put Requests to add template2 with yaml properties |
| 24 | ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 |
| 25 | Create Session clamp http://localhost:8080 auth=${auth} |
| 26 | ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate2.json |
| 27 | &{headers}= Create Dictionary Content-Type=application/json |
| 28 | ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template2 data=${data} headers=${headers} |
| 29 | Should Be Equal As Strings ${resp.status_code} 200 |
| 30 | |
| 31 | Get Requests verify template1 and template2 found |
| 32 | ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99 |
| 33 | Create Session clamp http://localhost:8080 auth=${auth} |
| 34 | ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names |
| 35 | Should Be Equal As Strings ${resp.status_code} 200 |
| 36 | Should Contain Match ${resp} *template1* |
| 37 | Should Contain Match ${resp} *template2* |
| 38 | Should Not Contain Match ${resp} *template99* |