diff options
author | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-10-20 17:28:04 +0100 |
---|---|---|
committer | a.sreekumar <ajith.sreekumar@bell.ca> | 2021-10-21 12:53:21 +0100 |
commit | f715119e9b084971bd57b0bd1da46a1686e2d8cb (patch) | |
tree | 8ebbe18f8d0ea6613a7b5b902af7aedac68f7a01 /csit/apex-pdp/tests/apex-pdp-test.robot | |
parent | d00369a9bdc26c22c3582b7759dcb87be6352649 (diff) |
Improving APEX-PDP CSIT tests
Change-Id: I06023f9b7555b23b007aadd20e87fb4e59c9980c
Issue-ID: POLICY-3709
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'csit/apex-pdp/tests/apex-pdp-test.robot')
-rw-r--r-- | csit/apex-pdp/tests/apex-pdp-test.robot | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/csit/apex-pdp/tests/apex-pdp-test.robot b/csit/apex-pdp/tests/apex-pdp-test.robot index 60497229..380b3779 100644 --- a/csit/apex-pdp/tests/apex-pdp-test.robot +++ b/csit/apex-pdp/tests/apex-pdp-test.robot @@ -31,15 +31,25 @@ ExecuteApexSampleDomainPolicy Wait Until Keyword Succeeds 4 min 5 sec RunEventOnApexEngine Wait Until Keyword Succeeds 3 min 5 sec VerifyPdpStatistics 1 1 1 1 -ExecuteApexControlLoopPolicy - Set Test Variable ${policyName} onap.policies.apex.Simplecontrolloop +ExecuteApexTestPnfPolicy + Set Test Variable ${policyName} onap.policies.apex.pnf.Test ${postjson}= Get file ${CURDIR}/data/${policyName}.json CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0 DeployPolicy Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex ${result}= Run Process ${SCRIPTS}/make_topic.sh APEX-CL-MGT Should Be Equal As Integers ${result.rc} 0 - Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyControlLoopPolicy + Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestPnfPolicy + +ExecuteApexTestVnfPolicy + Set Test Variable ${policyName} onap.policies.apex.vnf.Test + ${postjson}= Get file ${CURDIR}/data/${policyName}.json + CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} ${policyName} 1.0.0 + DeployPolicy + Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex + ${result}= Run Process ${SCRIPTS}/make_topic.sh APEX-CL-MGT + Should Be Equal As Integers ${result.rc} 0 + Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestVnfPolicy *** Keywords *** @@ -60,21 +70,33 @@ RunEventOnApexEngine ${resp}= PUT On Session apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 -TriggerAndVerifyControlLoopPolicy - [Documentation] Send event to DMaaP and read notifications to verify policy execution +TriggerAndVerifyTestPnfPolicy + [Documentation] Send TestPnf policy trigger event to DMaaP and read notifications to verify policy execution Create Session apexSession https://${DMAAP_IP}:3905 max_retries=1 - ${data}= Get Binary File ${CURDIR}/data/VesEvent.json + ${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json &{headers}= Create Dictionary Content-Type=application/json Accept=application/json ${resp}= POST On Session apexSession /events/unauthenticated.DCAE_CL_OUTPUT data=${data} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 - Run Keyword CheckLogMessage VES event has been received. Going to fetch details from AAI. - Run Keyword CheckLogMessage Received response from AAI successfully. Hostname in AAI matches with the one in Ves event. Going to make the update-config request to CDS. - Run Keyword CheckLogMessage Successfully processed the VES event. Hostname is updated. + Run Keyword CheckLogMessage ACTIVE VES event has been received. Going to fetch details from AAI. + Run Keyword CheckLogMessage SUCCESS Received response from AAI successfully. Hostname in AAI matches with the one in Ves event. Going to make the update-config request to CDS. + Run Keyword CheckLogMessage FINAL_SUCCESS Successfully processed the VES event. Hostname is updated. + +TriggerAndVerifyTestVnfPolicy + [Documentation] Send TestVnf policy trigger event to DMaaP and read notifications to verify policy execution + Create Session apexSession https://${DMAAP_IP}:3905 max_retries=1 + ${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json + &{headers}= Create Dictionary Content-Type=application/json Accept=application/json + ${resp}= POST On Session apexSession /events/unauthenticated.DCAE_POLICY_EXAMPLE_OUTPUT data=${data} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 200 + Run Keyword CheckLogMessage ACTIVE VES event has been received. Going to fetch VNF details from AAI. + Run Keyword CheckLogMessage SUCCESS VNF details are received from AAI successfully. Sending ConfigModify request to CDS. + Run Keyword CheckLogMessage SUCCESS ConfigModify request is successful. Sending restart request to CDS. + Run Keyword CheckLogMessage FINAL_SUCCESS Successfully processed the VES Event. Restart is complete. CheckLogMessage [Documentation] Read log messages received and check for expected content. - [Arguments] ${expectedMsg} - ${result}= Run Process ${SCRIPTS}/wait_topic.sh APEX-CL-MGT PNF101 + [Arguments] ${status} ${expectedMsg} + ${result}= Run Process ${SCRIPTS}/wait_topic.sh APEX-CL-MGT ${status} Log Received log event on APEX-CL-MGT topic ${result.stdout} Should Be Equal As Integers ${result.rc} 0 Should Contain ${result.stdout} ${expectedMsg} |