From cf7d746ed9dcc21427a2b15161751f090a884b08 Mon Sep 17 00:00:00 2001 From: Jerry Flood Date: Fri, 2 Jun 2017 15:25:36 -0400 Subject: 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 --- robot/resources/dcae_interface.robot | 26 ++++++++++++++++++++++++-- 1 file 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 -- cgit 1.2.3-korg