X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Fhelm%2Fnanobot%2Fconfigmap-src%2Fpublic%2Ftestsuites%2Fmcxapp.robot;fp=ric_robot_suite%2Fhelm%2Fnanobot%2Fconfigmap-src%2Fpublic%2Ftestsuites%2Fmcxapp.robot;h=756ff238e62f9ee1c13d20ba0373f15dc7b34214;hb=e41f46a29c4d635ee3f864e36cfd0ac123bac4ec;hp=0000000000000000000000000000000000000000;hpb=7bd8a0bd3e84d325d1a5d1df6feb7a259fee2004;p=it%2Ftest.git diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/mcxapp.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/mcxapp.robot new file mode 100644 index 0000000..756ff23 --- /dev/null +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/mcxapp.robot @@ -0,0 +1,82 @@ +# 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 Tests for the Measurement Campaign XApp + + +Resource /robot/resources/global_properties.robot +Resource /robot/resources/mcxapp_properties.robot + +Resource /robot/resources/ric/ric_utils.robot + +Library Collections +Library KubernetesEntity ${GLOBAL_XAPP_NAMESPACE} + +*** Variables *** +${listenerContainerName} mc-xapp-listener +${listenerStatRegex} ^[0-9]+\\s*\\[STAT\\]\\s*\\(mcl\\) +${recentListenerDrops} .*last 60s.*drops\\s*=\\s*([1-9][0-9]*) +${recentListenerErrors} .*last 60s.*errs\\s*=\\s*([1-9][0-9]*) +${writerVesSuccesses} .*successful\\s+ves\\s+posts\\s*-\\s*([1-9][0-9]*) +${writerVesErrors} .*failed\\s+ves\\s+posts\\s*-\\s*([1-9][0-9]*) + +*** Test Cases *** +XApp Should Be Available + [Tags] etetests xapptests mcxapptests + ${deploymentName} = Get From Dictionary ${GLOBAL_RICPLT_XAPPS} mcxapp + Set Suite Variable ${deploymentName} + ${deploy} = Deployment ${deploymentName} + ${status} = Most Recent Availability Condition @{deploy.status.conditions} + Should Be Equal As Strings ${status} True ignore_case=True + +Listener Should Not Be Dropping Messages + [Tags] etetests xapptests mcxapptests + ${log} = Most Recent Container Logs ${deploymentName} + ... ${GLOBAL_MCXAPP_LISTENER_NAME} + ... ${listenerStatRegex} + Should Not Contain Match ${log} regexp=${recentListenerDrops} + +Listener Should Not Be Producing Errors + [Tags] etetests xapptests mcxapptests + ${log} = Most Recent Container Logs ${deploymentName} + ... ${GLOBAL_MCXAPP_LISTENER_NAME} + ... ${listenerStatRegex} + Should Not Contain Match ${log} regexp=${recentListenerErrors} + +Writer Should Be Successfully Sending Statistics + [Tags] etetests xapptests mcxapptests + Set Test Variable ${finalStatus} PASS + :FOR ${stat} IN @{GLOBAL_MCXAPP_WRITER_STATISTICS} + \ ${statRE} = Regexp Escape ${stat} + \ ${log} = Most Recent Container Logs ${deploymentName} + ... ${GLOBAL_MCXAPP_WRITER_NAME} + ... ^${statRE}:\\s+successful\\s+ves\\s+posts\\.* + \ ${status} ${u} = Run Keyword And Ignore Error + ... Should Contain Match ${log} regexp=${writerVesSuccesses} + \ ${finalStatus} = Set Variable If "${status}" == "FAIL" + ... FAIL + ... ${finalStatus} + \ Run Keyword If "${status}" == "FAIL" + ... Log No messages have been sent to VES for ${stat} + \ ${status} ${u} = Run Keyword And Ignore Error + ... Should Not Contain Match ${log} regexp=${writerVesErrors} + \ ${finalStatus} = Set Variable If "${status}" == "FAIL" + ... FAIL + ... ${finalStatus} + \ Run Keyword If "${status}" == "FAIL" + ... Log ${stat} is producing errors logging to VES + Run Keyword If "${finalStatus}" == "FAIL" + ... Fail One or more statistics is not being succesfully logged +