From: Anusha Nalluri Date: Mon, 19 Apr 2021 14:13:25 +0000 (+0530) Subject: [Issue-Id:RIC-150] Enhancement to it/test repo X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=ffca952d72f824ea3cda7e03ec7c14b2a12de3df;p=it%2Ftest.git [Issue-Id:RIC-150] Enhancement to it/test repo Subtask RIC-754 KPIMON xapp validation using nanobot with SDL Updated Values.yaml for Kpimon xapp Added kpimonxapp.robot for EtE testing between kpimon and E2sim Updated global_properties variables for kpimonxapp Updated README file for nanobot testing Signed-off-by: Anusha Nalluri Change-Id: Ic84500b845bd5beacc9e751a2af978ab99e2e519 --- diff --git a/ric_robot_suite/helm/nanobot/README b/ric_robot_suite/helm/nanobot/README index 94f57fe..51639ff 100644 --- a/ric_robot_suite/helm/nanobot/README +++ b/ric_robot_suite/helm/nanobot/README @@ -15,32 +15,85 @@ This directory contains a Helm chart for the minimal robot container and Kubernetes job. -USING THE CHART -To install the chart (which creates and runs a single Kubernetes job), -first copy the packaged Common-Template chart (from -https://gerrit.o-ran-sc.org/r/it/dep.git) into -ric_robot_suite/helm/nanobot/charts. Then, edit -ric_robot_suite/helm/nanobot/values.yaml to reflect your -environment and desired tests and run +Before executing the nanobot test please do the following procedures +Deploy E2sim: +============ + +1. Deploy RIC platform + +2. kubectl rollout restart deployment --namespace ricplt deployment-ricplt-e2mgr deployment-ricplt-e2term-alpha (The e2mgr and e2term need to be restarted; this is due to some issues with health check; I don’t know whether it has been resolved by that team) + +3. clone sim/e2-interface + +4. In the root directory of e2sim: Follow directions in README to produce the deb files + +5. Since the deb files are not yet pushed to package cloud, we need to copy them + +6. cp e2sim*deb ../e2sm_examples/kpm_e2sm + +7. cd ../e2sm_examples/kpm_e2sm + +8. Edit the Dockerfile at the bottom to have IP address of service-ricplt-e2term-sctp-alpha service + +9. docker build . + +10. docker tag e2simul:0.0.2 + +11. Once deployed, kubectl logs will show: -Deploy E2sim using helm install by entering inside the path -/test/ric_benchmarking/E2-interface/e2sim/e2sm_examples/kpm_e2sm/helm/ +An E2 Setup Request from E2 Simulator to E2 Term +An E2 Setup Response from E2 Term to E2 Simulator -$ helm install --name --namespace +Deploy Bouncer Xapp in common way: +================================== -Update E2sim PLMID, GNBID to values.yaml(.Values.ric.robot.environment.gNodeB) +Follow the link to deploy xapps +https://wiki.o-ran-sc.org/display/IAT/AD+xApp+Flows -Deploy bouncer xapp using xapp onboarder steps(as mentioned below 2 steps) +1.Preparing an xApp for onboarding: -Copy the config-file.json schema file in to the vm where you are deploying and make URL -$ echo '{"config-file.json_url": "http:///config-file.json" }' > onboard..url +echo '{"config-file.json_url": "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/ts.git;a=blob_plain;f=xapp-descriptor/config.json;hb=HEAD" }' > onboard.ts.url -Onboard the xapp using below command -$ curl --location --request POST "http://:32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard..url" -Provide the xapp name which will be available in config-file.json in to values.yaml (.Values.ric.robot.environment.xapp) +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.ts.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": "trafficxapp"}' + +Deploy KPIMONXapp: +================== +currently KPIMON deployment must be done in the following way: + +https://wiki.o-ran-sc.org/display/IAT/Traffic+Steering+Flows + + +1. clone scp/ric-app/kpimon (note it is different than the ric-app/kpimon repo) +2. docker build . +3. docker tag nexus3.o-ran-sc.org:10002/ric-app-kpimon:1.0.0 +4 .curl -X POST --data-binary @xappkpimon-0.2.0.tgz http://:32080/helmrepo/api/charts (Push hand-crafted helm chart to appmgr chart museum) + +Once Xapp deployed + +1.Checkout the it/test repo +2.Modify Values.yaml based on your Xapp deployment name, Xapp name and E2sim deployment with PLMID, GNBID update. +ric_robot_suite/helm/nanobot/values.yaml. +3.Add testsuites name based on our testing. +Note: Only one xapp to E2sim test is possible. + +Follow the below steps for nanobot testing. +USING THE CHART +To install the chart (which creates and runs a single Kubernetes job), +first copy the packaged Common-Template chart (from +https://gerrit.o-ran-sc.org/r/it/dep.git) into +ric_robot_suite/helm/nanobot/charts. Then, edit +ric_robot_suite/helm/nanobot/values.yaml to reflect your +environment and desired tests and run -Deploy nanobot using below helm install $ helm install [--values ] --namespace nanobot ... in the ric_robot_suite/helm directory, where @@ -92,3 +145,4 @@ The job uses the nanobot docker image built by ric_robot_suite/docker/nanobot/Dockerfile; see ric_robot_suite/docker/nanobot/README for information about the image. + 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 a5de202..d789387 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 @@ -1,5 +1,5 @@ # Copyright (c) 2019 AT&T Intellectual Property. -# Copyright (c) 2020 HCL Technologies Limited. +# # 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 @@ -50,13 +50,11 @@ Documentation store all properties that can change or are used in multipl &{GLOBAL_RICPLT_XAPPS} {{- range keys .Values.ric.xapp }} ... {{.}}={{ printf "%s-%s" $xappNS . }} {{- end }} - # ${GLOBAL_PLMNID} {{ .Values.ric.robot.environment.gNodeB.plmnid }} ${GLOBAL_GNBID} {{ .Values.ric.robot.environment.gNodeB.gnbid }} # -# ${GLOBAL_APPLICATION_ID} {{ default "r0" .Values.ric.robot.release | printf "nanobot-%s" }} ${GLOBAL_BUILD_NUMBER} {{ default "0" .Values.ric.platform.build }} ${GLOBAL_RICPLT_NAMESPACE} {{ $ricpltNS }} @@ -136,7 +134,7 @@ ${GLOBAL_DASH_SERVER_PORT} {{ default "31080" .Values.ric.robot. ${GLOBAL_INJECTED_DASH_IP_ADDR} {{ default "127.0.0.1" .Values.ric.robot.environment.dashboard.port }} ${GLOBAL_XAPP} {{ .Values.ric.robot.environment.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/testsuites/kpimonxapp.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/kpimonxapp.robot new file mode 100644 index 0000000..4d3cb00 --- /dev/null +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/kpimonxapp.robot @@ -0,0 +1,210 @@ +# 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 + +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library KubernetesEntity ricplt +Library SDLWrapper False +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 + ${aaa} = 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 + ${aaa} = 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 + ${aaa} = 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 + ${aaa} = 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} + + +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"]} + Should Be Equal ${json} ${GLOBAL_PLMNID} + 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_XAPPKPIMON_DEPLOYMENT} namespace=${GLOBAL_XAPP_NAMESPACE} + 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=${GLOBAL_XAPP_NAMESPACE} + ${stringLog} Convert To String ${log1} + Set Global Variable ${stringLog} + Set Global Variable ${log1} + +Verifying Subscription Request From Xapp + [Tags] etetests xapptests + #Sleep 90000 + Log To Console "Sending Subscription Message from Xapp" + Should Match Regexp ${stringLog} The RMR message to be sent is 12010 + +Verifying Subscription Response From E2sim + [Tags] etetests xapptests + Log To Console "Received Subscription Message from RAN" + Should Match Regexp ${stringLog} Received message type: 12011 + +Verifying Ric Indication on Xapp + [Tags] etetests xapptests + #Sleep 20000 + Log To Console "Received Indication Message from RAN" + Should Match Regexp ${stringLog} Received message type: 12050 + +Verifying ueid from dbass by using sdl + [Tags] etetests xapptests + Log To Console "Verifying Healthcheck of dbass" + ${log} = Run Keyword healthcheck + Log To Console ${log} + Log To Console "Received ueid from dbass from sdl" + ${Allueid} = Run Keyword find and get kpimon {TS-UE-metrics} false + Log To Console ${Allueid} + Log To Console "############ printing the ueid's ###########" + Log To Console ${Allueid.keys()} + ${ueid_check} = Set Variable 0 + ${ueid} = Set Variable ${None} + FOR ${key} IN @{Allueid.keys()} + ${ueid_check} = Set Variable 1 + ${ueid} = Run Keyword get kpimon ${key} false + Log To Console ${key} + Log To Console "--------------ueid---------------" + Log To Console ${ueid} + + END + Should Not Be Equal ${ueid} ${None} + Should Match ${ueid_check} 1 + +Verifying cellid from dbass by using sdl + [Tags] etetests xapptests + Log To Console "Verifying Healthcheck of dbass" + ${log} = Run Keyword healthcheck + Log To Console ${log} + Log To Console "Received cellid from dbass from sdl" + ${Allcellid} = Run Keyword find and get kpimon {TS-cell-metrics} false + Log To Console ${Allcellid} + Log To Console "############ printing the cellid's ###########" + Log To Console ${Allcellid.keys()} + ${cellid_check} = Set Variable 0 + ${cellid} = Set Variable ${None} + FOR ${key} IN @{Allcellid.keys()} + ${cellid_check} = Set Variable 1 + ${cellid} = Run Keyword get kpimon ${key} false + Log To Console ${key} + Log To Console "--------------cellid---------------" + Log To Console ${cellid} + END + Should Not Be Equal ${cellid} ${None} + Should Match ${cellid_check} 1 diff --git a/ric_robot_suite/helm/nanobot/values.yaml b/ric_robot_suite/helm/nanobot/values.yaml index 5785c7e..031a864 100644 --- a/ric_robot_suite/helm/nanobot/values.yaml +++ b/ric_robot_suite/helm/nanobot/values.yaml @@ -131,10 +131,12 @@ ric: # Active testsuites can be chosen by # tag, testuite names, or both. leaving # either unspecified will cause all to run. + # Kpimonxapp testsuite need to be uncomment before testing kpimonxapp testsuites: - ricdeployment - health-check - ete + #- kpimonxapp tags: enabled: # - etetests @@ -168,6 +170,8 @@ ric: # This should be an xapp which is "onboarded" to # the appmgr but not deployed at the time the test # is initiated. + # Change the Xapp based on your requirement. + #xapp: xappkpimon xapp: bouncer-xapp gNodeB: # the details of a test gNodeB, for [E/X]2 tests.