diff options
author | Jerry Flood <jf9860@att.com> | 2017-06-02 15:25:36 -0400 |
---|---|---|
committer | Jerry Flood <jf9860@att.com> | 2017-06-02 15:33:16 -0400 |
commit | cf7d746ed9dcc21427a2b15161751f090a884b08 (patch) | |
tree | f7b897e9a0f61aa679cf3d4008224da0d6a4e220 | |
parent | 8b487f31999bc7ce6c7be67e6004706c69f55079 (diff) |
Add exceptions to DCAE health check
Identify allowable non-GREEN status in HC response.
Issue: TEST-37
Change-Id: I51fb920ae7caa142345da058013c2425781dfb4a
Signed-off-by: Jerry Flood <jf9860@att.com>
-rw-r--r-- | robot/resources/dcae_interface.robot | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/robot/resources/dcae_interface.robot b/robot/resources/dcae_interface.robot index e023a7e6..62a13af5 100644 --- a/robot/resources/dcae_interface.robot +++ b/robot/resources/dcae_interface.robot @@ -25,7 +25,7 @@ Run DCAE Health Check Check DCAE Results ${resp.json()} Check DCAE Results - [Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN + [Documentation] Parse DCAE JSON response and make sure all rows have healthTestStatus=GREEN (except for the exceptions ;-) [Arguments] ${json} @{rows}= Get From Dictionary ${json['returns']} rows @{headers}= Get From Dictionary ${json['returns']} columns @@ -40,7 +40,29 @@ Check DCAE Results :for ${row} in @{rows} \ ${cells}= Get From Dictionary ${row} cells \ ${dict}= Make A Dictionary ${cells} ${columns} - \ Dictionary Should Contain Item ${dict} healthTestStatus GREEN + \ Is DCAE Status Valid ${dict} + +Is DCAE Status Valid + [Arguments] ${dict} + # If it is GREEN we are done. + ${status} ${value}= Run Keyword And Ignore Error Dictionary Should Contain Item ${dict} healthTestStatus GREEN + Return From Keyword If '${status}' == 'PASS' + + # Check for Exceptions + # Only 1 so far + ${status} ${value}= Run Keyword And Ignore Error Check For Exception ${dict} vm-controller UNDEPLOYED YELLOW + Return From Keyword If '${status}' == 'PASS' + + # Status not GREEN or is not an exception + Fail Health check failed ${dict} + +Check for Exception + [Arguments] ${dict} ${service} ${status} ${healthTestStatus} + # Test the significant attributes to see if this is a legit exception + ${exception}= Copy Dictionary ${dict} + Set To Dictionary ${exception} service=${service} status=${status} healthTestStatus=${healthTestStatus} + Dictionaries Should Be Equal ${dict} ${exception} + Make A Dictionary |