diff options
-rw-r--r-- | csit/resources/tests/apex-pdp-common.robot | 30 | ||||
-rw-r--r-- | csit/resources/tests/apex-pdp-test.robot | 134 | ||||
-rw-r--r-- | csit/resources/tests/apex-slas.robot | 18 | ||||
-rw-r--r-- | csit/resources/tests/drools-applications-test.robot | 112 |
4 files changed, 147 insertions, 147 deletions
diff --git a/csit/resources/tests/apex-pdp-common.robot b/csit/resources/tests/apex-pdp-common.robot index 81924604..d88d16f8 100644 --- a/csit/resources/tests/apex-pdp-common.robot +++ b/csit/resources/tests/apex-pdp-common.robot @@ -1,26 +1,26 @@ *** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library Process +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Process Resource common-library.robot *** Keywords *** DeployPolicy - [Documentation] Deploy the policy in apex-pdp engine - ${postjson}= Get File ${CURDIR}/data/policy_deploy.json - ${postjson}= evaluate json.loads('''${postjson}''') json - set to dictionary ${postjson['groups'][0]['deploymentSubgroups'][0]['policies'][0]} name=${policyName} - ${postjson}= evaluate json.dumps(${postjson}) json - ${policyadmin}= PolicyAdminAuth - PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${policyadmin} + [Documentation] Deploy the policy in apex-pdp engine + ${postjson}= Get File ${CURDIR}/data/policy_deploy.json + ${postjson}= evaluate json.loads('''${postjson}''') json + set to dictionary ${postjson['groups'][0]['deploymentSubgroups'][0]['policies'][0]} name=${policyName} + ${postjson}= evaluate json.dumps(${postjson}) json + ${policyadmin}= PolicyAdminAuth + PerformPostRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${policyadmin} RunEventOnApexEngine [Documentation] Send event to verify policy execution Create Session apexSession http://${APEX_EVENTS_IP} max_retries=1 - ${data}= Get Binary File ${CURDIR}/data/event.json + ${data}= Get Binary File ${CURDIR}/data/event.json &{headers}= Create Dictionary Content-Type=application/json Accept=application/json ${resp}= PUT On Session apexSession /apex/FirstConsumer/EventIn data=${data} headers=${headers} Should Be Equal As Strings ${resp.status_code} 200 @@ -32,8 +32,8 @@ CheckLogMessage Should Contain ${result} ${expectedMsg} ValidateEventExecution - [Arguments] ${eventStartTime} ${eventEndTime} ${eventsNo} - [Documentation] Check that X amount of events were exeuted per second + [Arguments] ${eventStartTime} ${eventEndTime} ${eventsNo} + [Documentation] Check that X amount of events were executed per second ${eventTimeTaken}= Subtract Date From Date ${eventEndTime} ${eventStartTime} ${eventResult}= Set Variable ${eventTimeTaken * ${1000}} ${eventsPerSecond}= Set Variable ${${1000} / ${eventResult}} diff --git a/csit/resources/tests/apex-pdp-test.robot b/csit/resources/tests/apex-pdp-test.robot index 3989ec46..cf4c713d 100644 --- a/csit/resources/tests/apex-pdp-test.robot +++ b/csit/resources/tests/apex-pdp-test.robot @@ -1,96 +1,96 @@ *** Settings *** -Library Collections -Library RequestsLibrary -Library OperatingSystem -Library json -Library Process +Library Collections +Library RequestsLibrary +Library OperatingSystem +Library json +Library Process Resource common-library.robot Resource apex-pdp-common.robot *** Test Cases *** Healthcheck - [Documentation] Runs Apex PDP Health check - ${hcauth}= PolicyAdminAuth - ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} - Should Be Equal As Strings ${resp.json()['code']} 200 - Set Suite Variable ${pdpName} ${resp.json()['name']} + [Documentation] Runs Apex PDP Health check + ${hcauth}= PolicyAdminAuth + ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} + Should Be Equal As Strings ${resp.json()['code']} 200 + Set Suite Variable ${pdpName} ${resp.json()['name']} ExecuteApexSampleDomainPolicy - # [Tags] docker - Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain - ${postjson}= Get File ${CURDIR}/data/${policyName}.json - CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 - DeployPolicy - Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex - Wait Until Keyword Succeeds 4 min 5 sec RunEventOnApexEngine + # [Tags] docker + Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain + ${postjson}= Get File ${CURDIR}/data/${policyName}.json + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 + DeployPolicy + Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex + Wait Until Keyword Succeeds 4 min 5 sec RunEventOnApexEngine ExecuteApexTestPnfPolicy - Set Test Variable ${policyName} onap.policies.apex.pnf.Test - ${postjson}= Get File ${CURDIR}/data/${policyName}.json - CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 - DeployPolicy - Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex - GetKafkaTopic apex-cl-mgt - Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestPnfPolicy apex-cl-mgt + Set Test Variable ${policyName} onap.policies.apex.pnf.Test + ${postjson}= Get File ${CURDIR}/data/${policyName}.json + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 + DeployPolicy + Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex + GetKafkaTopic apex-cl-mgt + TriggerAndVerifyTestPnfPolicy apex-cl-mgt #ExecuteApexTestVnfPolicy -# Set Test Variable ${policyName} onap.policies.apex.vnf.Test -# ${postjson}= Get File ${CURDIR}/data/${policyName}.json -# CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 -# DeployPolicy -# Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex -# GetTopic apex-cl-mgt -# Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestVnfPolicy +# Set Test Variable ${policyName} onap.policies.apex.vnf.Test +# ${postjson}= Get File ${CURDIR}/data/${policyName}.json +# CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 +# DeployPolicy +# Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex +# GetKafkaTopic apex-cl-mgt +# TriggerAndVerifyTestVnfPolicy apex-cl-mgt ExecuteApexTestPnfPolicyWithMetadataSet - Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.Test - ${postjson}= Get File ${CURDIR}/data/${policyName}.json - CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 - ${postjson}= Get File ${CURDIR}/data/onap.pnf.metadataSet.Test.json - CreateNodeTemplate /policy/api/v1/nodetemplates 201 ${postjson} 1 - DeployPolicy - Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex - GetKafkaTopic apex-cl-mgt2 - Wait Until Keyword Succeeds 2 min 5 sec TriggerAndVerifyTestPnfPolicy apex-cl-mgt2 + Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.Test + ${postjson}= Get File ${CURDIR}/data/${policyName}.json + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 + ${postjson}= Get File ${CURDIR}/data/onap.pnf.metadataSet.Test.json + CreateNodeTemplate /policy/api/v1/nodetemplates 201 ${postjson} 1 + DeployPolicy + Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex + GetKafkaTopic apex-cl-mgt2 + TriggerAndVerifyTestPnfPolicy apex-cl-mgt2 Metrics - [Documentation] Verify policy-apex-pdp is exporting prometheus metrics - ${auth}= PolicyAdminAuth - ${resp}= PerformGetRequest ${APEX_IP} /metrics 200 null ${auth} - Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL",} 3.0 - Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS",} 3.0 - Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS",} 6.0 - Should Contain ${resp.text} pdpa_policy_executions_total{status="TOTAL",} 6.0 - Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="NSOApexEngine-*:0.0.1",}* - Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="MyApexEngine-*:0.0.1",}* - Should Match ${resp.text} *pdpa_engine_state{engine_instance_id=*,} 2.0* - Should Contain ${resp.text} pdpa_engine_event_executions - Should Contain ${resp.text} pdpa_engine_average_execution_time_seconds - Should Contain ${resp.text} pdpa_engine_last_execution_time_bucket - Should Contain ${resp.text} pdpa_engine_last_execution_time_count - Should Contain ${resp.text} pdpa_engine_last_execution_time_sum - Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="NSOApexEngine-*:0.0.1",}*E12* - Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="MyApexEngine-*:0.0.1",}*E12* - Should Contain ${resp.text} jvm_threads_current + [Documentation] Verify policy-apex-pdp is exporting prometheus metrics + ${auth}= PolicyAdminAuth + ${resp}= PerformGetRequest ${APEX_IP} /metrics 200 null ${auth} + Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL",} 3.0 + Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS",} 3.0 + Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS",} 3.0 + Should Contain ${resp.text} pdpa_policy_executions_total{status="TOTAL",} 3.0 + Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="NSOApexEngine-*:0.0.1",}* + Should Match ${resp.text} *pdpa_engine_event_executions{engine_instance_id="MyApexEngine-*:0.0.1",}* + Should Match ${resp.text} *pdpa_engine_state{engine_instance_id=*,} 2.0* + Should Contain ${resp.text} pdpa_engine_event_executions + Should Contain ${resp.text} pdpa_engine_average_execution_time_seconds + Should Contain ${resp.text} pdpa_engine_last_execution_time_bucket + Should Contain ${resp.text} pdpa_engine_last_execution_time_count + Should Contain ${resp.text} pdpa_engine_last_execution_time_sum + Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="NSOApexEngine-*:0.0.1",}*E12* + Should Match ${resp.text} *pdpa_engine_last_start_timestamp_epoch{engine_instance_id="MyApexEngine-*:0.0.1",}*E12* + Should Contain ${resp.text} jvm_threads_current *** Keywords *** TriggerAndVerifyTestPnfPolicy [Documentation] Send TestPnf policy trigger event to Kafka and read notifications to verify policy execution [Arguments] ${topic} - ${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json + ${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json ${resp}= Run Process ${CURDIR}/kafka_producer.py unauthenticated.dcae_cl_output ${data} ${KAFKA_IP} - Run Keyword CheckLogMessage ${topic} ACTIVE VES event has been received. Going to fetch details from AAI. - Run Keyword CheckLogMessage ${topic} 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 ${topic} FINAL_SUCCESS Successfully processed the VES event. Hostname is updated. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} ACTIVE VES event has been received. Going to fetch details from AAI. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} 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. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} FINAL_SUCCESS Successfully processed the VES event. Hostname is updated. TriggerAndVerifyTestVnfPolicy [Documentation] Send TestVnf policy trigger event to Kafka and read notifications to verify policy execution [Arguments] ${topic} - ${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json + ${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json ${resp}= Run Process ${CURDIR}/kafka_producer.py unauthenticated.dcae_policy_example_output ${data} ${KAFKA_IP} - Run Keyword CheckLogMessage ${topic} ACTIVE VES event has been received. Going to fetch VNF details from AAI. - Run Keyword CheckLogMessage ${topic} SUCCESS VNF details are received from AAI successfully. Sending ConfigModify request to CDS. - Run Keyword CheckLogMessage ${topic} SUCCESS ConfigModify request is successful. Sending restart request to CDS. - Run Keyword CheckLogMessage ${topic} FINAL_SUCCESS Successfully processed the VES Event. Restart is complete. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} ACTIVE VES event has been received. Going to fetch VNF details from AAI. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} SUCCESS VNF details are received from AAI successfully. Sending ConfigModify request to CDS. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} SUCCESS ConfigModify request is successful. Sending restart request to CDS. + Wait Until Keyword Succeeds 4 x 10 sec CheckLogMessage ${topic} FINAL_SUCCESS Successfully processed the VES Event. Restart is complete. diff --git a/csit/resources/tests/apex-slas.robot b/csit/resources/tests/apex-slas.robot index 760bc348..e27f0da2 100644 --- a/csit/resources/tests/apex-slas.robot +++ b/csit/resources/tests/apex-slas.robot @@ -10,11 +10,11 @@ Resource apex-pdp-common.robot *** Test Cases *** Healthcheck - [Documentation] Runs Apex PDP Health check - ${hcauth}= PolicyAdminAuth - ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} - Should Be Equal As Strings ${resp.json()['code']} 200 - Set Suite Variable ${pdpName} ${resp.json()['name']} + [Documentation] Runs Apex PDP Health check + ${hcauth}= PolicyAdminAuth + ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} + Should Be Equal As Strings ${resp.json()['code']} 200 + Set Suite Variable ${pdpName} ${resp.json()['name']} ValidatePolicyExecutionAndEventRateLowComplexity [Documentation] Validate that a moderate complexity policy can be executed in less than 100ms and minimum 10 events triggered per second @@ -23,8 +23,8 @@ ValidatePolicyExecutionAndEventRateLowComplexity CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 DeployPolicy Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex - GetKafkaTopic apex-cl-mgt - ${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json + GetKafkaTopic apex-cl-mgt + ${data}= Get Binary File ${CURDIR}/data/VesEventForPnfPolicy.json ${eventStartTime}= Get Current Date ${resp}= Run Process ${CURDIR}/kafka_producer.py unauthenticated.dcae_cl_output ${data} ${KAFKA_IP} ${eventEndTime}= Get Current Date @@ -50,8 +50,8 @@ ValidatePolicyExecutionAndEventRateHighComplexity CreateNodeTemplate /policy/api/v1/nodetemplates 201 ${postjson} 1 DeployPolicy Wait Until Keyword Succeeds 2 min 5 sec QueryPolicyStatus ${policyName} defaultGroup apex ${pdpName} onap.policies.native.Apex - GetKafkaTopic apex-cl-mgt2 - ${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json + GetKafkaTopic apex-cl-mgt2 + ${data}= Get Binary File ${CURDIR}/data/VesEventForVnfPolicy.json ${eventStartTime}= Get Current Date ${resp}= Run Process ${CURDIR}/kafka_producer.py unauthenticated.dcae_policy_example_output ${data} ${KAFKA_IP} ${eventEndTime}= Get Current Date diff --git a/csit/resources/tests/drools-applications-test.robot b/csit/resources/tests/drools-applications-test.robot index 4ceb288b..61d77591 100644 --- a/csit/resources/tests/drools-applications-test.robot +++ b/csit/resources/tests/drools-applications-test.robot @@ -1,10 +1,10 @@ *** Settings *** -Library Collections -Library String -Library RequestsLibrary -Library OperatingSystem -Library Process -Library json +Library Collections +Library String +Library RequestsLibrary +Library OperatingSystem +Library Process +Library json Resource common-library.robot *** Test Cases *** @@ -29,18 +29,18 @@ Controller AssertTopicsOnKafkaClient [Documentation] Verify that the Policy topics policy-pdp-pap and policy-cl-mgt are available on kafka - GetKafkaTopic policy-pdp-pap - GetKafkaTopic policy-cl-mgt + GetKafkaTopic policy-pdp-pap + GetKafkaTopic policy-cl-mgt CheckTopics - [Documentation] List the topics registered with TopicManager + [Documentation] List the topics registered with TopicManager ${resp}= PerformGetRequestOnDrools /policy/pdp/engine/topics ${DROOLS_IP_2} 200 Should Contain ${resp.text} policy-cl-mgt Should Contain ${resp.text} policy-pdp-pap Should Contain ${resp.text} dcae_topic CheckEngineFeatures - [Documentation] List the features available in the drools engine + [Documentation] List the features available in the drools engine ${resp}= PerformGetRequestOnDrools /policy/pdp/engine/features ${DROOLS_IP_2} 200 Should Contain ${resp.text} "org.onap.policy.drools.lifecycle.LifecycleFeature" Should Contain ${resp.text} "org.onap.policy.drools.apps.controlloop.feature.usecases.UsecasesFeature" @@ -98,7 +98,7 @@ DeployXacmlPolicies [Documentation] Deploys the Policies to Xacml DeployPolicy deploy.xacml.policies.json Sleep 5s - @{otherMessages}= Create List deployed-policies onap.scaleout.tca onap.restart.tca + @{otherMessages}= Create List deployed-policies onap.scaleout.tca onap.restart.tca AssertMessageFromTopic policy-notification onap.vfirewall.tca ${otherMessages} VerifyDeployedXacmlPolicies @@ -106,14 +106,14 @@ VerifyDeployedXacmlPolicies ${resp}= GetDeployedPolicies @{policies}= Create List onap.vfirewall.tca onap.scaleout.tca onap.restart.tca FOR ${policy} IN @{policies} - Should Contain ${resp.text} ${policy} + Should Contain ${resp.text} ${policy} END DeployDroolsPolicies [Documentation] Deploys the Policies to Drools DeployPolicy deploy.drools.policies.json Sleep 5s - @{otherMessages}= Create List deployed-policies operational.scaleout operational.restart + @{otherMessages}= Create List deployed-policies operational.scaleout operational.restart AssertMessageFromTopic policy-notification operational.modifyconfig ${otherMessages} VerifyDeployedDroolsPolicies @@ -121,68 +121,68 @@ VerifyDeployedDroolsPolicies ${resp}= GetDeployedPolicies @{policies}= Create List operational.modifyconfig operational.scaleout operational.restart FOR ${policy} IN @{policies} - Should Contain ${resp.text} ${policy} + Should Contain ${resp.text} ${policy} END VcpeExecute [Documentation] Executes VCPE Policy - OnSet ${CURDIR}/data/drools/vcpeOnset.json + OnSet ${CURDIR}/data/drools/vcpeOnset.json ${policyExecuted}= Set Variable ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e @{otherMessages}= Create List ACTIVE - AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} @{otherMessages}= Create List ${policyExecuted} OPERATION - AssertMessageFromTopic policy-cl-mgt Sending guard query for APPC Restart ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Sending guard query for APPC Restart ${otherMessages} - AssertMessageFromTopic policy-cl-mgt Guard result for APPC Restart is Permit ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Guard result for APPC Restart is Permit ${otherMessages} - AssertMessageFromTopic policy-cl-mgt actor=APPC,operation=Restart ${otherMessages} + AssertMessageFromTopic policy-cl-mgt actor=APPC,operation=Restart ${otherMessages} # @{otherMessages}= Create List OPERATION: SUCCESS actor=APPC,operation=Restart -# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} # # @{otherMessages}= Create List FINAL: SUCCESS APPC Restart -# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} VdnsExecute [Documentation] Executes VDNS Policy - OnSet ${CURDIR}/data/drools/vdnsOnset.json + OnSet ${CURDIR}/data/drools/vdnsOnset.json ${policyExecuted}= Set Variable ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 @{otherMessages}= Create List ACTIVE - AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} @{otherMessages}= Create List ${policyExecuted} OPERATION - AssertMessageFromTopic policy-cl-mgt Sending guard query for SO VF Module Create ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Sending guard query for SO VF Module Create ${otherMessages} - AssertMessageFromTopic policy-cl-mgt Guard result for SO VF Module Create is Permit ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Guard result for SO VF Module Create is Permit ${otherMessages} - AssertMessageFromTopic policy-cl-mgt actor=SO,operation=VF Module Create ${otherMessages} + AssertMessageFromTopic policy-cl-mgt actor=SO,operation=VF Module Create ${otherMessages} @{otherMessages}= Create List ${policyExecuted} OPERATION: SUCCESS - AssertMessageFromTopic policy-cl-mgt actor=SO,operation=VF Module Create ${otherMessages} + AssertMessageFromTopic policy-cl-mgt actor=SO,operation=VF Module Create ${otherMessages} @{otherMessages}= Create List ${policyExecuted} FINAL: SUCCESS SO - AssertMessageFromTopic policy-cl-mgt VF Module Create ${otherMessages} + AssertMessageFromTopic policy-cl-mgt VF Module Create ${otherMessages} VfwExecute [Documentation] Executes VFW Policy - OnSet ${CURDIR}/data/drools/vfwOnset.json + OnSet ${CURDIR}/data/drools/vfwOnset.json ${policyExecuted}= Set Variable ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a @{otherMessages}= Create List ACTIVE - AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} @{otherMessages}= Create List ${policyExecuted} OPERATION - AssertMessageFromTopic policy-cl-mgt Sending guard query for APPC ModifyConfig ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Sending guard query for APPC ModifyConfig ${otherMessages} - AssertMessageFromTopic policy-cl-mgt Guard result for APPC ModifyConfig is Permit ${otherMessages} + AssertMessageFromTopic policy-cl-mgt Guard result for APPC ModifyConfig is Permit ${otherMessages} - AssertMessageFromTopic policy-cl-mgt actor=APPC,operation=ModifyConfig ${otherMessages} + AssertMessageFromTopic policy-cl-mgt actor=APPC,operation=ModifyConfig ${otherMessages} # @{otherMessages}= Create List OPERATION: SUCCESS actor=APPC,operation=ModifyConfig -# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} # # @{otherMessages}= Create List FINAL: SUCCESS APPC ModifyConfig -# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} *** Keywords *** @@ -192,25 +192,25 @@ VerifyController Should Be Equal As Strings ${resp.json()['usecases']} 1 PerformGetRequestOnDrools - [Arguments] ${url} ${domain} ${expectedstatus} - ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session http://${domain} - ${session}= Create Session policy http://${domain} auth=${auth} - ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= GET On Session policy ${url} headers=${headers} expected_status=${expectedstatus} - Log Received response from policy ${resp.text} - RETURN ${resp} + [Arguments] ${url} ${domain} ${expectedstatus} + ${auth}= Create List demo@people.osaaf.org demo123456! + Log Creating session http://${domain} + ${session}= Create Session policy http://${domain} auth=${auth} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= GET On Session policy ${url} headers=${headers} expected_status=${expectedstatus} + Log Received response from policy ${resp.text} + RETURN ${resp} PerformPostRequest - [Arguments] ${url} ${domain} ${file} ${folder} ${contenttype} ${expectedstatus} - ${auth}= Create List policyadmin zb!XztG34 - ${body}= Get file ${folder}/${file} - Log Creating session http://${domain} - ${session}= Create Session policy http://${domain} auth=${auth} - ${headers}= Create Dictionary Accept=application/${contenttype} Content-Type=application/${contenttype} - ${resp}= POST On Session policy ${url} data=${body} headers=${headers} expected_status=${expectedstatus} - Log Received response from policy ${resp.text} - RETURN ${resp} + [Arguments] ${url} ${domain} ${file} ${folder} ${contenttype} ${expectedstatus} + ${auth}= Create List policyadmin zb!XztG34 + ${body}= Get file ${folder}/${file} + Log Creating session http://${domain} + ${session}= Create Session policy http://${domain} auth=${auth} + ${headers}= Create Dictionary Accept=application/${contenttype} Content-Type=application/${contenttype} + ${resp}= POST On Session policy ${url} data=${body} headers=${headers} expected_status=${expectedstatus} + Log Received response from policy ${resp.text} + RETURN ${resp} OnSet [Arguments] ${file} @@ -220,18 +220,18 @@ OnSet RETURN ${resp.stdout} CreatePolicy - [Arguments] ${policyFile} ${contenttype} + [Arguments] ${policyFile} ${contenttype} PerformPostRequest /policy/api/v1/policies ${POLICY_API_IP} ${policyFile} ${DATA} ${contenttype} 201 DeployPolicy - [Arguments] ${policyName} + [Arguments] ${policyName} PerformPostRequest /policy/pap/v1/pdps/deployments/batch ${POLICY_PAP_IP} ${policyName} ${CURDIR}/data/drools json 202 AssertMessageFromTopic - [Arguments] ${topic} ${topicMessage} ${otherMessages} + [Arguments] ${topic} ${topicMessage} ${otherMessages} ${response}= Wait Until Keyword Succeeds 4 x 10 sec CheckKafkaTopic ${topic} ${topicMessage} FOR ${msg} IN @{otherMessages} - Should Contain ${response} ${msg} + Should Contain ${response} ${msg} END GetDeployedPolicies |