diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-08-01 14:18:34 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2024-08-02 12:50:19 +0100 |
commit | f11e6d9815fd739f2241464612fd0b48736f06af (patch) | |
tree | ce890e828cc01b559a698ef47ea786391f32c60c | |
parent | 1836bd57d497827977f175fa88cb7ed49b485e30 (diff) |
Drools-apps CSIT tests (almost) fix.
- controller usecases is now starting normally.
- drools policy is deploying.
- two policy executions are still failing.
Issue-ID: POLICY-4955
Change-Id: I08cee61463c1e8e52f0f874bbb15acca8ed7d6b2
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
-rw-r--r-- | compose/config/drools-applications/env/base.conf | 7 | ||||
-rwxr-xr-x | compose/stop-compose.sh | 7 | ||||
-rwxr-xr-x | csit/resources/scripts/build-csit-docker-image.sh | 2 | ||||
-rw-r--r-- | csit/resources/tests/drools-applications-test.robot | 148 | ||||
-rwxr-xr-x | csit/run-project-csit.sh | 2 |
5 files changed, 89 insertions, 77 deletions
diff --git a/compose/config/drools-applications/env/base.conf b/compose/config/drools-applications/env/base.conf index 0f677239..4ac3330c 100644 --- a/compose/config/drools-applications/env/base.conf +++ b/compose/config/drools-applications/env/base.conf @@ -141,3 +141,10 @@ SDNC_PORT=6668 SDNC_CONTEXT_URI= SDNC_USERNAME= SDNC_PASSWORD= + +# CDS + +CDS_GRPC_HOST=grpc-sim +CDS_GRPC_PORT=6680 +CDS_GRPC_USERNAME="ccsdkapps" +CDS_GRPC_PASSWORD="ccsdkapps" diff --git a/compose/stop-compose.sh b/compose/stop-compose.sh index 809c8f47..493f9b57 100755 --- a/compose/stop-compose.sh +++ b/compose/stop-compose.sh @@ -42,7 +42,7 @@ source export-ports.sh > /dev/null 2>&1 source get-versions.sh > /dev/null 2>&1 echo "Collecting logs from docker compose containers..." -rm -rf docker_compose.log +rm -rf *.log # this will collect logs by service instead of mixing all together containers=$(docker compose ps --all --format '{{.Service}}') @@ -51,10 +51,7 @@ IFS=$'\n' read -d '' -r -a item_list <<< "$containers" for item in "${item_list[@]}" do if [ -n "$item" ]; then - echo "======== Logs from ${item} ========" >> docker_compose.log - docker compose logs $item >> docker_compose.log - echo "===================================" >> docker_compose.log - echo "" >> docker_compose.log + docker compose logs $item >> $item.log fi done diff --git a/csit/resources/scripts/build-csit-docker-image.sh b/csit/resources/scripts/build-csit-docker-image.sh index d4686422..8fd300f4 100755 --- a/csit/resources/scripts/build-csit-docker-image.sh +++ b/csit/resources/scripts/build-csit-docker-image.sh @@ -46,7 +46,7 @@ docker image rm -f ${ROBOT_DOCKER_IMAGE} clone_models echo "Build robot framework docker image" -docker build . --file Dockerfile --tag "${ROBOT_DOCKER_IMAGE}" --no-cache +docker build . --file Dockerfile --tag "${ROBOT_DOCKER_IMAGE}" --quiet docker save -o policy-csit-robot.tar ${ROBOT_DOCKER_IMAGE}:latest rm -rf ${WORKSPACE}/csit/resources/policy-csit-robot.tar diff --git a/csit/resources/tests/drools-applications-test.robot b/csit/resources/tests/drools-applications-test.robot index e7b2105f..3c4303ad 100644 --- a/csit/resources/tests/drools-applications-test.robot +++ b/csit/resources/tests/drools-applications-test.robot @@ -23,9 +23,9 @@ Healthcheck ${resp}= PeformGetRequest /healthcheck ${DROOLS_IP} 200 Should Be Equal As Strings ${resp.json()['healthy']} True -#Controller -# [Documentation] Checks controller is up -# Wait Until Keyword Succeeds 2 min 15 sec VerifyController +Controller + [Documentation] Checks controller is up + Wait Until Keyword Succeeds 2 min 15 sec VerifyController MakeTopics [Documentation] Creates the Policy topics @@ -65,81 +65,82 @@ DeployXacmlPolicies Should Contain ${result} onap.scaleout.tca Should Contain ${result} onap.restart.tca -## Uncomment the drools policy deployment once the drools pdp code is fixed -#DeployDroolsPolicies -# [Documentation] Deploys the Policies to Drools -# DeployPolicy deploy.drools.policies.json -# Sleep 5s -# ${result}= CheckKafkaTopic policy-notification operational.modifyconfig -# Should Contain ${result} deployed-policies -# Should Contain ${result} operational.scaleout -# Should Contain ${result} operational.restart -# +DeployDroolsPolicies + [Documentation] Deploys the Policies to Drools + DeployPolicy deploy.drools.policies.json + Sleep 5s + ${result}= CheckKafkaTopic policy-notification operational.modifyconfig + Should Contain ${result} deployed-policies + Should Contain ${result} operational.scaleout + Should Contain ${result} operational.restart + #VcpeExecute # [Documentation] Executes VCPE Policy # OnSet ${CURDIR}/data/vcpeOnset.json -# ${result}= CheckKafkaTopic policy-cl-mgt ACTIVE -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# Should Contain ${result} Sending guard query for APPC Restart -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# Should Contain ${result} Guard result for APPC Restart is Permit -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# Should Contain ${result} actor=APPC,operation=Restart -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION: SUCCESS -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# Should Contain ${result} actor=APPC,operation=Restart -# ${result}= CheckKafkaTopic policy-cl-mgt FINAL: SUCCESS -# Should Contain ${result} ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e -# Should Contain ${result} APPC -# Should Contain ${result} Restart +# ${policyExecuted}= Set Variable ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e +# @{otherMessages}= Create List ACTIVE +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION Sending guard query for APPC Restart +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION Guard result for APPC Restart is Permit +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} # -#VdnsExecute -# [Documentation] Executes VDNS Policy -# OnSet ${CURDIR}/data/vdnsOnset.json -# ${result}= CheckKafkaTopic policy-cl-mgt ACTIVE -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# Should Contain ${result} Sending guard query for SO VF Module Create -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# Should Contain ${result} Guard result for SO VF Module Create is Permit -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# Should Contain ${result} actor=SO,operation=VF Module Create -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION: SUCCESS -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# Should Contain ${result} actor=SO,operation=VF Module Create -# ${result}= CheckKafkaTopic policy-cl-mgt FINAL: SUCCESS -# Should Contain ${result} ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 -# Should Contain ${result} SO -# Should Contain ${result} VF Module Create +# @{otherMessages}= Create List OPERATION actor=APPC,operation=Restart +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} # +# @{otherMessages}= Create List OPERATION: SUCCESS actor=APPC,operation=Restart +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List FINAL: SUCCESS APPC Restart +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + +VdnsExecute + [Documentation] Executes VDNS Policy + OnSet ${CURDIR}/data/vdnsOnset.json + ${policyExecuted}= Set Variable ControlLoop-vDNS-6f37f56d-a87d-4b85-b6a9-cc953cf779b3 + @{otherMessages}= Create List ACTIVE + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + + @{otherMessages}= Create List OPERATION Sending guard query for SO VF Module Create + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + + @{otherMessages}= Create List OPERATION Guard result for SO VF Module Create is Permit + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + + @{otherMessages}= Create List OPERATION actor=SO,operation=VF Module Create + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + + @{otherMessages}= Create List OPERATION: SUCCESS actor=SO,operation=VF Module Create + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + + @{otherMessages}= Create List FINAL: SUCCESS SO VF Module Create + AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + #VfwExecute # [Documentation] Executes VFW Policy # OnSet ${CURDIR}/data/vfwOnset.json -# ${result}= CheckKafkaTopic policy-cl-mgt ACTIVE -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# Should Contain ${result} Sending guard query for APPC ModifyConfig -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# Should Contain ${result} Guard result for APPC ModifyConfig is Permit -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# Should Contain ${result} actor=APPC,operation=ModifyConfig -# ${result}= CheckKafkaTopic policy-cl-mgt OPERATION: SUCCESS -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# Should Contain ${result} actor=APPC,operation=ModifyConfig -# ${result}= CheckKafkaTopic policy-cl-mgt FINAL: SUCCESS -# Should Contain ${result} ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a -# Should Contain ${result} APPC -# Should Contain ${result} ModifyConfig +# ${policyExecuted}= Set Variable ControlLoop-vFirewall-d0a1dfc6-94f5-4fd4-a5b5-4630b438850a +# @{otherMessages}= Create List ACTIVE +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION Sending guard query for APPC ModifyConfig +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION Guard result for APPC ModifyConfig is Permit +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION actor=APPC,operation=ModifyConfig +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# @{otherMessages}= Create List OPERATION: SUCCESS actor=APPC,operation=ModifyConfig +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} +# +# Log "Checking if policy execution status is FINAL: SUCCESS" +# @{otherMessages}= Create List FINAL: SUCCESS APPC ModifyConfig +# AssertMessageFromTopic policy-cl-mgt ${policyExecuted} ${otherMessages} + *** Keywords *** @@ -182,3 +183,10 @@ CreatePolicy DeployPolicy [Arguments] ${policyName} PerformPostRequest /policy/pap/v1/pdps/deployments/batch ${POLICY_PAP_IP} ${policyName} ${CURDIR}/data json 202 + +AssertMessageFromTopic + [Arguments] ${topic} ${topicMessage} ${otherMessages} + ${response}= Wait Until Keyword Succeeds 4 x 10 sec CheckKafkaTopic ${topic} ${topicMessage} + FOR ${msg} IN @{otherMessages} + Should Contain ${response} ${msg} + END diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh index 36bad1ff..8d467ade 100755 --- a/csit/run-project-csit.sh +++ b/csit/run-project-csit.sh @@ -294,7 +294,7 @@ unset http_proxy https_proxy export ROBOT_FILES -# use a separate script to build a CSIT docker image, to containerize the test run +# use a separate script to build a CSIT docker image, to isolate the test run if [ "${2}" == "--skip-build-csit" ]; then echo "Skipping build csit robot image" else |