Update CSIT to check for 202 response during PAP Deployment
[integration/csit.git] / tests / policy / xacml-pdp / xacml-pdp-test.robot
index 250e01f..03b0ca7 100644 (file)
@@ -2,6 +2,7 @@
 Library     Collections
 Library     RequestsLibrary
 Library     OperatingSystem
+Library     Process
 Library     json
 
 *** Test Cases ***
@@ -27,6 +28,11 @@ Statistics
      Should Be Equal As Strings    ${resp.status_code}     200
      Should Be Equal As Strings    ${resp.json()['code']}  200
 
+MakeTopics
+     [Documentation]    Creates the Policy topics
+     ${result}=     Run Process     ${SCR_DMAAP}/make_topic.sh   POLICY-PDP-PAP
+     Should Be Equal As Integers        ${result.rc}    0
+
 ExecuteXacmlPolicy
      Wait Until Keyword Succeeds    0 min   15 sec  CreateMonitorPolicy
      Wait Until Keyword Succeeds    0 min   15 sec  CreateOptimizationPolicy
@@ -46,7 +52,7 @@ CreateMonitorPolicy
      Log    Creating session https://${POLICY_API_IP}:6969
      ${session}=    Create Session      policy  https://${POLICY_API_IP}:6969   auth=${auth}
      ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
-     ${resp}=   Post Request   policy  /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies  data=${postjson}   headers=${headers}
+     ${resp}=   Post Request   policy  /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies  data=${postjson}   headers=${headers}
      Log    Received response from policy4 ${resp.text}
      ${postjsonobject}   To Json    ${postjson}
      Should Be Equal As Strings    ${resp.status_code}     200
@@ -77,7 +83,9 @@ DeployPolicies
      ${resp}=   Post Request   policy  /policy/pap/v1/pdps/policies  data=${postjson}   headers=${headers}
      Log    Received response from policy5 ${resp.text}
      ${postjsonobject}   To Json    ${postjson}
-     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.status_code}     202
+     ${result}=     Run Process    ${SCR_DMAAP}/wait_topic.sh    POLICY-PDP-PAP
+     ...            responseTo    xacml    ACTIVE    onap.restart.tca
 
 GetStatisticsAfterDeployed
      [Documentation]    Runs Policy Xacml PDP Statistics after policy is deployed
@@ -194,7 +202,7 @@ UndeployMonitorPolicy
      ${headers}=  Create Dictionary     Accept=application/json    Content-Type=application/json
      ${resp}=   Delete Request     policy  /policy/pap/v1/pdps/policies/onap.restart.tca     headers=${headers}
      Log    Received response from policy ${resp.text}
-     Should Be Equal As Strings    ${resp.status_code}     200
+     Should Be Equal As Strings    ${resp.status_code}     202
 
 GetStatisticsAfterUndeploy
      [Documentation]    Runs Policy Xacml PDP Statistics after policy is undeployed