diff options
-rw-r--r-- | compose/config/pap/papParameters.yaml | 1 | ||||
-rw-r--r-- | compose/docker-compose.yml | 2 | ||||
-rwxr-xr-x | compose/start-compose.sh | 3 | ||||
-rwxr-xr-x | compose/stop-compose.sh | 6 | ||||
-rw-r--r-- | csit/resources/tests/apex-pdp-test.robot | 10 | ||||
-rw-r--r-- | csit/resources/tests/apex-slas-10.robot | 8 | ||||
-rw-r--r-- | csit/resources/tests/apex-slas-3.robot | 8 | ||||
-rw-r--r-- | csit/resources/tests/apex-slas.robot | 8 | ||||
-rw-r--r-- | csit/resources/tests/api-test.robot | 12 | ||||
-rw-r--r-- | csit/resources/tests/common-library.robot | 12 | ||||
-rw-r--r-- | csit/resources/tests/drools-applications-test.robot | 32 | ||||
-rw-r--r-- | csit/resources/tests/pap-test.robot | 6 | ||||
-rw-r--r-- | csit/resources/tests/xacml-pdp-test.robot | 4 | ||||
-rwxr-xr-x | csit/run-project-csit.sh | 1 |
14 files changed, 65 insertions, 48 deletions
diff --git a/compose/config/pap/papParameters.yaml b/compose/config/pap/papParameters.yaml index 51aaec38..5b6c640e 100644 --- a/compose/config/pap/papParameters.yaml +++ b/compose/config/pap/papParameters.yaml @@ -27,7 +27,6 @@ server: pap: name: PapGroup - aaf: false topic: pdp-pap.name: policy-pdp-pap notification.name: policy-notification diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml index d5a2cc78..49c63779 100644 --- a/compose/docker-compose.yml +++ b/compose/docker-compose.yml @@ -500,7 +500,7 @@ services: TEST_ENV: ${TEST_ENV} jaeger: - image: jaegertracing/all-in-one:latest + image: jaegertracing/all-in-one:1.58 container_name: jaeger ports: - 4318:4318 diff --git a/compose/start-compose.sh b/compose/start-compose.sh index a5da09d8..a6ada298 100755 --- a/compose/start-compose.sh +++ b/compose/start-compose.sh @@ -72,6 +72,9 @@ if [ -z "$ROBOT_LOG_DIR" ]; then export ROBOT_LOG_DIR=/tmp/ fi +# always 'docker' if running docker compose +export TEST_ENV="docker" + if [ -n "$component" ]; then if [ "$component" == "logs" ]; then echo "Collecting logs..." diff --git a/compose/stop-compose.sh b/compose/stop-compose.sh index 013fbe1e..809c8f47 100755 --- a/compose/stop-compose.sh +++ b/compose/stop-compose.sh @@ -24,6 +24,9 @@ if [ -z "${WORKSPACE}" ]; then export WORKSPACE fi +# always 'docker' if running docker compose +export TEST_ENV="docker" + # docker compose fails when not running CSIT if [ -z "$ROBOT_LOG_DIR" ]; then export ROBOT_LOG_DIR=/tmp/ @@ -51,11 +54,10 @@ do echo "======== Logs from ${item} ========" >> docker_compose.log docker compose logs $item >> docker_compose.log echo "===================================" >> docker_compose.log + echo "" >> docker_compose.log fi done -cat docker_compose.log - echo "Tearing down containers..." docker compose down -v --remove-orphans diff --git a/csit/resources/tests/apex-pdp-test.robot b/csit/resources/tests/apex-pdp-test.robot index 42be4415..6e426851 100644 --- a/csit/resources/tests/apex-pdp-test.robot +++ b/csit/resources/tests/apex-pdp-test.robot @@ -20,7 +20,7 @@ ExecuteApexSampleDomainPolicy # [Tags] docker Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain ${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 + 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 @@ -28,7 +28,7 @@ ExecuteApexSampleDomainPolicy 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 + 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 @@ -37,7 +37,7 @@ ExecuteApexTestPnfPolicy #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 +# 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 @@ -46,9 +46,9 @@ ExecuteApexTestPnfPolicy ExecuteApexTestPnfPolicyWithMetadataSet Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.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 + 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 200 ${postjson} 1 + 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 diff --git a/csit/resources/tests/apex-slas-10.robot b/csit/resources/tests/apex-slas-10.robot index 53779774..e2338c60 100644 --- a/csit/resources/tests/apex-slas-10.robot +++ b/csit/resources/tests/apex-slas-10.robot @@ -20,9 +20,9 @@ ValidatePolicyExecutionAndEventRateLowComplexity [Documentation] Validate that a moderate complexity policity can be executed in less than 100ms and minimum 100 events triggered per second Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.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 + 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 200 ${postjson} 1 + 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 @@ -36,7 +36,7 @@ ValidatePolicyExecutionAndEventRateHighComplexity [Documentation] Validate that a high complexity policity can be executed in less than 5000ms and minimum 2 events triggered per second Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain ${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 + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 DeployPolicy Create Session apexSession http://${APEX_EVENTS_IP} max_retries=1 ${data}= Get Binary File ${CURDIR}/data/event.json @@ -52,7 +52,7 @@ ValidatePolicyExecutionAndEventRateModerateComplexity [Documentation] Validate that a low complexity policity can be executed in less than 1000ms and minimum 10 events triggered per second 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 + 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 diff --git a/csit/resources/tests/apex-slas-3.robot b/csit/resources/tests/apex-slas-3.robot index 048e2e76..9322f177 100644 --- a/csit/resources/tests/apex-slas-3.robot +++ b/csit/resources/tests/apex-slas-3.robot @@ -20,7 +20,7 @@ ValidatePolicyExecutionAndEventRateLowComplexity [Documentation] Validate that a moderate complexity policity can be executed in less than 100ms and minimum 30 events triggered per second 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 + 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 @@ -34,9 +34,9 @@ ValidatePolicyExecutionAndEventRateHighComplexity [Documentation] Validate that a high complexity policity can be executed in less than 5000ms and minimum 0.6 events triggered per second Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.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 + 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 200 ${postjson} 1 + 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 @@ -50,7 +50,7 @@ ValidatePolicyExecutionAndEventRateModerateComplexity [Documentation] Validate that a low complexity policity can be executed in less than 1000ms and minimum 3 events triggered per second Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain ${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 + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 DeployPolicy #Wait Until Keyword Succeeds 4 min 5 sec RunEventOnApexEngine Create Session apexSession http://${APEX_EVENTS_IP} max_retries=1 diff --git a/csit/resources/tests/apex-slas.robot b/csit/resources/tests/apex-slas.robot index 69b24521..08d50062 100644 --- a/csit/resources/tests/apex-slas.robot +++ b/csit/resources/tests/apex-slas.robot @@ -20,7 +20,7 @@ ValidatePolicyExecutionAndEventRateLowComplexity [Documentation] Validate that a moderate complexity policity can be executed in less than 100ms and minimum 10 events triggered per second 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 + 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 @@ -34,7 +34,7 @@ ValidatePolicyExecutionAndEventRateModerateComplexity [Documentation] Validate that a low complexity policity can be executed in less than 1000ms and minimum 1 events triggered per second Set Test Variable ${policyName} onap.policies.native.apex.Sampledomain ${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 + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} ${policyName} 1.0.0 DeployPolicy ${eventStartTime}= Get Current Date Wait Until Keyword Succeeds 4 min 5 sec RunEventOnApexEngine @@ -45,9 +45,9 @@ ValidatePolicyExecutionAndEventRateHighComplexity [Documentation] Validate that a high complexity policity can be executed in less than 5000ms and minimum 0.2 events triggered per second Set Test Variable ${policyName} onap.policies.apex.pnf.metadataSet.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 + 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 200 ${postjson} 1 + 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 diff --git a/csit/resources/tests/api-test.robot b/csit/resources/tests/api-test.robot index bce58231..9c8a5f0b 100644 --- a/csit/resources/tests/api-test.robot +++ b/csit/resources/tests/api-test.robot @@ -28,7 +28,7 @@ CreateTCAPolicyTypeV2 CreateTCAPolicyTypeV3 [Documentation] Create a policy type named 'onap.policies.monitoring.tcagen2' and version '3.0.0' - CreatePolicyType /policy/api/v1/policytypes 200 onap.policy.monitoring.tcagen2.v3.json onap.policies.monitoring.tcagen2 3.0.0 + CreatePolicyType /policy/api/v1/policytypes 201 onap.policy.monitoring.tcagen2.v3.json onap.policies.monitoring.tcagen2 3.0.0 RetrieveMonitoringPolicyTypes [Documentation] Retrieve all monitoring related policy types @@ -37,7 +37,7 @@ RetrieveMonitoringPolicyTypes CreateNewMonitoringPolicyV1 [Documentation] Create a policy named 'onap.restart.tca' and version '1.0.0' using specific api ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 200 ${postjson} onap.restart.tca 1.0.0 + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies ${postjson} onap.restart.tca 1.0.0 CreateNewMonitoringPolicyV1Again [Documentation] Create an existing policy with modification and keeping the same version should result in error. @@ -47,12 +47,12 @@ CreateNewMonitoringPolicyV1Again CreateNewMonitoringPolicyV2 [Documentation] Create a policy named 'onap.restart.tca' and version '2.0.0' using generic api ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v2.json - CreatePolicy /policy/api/v1/policies 200 ${postjson} onap.restart.tca 2.0.0 + CreatePolicySuccessfully /policy/api/v1/policies ${postjson} onap.restart.tca 2.0.0 CreateNodeTemplates [Documentation] Create node templates in database using specific api ${postjson}= Get file ${NODETEMPLATES}/nodetemplates.metadatasets.input.tosca.json - CreateNodeTemplate /policy/api/v1/nodetemplates 200 ${postjson} 3 + CreateNodeTemplate /policy/api/v1/nodetemplates 201 ${postjson} 3 RetrievePoliciesOfType [Documentation] Retrieve all policies belonging to a specific Policy Type @@ -113,8 +113,8 @@ Metrics Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policies",} 1.0 Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0 Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="GET",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0 - Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0 - Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="201",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies",} 1.0 + Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="POST",outcome="SUCCESS",status="201",uri="/policytypes",} 1.0 Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/policies/{policyId}/versions/{policyVersion}",} 1.0 Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{versionId}",} 3.0 Should Contain ${resp.text} http_server_requests_seconds_count{error="none",exception="none",method="DELETE",outcome="SUCCESS",status="200",uri="/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}",} 1.0 diff --git a/csit/resources/tests/common-library.robot b/csit/resources/tests/common-library.robot index a585bc97..30fd32a2 100644 --- a/csit/resources/tests/common-library.robot +++ b/csit/resources/tests/common-library.robot @@ -50,15 +50,21 @@ CreatePolicy [Documentation] Create the specific policy ${policyadmin}= PolicyAdminAuth ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} null ${policyadmin} - Run Keyword If ${expectedstatus}==200 Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} ${policyname} - Run Keyword If ${expectedstatus}==200 Should Be Equal As Strings ${resp.json()['topology_template']['policies'][0]['${policyname}']['version']} ${policyversion} + +CreatePolicySuccessfully + [Arguments] ${url} ${postjson} ${policyname} ${policyversion} + [Documentation] Create the specific policy + ${policyadmin}= PolicyAdminAuth + ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} 201 ${postjson} null ${policyadmin} + Dictionary Should Contain Key ${resp.json()['topology_template']['policies'][0]} ${policyname} + Should Be Equal As Strings ${resp.json()['topology_template']['policies'][0]['${policyname}']['version']} ${policyversion} CreateNodeTemplate [Arguments] ${url} ${expectedstatus} ${postjson} ${nodeTemplateListLength} [Documentation] Create the node templates ${policyadmin}= PolicyAdminAuth ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} \ ${policyadmin} - Run Keyword If ${expectedstatus}==200 Length Should Be ${resp.json()['topology_template']['node_templates']} ${nodeTemplateListLength} + Run Keyword If ${expectedstatus}==201 Length Should Be ${resp.json()['topology_template']['node_templates']} ${nodeTemplateListLength} QueryPdpGroups diff --git a/csit/resources/tests/drools-applications-test.robot b/csit/resources/tests/drools-applications-test.robot index edbc1df6..e7b2105f 100644 --- a/csit/resources/tests/drools-applications-test.robot +++ b/csit/resources/tests/drools-applications-test.robot @@ -34,41 +34,41 @@ MakeTopics CreateVcpeXacmlPolicy [Documentation] Create VCPE Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vCPE.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + CreatePolicy vCPE.policy.monitoring.input.tosca.yaml yaml CreateVcpeDroolsPolicy [Documentation] Create VCPE Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vCPE.policy.operational.input.tosca.yaml ${DATA} yaml 200 + CreatePolicy vCPE.policy.operational.input.tosca.yaml yaml CreateVdnsXacmlPolicy [Documentation] Create VDNS Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vDNS.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + CreatePolicy vDNS.policy.monitoring.input.tosca.yaml yaml CreateVdnsDroolsPolicy [Documentation] Create VDNS Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vDNS.policy.operational.input.tosca.json ${DATA} json 200 + CreatePolicy vDNS.policy.operational.input.tosca.json json CreateVfwXacmlPolicy [Documentation] Create VFW Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vFirewall.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + CreatePolicy vFirewall.policy.monitoring.input.tosca.yaml yaml CreateVfwDroolsPolicy [Documentation] Create VFW Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${POLICY_API_IP} vFirewall.policy.operational.input.tosca.json ${DATA} json 200 + CreatePolicy vFirewall.policy.operational.input.tosca.json json DeployXacmlPolicies [Documentation] Deploys the Policies to Xacml - PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${POLICY_PAP_IP} deploy.xacml.policies.json ${CURDIR}/data json 202 + DeployPolicy deploy.xacml.policies.json Sleep 5s ${result}= CheckKafkaTopic policy-notification onap.vfirewall.tca Should Contain ${result} deployed-policies Should Contain ${result} onap.scaleout.tca Should Contain ${result} onap.restart.tca -# Uncomment the drools policy deployment once the drools pdp code is fixed +## Uncomment the drools policy deployment once the drools pdp code is fixed #DeployDroolsPolicies # [Documentation] Deploys the Policies to Drools -# PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${POLICY_PAP_IP} deploy.drools.policies.json ${CURDIR}/data json 202 +# DeployPolicy deploy.drools.policies.json # Sleep 5s # ${result}= CheckKafkaTopic policy-notification operational.modifyconfig # Should Contain ${result} deployed-policies @@ -158,13 +158,13 @@ PeformGetRequest RETURN ${resp} PerformPostRequest - [Arguments] ${url} ${params} ${domain} ${jsonfile} ${filepath} ${contenttype} ${expectedstatus} + [Arguments] ${url} ${domain} ${file} ${folder} ${contenttype} ${expectedstatus} ${auth}= Create List policyadmin zb!XztG34 - ${postjson}= Get file ${filepath}/${jsonfile} + ${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} params=${params} data=${postjson} headers=${headers} expected_status=${expectedstatus} + ${resp}= POST On Session policy ${url} data=${body} headers=${headers} expected_status=${expectedstatus} Log Received response from policy ${resp.text} RETURN ${resp} @@ -174,3 +174,11 @@ OnSet ${resp}= Run Process ${CURDIR}/kafka_producer.py unauthenticated.dcae_cl_output ${data} ${KAFKA_IP} Log Response from kafka ${resp.stdout} RETURN ${resp.stdout} + +CreatePolicy + [Arguments] ${policyFile} ${contenttype} + PerformPostRequest /policy/api/v1/policies ${POLICY_API_IP} ${policyFile} ${DATA} ${contenttype} 201 + +DeployPolicy + [Arguments] ${policyName} + PerformPostRequest /policy/pap/v1/pdps/deployments/batch ${POLICY_PAP_IP} ${policyName} ${CURDIR}/data json 202 diff --git a/csit/resources/tests/pap-test.robot b/csit/resources/tests/pap-test.robot index 13bf16ed..58a6a049 100644 --- a/csit/resources/tests/pap-test.robot +++ b/csit/resources/tests/pap-test.robot @@ -19,17 +19,17 @@ CheckUndeploymentStatus LoadPolicy [Documentation] Create a policy named 'onap.restart.tca' and version '1.0.0' using specific api ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 200 ${postjson} onap.restart.tca 1.0.0 + CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 201 ${postjson} onap.restart.tca 1.0.0 LoadPolicyWithMetadataSet [Documentation] Create a policy named 'operational.apex.decisionMaker' and version '1.0.0' using specific api ${postjson}= Get file ${CURDIR}/data/apex.policy.decisionmaker.input.tosca.json - CreatePolicy /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies 200 ${postjson} operational.apex.decisionMaker 1.0.0 + CreatePolicySuccessfully /policy/api/v1/policytypes/onap.policies.native.Apex/versions/1.0.0/policies ${postjson} operational.apex.decisionMaker 1.0.0 LoadNodeTemplates [Documentation] Create node templates in database using specific api ${postjson}= Get file ${NODETEMPLATES}/nodetemplates.metadatasets.input.tosca.json - CreateNodeTemplate /policy/api/v1/nodetemplates 200 ${postjson} 3 + CreateNodeTemplate /policy/api/v1/nodetemplates 201 ${postjson} 3 Healthcheck [Documentation] Verify policy pap health check diff --git a/csit/resources/tests/xacml-pdp-test.robot b/csit/resources/tests/xacml-pdp-test.robot index cddecab9..9d6227c3 100644 --- a/csit/resources/tests/xacml-pdp-test.robot +++ b/csit/resources/tests/xacml-pdp-test.robot @@ -37,12 +37,12 @@ ExecuteXacmlPolicy CreateMonitorPolicy [Documentation] Create a Monitoring policy ${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.json - CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 200 ${postjson} onap.restart.tca 1.0.0 + CreatePolicy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies 201 ${postjson} onap.restart.tca 1.0.0 CreateOptimizationPolicy [Documentation] Create an Optimization policy ${postjson}= Get file ${DATA}/vCPE.policies.optimization.input.tosca.json - CreatePolicy /policy/api/v1/policytypes/onap.policies.optimization.resource.AffinityPolicy/versions/1.0.0/policies 200 ${postjson} OSDF_CASABLANCA.Affinity_Default 1.0.0 + CreatePolicy /policy/api/v1/policytypes/onap.policies.optimization.resource.AffinityPolicy/versions/1.0.0/policies 201 ${postjson} OSDF_CASABLANCA.Affinity_Default 1.0.0 GetDefaultDecision [Documentation] Get Default Decision with no policies in Xacml PDP diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh index 678bfe2a..bd2a33eb 100755 --- a/csit/run-project-csit.sh +++ b/csit/run-project-csit.sh @@ -42,7 +42,6 @@ function docker_stats(){ function setup_clamp() { export ROBOT_FILES="policy-clamp-test.robot" - export TEST_ENV="docker" source "${WORKSPACE}"/compose/start-compose.sh policy-clamp-runtime-acm sleep 30 bash "${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}" |