Checking that CBS is registered in consul
[integration/csit.git] / tests / dcaegen2 / prh-testcases / resources / prh_library.robot
index 0353e11..0727169 100644 (file)
@@ -1,5 +1,6 @@
 *** Settings ***
 Library           RequestsLibrary
+Library           Collections
 Library           PrhLibrary.py
 Resource          ../../../common.robot
 
@@ -32,10 +33,10 @@ Verify incorrect JSON event is logged
     [Arguments]    ${test_case_directory}
     ${invalid_ves_event}=    Get Data From File    ${test_case_directory}/invalid-ves-event.json
     Set VES event in DMaaP    ${invalid_ves_event}
-    # TODO hangs build
-    #Wait Until Keyword Succeeds    10x    3000ms    Check PRH log    |java.lang.IllegalStateException: Not a JSON Array:
+    Wait Until Keyword Succeeds    10x    3000ms    Check PRH log    |Element is neither JSON Object or Array
 
 Verify missing AAI record is logged
+    [Timeout]    100s
     [Arguments]    ${test_case_directory}
     ${incorrect_aai_entry}=    Get Data From File    ${test_case_directory}/incorrect-aai-entry.json
     ${ves_event}=    Get Data From File    ${test_case_directory}/ves-event.json
@@ -45,6 +46,7 @@ Verify missing AAI record is logged
     Wait Until Keyword Succeeds    10x    3000ms    Check PRH log    |Chain of tasks have been aborted due to errors in PRH workflow
 
 Verify AAI not responding is logged
+    [Timeout]    100s
     [Arguments]    ${test_case_directory}
     ${ves_event}=    Get Data From File    ${test_case_directory}/ves-event.json
     Ensure Container Is Exited    aai_simulator
@@ -53,9 +55,10 @@ Verify AAI not responding is logged
     Ensure Container Is Running   aai_simulator
 
 Check CBS ready
-    ${resp}=    Get Request    ${consul_setup_session}    /v1/catalog/service/cbs
+    ${resp}=    Get Request    ${consul_setup_session}    /v1/catalog/services
     Should Be Equal As Strings    ${resp.status_code}    200
-    Log    CBS ${resp.content}
+    Log    Service Catalog response: ${resp.content}
+    Dictionary Should Contain Key    ${resp.json()}    cbs    |Consul service catalog should contain CBS entry
 
 Check recorded PNF_READY notification
     [Arguments]    ${expected_event_pnf_ready_in_dpaap}
@@ -103,6 +106,7 @@ Create sessions
     Set Suite Variable    ${aai_setup_session}    aai_setup_session
     Create Session    consul_setup_session    ${CONSUL_SETUP_URL}
     Set Suite Variable    ${consul_setup_session}    consul_setup_session
+    Sleep    120s
 
 Reset Simulators
     Reset AAI simulator