1 # Copyright (c) 2019 AT&T Intellectual Property.
2 # Copyright (c) 2020 HCL Technologies Ltd.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 Documentation Run basic health checks for all known components which have one
19 Resource /robot/resources/global_properties.robot
21 Resource /robot/resources/ric/ric_utils.robot
23 Library KubernetesEntity ${GLOBAL_RICPLT_NAMESPACE}
27 Library OperatingSystem
31 Basic Component Health Checks
32 [Documentation] For any defined RIC component with a health check keyword,
33 ... Run that keyword. "Health check" keywords have names of the
34 ... form "Run ${component} Health Check".
35 # This could have been entirely implemented in Helm; however, I wanted to
36 # allow for the possibility that it would be used (with some modification)
37 # by the ric-robot, which does not perform template expansion on testsuites.
39 Set Test Variable ${finalStatus} PASS
40 FOR ${component} IN @{GLOBAL_RICPLT_COMPONENTS}
41 Log To Console component is ${component}
42 Run Keyword And Ignore Error
43 ... Import Resource /robot/resources/${component}_interface.robot
44 ${healthCheck} = Set Variable Run ${component} Health Check
45 ${status} = Run Keyword If Present ${healthCheck}
46 Log To Console ${healthcheck}
47 Log To Console ${status}
48 ${finalStatus} = Set Variable If '${status}' == 'FAIL' FAIL ${finalStatus}
49 Run Keyword If '${status}' == 'FAIL'
50 ... Log To Console ${component} is unhealthy
52 ... Log To Console ${component} is healthy
53 Log To Console -----------------------------------------------------------------
55 Run Keyword If '${finalStatus}' == 'FAIL'
56 ... Fail One or more Health Checks failed