Issue-ID: RIC-149
[it/test.git] / ric_robot_suite / helm / nanobot / configmap-src / public / resources / submgr_interface.robot
1 *** Settings ***
2 Documentation  Tests for the UE Event Collector XApp
3
4 Resource       /robot/resources/global_properties.robot
5 Resource       /robot/resources/ric/ric_utils.robot
6 Resource       /robot/resources/json_templater.robot
7
8 Library        String
9 Library        Collections
10 Library        XML
11 Library        RequestsLibrary
12 Library        UUID
13 Library        Process
14 Library        OperatingSystem
15
16 Library        KubernetesEntity  ${GLOBAL_RICPLT_NAMESPACE}
17
18 *** Variables ***
19 ${SUBMGR_BASE_PATH}    /ric/v1/health/alive
20
21
22 *** Keywords ***
23 Run submgr Health Check
24      [Documentation]    Runs SubMgr Health check
25      ${data_path}=      Set Variable    ${SUBMGR_BASE_PATH}
26      ${resp} =   Run Keyword    Run submgr GET Request  ${data_path}
27
28 Run submgr GET Request
29      [Documentation]  Make an HTTP GET request against the submgr
30      [Arguments]   ${data_path}
31      ${auth}=  Create List  ${GLOBAL_INJECTED_SUBMGR_USER}    ${GLOBAL_INJECTED_SUBMGR_PASSWORD}
32      ${c} =            Get From Dictionary  ${GLOBAL_RICPLT_COMPONENTS}  submgr
33      ${ctrl}  ${submgr1} =  Split String         ${c}       |
34      ${name} =  Run Keyword     RetrievePodsForDeployment       ${submgr1}
35      ${name1} = Set Variable    ${name[0]}
36      ${cType} =        Set Variable    Pod
37      ${ctrl1} = Run Keyword     ${cType}        ${name1}
38      ${podIP} = Set Variable    ${ctrl1.status.pod_ip}
39      Log To Console     ${podIP}
40      ${SUBMGR_ENDPOINT}=        Set Variable    ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${podIP}:${GLOBAL_SUBMGR_SERVER_PORT}
41      ${session}=    Create Session      robosubmgr      ${SUBMGR_ENDPOINT}   auth=${auth}
42      ${uuid}=    Generate UUID
43      ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
44      ${resp}=   Get Request     robosubmgr    ${data_path}     headers=${headers}
45      Log    Received response from SubMgr ${resp.text}
46      Should Be Equal As Strings        ${resp.status_code}     200
47      [Return]    ${resp}