9fb9d06dcc5538c7e629060ee5e4a6946416425a
[integration/csit.git] / tests / clamp / APIs / 01__Test_CL_APIs.robot
1 *** Settings ***
2 Library     Collections
3 Library     RequestsLibrary
4 Library     OperatingSystem
5 Library     json
6
7 *** Variables ***
8 ${login}                     admin
9 ${passw}                     password
10
11 *** Keywords ***
12 Create the sessions
13     ${auth}=    Create List     ${login}    ${passw}
14     Create Session   clamp  https://localhost:8443   auth=${auth}   disable_warnings=1
15     Set Global Variable     ${clamp_session}      clamp
16
17 *** Test Cases ***
18 Get Requests health check ok
19     Create the sessions
20     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v1/healthcheck
21     Should Be Equal As Strings  ${resp.status_code}     200
22
23 List TCAs
24     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/getAllNames
25     Should Contain Match    ${resp}   *Name1_tca*
26     Should Contain Match    ${resp}   *tca_2*
27     Should Contain Match    ${resp}   *Name1_tca_3*
28
29 Open TCA1
30     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/LOOP_yHsgu_v1_0_ResourceInstanceName1_tca
31     Should Contain Match    ${resp}   *Name1_tca*
32     Should Contain Match    ${resp}   *Operational Policy Item*
33     Should Contain Match    ${resp}   *Operational policies*
34
35 Open TCA2
36     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/LOOP_yHsgu_v1_0_ResourceInstanceName2_tca_2
37     Should Contain Match    ${resp}   *Name2_tca_2*
38     Should Contain Match    ${resp}   *Operational Policy Item*
39     Should Contain Match    ${resp}   *1004*
40     Should Contain Match    ${resp}   *TCA Policy Scope*
41
42 Open TCA3
43     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/LOOP_yHsgu_v1_0_ResourceInstanceName1_tca_3
44     Should Contain Match    ${resp}   *Name1_tca_3*
45     Should Contain Match    ${resp}   *Operational Policy Item*
46     Should Contain Match    ${resp}   *1004*
47     Should Contain Match    ${resp}   *TCA Policy Scope*