aboutsummaryrefslogtreecommitdiffstats
path: root/csit/api
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2023-02-10 22:01:43 +0000
committerliamfallon <liam.fallon@est.tech>2023-02-13 16:45:02 +0000
commitf5a11b0b346df610ffa8d9857956abf113ce6765 (patch)
treecb27bb6b9e29c2d23ac313d86b4bbdfe5883a855 /csit/api
parent600a3002192da1ba2174c63d248a46dc27414397 (diff)
Refactor CSITs to use exposed ports
The CSITs were using the ports in the Docker environment directly. This commit changes the CSITs to use published ports. Issue-ID: POLICY-4533 Change-Id: I17d60c8bceae71f1bf2175dcb6addf032f14a899 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'csit/api')
-rwxr-xr-xcsit/api/plans/setup.sh4
-rw-r--r--csit/api/tests/api-test.robot9
2 files changed, 7 insertions, 6 deletions
diff --git a/csit/api/plans/setup.sh b/csit/api/plans/setup.sh
index 874eb954..31d16836 100755
--- a/csit/api/plans/setup.sh
+++ b/csit/api/plans/setup.sh
@@ -51,15 +51,17 @@ sleep 10
unset http_proxy https_proxy
POLICY_API_IP=$(get-instance-ip.sh policy-api)
+POLICY_API_PORT=30440
MARIADB_IP=$(get-instance-ip.sh mariadb)
echo API IP IS "${POLICY_API_IP}"
echo MARIADB IP IS "${MARIADB_IP}"
# wait for the app to start up
-"${SCRIPTS}"/wait_for_port.sh "${POLICY_API_IP}" 6969
+"${SCRIPTS}"/wait_for_rest.sh localhost "$POLICY_API_PORT"
ROBOT_VARIABLES=""
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 DATA:${DATA}"
ROBOT_VARIABLES="${ROBOT_VARIABLES} -v NODETEMPLATES:${NODETEMPLATES}" \ No newline at end of file
diff --git a/csit/api/tests/api-test.robot b/csit/api/tests/api-test.robot
index c6927326..33848795 100644
--- a/csit/api/tests/api-test.robot
+++ b/csit/api/tests/api-test.robot
@@ -54,7 +54,6 @@ CreateNewMonitoringPolicyV2
${postjson}= Get file ${DATA}/vCPE.policy.monitoring.input.tosca.v2.json
CreatePolicy /policy/api/v1/policies 200 ${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
@@ -114,7 +113,7 @@ DeleteSpecificPolicyTypeV3
Metrics
[Documentation] Verify policy-api is exporting prometheus metrics
${auth}= PolicyAdminAuth
- ${resp}= GetMetrics ${POLICY_API_IP} ${auth} /policy/api/v1/
+ ${resp}= GetMetrics ${POLICY_API_PORT} ${auth} /policy/api/v1/
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/healthcheck",} 1.0
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/statistics",} 1.0
Should Contain ${resp.text} http_server_requests_seconds_count{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/policytypes",} 1.0
@@ -138,13 +137,13 @@ Metrics
GetReq
[Arguments] ${url}
${auth}= PolicyAdminAuth
- ${resp}= PerformGetRequest ${POLICY_API_IP} ${url} 200 null ${auth}
+ ${resp}= PerformGetRequest ${POLICY_API_PORT} ${url} 200 null ${auth}
[return] ${resp}
DeleteReq
[Arguments] ${url} ${expectedstatus}
${auth}= PolicyAdminAuth
- ${resp}= PerformDeleteRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${auth}
+ ${resp}= PerformDeleteRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${auth}
[return] ${resp}
CreatePolicyType
@@ -152,7 +151,7 @@ CreatePolicyType
[Documentation] Create the specific policy type
${postjson}= Get file ${CURDIR}/data/${jsonfile}
${auth}= PolicyAdminAuth
- ${resp}= PerformPostRequest ${POLICY_API_IP} ${url} ${expectedstatus} ${postjson} null ${auth}
+ ${resp}= PerformPostRequest ${POLICY_API_PORT} ${url} ${expectedstatus} ${postjson} null ${auth}
Run Keyword If ${expectedstatus}==200 List Should Contain Value ${resp.json()['policy_types']} ${policytypename}
Run Keyword If ${expectedstatus}==200 Should Be Equal As Strings ${resp.json()['policy_types']['${policytypename}']['version']} ${policytypeversion}