[Issue-Id:RIC-150] Enhancement to it/test repo 64/5764/6
authorSangeetha KR <sangeetha-kr@hcl.com>
Sun, 14 Mar 2021 18:01:33 +0000 (23:31 +0530)
committerSangeetha KR <sangeetha-kr@hcl.com>
Fri, 16 Apr 2021 15:20:16 +0000 (20:50 +0530)
As per review comments from Dave, Addressed the review comment.
Fixed variables descriptive ${aaa}
Oran build issue fixed by setting ENV
"CRYPTOGRAPHY_DONT_BUILD_RUST=1"
Fixed deployment name and namespace in global properties and ete
testsuite
Addressed review comments from Dave - Fixed XappNS variable by replacing
the hardcode ricxapp in global_properties.

subtasks:
RIC-740, Verify E2 setup and response using rest API
RIC-741 Verify Subcription flow using nanobot
RIC-742 Verify Indication flow using nanobot
RIC-750 it-test repo: Missing space in template folder

       Added E2mgr API to validate the E2setup request response in to ete.robot
       Added Kubectl client API function to validate subscription and indication in to ete.robot
       Added new field plmnid and gnb id in values.yaml file to add up gnbs
       Added global variabled for gnbs in global_properties.robot
       Updated README file wrt recent modification
       Fixed one space issue in template folder/job-ric-robot-run.yaml

Signed-off-by: Sangeetha KR <sangeetha-kr@hcl.com>
Change-Id: I9d0b242b0b549b989e9e005cbb8405d34e3ce62d

ric_robot_suite/docker/nanobot/Dockerfile
ric_robot_suite/helm/nanobot/README
ric_robot_suite/helm/nanobot/configmap-src/public/properties/global_properties.robot
ric_robot_suite/helm/nanobot/configmap-src/public/resources/e2term_interface.robot
ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/ete.robot
ric_robot_suite/helm/nanobot/templates/job-ric-robot-run.yaml
ric_robot_suite/helm/nanobot/values.yaml

index 46a86be..3d57ad5 100644 (file)
 
    FROM python:3.8-alpine AS nanobot-build
 
-   RUN apk update && apk add git build-base libffi-dev libxml2 libxslt libxml2-dev libxslt-dev openssl-dev
+   RUN apk update && apk add --no-cache git build-base libffi-dev libxml2 libxslt libxml2-dev libxslt-dev openssl-dev
    RUN apk update && apk add git gcc linux-headers libc-dev cmake pkgconfig make
 
-
+   ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
    RUN pip install kubernetes
    RUN pip install redis
    RUN pip install asyncio
index ce2b1e4..94f57fe 100644 (file)
@@ -23,6 +23,24 @@ 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 E2sim using helm install by entering inside the path
+/test/ric_benchmarking/E2-interface/e2sim/e2sm_examples/kpm_e2sm/helm/
+
+$ helm install --name <name of deployment> --namespace <namespace>
+
+Update E2sim PLMID, GNBID to values.yaml(.Values.ric.robot.environment.gNodeB)
+
+Deploy bouncer xapp using xapp onboarder steps(as mentioned below 2 steps)
+
+Copy the config-file.json schema file in to the vm where you are deploying and make URL
+$ echo '{"config-file.json_url": "http://<RIC Server IP>/config-file.json" }' > onboard.<xappname>.url
+
+Onboard the xapp using below command
+$ curl --location --request POST "http://<RIC Server IP>:32080/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.<xappname>.url"
+
+Provide the xapp name which will be available in config-file.json in to values.yaml (.Values.ric.robot.environment.xapp)
+
+Deploy nanobot using below helm install
 $ helm install [--values <override-file> ] --namespace <namespace> nanobot
 
 ... in the ric_robot_suite/helm directory, where <override-file>
@@ -73,4 +91,4 @@ collide across those directories, particularly between trees.
 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.
\ No newline at end of file
+image.
index 0e9d3ff..a5de202 100644 (file)
@@ -51,6 +51,11 @@ Documentation        store all properties that can change or are used in multipl
 ...                                   {{.}}={{ 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  }}
@@ -130,6 +135,7 @@ ${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_XAPP_DEPLOYMENT}             {{ printf "%s-%s" ($xappNS) .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 }}
 
index 1dd4545..42e54dd 100644 (file)
@@ -30,6 +30,6 @@ Run E2Term RMR Probe Check
 
      ${resp} =  Run     /bin/sh -c "/opt/e2/rmr_probe -h ${data_path} -v verbose" 
      Log To Console     Received response from E2term ${resp} 
-     ${ret} =   Should Match Regexp     ${resp} got.*OK.*state=0 
+     ${ret} =   Should Match Regexp     ${resp} OK 
      Log To Console     ${ret} 
      [Return]    ${ret} 
index b72bd1f..bf78bf0 100644 (file)
@@ -29,6 +29,7 @@ Library   OperatingSystem
 Library   RequestsLibrary
 Library   KubernetesEntity  ${GLOBAL_RICPLT_NAMESPACE}
 Library   String
