blob: 45f20f248a194e4c5b8b887f984a4482bd38ef7f [file] [log] [blame]
eh552t9c0b4682017-08-21 11:10:11 +02001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
eh552t9c0b4682017-08-21 11:10:11 +02006
7
8*** Test Cases ***
9Get Requests health check ok
10 CreateSession clamp http://localhost:8080
11 ${resp}= Get Request clamp /restservices/clds/v1/clds/healthcheck
12 Should Be Equal As Strings ${resp.status_code} 200
13
14Put Requests to add template1 with yaml properties
15 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
16 Create Session clamp http://localhost:8080 auth=${auth}
17 ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate1.json
18 &{headers}= Create Dictionary Content-Type=application/json
19 ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template1 data=${data} headers=${headers}
20 Should Be Equal As Strings ${resp.status_code} 200
21
22Put Requests to add template2 with yaml properties
23 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
24 Create Session clamp http://localhost:8080 auth=${auth}
25 ${data}= Get Binary File ${CURDIR}${/}data${/}createTemplate2.json
26 &{headers}= Create Dictionary Content-Type=application/json
27 ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/template2 data=${data} headers=${headers}
28 Should Be Equal As Strings ${resp.status_code} 200
29
30Get Requests verify template1 and template2 found
31 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
32 Create Session clamp http://localhost:8080 auth=${auth}
33 ${resp}= Get Request clamp /restservices/clds/v1/cldsTempate/template-names
34 Should Be Equal As Strings ${resp.status_code} 200
35 Should Contain Match ${resp} *template1*
36 Should Contain Match ${resp} *template2*
37 Should Not Contain Match ${resp} *template99*
eh552tedc947f2017-08-25 18:00:32 +020038
39Put Requests to add Close Loop Model1
40 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
41 Create Session clamp http://localhost:8080 auth=${auth}
42 ${data}= Get Binary File ${CURDIR}${/}data${/}createModel1.json
43 &{headers}= Create Dictionary Content-Type=application/json
44 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model1 data=${data} headers=${headers}
45 Should Be Equal As Strings ${resp.status_code} 200
46
47Put Requests to add Close Loop Model2
48 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
49 Create Session clamp http://localhost:8080 auth=${auth}
50 ${data}= Get Binary File ${CURDIR}${/}data${/}createModel2.json
51 &{headers}= Create Dictionary Content-Type=application/json
52 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model2 data=${data} headers=${headers}
53 Should Be Equal As Strings ${resp.status_code} 200
54
55Get Requests verify Model1 and Model2 found
56 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
57 Create Session clamp http://localhost:8080 auth=${auth}
58 ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names
59 Should Be Equal As Strings ${resp.status_code} 200
60 Should Contain Match ${resp} *Model1*
61 Should Contain Match ${resp} *Model2*
62 Should Not Contain Match ${resp} *Model99*