Fix test for clamp-backend and frontend new UI
[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_ejh5S_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     Should Contain Match    ${resp}   *Micro Service policies UPDATED*
35
36 Open TCA2
37     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName2_tca_2
38     Should Contain Match    ${resp}   *Name2_tca_2*
39     Should Contain Match    ${resp}   *Operational Policy Item*
40     Should Contain Match    ${resp}   *1004*
41     Should Contain Match    ${resp}   *TCA Policy Scope*
42
43 Open TCA3
44     ${resp}=    Get Request    ${clamp_session}   /restservices/clds/v2/loop/LOOP_ejh5S_v1_0_ResourceInstanceName1_tca_3
45     Should Contain Match    ${resp}   *Name1_tca_3*
46     Should Contain Match    ${resp}   *Operational Policy Item*
47     Should Contain Match    ${resp}   *1004*
48     Should Contain Match    ${resp}   *TCA Policy Scope*