blob: b1fb0f44059c881b4be420161ec8e0851624d510 [file] [log] [blame]
eh552t9c0b4682017-08-21 11:10:11 +02001*** Settings ***
2Library Collections
3Library RequestsLibrary
4Library OperatingSystem
5Library json
6Library HttpLibrary.HTTP
7
8
9*** Test Cases ***
10Get 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
15Put 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
23Put 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
31Get 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*
eh552tedc947f2017-08-25 18:00:32 +020039
40Put Requests to add Close Loop Model1
41 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
42 Create Session clamp http://localhost:8080 auth=${auth}
43 ${data}= Get Binary File ${CURDIR}${/}data${/}createModel1.json
44 &{headers}= Create Dictionary Content-Type=application/json
45 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model1 data=${data} headers=${headers}
46 Should Be Equal As Strings ${resp.status_code} 200
47
48Put Requests to add Close Loop Model2
49 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
50 Create Session clamp http://localhost:8080 auth=${auth}
51 ${data}= Get Binary File ${CURDIR}${/}data${/}createModel2.json
52 &{headers}= Create Dictionary Content-Type=application/json
53 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/Model2 data=${data} headers=${headers}
54 Should Be Equal As Strings ${resp.status_code} 200
55
56Get Requests verify Model1 and Model2 found
57 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
58 Create Session clamp http://localhost:8080 auth=${auth}
59 ${resp}= Get Request clamp /restservices/clds/v1/clds/model-names
60 Should Be Equal As Strings ${resp.status_code} 200
61 Should Contain Match ${resp} *Model1*
62 Should Contain Match ${resp} *Model2*
63 Should Not Contain Match ${resp} *Model99*