From 0cd9b7cd78b4f4cd38a42876734a634b511ca3fe Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Fri, 14 Nov 2025 11:47:50 +0000 Subject: [PATCH] Added k8 specific tests for second dmi-stub in postman-collections - added new env. variable suit for k8s deployment - new tests are added for k8s, all using the new env. suit: - cm handle registration for dmi-stub-1 and dmi-stub-2 each having two cm handles - cm handle get for dmi-stub-1 and dmi-stub-2 - get resource data operation - delete cm handles for both dmis Issue-ID: CPS-3039 Change-Id: Icd0a99b09d4c83a356886dbc9b80ea9463fb35a8 Signed-off-by: halil.cakal --- .../CPS Environment k8s.postman_environment.json | 46 +++ postman-collections/CPS.postman_collection.json | 420 ++++++++++++++++++++- 2 files changed, 464 insertions(+), 2 deletions(-) create mode 100644 postman-collections/CPS Environment k8s.postman_environment.json diff --git a/postman-collections/CPS Environment k8s.postman_environment.json b/postman-collections/CPS Environment k8s.postman_environment.json new file mode 100644 index 0000000000..d001106eb9 --- /dev/null +++ b/postman-collections/CPS Environment k8s.postman_environment.json @@ -0,0 +1,46 @@ +{ + "id": "a0df880f-ad98-482a-8725-ee4577cf224e", + "name": "CPS Environment k8s", + "values": [ + { + "key": "CPS_HOST", + "value": "localhost", + "type": "default", + "enabled": true + }, + { + "key": "CPS_PORT", + "value": "30080", + "type": "default", + "enabled": true + }, + { + "key": "DMI_HOST", + "value": "cps-ncmp-dmi-stub-1", + "type": "default", + "enabled": true + }, + { + "key": "DMI_PORT", + "value": "8092", + "type": "default", + "enabled": true + }, + { + "key": "DMI_HOST_2", + "value": "cps-ncmp-dmi-stub-2", + "type": "default", + "enabled": true + }, + { + "key": "DMI_PORT_2", + "value": "8093", + "type": "default", + "enabled": true + } + ], + "color": null, + "_postman_variable_scope": "environment", + "_postman_exported_at": "2025-12-01T11:44:08.222Z", + "_postman_exported_using": "Postman/11.73.4" +} \ No newline at end of file diff --git a/postman-collections/CPS.postman_collection.json b/postman-collections/CPS.postman_collection.json index 099d2dbca8..33aa49a746 100644 --- a/postman-collections/CPS.postman_collection.json +++ b/postman-collections/CPS.postman_collection.json @@ -1,10 +1,10 @@ { "info": { - "_postman_id": "1a955ed1-f754-4206-a3dd-b2b975b3098f", + "_postman_id": "3fb9f537-3b7a-4b48-a336-ed66e1f5a05e", "name": "CPS", "description": "\n\n# [CPS ONAP Documentation](https://docs.onap.org/projects/onap-cps/en/latest/index.html)\n\n# [DMI ONAP Documentation](https://docs.onap.org/projects/onap-cps-ncmp-dmi-plugin/en/latest/index.html)\n\n### How-to\n\nBuild CPS docker images with maven:\n\n`mvn clean install`\n\nor\n\n`mvn clean install -DskipTests`\n\nNavigate to docker-compose folder:\n\n`cd .\\docker-compose\\`\n\nBring up docker containers using commands found in docker-compose.yaml or run CPS services including dmi plugin\n\n`docker-compose --profile dmi-service up -d`\n\n### CPS-Enviroment\n\nTo enable the CPS enviroment, go to the top right of the screen in Postman and click envrioments. Import the CPS-envrioment file from the Postman Collections file in CPS.\n\n**To utilise NCMP-DMI-Stub endpoints begin the docker containers with:**\n\n`docker-compose --profile dmi-stub --profile monitoring up -d`\n\n# CPS Core Example\n\n- Create dataspace\n \n- Verify dataspace exists\n \n- etc...\n \n\n# CPS-NCMP Example\n\n- Create CM handles\n \n- Verify CM handles exist\n \n- etc...", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "26733783" + "_exporter_id": "21077354" }, "item": [ { @@ -2010,6 +2010,422 @@ } ], "description": "NCMP-DMI-Stub endpoints as defined by Rest OpenApi Specification [here](https://docs.onap.org/projects/onap-cps-ncmp-dmi-plugin/en/latest/design.html#offered-apis)\n\n**To utilise NCMP-DMI-Stub begin the docker containers with:**\n\n`docker-compose --profile dmi-stub --profile monitoring up -d`" + }, + { + "name": "CPS-NCMP-K8s", + "item": [ + { + "name": "CM handle registration for dmi-stub-1", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-1\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X1\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"123\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-2\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X2\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"456\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] + }, + { + "name": "CM handle registration for dmi-stub-2", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + }, + { + "listen": "test", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"createdCmHandles\": [\r\n {\r\n \"cmHandle\": \"cm-handle-3\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X3\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"123\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n },\r\n {\r\n \"cmHandle\": \"cm-handle-4\",\r\n \"alternateId\": \"Subnetwork=Europe,ManagedElement=X4\",\r\n \"dataProducerIdentifier\": \"my-data-producer-identifier\",\r\n \"cmHandleProperties\": {},\r\n \"publicCmHandleProperties\": {\r\n \"id\": \"456\",\r\n \"userLabel\": \"test\"\r\n },\r\n \"moduleSetTag\": \"my-module-set-tag\",\r\n \"trustLevel\": \"COMPLETE\"\r\n }\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] + }, + { + "name": "Get All CM handles for dmi-stub-1", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic Y3BzdXNlcjpjcHNyMGNrcyE=", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch/cmHandles?dmi-plugin-identifier=http://{{DMI_HOST}}:{{DMI_PORT}}", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch", + "cmHandles" + ], + "query": [ + { + "key": "dmi-plugin-identifier", + "value": "http://{{DMI_HOST}}:{{DMI_PORT}}" + }, + { + "key": "outputAlternateId", + "value": "true", + "description": "Returns alternate ids rather then cm handle ids", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Get All CM handles for dmi-stub-2", + "protocolProfileBehavior": { + "disableBodyPruning": true + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Basic Y3BzdXNlcjpjcHNyMGNrcyE=", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch/cmHandles?dmi-plugin-identifier=http://{{DMI_HOST_2}}:{{DMI_PORT_2}}", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch", + "cmHandles" + ], + "query": [ + { + "key": "dmi-plugin-identifier", + "value": "http://{{DMI_HOST_2}}:{{DMI_PORT_2}}" + }, + { + "key": "outputAlternateId", + "value": "true", + "description": "Returns alternate ids rather then cm handle ids", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "Get resource data", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmp/v1/ch/cm-handle-2/data/ds/ncmp-datastore:passthrough-running?resourceIdentifier=my-data-producer-identifier", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmp", + "v1", + "ch", + "cm-handle-2", + "data", + "ds", + "ncmp-datastore:passthrough-running" + ], + "query": [ + { + "key": "resourceIdentifier", + "value": "my-data-producer-identifier" + } + ] + } + }, + "response": [] + }, + { + "name": "CM handle de-registration for dmi-stub-1", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST}}:{{DMI_PORT}}\",\r\n \"removedCmHandles\": [\r\n \"cm-handle-1\",\r\n \"cm-handle-2\"\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] + }, + { + "name": "CM handle de-registration for dmi-stub-2", + "event": [ + { + "listen": "prerequest", + "script": { + "exec": [ + "" + ], + "type": "text/javascript", + "packages": {}, + "requests": {} + } + } + ], + "request": { + "method": "POST", + "header": [], + "body": { + "mode": "raw", + "raw": "{\r\n \"dmiPlugin\": \"http://{{DMI_HOST_2}}:{{DMI_PORT_2}}\",\r\n \"removedCmHandles\": [\r\n \"cm-handle-3\",\r\n \"cm-handle-4\"\r\n ]\r\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "http://{{CPS_HOST}}:{{CPS_PORT}}/ncmpInventory/v1/ch", + "protocol": "http", + "host": [ + "{{CPS_HOST}}" + ], + "port": "{{CPS_PORT}}", + "path": [ + "ncmpInventory", + "v1", + "ch" + ] + }, + "description": "DMI notifies NCMP of new CM handles" + }, + "response": [] + } + ] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "packages": {}, + "requests": {}, + "exec": [ + "" + ] + } + } + ], + "variable": [ + { + "key": "createdCmHandleIds", + "value": "" + }, + { + "key": "createdCmHandles", + "value": "" + }, + { + "key": "targetIds", + "value": "" + }, + { + "key": "dmi-stub-1", + "value": "" + }, + { + "key": "createdCmHandlesForDmiStub1", + "value": "" + }, + { + "key": "createdCmHandlesForDmiStub2", + "value": "" + }, + { + "key": "dmi-stub-2", + "value": "" + }, + { + "key": "currentDmiPlugin", + "value": "" + }, + { + "key": "currentCreatedCmHandles", + "value": "" + }, + { + "key": "stubCounter", + "value": "" + }, + { + "key": "noOfRegistrationDone", + "value": "" + }, + { + "key": "dmi-stub", + "value": "" + }, + { + "key": "createdCmHandlesForDmiStub", + "value": "" } ] } \ No newline at end of file -- 2.16.6