From: himeshshukla Date: Wed, 8 Dec 2021 07:35:51 +0000 (+0530) Subject: Issue ID: RIC-779: xAPP Functionality Enhancement- Subscription Duplication Automation X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=aa2ab0104a1271f523576b5e0bfbd566ebdce409;p=it%2Ftest.git Issue ID: RIC-779: xAPP Functionality Enhancement- Subscription Duplication Automation Subscription Duplication Scenario 1 and 2 code committed Updated README file Added keywords to submgr_interface.robot Added new parameters to global_properties.robot Added test suites to: Subscription_Duplication_Scen1.robot Subscription_Duplication_Scen2.robot Updated values.yaml Signed-off-by: himeshshukla Sangeeth-kr Change-Id: Icfe7e721e7968fbcfbe52ceebbd81e03350a085b --- diff --git a/ric_robot_suite/helm/nanobot/README b/ric_robot_suite/helm/nanobot/README index 51639ff..64ff5a6 100644 --- a/ric_robot_suite/helm/nanobot/README +++ b/ric_robot_suite/helm/nanobot/README @@ -85,6 +85,94 @@ ric_robot_suite/helm/nanobot/values.yaml. 3.Add testsuites name based on our testing. Note: Only one xapp to E2sim test is possible. +================================================================================================================================================================================== +Subscription Duplication Deployment +==================================== +The above E2sim deployment procedures are same. For Bouncer xApp deployment please follow up below steps. + +Scenario-1: +========== +Deploy 2 bouncer xapps with intermission delay of 2 to 5secs. +1. Use 2 different paths for 2 xapps configfile and modify xappname based on your requirement in configfile. + +2.Use local config file shared path for preparing an xApp onboarding: + +examples: +echo '{"config-file.json_url": "https://${hostname}:8090/config.json" }' > onboard.bouncer.url +echo '{"config-file.json_url": "https://${hostname}:8090/anotherxapp/config.json" }' > onboard.bouncer_another.url + +3. Onboarding xApps: +Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters. +curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer.url" +curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer_another.url" + +4. Checking the on-boarded charts: +curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts" + +5. Deploying Xapp: +curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp"}' +delay 2 to 5secs +curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp_1"}' + +Once Xapp deployed + +1.Checkout the it/test repo +2.Modify Values.yaml based on your Xapp deployment- 2 Xapp names and E2sim deployment with PLMID, GNBID update. +ric_robot_suite/helm/nanobot/values.yaml. +3.Add testsuites name "subscription_duplication_scenario1". +Note: Only bouncer xapps to E2sim test possible. + + +Scenario-2: +=========== +Deploy 1 bouncer xapp by following the below procedure + +1.Use local config file shared path for preparing an xApp onboarding: + +examples: +echo '{"config-file.json_url": "https://${hostname}:8090/config.json" }' > onboard.bouncer.url + +2. Onboarding xApps: +Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters. +curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer.url" + +3. Checking the on-boarded charts: +curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts" + +4. Deploying Xapp: +curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp"}' + +Ensure on bouncer xapp logs to check upto indication packets received from E2sim. + +Deploy 2 bouncer xapp + +1.Use local config file shared path for preparing an xApp onboarding: + +examples: +echo '{"config-file.json_url": "https://${hostname}:8090/anotherxapp/config.json" }' > onboard.bouncer_another.url + +2. Onboarding xApps: +Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters. +curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer_another.url" + +4. Checking the on-boarded charts: +curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts" + +5. Deploying Xapp: +curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp_1"}' + + +Once Xapp deployed + +1.Checkout the it/test repo +2.Modify Values.yaml based on your Xapp deployment- 2 Xapp names and E2sim deployment with PLMID, GNBID update. +ric_robot_suite/helm/nanobot/values.yaml. +3.Add testsuites name "subscription_duplication_scenario2" . +Note: Only bouncer xapps to E2sim tests possible. + + +=============================================================================================================================================== + Follow the below steps for nanobot testing. USING THE CHART To install the chart (which creates and runs a single Kubernetes job), diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/properties/global_properties.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/properties/global_properties.robot index d789387..08d83ae 100644 --- a/ric_robot_suite/helm/nanobot/configmap-src/public/properties/global_properties.robot +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/properties/global_properties.robot @@ -133,8 +133,8 @@ ${GLOBAL_DASH_SERVER_PROTOCOL} {{ default "http" .Values.ric.robot. ${GLOBAL_DASH_SERVER_PORT} {{ default "31080" .Values.ric.robot.environment.dashboard.port }} ${GLOBAL_INJECTED_DASH_IP_ADDR} {{ default "127.0.0.1" .Values.ric.robot.environment.dashboard.port }} ${GLOBAL_XAPP} {{ .Values.ric.robot.environment.xapp }} +${GLOBAL_DUPLICATE_XAPP} {{ .Values.ric.robot.environment.duplicate_xapp }} ${GLOBAL_XAPP_DEPLOYMENT} {{ printf "%s-%s" ($xappNS) .Values.ric.robot.environment.xapp }} ${GLOBAL_XAPPKPIMON_DEPLOYMENT} {{ printf "%s" .Values.ric.robot.environment.xapp }} ${Global_RAN_NAMESPACE} {{ .Values.ric.robot.environment.gNodeB.ran_namespace }} ${Global_RAN_DEPLOYMENT} {{ .Values.ric.robot.environment.gNodeB.ran_deployment }} - 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} + diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen1.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen1.robot new file mode 100644 index 0000000..47f4eb2 --- /dev/null +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen1.robot @@ -0,0 +1,219 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +Documentation Executes the End To End Test cases +... +Resource /robot/resources/appmgr_interface.robot +Resource /robot/resources/negative_appmgr_tests.robot +Resource /robot/resources/e2mgr_interface.robot +Resource /robot//resources/dashboard_interface.robot +Resource /robot/resources/global_properties.robot +Resource /robot/resources/ric/ric_utils.robot +Resource /robot/resources/e2term_interface.robot +Resource /robot/resources/submgr_interface.robot + +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library KubernetesEntity ricplt +Library String + +*** Variables *** +${TEST_XAPPNAME} ${GLOBAL_TEST_XAPP} +${TEST_NODE_B_NAME} ${GLOBAL_TEST_NODEB_NAME} +${TEST_NODE_B_IP} ${GLOBAL_TEST_NODEB_ADDRESS} +${TEST_NODE_B_PORT} ${GLOBAL_TEST_NODEB_PORT} +${ricxapp_POD_NAME} ${GLOBAL_XAPP_NAMESPACE}-${GLOBAL_XAPP} +${TEST_XAPP_ONBOARDER} ${GLOBAL_TEST_XAPP_ONBOARDER} + +*** Keywords *** +Keyword Check subreq + [Arguments] ${linematch} + ${result_subreq} = Set variable 1 + Set Global Variable ${result_subreq} + ${messages} = Split String ${linematch} , + Log To Console ${messages} + ${ts} = Get From List ${messages} 0 + Log To Console ${ts} + ${timestamp1} = Split String ${ts} : + ${timestampval1} = Get From List ${timestamp1} 1 + Log To Console ${timestampval1} + Set Global Variable ${timestampval1} + +Keyword Check No subreq + ${checkNosubreq} = Set Variable 1 + + +Keyword Check subres + [Arguments] ${linematch} + ${result_subres} = Set variable 1 + Set Global Variable ${result_subres} + ${messages1} = Split String ${linematch} , + Log To Console ${messages1} + ${ts1} = Get From List ${messages1} 0 + Log To Console ${ts1} + ${timestamp2} = Split String ${ts1} : + ${timestampval2} = Get From List ${timestamp2} 1 + Log To Console ${timestampval2} + Set Global Variable ${timestampval2} + +Keyword Check No subres + ${checkNosubres} = Set Variable 1 + + +Keyword Check IndMessage + [Arguments] ${linematch} + ${result_Ind1} = Set Variable 1 + Set Global Variable ${result_Ind1} + ${messages} = Split String ${linematch} : + Log To Console ${messages} + ${timestampval_ind1} = Get From List ${messages} 1 + Log To Console ${timestampval_ind1} + Set Global Variable ${timestampval_ind1} + Append To List ${IndMessgList} ${timestampval_ind1} + +Keyword Check No IndMsg + ${checkNoindication} = Set Variable 1 + +Keyword Check ControlMsg + [Arguments] ${linematch} + ${result_ctrl1} = Set Variable 1 + Set Global Variable ${result_ctrl1} + ${messages1} = Split String ${linematch} : + Log To Console ${messages1} + ${timestampval_ctrl1} = Get From List ${messages1} 1 + Log To Console ${timestampval_ctrl1} + Set Global Variable ${timestampval_ctrl1} + Append To List ${ContMessgList} ${timestampval_ctrl1} + +Keyword Check No CtrlMsg + ${checkNocontrol} = Set Variable 1 + + +*** Test Cases *** +Test XApp Manager Health + [Tags] etetests xapptests + Run AppMgr Health Check + + +Ensure RIC Xapp Onboarder is deployed and available + [Tags] etetests xapptests + ${controllerName} = Set Variable ${GLOBAL_TEST_XAPP_ONBOARDER} + ${cType} ${name} = Split String ${controllerName} | + Log To Console ${cType} + ${ctrl} = Run Keyword ${cType} ${name} + Should Be Equal ${ctrl.status.replicas} ${ctrl.status.ready_replicas} + +Ensure E2Sim is deployed and available + [Tags] etetests xapptests + ${ctrl} = Run Keyword deployment ${Global_RAN_DEPLOYMENT} ${Global_RAN_NAMESPACE} + Should Be Equal ${ctrl.status.replicas} ${ctrl.status.ready_replicas} +#Before doing this kept configfile.json in to shared path and create url +#onboard the xapp using onboard link + +Attempt To Undeploy An Already Undeployed XApp + [Tags] etetests xapptests intrusive + Undeploy Nondeployed XApp And Expect Error + +Attempt To Request A Nonexistent XApp + [Tags] etetests xapptests intrusive + Request Nonexistent XApp And Expect Error + +Get All NodeBs Via E2Mgr + [Tags] e2mgrtest etetests e2setup x2setup + ${log} = Run E2Mgr Get All NodeBs Request + FOR ${item} IN @{log.json()} + Log To Console ${item} + ${json}= Set variable ${item['globalNbId']["plmnId"]} + Log To Console ${json} + #Should Be Equal ${json} ${GLOBAL_PLMNID} + Exit For Loop If "${json}" == "${GLOBAL_PLMNID}" + Log ${json} + END + +Get All E2T Via E2Mgr + [Tags] e2mgrtests etetests e2setup x2setup + ${log} = Run E2Mgr Get All E2T Request + Log To Console ${log} + +Get NodeB Request Via E2Mgr + [Tags] e2mgrtests etetests e2setup x2setup + Run E2Mgr Get NodeB Request ${GLOBAL_GNBID} + + +RetriveLog From XAPP + [Tags] etetests xapptests intrusive + ${podname} = Run Keyword RetrievePodsForDeployment ${GLOBAL_XAPP_DEPLOYMENT} namespace=ricxapp + Log To Console ${podname} + ${ric_xapp_pod1} = Set Variable ${podname[0]} + Log To Console ${ric_xapp_pod1} + ${log1} = Run keyword RetrieveLogForPod ${ric_xapp_pod1} namespace=ricxapp + ${stringLog} Convert To String ${log1} + Set Global Variable ${stringLog} + Set Global Variable ${log1} + +RetriveLog From duplicate XAPP + [Tags] etetests xapptests intrusive + ${podname} = Run Keyword RetrievePodsForDeployment ${GLOBAL_DUPLICATE_XAPP} namespace=ricxapp + Log To Console ${podname} + ${ric_xapp_pod2} = Set Variable ${podname[0]} + Log To Console ${ric_xapp_pod2} + ${log2} = Run keyword RetrieveLogForPod ${ric_xapp_pod2} namespace=ricxapp + ${stringLog1} Convert To String ${log2} + Set Global Variable ${stringLog1} + Set Global Variable ${log2} + + +Verifying Subscription Request From Xapp + [Tags] etetests xapptests + Sleep 80 + Log To Console "Sending Subscription Message from Xapp" + Should Match Regexp ${stringLog} Transmitted subscription request + +Verifying Subscription Request From AnotherXapp + [Tags] etetests xapptests + Sleep 10 + Log To Console "Sending Subscription Message from Xapp" + Should Match Regexp ${stringLog1} Transmitted subscription request + +Verifying Subscription Requests on Submgr + [Tags] etetests xapptests + Sleep 20 + Log To Console "Verifying the Subscription Requests on submgr" + ${subvalidation} = Run Keyword Run submgr SUBSCRIPTIONGET Request /ric/v1/subscriptions + Should Be Equal As Strings ${subvalidation} True + + +Verifying Subscription Merge Requests on Submgr + [Tags] etetests xapptests + Log To Console "Verifying the Subscription Merge on submgr" + ${subvalidation1} = Run Keyword Run submgr SUBSCRIPTIONMERGE Check /ric/v1/subscriptions + Should Be Equal As Strings ${subvalidation1} True + +Verifying Subscription Response From E2sim + [Tags] etetests xapptests + Log To Console "Received Subscription Message from RAN" + Should Match Regexp ${stringLog} Received subscription message of type = 12011 + +Verifying Ric Indication on Xapp + [Tags] etetests xapptests + Log To Console "Received Indication Message from RAN" + Should Match Regexp ${stringLog} Received indication message of type = 12050 + +Verifying Control message on Xapp + [Tags] etetests xapptests + Log To Console "Verified Control message from Xapp" + Should Match Regexp ${stringLog} Bouncer Control OK + diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen2.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen2.robot new file mode 100644 index 0000000..8cece2b --- /dev/null +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/Subscription_Duplication_Scen2.robot @@ -0,0 +1,230 @@ +# Copyright (c) 2019 AT&T Intellectual Property. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +Documentation Executes the End To End Test cases +... +Resource /robot/resources/appmgr_interface.robot +Resource /robot/resources/negative_appmgr_tests.robot +Resource /robot/resources/e2mgr_interface.robot +Resource /robot//resources/dashboard_interface.robot +Resource /robot/resources/global_properties.robot +Resource /robot/resources/ric/ric_utils.robot +Resource /robot/resources/e2term_interface.robot +Resource /robot/resources/submgr_interface.robot +#Resource /robot/testsuites/bouncer_dms_cli.robot +#Resource /opt/ric/robot/bouncer_dms_cli.robot + +Library Process +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library KubernetesEntity ricplt +Library String + +*** Variables *** +${TEST_XAPPNAME} ${GLOBAL_TEST_XAPP} +${TEST_NODE_B_NAME} ${GLOBAL_TEST_NODEB_NAME} +${TEST_NODE_B_IP} ${GLOBAL_TEST_NODEB_ADDRESS} +${TEST_NODE_B_PORT} ${GLOBAL_TEST_NODEB_PORT} +${ricxapp_POD_NAME} ${GLOBAL_XAPP_NAMESPACE}-${GLOBAL_XAPP} +${TEST_XAPP_ONBOARDER} ${GLOBAL_TEST_XAPP_ONBOARDER} + +*** Keywords *** +Keyword Check subreq + [Arguments] ${linematch} + ${result_subreq} = Set variable 1 + Set Global Variable ${result_subreq} + ${messages} = Split String ${linematch} , + Log To Console ${messages} + ${ts} = Get From List ${messages} 0 + Log To Console ${ts} + ${timestamp1} = Split String ${ts} : + ${timestampval1} = Get From List ${timestamp1} 1 + Log To Console ${timestampval1} + Set Global Variable ${timestampval1} + +Keyword Check No subreq + ${checkNosubreq} = Set Variable 1 + + +Keyword Check subres + [Arguments] ${linematch} + ${result_subres} = Set variable 1 + Set Global Variable ${result_subres} + ${messages1} = Split String ${linematch} , + Log To Console ${messages1} + ${ts1} = Get From List ${messages1} 0 + Log To Console ${ts1} + ${timestamp2} = Split String ${ts1} : + ${timestampval2} = Get From List ${timestamp2} 1 + Log To Console ${timestampval2} + Set Global Variable ${timestampval2} + +Keyword Check No subres + ${checkNosubres} = Set Variable 1 + + +Keyword Check IndMessage + [Arguments] ${linematch} + ${result_Ind1} = Set Variable 1 + Set Global Variable ${result_Ind1} + ${messages} = Split String ${linematch} : + Log To Console ${messages} + ${timestampval_ind1} = Get From List ${messages} 1 + Log To Console ${timestampval_ind1} + Set Global Variable ${timestampval_ind1} + Append To List ${IndMessgList} ${timestampval_ind1} + +Keyword Check No IndMsg + ${checkNoindication} = Set Variable 1 + +Keyword Check ControlMsg + [Arguments] ${linematch} + ${result_ctrl1} = Set Variable 1 + Set Global Variable ${result_ctrl1} + ${messages1} = Split String ${linematch} : + Log To Console ${messages1} + ${timestampval_ctrl1} = Get From List ${messages1} 1 + Log To Console ${timestampval_ctrl1} + Set Global Variable ${timestampval_ctrl1} + Append To List ${ContMessgList} ${timestampval_ctrl1} + +Keyword Check No CtrlMsg + ${checkNocontrol} = Set Variable 1 + + +*** Test Cases *** +Test XApp Manager Health + [Tags] etetests xapptests + Run AppMgr Health Check + + +Ensure RIC Xapp Onboarder is deployed and available + [Tags] etetests xapptests + ${controllerName} = Set Variable ${GLOBAL_TEST_XAPP_ONBOARDER} + ${cType} ${name} = Split String ${controllerName} | + Log To Console ${cType} + ${ctrl} = Run Keyword ${cType} ${name} + Should Be Equal ${ctrl.status.replicas} ${ctrl.status.ready_replicas} + +Ensure E2Sim is deployed and available + [Tags] etetests xapptests + ${ctrl} = Run Keyword deployment ${Global_RAN_DEPLOYMENT} ${Global_RAN_NAMESPACE} + Should Be Equal ${ctrl.status.replicas} ${ctrl.status.ready_replicas} + +Attempt To Undeploy An Already Undeployed XApp + [Tags] etetests xapptests intrusive + Undeploy Nondeployed XApp And Expect Error + +Attempt To Request A Nonexistent XApp + [Tags] etetests xapptests intrusive + Request Nonexistent XApp And Expect Error + +#Verify plmnid via E2mgr +Get All NodeBs Via E2Mgr + [Tags] e2mgrtest etetests e2setup x2setup + ${log} = Run E2Mgr Get All NodeBs Request + FOR ${item} IN @{log.json()} + Log To Console ${item} + ${json}= Set variable ${item['globalNbId']["plmnId"]} + Log To Console ${json} + #Should Be Equal ${json} ${GLOBAL_PLMNID} + Exit For Loop If "${json}" == "${GLOBAL_PLMNID}" + Log ${json} + END + +Get All E2T Via E2Mgr + [Tags] e2mgrtests etetests e2setup x2setup + ${log} = Run E2Mgr Get All E2T Request + Log To Console ${log} + +#Verify gnbid via E2mgr +Get All NodeBs Via E2Mgr + [Tags] e2mgrtest etetests e2setup x2setup + ${log} = Run E2Mgr Get All NodeBs Request + FOR ${item} IN @{log.json()} + Log To Console ${item} + ${json}= Set variable ${item['inventoryName']} + Log To Console ${json} + Exit For Loop If "${json}" == "${GLOBAL_GNBID}" + Log ${json} + END + +RetriveLog From XAPP + [Tags] etetests xapptests intrusive + ${podname} = Run Keyword RetrievePodsForDeployment ${GLOBAL_XAPP_DEPLOYMENT} namespace=ricxapp + Log To Console ${podname} + ${ric_xapp_pod1} = Set Variable ${podname[0]} + Log To Console ${ric_xapp_pod1} + ${log1} = Run keyword RetrieveLogForPod ${ric_xapp_pod1} namespace=ricxapp + ${stringLog} Convert To String ${log1} + Set Global Variable ${stringLog} + Set Global Variable ${log1} + + +Verifying Subscription Request From Xapp + [Tags] etetests xapptests + Sleep 80 + Log To Console "Sending Subscription Message from Xapp" + Should Match Regexp ${stringLog} Transmitted subscription request + + +Verifying Subscription Requests on Submgr + [Tags] etetests xapptests + Sleep 20 + Log To Console "Verifying the Subscription Requests on submgr" + ${subvalidation} = Run Keyword Run submgr SUBSCRIPTIONGET Request /ric/v1/subscriptions + Should Be Equal As Strings ${subvalidation} True + + +Verifying Subscription Response From E2sim + [Tags] etetests xapptests + Log To Console "Received Subscription Message from RAN" + Should Match Regexp ${stringLog} Received subscription message of type = 12011 + +Verifying Ric Indication on Xapp + [Tags] etetests xapptests + Log To Console "Received Indication Message from RAN" + Should Match Regexp ${stringLog} Received indication message of type = 12050 + +Verifying Control message on Xapp + [Tags] etetests xapptests + Log To Console "Verified Control message from Xapp" + Should Match Regexp ${stringLog} Bouncer Control OK + +RetriveLog From duplicate XAPP + [Tags] etetests xapptests intrusive + ${podname} = Run Keyword RetrievePodsForDeployment ${GLOBAL_DUPLICATE_XAPP} namespace=ricxapp + Log To Console ${podname} + ${ric_xapp_pod2} = Set Variable ${podname[0]} + Log To Console ${ric_xapp_pod2} + ${log2} = Run keyword RetrieveLogForPod ${ric_xapp_pod2} namespace=ricxapp + ${stringLog1} Convert To String ${log2} + Set Global Variable ${stringLog1} + Set Global Variable ${log2} + +Verifying Subscription Requests on Submgr + [Tags] etetests xapptests + Sleep 20 + Log To Console "Verifying the Subscription Requests on submgr" + ${subvalidation} = Run Keyword Run submgr SUBSCRIPTIONGET Request /ric/v1/subscriptions + Should Be Equal As Strings ${subvalidation} True + +Verifying Subscription Merge Requests on Submgr + [Tags] etetests xapptests + Log To Console "Verifying the Subscription Merge on submgr" + ${subvalidation1} = Run Keyword Run submgr SUBSCRIPTIONMERGE Check /ric/v1/subscriptions + Should Be Equal As Strings ${subvalidation1} True + diff --git a/ric_robot_suite/helm/nanobot/values.yaml b/ric_robot_suite/helm/nanobot/values.yaml index 031a864..c9adcb3 100644 --- a/ric_robot_suite/helm/nanobot/values.yaml +++ b/ric_robot_suite/helm/nanobot/values.yaml @@ -136,6 +136,9 @@ ric: - ricdeployment - health-check - ete + # Enable if you want to execute Subscription Duplication Scenarios. Check README file for the same. + #- Subscription_Duplication_Scen1 + #- Subscription_Duplication_Scen2 #- kpimonxapp tags: enabled: @@ -173,6 +176,7 @@ ric: # Change the Xapp based on your requirement. #xapp: xappkpimon xapp: bouncer-xapp + duplicate_xapp: ricxapp-bouncer1-xapp gNodeB: # the details of a test gNodeB, for [E/X]2 tests. # This can be either a real gnodeb or a simulator,