diff options
Diffstat (limited to 'csit/drools-applications')
-rwxr-xr-x | csit/drools-applications/plans/setup.sh | 12 | ||||
-rw-r--r-- | csit/drools-applications/tests/drools-applications-test.robot | 36 |
2 files changed, 28 insertions, 20 deletions
diff --git a/csit/drools-applications/plans/setup.sh b/csit/drools-applications/plans/setup.sh index 6ca073bc..5f680b44 100755 --- a/csit/drools-applications/plans/setup.sh +++ b/csit/drools-applications/plans/setup.sh @@ -2,7 +2,7 @@ # # ===========LICENSE_START==================================================== # Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. -# Modifications Copyright 2021-2022 Nordix Foundation. +# Modifications Copyright 2021-2023 Nordix Foundation. # ============================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,9 +33,13 @@ docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools-apps unset http_proxy https_proxy DROOLS_IP=$(get-instance-ip.sh drools-apps) +DROOLS_PORT=30221 API_IP=$(get-instance-ip.sh policy-api) +API_PORT=30440 PAP_IP=$(get-instance-ip.sh policy-pap) +PAP_PORT=30442 XACML_IP=$(get-instance-ip.sh policy-xacml-pdp) +XACML_PORT=30441 SIM_IP=$(get-instance-ip.sh simulator) export SIM_IP @@ -46,7 +50,7 @@ echo XACML IP IS "${XACML_IP}" echo SIMULATORS IP IS "${SIM_IP}" # wait for the app to start up -"${SCRIPTS}"/wait_for_port.sh "${DROOLS_IP}" 6969 +"${SCRIPTS}"/wait_for_rest.sh localhost 30219 # give enough time for the controllers to come up sleep 15 @@ -59,7 +63,11 @@ ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCR2:${SCRIPTS}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA:${DATA}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DATA2:${DATA2}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_IP:${DROOLS_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DROOLS_PORT:${DROOLS_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_IP:${API_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v API_PORT:${API_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_IP:${PAP_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v PAP_PORT:${PAP_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_IP:${XACML_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v XACML_PORT:${XACML_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SIM_IP:${SIM_IP}" diff --git a/csit/drools-applications/tests/drools-applications-test.robot b/csit/drools-applications/tests/drools-applications-test.robot index c06631b9..02dc0f32 100644 --- a/csit/drools-applications/tests/drools-applications-test.robot +++ b/csit/drools-applications/tests/drools-applications-test.robot @@ -9,17 +9,17 @@ Library json *** Test Cases *** Alive [Documentation] Runs Policy PDP Alive Check - ${resp}= PeformGetRequest /policy/pdp/engine ${DROOLS_IP} 9696 200 + ${resp}= PeformGetRequest /policy/pdp/engine 30219 200 Should Be Equal As Strings ${resp.json()['alive']} True Metrics [Documentation] Verify drools-apps is exporting metrics - ${resp}= PeformGetRequest /metrics ${DROOLS_IP} 9696 200 + ${resp}= PeformGetRequest /metrics 30219 200 Should Contain ${resp.text} jvm_threads_current Healthcheck [Documentation] Runs Policy PDP-D Health check - ${resp}= PeformGetRequest /healthcheck ${DROOLS_IP} 6969 200 + ${resp}= PeformGetRequest /healthcheck ${DROOLS_PORT} 200 Should Be Equal As Strings ${resp.json()['healthy']} True Controller @@ -35,31 +35,31 @@ MakeTopics CreateVcpeXacmlPolicy [Documentation] Create VCPE Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vCPE.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vCPE.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 CreateVcpeDroolsPolicy [Documentation] Create VCPE Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vCPE.policy.operational.input.tosca.yaml ${DATA} yaml 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vCPE.policy.operational.input.tosca.yaml ${DATA} yaml 200 CreateVdnsXacmlPolicy [Documentation] Create VDNS Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vDNS.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vDNS.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 CreateVdnsDroolsPolicy [Documentation] Create VDNS Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vDNS.policy.operational.input.tosca.json ${DATA} json 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vDNS.policy.operational.input.tosca.json ${DATA} json 200 CreateVfwXacmlPolicy [Documentation] Create VFW Policy for Xacml - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vFirewall.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vFirewall.policy.monitoring.input.tosca.yaml ${DATA} yaml 200 CreateVfwDroolsPolicy [Documentation] Create VFW Policy for Drools - PerformPostRequest /policy/api/v1/policies null ${API_IP} 6969 vFirewall.policy.operational.input.tosca.json ${DATA} json 200 + PerformPostRequest /policy/api/v1/policies null ${API_PORT} vFirewall.policy.operational.input.tosca.json ${DATA} json 200 DeployXacmlPolicies [Documentation] Deploys the Policies to Xacml - PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_IP} 6969 deploy.xacml.policies.json ${DATA2} json 202 + PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_PORT} deploy.xacml.policies.json ${DATA2} json 202 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP ... responseTo xacml ACTIVE restart Log Received status ${result.stdout} @@ -70,7 +70,7 @@ DeployXacmlPolicies DeployDroolsPolicies [Documentation] Deploys the Policies to Drools - PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_IP} 6969 deploy.drools.policies.json ${DATA2} json 202 + PerformPostRequest /policy/pap/v1/pdps/deployments/batch null ${PAP_PORT} deploy.drools.policies.json ${DATA2} json 202 ${result}= Run Process ${SCR2}/wait_topic.sh POLICY-PDP-PAP ... responseTo drools ACTIVE Log Received status ${result.stdout} @@ -207,25 +207,25 @@ VfwExecute *** Keywords *** VerifyController - ${resp}= PeformGetRequest /policy/pdp/engine/controllers/usecases/drools/facts ${DROOLS_IP} 9696 200 + ${resp}= PeformGetRequest /policy/pdp/engine/controllers/usecases/drools/facts 30219 200 Should Be Equal As Strings ${resp.json()['usecases']} 1 PeformGetRequest - [Arguments] ${url} ${hostname} ${port} ${expectedstatus} + [Arguments] ${url} ${port} ${expectedstatus} ${auth}= Create List demo@people.osaaf.org demo123456! - Log Creating session http://${hostname}:${port} - ${session}= Create Session policy http://${hostname}:${port} auth=${auth} + Log Creating session http://localhost:${port} + ${session}= Create Session policy http://localhost:${port} 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} ${params} ${hostname} ${port} ${jsonfile} ${filepath} ${contenttype} ${expectedstatus} + [Arguments] ${url} ${params} ${port} ${jsonfile} ${filepath} ${contenttype} ${expectedstatus} ${auth}= Create List policyadmin zb!XztG34 ${postjson}= Get file ${filepath}/${jsonfile} - Log Creating session http://${hostname}:${port} - ${session}= Create Session policy http://${hostname}:${port} auth=${auth} + Log Creating session http://localhost:${port} + ${session}= Create Session policy http://localhost:${port} 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} Log Received response from policy ${resp.text} |