blob: e4837a66a40690e778dc45bfdbc9480664e82507 [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
eh552t10d13032017-09-15 14:47:45 +020014Put Requests to add TCA template1 with yaml properties
eh552t9c0b4682017-08-21 11:10:11 +020015 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
16 Create Session clamp http://localhost:8080 auth=${auth}
eh552t10d13032017-09-15 14:47:45 +020017 ${data}= Get Binary File ${CURDIR}${/}data${/}createTCATemplate1.json
eh552t9c0b4682017-08-21 11:10:11 +020018 &{headers}= Create Dictionary Content-Type=application/json
eh552t10d13032017-09-15 14:47:45 +020019 ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/TCATemplate1 data=${data} headers=${headers}
eh552t9c0b4682017-08-21 11:10:11 +020020 Should Be Equal As Strings ${resp.status_code} 200
21
eh552t10d13032017-09-15 14:47:45 +020022Put Requests to add TCA template2 with yaml properties
eh552t9c0b4682017-08-21 11:10:11 +020023 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
24 Create Session clamp http://localhost:8080 auth=${auth}
eh552t10d13032017-09-15 14:47:45 +020025 ${data}= Get Binary File ${CURDIR}${/}data${/}createTCATemplate2.json
eh552t9c0b4682017-08-21 11:10:11 +020026 &{headers}= Create Dictionary Content-Type=application/json
eh552t10d13032017-09-15 14:47:45 +020027 ${resp}= Put Request clamp /restservices/clds/v1/cldsTempate/template/TCATemplate2 data=${data} headers=${headers}
eh552t9c0b4682017-08-21 11:10:11 +020028 Should Be Equal As Strings ${resp.status_code} 200
29
eh552t10d13032017-09-15 14:47:45 +020030Get Requests verify TCA template1 and template2 found
eh552t9c0b4682017-08-21 11:10:11 +020031 ${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
eh552t10d13032017-09-15 14:47:45 +020035 Should Contain Match ${resp} *TCATemplate1*
36 Should Contain Match ${resp} *TCATemplate2*
37 Should Not Contain Match ${resp} *TCATemplate99*
eh552tedc947f2017-08-25 18:00:32 +020038
eh552t10d13032017-09-15 14:47:45 +020039Put Requests to add Close Loop TCA Model1
eh552tedc947f2017-08-25 18:00:32 +020040 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
41 Create Session clamp http://localhost:8080 auth=${auth}
eh552t10d13032017-09-15 14:47:45 +020042 ${data}= Get Binary File ${CURDIR}${/}data${/}createTCAModel1.json
eh552tedc947f2017-08-25 18:00:32 +020043 &{headers}= Create Dictionary Content-Type=application/json
eh552t10d13032017-09-15 14:47:45 +020044 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/TCAModel1 data=${data} headers=${headers}
eh552tedc947f2017-08-25 18:00:32 +020045 Should Be Equal As Strings ${resp.status_code} 200
46
eh552t10d13032017-09-15 14:47:45 +020047Put Requests to add Close Loop TCA Model2
eh552tedc947f2017-08-25 18:00:32 +020048 ${auth}= Create List admin 5f4dcc3b5aa765d61d8327deb882cf99
49 Create Session clamp http://localhost:8080 auth=${auth}
eh552t10d13032017-09-15 14:47:45 +020050 ${data}= Get Binary File ${CURDIR}${/}data${/}createTCAModel2.json
eh552tedc947f2017-08-25 18:00:32 +020051 &{headers}= Create Dictionary Content-Type=application/json
eh552t10d13032017-09-15 14:47:45 +020052 ${resp}= Put Request clamp /restservices/clds/v1/clds/model/TCAModel2 data=${data} headers=${headers}
eh552tedc947f2017-08-25 18:00:32 +020053 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
eh552t10d13032017-09-15 14:47:45 +020060 Should Contain Match ${resp} *TCAModel1*
61 Should Contain Match ${resp} *TCAModel2*
62 Should Not Contain Match ${resp} *TCAModel99*