X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Fhelm%2Fnanobot%2Fconfigmap-src%2Fpublic%2Fresources%2Fsubmgr_interface.robot;h=0b3ba35294c369d2ca7ea4f42dd76c6107b84e50;hb=aa2ab0104a1271f523576b5e0bfbd566ebdce409;hp=65722f47ce7b6502f854f77b42f7bbc8483ce2e3;hpb=427c16323bdc11b3ffa338ce51a2d509698ce7db;p=it%2Ftest.git diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/resources/submgr_interface.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/resources/submgr_interface.robot index 65722f4..0b3ba35 100644 --- a/ric_robot_suite/helm/nanobot/configmap-src/public/resources/submgr_interface.robot +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/resources/submgr_interface.robot @@ -10,20 +10,22 @@ Library Collections Library XML Library RequestsLibrary Library UUID -Library Process +Library Process Library OperatingSystem Library KubernetesEntity ${GLOBAL_RICPLT_NAMESPACE} *** Variables *** ${SUBMGR_BASE_PATH} /ric/v1/health/alive +${SUBMGR_SUBDATA_PATH} /ric/v1/subscriptions +${gnb_id} = Set Variable ${GLOBAL_GNBID} *** Keywords *** Run submgr Health Check [Documentation] Runs SubMgr Health check - ${data_path}= Set Variable ${SUBMGR_BASE_PATH} - ${resp} = Run Keyword Run submgr GET Request ${data_path} + ${data_path}= Set Variable ${SUBMGR_BASE_PATH} + ${resp} = Run Keyword Run submgr GET Request ${data_path} Run submgr GET Request [Documentation] Make an HTTP GET request against the submgr @@ -31,17 +33,84 @@ Run submgr GET Request ${auth}= Create List ${GLOBAL_INJECTED_SUBMGR_USER} ${GLOBAL_INJECTED_SUBMGR_PASSWORD} ${c} = Get From Dictionary ${GLOBAL_RICPLT_COMPONENTS} submgr ${ctrl} ${submgr1} = Split String ${c} | - ${name} = Run Keyword RetrievePodsForDeployment ${submgr1} - ${name1} = Set Variable ${name[0]} + ${name} = Run Keyword RetrievePodsForDeployment ${submgr1} + ${name1} = Set Variable ${name[0]} + Log To Console ${name1} ${cType} = Set Variable Pod - ${ctrl1} = Run Keyword ${cType} ${name1} - ${podIP} = Set Variable ${ctrl1.status.pod_ip} - Log To Console ${podIP} - ${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${podIP}:${GLOBAL_SUBMGR_SERVER_PORT} - ${session}= Create Session robosubmgr ${SUBMGR_ENDPOINT} auth=${auth} + ${ctrl1} = Run Keyword ${cType} ${name1} + ${podIP} = Set Variable ${ctrl1.status.pod_ip} + Log To Console ${podIP} + #${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${GLOBAL_SUBMGR_HTTP_SERVER}:${GLOBAL_SUBMGR_PORT} + ${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${podIP}:8080 + ${session}= Create Session robosubmgr ${SUBMGR_ENDPOINT} auth=${auth} ${uuid}= Generate UUID - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${resp}= Get Request robosubmgr ${data_path} headers=${headers} Log Received response from SubMgr ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 [Return] ${resp} + +Run submgr SUBSCRIPTIONGET Request + [Documentation] Make an HTTP GET request against the submgr + [Arguments] ${sub_data_path} + ${auth}= Create List ${GLOBAL_INJECTED_SUBMGR_USER} ${GLOBAL_INJECTED_SUBMGR_PASSWORD} + ${c} = Get From Dictionary ${GLOBAL_RICPLT_COMPONENTS} submgr + ${ctrl} ${submgr1} = Split String ${c} | + ${name} = Run Keyword RetrievePodsForDeployment ${submgr1} + ${name1} = Set Variable ${name[0]} + Log To Console ${name1} + ${cType} = Set Variable Pod + ${ctrl1} = Run Keyword ${cType} ${name1} + ${podIP} = Set Variable ${ctrl1.status.pod_ip} + Log To Console ${podIP} + #${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${GLOBAL_SUBMGR_HTTP_SERVER}:${GLOBAL_SUBMGR_PORT} + ${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${podIP}:8088 + Log To Console ${SUBMGR_ENDPOINT} + ${session}= Create Session subscriptioncheck ${SUBMGR_ENDPOINT} auth=${auth} + ${uuid}= Generate UUID + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request subscriptioncheck ${sub_data_path} headers=${headers} + Log To Console ${resp} + Log TO Console ${resp.text} + Log TO Console ${gnb_id} + ${ret} = Run Keyword And Return Status Should Contain ${resp.text} "${GLOBAL_GNBID}" + [Return] ${ret} + + + +Run submgr SUBSCRIPTIONMERGE Check + [Documentation] Make an HTTP GET request against the submgr + [Arguments] ${sub_data_path} + ${auth}= Create List ${GLOBAL_INJECTED_SUBMGR_USER} ${GLOBAL_INJECTED_SUBMGR_PASSWORD} + ${c} = Get From Dictionary ${GLOBAL_RICPLT_COMPONENTS} submgr + ${ctrl} ${submgr1} = Split String ${c} | + ${name} = Run Keyword RetrievePodsForDeployment ${submgr1} + ${name1} = Set Variable ${name[0]} + Log To Console ${name1} + ${cType} = Set Variable Pod + ${ctrl1} = Run Keyword ${cType} ${name1} + ${podIP} = Set Variable ${ctrl1.status.pod_ip} + Log To Console ${podIP} + #${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${GLOBAL_SUBMGR_HTTP_SERVER}:${GLOBAL_SUBMGR_PORT} + ${SUBMGR_ENDPOINT}= Set Variable ${GLOBAL_SUBMGR_SERVER_PROTOCOL}://${podIP}:8088 + Log To Console ${SUBMGR_ENDPOINT} + ${session}= Create Session subscriptioncheck1 ${SUBMGR_ENDPOINT} auth=${auth} + ${uuid}= Generate UUID + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Get Request subscriptioncheck1 ${sub_data_path} headers=${headers} + Log To Console ${resp} + Log TO Console ${resp.text} + Log TO Console ${gnb_id} + @{jsonoutput} = To Json ${resp.text} + Log TO Console ${jsonoutput} + FOR ${item} IN @{jsonoutput} + Log To Console ${item} + ${json}= Set variable ${item['Endpoint']} + ${len_endpointfromjson} = Get Length ${json} + Log To Console ${json} + Log To Console ${len_endpointfromjson} + ${ret} = Run Keyword And Return Status Should Be Equal As Integers ${len_endpointfromjson} 2 + Log To Console ${ret} + END + [Return] ${ret} +