diff options
Diffstat (limited to 'csit/apex-pdp')
-rwxr-xr-x | csit/apex-pdp/plans/setup.sh | 10 | ||||
-rw-r--r-- | csit/apex-pdp/tests/apex-pdp-test.robot | 14 |
2 files changed, 15 insertions, 9 deletions
diff --git a/csit/apex-pdp/plans/setup.sh b/csit/apex-pdp/plans/setup.sh index f38b9e45..9241041a 100755 --- a/csit/apex-pdp/plans/setup.sh +++ b/csit/apex-pdp/plans/setup.sh @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # Copyright (C) 2018 Ericsson. All rights reserved. # -# Modifications Copyright (c) 2019-2022 Nordix Foundation. +# Modifications Copyright (c) 2019-2023 Nordix Foundation. # Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. # Modifications Copyright (C) 2021 Bell Canada. All rights reserved. # ================================================================================ @@ -35,9 +35,12 @@ docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d apex-pdp grafana unset http_proxy https_proxy POLICY_API_IP=$(get-instance-ip.sh policy-api) +POLICY_API_PORT=30440 POLICY_PAP_IP=$(get-instance-ip.sh policy-pap) +POLICY_PAP_PORT=30442 MARIADB_IP=$(get-instance-ip.sh mariadb) APEX_IP=$(get-instance-ip.sh policy-apex-pdp) +APEX_PORT=30237 SIM_IP=$(get-instance-ip.sh simulator) export SIM_IP @@ -48,11 +51,14 @@ echo APEX IP IS "${APEX_IP}" echo DMAAP_IP IS "${SIM_IP}" # wait for the app to start up -"${SCRIPTS}"/wait_for_port.sh "${APEX_IP}" 6969 +"${SCRIPTS}"/wait_for_rest.sh localhost "${APEX_PORT}" ROBOT_VARIABLES="" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPTS:${SCRIPTS}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_PORT:${APEX_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_PORT:${POLICY_API_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_IP:${POLICY_PAP_IP}" +ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_PAP_PORT:${POLICY_PAP_PORT}" ROBOT_VARIABLES="${ROBOT_VARIABLES} -v DMAAP_IP:${SIM_IP}" diff --git a/csit/apex-pdp/tests/apex-pdp-test.robot b/csit/apex-pdp/tests/apex-pdp-test.robot index 77393270..3de53a96 100644 --- a/csit/apex-pdp/tests/apex-pdp-test.robot +++ b/csit/apex-pdp/tests/apex-pdp-test.robot @@ -12,7 +12,7 @@ Resource ${CURDIR}/../../common-library.robot Healthcheck [Documentation] Runs Apex PDP Health check ${hcauth}= HealthCheckAuth - ${resp}= PerformGetRequest ${APEX_IP} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} + ${resp}= PerformGetRequest ${APEX_PORT} /policy/apex-pdp/v1/healthcheck 200 null ${hcauth} Should Be Equal As Strings ${resp.json()['code']} 200 Set Suite Variable ${pdpName} ${resp.json()['name']} @@ -62,7 +62,7 @@ ExecuteApexTestPnfPolicyWithMetadataSet Metrics [Documentation] Verify policy-apex-pdp is exporting prometheus metrics ${auth}= HealthCheckAuth - ${resp}= PerformGetRequest ${APEX_IP} /metrics 200 null ${auth} + ${resp}= PerformGetRequest ${APEX_PORT} /metrics 200 null ${auth} Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="TOTAL",} 4.0 Should Contain ${resp.text} pdpa_policy_deployments_total{operation="deploy",status="SUCCESS",} 4.0 Should Contain ${resp.text} pdpa_policy_executions_total{status="SUCCESS",} 3.0 @@ -88,11 +88,11 @@ DeployPolicy 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} + PerformPostRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/deployments/batch 202 ${postjson} null ${policyadmin} RunEventOnApexEngine [Documentation] Send event to verify policy execution - Create Session apexSession http://${APEX_IP}:23324 max_retries=1 + Create Session apexSession http://localhost:23324 max_retries=1 ${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} @@ -100,7 +100,7 @@ RunEventOnApexEngine TriggerAndVerifyTestPnfPolicy [Documentation] Send TestPnf policy trigger event to DMaaP and read notifications to verify policy execution - Create Session apexSession http://${DMAAP_IP}:3904 max_retries=1 + Create Session apexSession http://localhost:30227 max_retries=1 ${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} @@ -111,7 +111,7 @@ TriggerAndVerifyTestPnfPolicy TriggerAndVerifyTestVnfPolicy [Documentation] Send TestVnf policy trigger event to DMaaP and read notifications to verify policy execution - Create Session apexSession http://${DMAAP_IP}:3904 max_retries=1 + Create Session apexSession http://localhost:30227 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} @@ -133,7 +133,7 @@ VerifyPdpStatistics [Documentation] Verify pdp statistics after policy execution [Arguments] ${deployCount} ${deploySuccessCount} ${executedCount} ${executedSuccessCount} ${policyadmin}= PolicyAdminAuth - ${resp}= PerformGetRequest ${POLICY_PAP_IP} /policy/pap/v1/pdps/statistics/defaultGroup/apex/${pdpName} 200 null ${policyadmin} + ${resp}= PerformGetRequest ${POLICY_PAP_PORT} /policy/pap/v1/pdps/statistics/defaultGroup/apex/${pdpName} 200 null ${policyadmin} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As Strings ${resp.json()['defaultGroup']['apex'][0]['pdpInstanceId']} ${pdpName} Should Be Equal As Strings ${resp.json()['defaultGroup']['apex'][0]['pdpGroupName']} defaultGroup |