diff options
author | puthuparambil.aditya <aditya.puthuparambil@bell.ca> | 2021-07-09 12:51:10 +0100 |
---|---|---|
committer | puthuparambil.aditya <aditya.puthuparambil@bell.ca> | 2021-07-14 15:54:48 +0100 |
commit | b46d137c04a78f62d097f680e016558b815bd915 (patch) | |
tree | d20f0ca020ff6f49ad518ac0539b8143cbf14afd /csit | |
parent | 0190d0246ab18311fe12cdebb808d9f6e4b131c1 (diff) |
Expose Prometheus metrics for monitoring
Issue-ID: CPS-492
Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca>
Change-Id: I264066bd543daf2a45f2ec9a6b8cdf8012927828
Diffstat (limited to 'csit')
-rwxr-xr-x | csit/plans/default/setup.sh | 8 | ||||
-rw-r--r-- | csit/tests/actuator/actuator.robot | 8 | ||||
-rw-r--r-- | csit/tests/cps-admin/cps-admin.robot | 14 | ||||
-rw-r--r-- | csit/tests/cps-data/cps-data.robot | 6 |
4 files changed, 21 insertions, 15 deletions
diff --git a/csit/plans/default/setup.sh b/csit/plans/default/setup.sh index 4d5d1c85c4..cf29b53ac5 100755 --- a/csit/plans/default/setup.sh +++ b/csit/plans/default/setup.sh @@ -17,6 +17,7 @@ # Modifications copyright (c) 2017 AT&T Intellectual Property # Modifications copyright (c) 2020-2021 Samsung Electronics Co., Ltd. # Modifications Copyright (C) 2021 Pantheon.tech +# Modifications Copyright (C) 2021 Bell Canada. # # Branched from ccsdk/distribution to this repository Feb 23, 2021 # @@ -66,8 +67,11 @@ if [ "$TIME" -gt "$TIME_OUT" ]; then fi # The CPS host according to docker-compose.yml -CPS_HOST="http://localhost:8883" +CPS_HOST="localhost" +CPS_PORT="8883" + +MANAGEMENT_PORT="8887" # Pass variables required for Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v CPS_HOST:$CPS_HOST -v DATADIR:$WORKSPACE/data" +ROBOT_VARIABLES="-v CPS_HOST:$CPS_HOST -v CPS_PORT:$CPS_PORT -v MANAGEMENT_PORT:$MANAGEMENT_PORT -v DATADIR:$WORKSPACE/data" diff --git a/csit/tests/actuator/actuator.robot b/csit/tests/actuator/actuator.robot index 3a0493d686..55ff40e076 100644 --- a/csit/tests/actuator/actuator.robot +++ b/csit/tests/actuator/actuator.robot @@ -1,5 +1,6 @@ # ============LICENSE_START======================================================= # Copyright (c) 2021 Pantheon.tech. +# Modifications Copyright (c) 2021 Bell Canada. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,16 +23,17 @@ Documentation CPS - Actuator endpoints Library Collections Library RequestsLibrary -Suite Setup Create Session CPS_HOST ${CPS_HOST} +Suite Setup Create Session MANAGEMENT_URL http://${CPS_HOST}:${MANAGEMENT_PORT}/manage *** Variables *** *** Test Cases *** Test Liveness Probe Endpoint - ${response}= GET On Session CPS_HOST /manage/health/liveness expected_status=200 + ${response}= GET On Session MANAGEMENT_URL health/liveness expected_status=200 Should Be Equal As Strings ${response.json()['status']} UP Test Readiness Probe Endpoint - ${response}= GET On Session CPS_HOST /manage/health/readiness expected_status=200 + ${response}= GET On Session MANAGEMENT_URL health/readiness expected_status=200 Should Be Equal As Strings ${response.json()['status']} UP + diff --git a/csit/tests/cps-admin/cps-admin.robot b/csit/tests/cps-admin/cps-admin.robot index 7e944ec6f7..43a46d3274 100644 --- a/csit/tests/cps-admin/cps-admin.robot +++ b/csit/tests/cps-admin/cps-admin.robot @@ -23,7 +23,7 @@ Library Collections Library OperatingSystem Library RequestsLibrary -Suite Setup Create Session CPS_HOST ${CPS_HOST} +Suite Setup Create Session CPS_URL http://${CPS_HOST}:${CPS_PORT} *** Variables *** @@ -40,7 +40,7 @@ Create Dataspace ${uri}= Set Variable ${basePath}/v1/dataspaces ${params}= Create Dictionary dataspace-name=${dataspaceName} ${headers}= Create Dictionary Authorization=${auth} - ${response}= POST On Session CPS_HOST ${uri} params=${params} headers=${headers} + ${response}= POST On Session CPS_URL ${uri} params=${params} headers=${headers} Should Be Equal As Strings ${response.status_code} 201 Create Schema Set from YANG file @@ -50,7 +50,7 @@ Create Schema Set from YANG file ${fileTuple}= Create List test.yang ${fileData} application/zip &{files}= Create Dictionary file=${fileTuple} ${headers}= Create Dictionary Authorization=${auth} - ${response}= POST On Session CPS_HOST ${uri} files=${files} params=${params} headers=${headers} + ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params} headers=${headers} Should Be Equal As Strings ${response.status_code} 201 Create Schema Set from ZIP file @@ -60,13 +60,13 @@ Create Schema Set from ZIP file ${fileTuple}= Create List test.zip ${fileData} application/zip &{files}= Create Dictionary file=${fileTuple} ${headers}= Create Dictionary Authorization=${auth} - ${response}= POST On Session CPS_HOST ${uri} files=${files} params=${params} headers=${headers} + ${response}= POST On Session CPS_URL ${uri} files=${files} params=${params} headers=${headers} Should Be Equal As Strings ${response.status_code} 201 Get Schema Set info ${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/schema-sets/${schemaSetName} ${headers}= Create Dictionary Authorization=${auth} - ${response}= Get On Session CPS_HOST ${uri} headers=${headers} expected_status=200 + ${response}= Get On Session CPS_URL ${uri} headers=${headers} expected_status=200 ${responseJson}= Set Variable ${response.json()} Should Be Equal As Strings ${responseJson['name']} ${schemaSetName} Should Be Equal As Strings ${responseJson['dataspaceName']} ${dataspaceName} @@ -75,13 +75,13 @@ Create Anchor ${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors ${params}= Create Dictionary schema-set-name=${schemaSetName} anchor-name=${anchorName} ${headers}= Create Dictionary Authorization=${auth} - ${response}= POST On Session CPS_HOST ${uri} params=${params} headers=${headers} + ${response}= POST On Session CPS_URL ${uri} params=${params} headers=${headers} Should Be Equal As Strings ${response.status_code} 201 Get CPS RAN Schema Set info ${uri}= Set Variable ${basePath}/v1/dataspaces/${ranDataspaceName}/schema-sets/${ranSchemaSetName} ${headers}= Create Dictionary Authorization=${auth} - ${response}= Get On Session CPS_HOST ${uri} headers=${headers} expected_status=200 + ${response}= Get On Session CPS_URL ${uri} headers=${headers} expected_status=200 ${responseJson}= Set Variable ${response.json()} Should Be Equal As Strings ${responseJson['name']} ${ranSchemaSetName} Should Be Equal As Strings ${responseJson['dataspaceName']} ${ranDataspaceName} diff --git a/csit/tests/cps-data/cps-data.robot b/csit/tests/cps-data/cps-data.robot index 9fd8451d28..e7334ae11e 100644 --- a/csit/tests/cps-data/cps-data.robot +++ b/csit/tests/cps-data/cps-data.robot @@ -23,7 +23,7 @@ Library Collections Library OperatingSystem Library RequestsLibrary -Suite Setup Create Session CPS_HOST ${CPS_HOST} +Suite Setup Create Session CPS_URL http://${CPS_HOST}:${CPS_PORT} *** Variables *** @@ -37,14 +37,14 @@ Create Data Node ${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/nodes ${headers} Create Dictionary Content-Type=application/json Authorization=${auth} ${jsonData}= Get Binary File ${DATADIR}${/}test-tree.json - ${response}= POST On Session CPS_HOST ${uri} headers=${headers} data=${jsonData} + ${response}= POST On Session CPS_URL ${uri} headers=${headers} data=${jsonData} Should Be Equal As Strings ${response.status_code} 201 Get Data Node by XPath ${uri}= Set Variable ${basePath}/v1/dataspaces/${dataspaceName}/anchors/${anchorName}/node ${params}= Create Dictionary xpath=/test-tree/branch[@name='Left']/nest ${headers}= Create Dictionary Authorization=${auth} - ${response}= Get On Session CPS_HOST ${uri} params=${params} headers=${headers} expected_status=200 + ${response}= Get On Session CPS_URL ${uri} params=${params} headers=${headers} expected_status=200 ${responseJson}= Set Variable ${response.json()} Should Be Equal As Strings ${responseJson['name']} Small |