1 # Copyright (c) 2019 AT&T Intellectual Property.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 Documentation Tests for the Measurement Campaign XApp
19 Resource /robot/resources/global_properties.robot
20 Resource /robot/resources/mcxapp_properties.robot
22 Resource /robot/resources/ric/ric_utils.robot
25 Library KubernetesEntity ${GLOBAL_XAPP_NAMESPACE}
28 ${writerVesSuccesses} .*successful\\s+ves\\s+posts\\s*-\\s*([1-9][0-9]*)
29 ${writerVesErrors} .*failed\\s+ves\\s+posts\\s*-\\s*([1-9][0-9]*)
32 XApp Should Be Available
33 [Tags] etetests xapptests mcxapptests
34 ${deploymentName} = Get From Dictionary ${GLOBAL_RICPLT_XAPPS} mcxapp
35 Set Suite Variable ${deploymentName}
36 ${deploy} = Deployment ${deploymentName}
37 ${status} = Most Recent Availability Condition @{deploy.status.conditions}
38 Should Be Equal As Strings ${status} True ignore_case=True
40 Writer Should Be Successfully Sending Statistics
41 [Tags] etetests xapptests mcxapptests
42 Set Test Variable ${finalStatus} PASS
43 FOR ${stat} IN @{GLOBAL_MCXAPP_WRITER_STATISTICS}
44 ${statRE} = Regexp Escape ${stat}
45 ${log} = Most Recent Container Logs ${deploymentName}
46 ... ${GLOBAL_MCXAPP_WRITER_NAME}
47 ... ^${statRE}:\\s+successful\\s+ves\\s+posts\\.*
48 ${status} ${u} = Run Keyword And Ignore Error
49 ... Should Contain Match ${log} regexp=${writerVesSuccesses}
50 ${finalStatus} = Set Variable If "${status}" == "FAIL"
53 Run Keyword If "${status}" == "FAIL"
54 ... Log No messages have been sent to VES for ${stat}
55 ${status} ${u} = Run Keyword And Ignore Error
56 ... Should Not Contain Match ${log} regexp=${writerVesErrors}
57 ${finalStatus} = Set Variable If "${status}" == "FAIL"
60 Run Keyword If "${status}" == "FAIL"
61 ... Log ${stat} is producing errors logging to VES
63 Run Keyword If "${finalStatus}" == "FAIL"
64 ... Fail One or more statistics is not being succesfully logged