+
 *** Variables ***
 ${TEST_XAPPNAME}      ${GLOBAL_TEST_XAPP}
 ${TEST_NODE_B_NAME}   ${GLOBAL_TEST_NODEB_NAME}
@@ -36,25 +37,92 @@ ${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} |
+    ${cType}  ${name} = Split String  ${controllerName} |
     ${ctrl} =  Run Keyword      ${cType}        ${name}
     Should Be Equal      ${ctrl.status.replicas}          ${ctrl.status.ready_replicas}
 
+#Before doing this, Deploy E2sim, keep bouncer xapp config-file.json in to shared path and create url
+#onboard the xapp using onboard link
+
 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
 Deploy An XApp
     [Tags]  etetests  xapptests  intrusive
     Deploy XApp       ${TEST_XAPPNAME}
@@ -75,9 +143,6 @@ 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   ci_tests
-    Run E2Mgr Get All NodeBs Request
 
 # disabled below 3 testcases due to x2 setup related APIs deprecated
 # webservices interface specification deprecated
@@ -114,50 +179,150 @@ Get NodeB via Dashboard
 Get All NodeBs via Dashboard
     [Tags]   e2setup_dash   x2setup_dash    ci_tests
     Run Dashboard Get All NodeBs Request
-###############
-Verifying E2setup Request From E2sim
-    [Tags]  etetests  xapptests
-    ${ric_xapp_pod} =   Run Keyword     RetrievePodsForDeployment       ${ricxapp_POD_NAME}     ${GLOBAL_XAPP_NAMESPACE}
-    ${ric_xapp_pod1} =  Set Variable    ${ric_xapp_pod[0]}
-    Set Global Variable ${ric_xapp_pod1}
-    ${e2simpod} =       Run Keyword     RetrievePodsForDeployment       ${Global_RAN_DEPLOYMENT}        ${Global_RAN_NAMESPACE}
-    ${e2simpod1} =      Set Variable    ${e2simpod[0]}
-    Set Global Variable ${e2simpod1}
-    ${setupres_recv} =  Run     kubectl logs ${e2simpod1} -n ${Global_RAN_NAMESPACE} | grep "SETUP"
-    Log To Console      Subscription Received: ${setupres_recv}
-    Should Match Regexp         ${setupres_recv}       Received SETUP-RESPONSE-SUCCESS
+
+
+
+##### E2setup Verification using E2MGR API
+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}
+
+
+#######Subscription verification between Bouncer Xapp and E2sim
+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        100
+   Sleep       80
    Log To Console      "Sending Subscription Message from Xapp"
-   ${subname} =        Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Subscription SUCCESSFUL"
-   Should Match Regexp         ${subname}      Subscription.*SUCCESSFUL
-   ${sub_sent} =       Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Message Sent: RMR State = RMR_OK"
-   Log To Console      Subscription Sent: ${sub_sent}
-   Should Match Regexp         ${sub_sent}     RMR_OK
+   Should Match Regexp   ${stringLog}    Transmitted subscription request
+
 Verifying Subscription Response From E2sim
    [Tags]  etetests  xapptests
-   Log To Console      "Receiving Subscription Message from RAN"
-   ${subrcv} =  Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Received subscription message of type"
-   Log To Console       Subscription Received: ${subrcv}
-   Should Match Regexp         ${subrcv}       Received subscription message
-Verifying Ric Indication From E2sim
+    Log To Console      "Received Subscription Message from RAN"
+    Should Match Regexp  ${stringLog}    Received subscription message of type = 12011
+
+#######RIC Indication and Control flow verification betwwen Bouncer xapp and E2sim
+Verifying RIC Indication on Xapp
    [Tags]  etetests  xapptests
