X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ric_robot_suite%2Fhelm%2Fnanobot%2Fconfigmap-src%2Fpublic%2Ftestsuites%2Fhealth-check.robot;h=1a18d571bd6a4e92a98e7ac456977b6060bcb832;hb=427c16323bdc11b3ffa338ce51a2d509698ce7db;hp=5e5fdba8ff43987629a603d699d58b5b80d844ef;hpb=3d053f85cc9c42c57850780a18afb0eef425303c;p=it%2Ftest.git diff --git a/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/health-check.robot b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/health-check.robot index 5e5fdba..1a18d57 100644 --- a/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/health-check.robot +++ b/ric_robot_suite/helm/nanobot/configmap-src/public/testsuites/health-check.robot @@ -1,4 +1,5 @@ # Copyright (c) 2019 AT&T Intellectual Property. +# Copyright (c) 2020 HCL Technologies Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,31 +13,45 @@ # See the License for the specific language governing permissions and # limitations under the License. +*** Settings *** +Documentation Run basic health checks for all known components which have one + +Resource /robot/resources/global_properties.robot + +Resource /robot/resources/ric/ric_utils.robot + +Library KubernetesEntity ${GLOBAL_RICPLT_NAMESPACE} +Library Collections +Library String +Library Process +Library OperatingSystem + + +*** Test Cases *** +Basic Component Health Checks + [Documentation] For any defined RIC component with a health check keyword, + ... Run that keyword. "Health check" keywords have names of the + ... form "Run ${component} Health Check". + # This could have been entirely implemented in Helm; however, I wanted to + # allow for the possibility that it would be used (with some modification) + # by the ric-robot, which does not perform template expansion on testsuites. + [Tags] health + Set Test Variable ${finalStatus} PASS + FOR ${component} IN @{GLOBAL_RICPLT_COMPONENTS} + Log To Console component is ${component} + Run Keyword And Ignore Error + ... Import Resource /robot/resources/${component}_interface.robot + ${healthCheck} = Set Variable Run ${component} Health Check + ${status} = Run Keyword If Present ${healthCheck} + Log To Console ${healthcheck} + Log To Console ${status} + ${finalStatus} = Set Variable If '${status}' == 'FAIL' FAIL ${finalStatus} + Run Keyword If '${status}' == 'FAIL' + ... Log To Console ${component} is unhealthy + ... ELSE + ... Log To Console ${component} is healthy + Log To Console ----------------------------------------------------------------- + END + Run Keyword If '${finalStatus}' == 'FAIL' + ... Fail One or more Health Checks failed -*** Settings *** -Documentation Run basic health checks for all known components which have one - -Resource /robot/resources/global_properties.robot - -Resource /robot/resources/ric/ric_utils.robot - -*** Test Cases *** -Basic Component Health Checks - [Documentation] For any defined RIC component with a health check keyword, - ... Run that keyword. "Health check" keywords have names of the - ... form "Run ${component} Health Check". - # This could have been entirely implemented in Helm; however, I wanted to - # allow for the possibility that it would be used (with some modification) - # by the ric-robot, which does not perform template expansion on testsuites. - [Tags] health - Set Test Variable ${finalStatus} PASS - :FOR ${component} IN @{GLOBAL_RICPLT_COMPONENTS} - \ Run Keyword And Ignore Error - ... Import Resource /robot/resources/${component}/${component}_interface.robot - \ ${healthCheck} = Set Variable Run ${component} Health Check - \ ${status} = Run Keyword If Present ${healthCheck} - \ ${finalStatus} = Set Variable If '${status}' == 'FAIL' FAIL ${finalStatus} - \ Run Keyword If '${status}' == 'FAIL' - ... Log ${component} is unhealthy - Run Keyword If '${finalStatus}' == 'FAIL' - ... Fail One or more Health Checks failed