-   Log To Console      "Sending Indication Message from E2sim"
-   ${indication_sent} =        Run      kubectl logs ${e2simpod1} -n ${Global_RAN_NAMESPACE} | grep "Indication"
-   Log To Console       Sending Indication: ${indication_sent}
-   Should Match Regexp         ${indication_sent}      sending RIC Indication
-Verifying Ric Indication on Xapp
+    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      "Received Indication Message from RAN"
-   ${indication_rcv} =  Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Received indication message of type"
-   Log To Console       Received Indication: ${indication_rcv}
-   Should Match Regexp         ${indication_rcv}       Received indication message
+    Log To Console      "Verified Controll message"
+    Should Match Regexp  ${stringLog}   Bouncer Control OK
+
+Calculating Timestamp for subscription request on Xapp
+   [Tags]  etetests  xapptests
+   ${result_subreq} =   Set Variable    0
+   Set Global Variable  ${result_subreq}
+   FOR  ${item} IN      @{log1}
+        ${itemString}   Convert To String       ${item}
+        ${contains}=    Run Keyword And Return Status   Should Contain  ${itemString}   Transmitted subscription request
+        ${status}=      Run Keyword If  ${contains}     Keyword Check subreq        ${itemString}       ELSE    Keyword Check No subreq
+   END
+   Log To Console       ${result_subreq}
+   Should Match ${result_subreq}        1
+
+Calculating Timestamp for subscription response on Xapp
+   [Tags]  etetests  xapptests
+   ${result_subres} =   Set Variable    0
+   Set Global Variable  ${result_subres}
+   FOR  ${item} IN      @{log1}
+        ${itemString}   Convert To String       ${item}
+        ${contains}=    Run Keyword And Return Status   Should Contain  ${itemString}   Received subscription message of type = 12011
+        ${status}=      Run Keyword If  ${contains}     Keyword Check subres    ${itemString}   ELSE    Keyword Check No subres
+
+   END
+   Log To Console       ${result_subres}
+   Should Match ${result_subres}        1
+
+
+Latecncy Check on RoundTripTime Subscription Request and Response
+   [Tags]  etetests  xapptests
+   ${timediff} =        Evaluate        ${timestampval2} - ${timestampval1}
+   Log To Console       ${timediff}
+
+
+RetriveLog From GNB
+    [Tags]  etetests  xapptests  intrusive
+    ${e2simpodname} =   Run Keyword     RetrievePodsForDeployment       ${Global_RAN_DEPLOYMENT}   namespace=${Global_RAN_NAMESPACE}
+    Log To Console      ${e2simpodname}
+    ${e2sim_pod1} =  Set Variable       ${e2simpodname[0]}
+    Log To Console      ${e2sim_pod1}
+    ${e2sim_log} =      Run keyword     RetrieveLogForPod       ${e2sim_pod1}   namespace=${Global_RAN_NAMESPACE}
+    ${e2simstringLog}        Convert To String       ${e2sim_log}
+    Set Global Variable         ${e2simstringLog}
+    Set Global Variable         ${e2sim_log}
+
+Calculating Timestamp for Indication Messagae from E2SIM
+   [Tags]  etetests  xapptests
+   ${result_ind1} =     Set Variable    0
+   Set Global Variable  ${result_ind1}
+   @{IndMessgList}=    Create List
+   Set Global Variable  ${IndMessgList}
+   FOR  ${item} IN      @{e2sim_log}
+        ${itemString}   Convert To String       ${item}
+        ${contains}=    Run Keyword And Return Status   Should Contain  ${itemString}   Sent RIC Indication at time
+        ${status}=      Run Keyword If  ${contains}     Keyword Check IndMessage        ${itemString}   ELSE    Keyword Check No IndMsg
+   END
+   Log To Console       ${result_Ind1}
+   Log To Console       ${IndMessgList}
+   Should Match ${result_Ind1}  1
+
+Calculating Timestamp for Control Messages From Xapp to E2sim
+   [Tags]  etetests  xapptests
+   ${result_ctrl1} =    Set Variable    0
+   Set Global Variable  ${result_ctrl1}
+   @{ContMessgList}=    Create List
+   Set Global Variable  ${ContMessgList}
+   FOR  ${item} IN      @{e2sim_log}
+        ${itemString}   Convert To String       ${item}
+        ${contains}=    Run Keyword And Return Status   Should Contain  ${itemString}   Received RIC Control Msg at time
+        ${status}=      Run Keyword If  ${contains}     Keyword Check ControlMsg        ${itemString}   ELSE    Keyword Check No CtrlMsg
+
+   END
+   Log To Console       ${result_ctrl1}
+   Log To Console       ${ContMessgList}
+   Should Match ${result_ctrl1} 1
+
+
+Latecncy Check on RoundTripTime Indication message and Control message
+   [Tags]  etetests  xapptests
+   ${index} =   Set Variable    0
+   @{Timediff1}=        Create List
+   FOR  ${item} IN      @{ContMessgList}
+        ${timediff} =        Evaluate        ${ContMessgList}[${index}] - ${IndMessgList}[${index}]
+        Append To List  ${Timediff1}    ${timediff}
+        ${index}=       Evaluate        ${index} + 1
+   END
+   Log To Console       ${Timediff1}
+
+
 Undeploy The Deployed XApp
     [Tags]  etetests  xapptests  intrusive
     Undeploy XApp     ${TEST_XAPPNAME}
index a812055..700bc2a 100644 (file)
@@ -210,7 +210,7 @@ spec:
               value: /robot/etc/ric-robot-kubeconfig.conf
           command: ["robot"]
           args:
-           - "-T"
+            - "-T"
             {{- if not .Values.ric.robot.job.failOnTestFail }}
             - "--NoStatusRC"
             {{- end }}
index ebea4d0..5785c7e 100644 (file)
@@ -168,7 +168,7 @@ ric:
     # This should be an xapp which is "onboarded" to
     # the appmgr but not deployed at the time the test
     # is initiated.
-    xapp: bouncerauto-xapp
+    xapp: bouncer-xapp
     gNodeB:
      # the details of a test gNodeB, for [E/X]2 tests.
      # This can be either a real gnodeb or a simulator,
@@ -181,6 +181,8 @@ ric:
      port: 36421
      ran_deployment: e2sim
      ran_namespace: test
+     plmnid: 373437
+     gnbid: gnb_734_733_b5c67788
     dashboard:
      address: 10.1.0.1
      port: 31080