diff options
author | Niranjana <niranjana.y60@wipro.com> | 2022-03-17 09:03:08 +0000 |
---|---|---|
committer | decheng zhang <decheng.zhang@huawei.com> | 2022-04-26 12:24:15 -0400 |
commit | 9ed698d4522c487445a1ca048f29836c5f59c5e6 (patch) | |
tree | 2976ff365ecdfcb294c9f4d4d377ac23d12dfb83 | |
parent | 8f88f01b9fbbdd2af363a747ecf43b9de15a9b6e (diff) |
Add new testcase for network slicing capacity in slice-analysis-ms
Issue-ID: DCAEGEN2-2942
Signed-off-by: Niranjana <niranjana.y60@wipro.com>
Change-Id: I3842e57f094a996ea64423eab0790ac99927d751
31 files changed, 367 insertions, 1159 deletions
diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json index 7504ca86..70bc6c8b 100644 --- a/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/config/sliceanalysisms/config_all.json @@ -63,10 +63,13 @@ "sliceanalysisms.initialDelaySeconds": 300000, "sliceanalysisms.pollingTimeout": 60, "sliceanalysisms.cid": "sliceanalysisms-cid", - "sliceanalysisms.configDb.service": "http://configdb_sim:5000", + "sliceanalysisms.configDb.service": "http://configdb_des_sim:5000", "sliceanalysisms.aai.url": "https://aai-resources:8447/aai/v21", "sliceanalysisms.cps.url": "http://cps-tbdmt:8080/execute/ran-network", "sliceanalysisms.configDbEnabled": "false", + "sliceanalysisms.rannfnssiDetailsTemplateId": "get-rannfnssiid-details", + "sliceanalysisms.desUrl": "http://configdb_des_sim:5000/datalake/v1/exposure/pm_data", + "sliceanalysisms.pmDataDurationInWeeks": 4, "service_calls": { "policy-req": [] }, diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml b/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml index 869e69d1..54eb29b6 100644 --- a/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/docker-compose.yaml @@ -77,7 +77,7 @@ services: networks: - slice-analysis-ms-default sliceanalysisms: - image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components.slice-analysis-ms:latest + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.components.slice-analysis-ms:1.0.7 container_name: sliceanalysisms hostname: sliceanalysisms environment: diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh b/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh index b75df561..1975b5ba 100644 --- a/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/setup.sh @@ -49,13 +49,13 @@ http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT #build configdb-sim image cd $TEST_SCRIPTS_DIR -docker build -t configdb_sim . +docker build -t configdb_des_sim . #run configdb-sim -docker run -d --name configdb_sim --network=testsuites_slice-analysis-ms-default -p "5000:5000" configdb_sim:latest; +docker run -d --name configdb_des_sim --network=testsuites_slice-analysis-ms-default -p "5000:5000" configdb_des_sim:latest; sleep 10 -CONFIGDB_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_sim) -echo "CONFIGDB_SIM_IP=${CONFIGDB_SIM_IP}" +CONFIGDB_DES_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_des_sim) +echo "CONFIGDB_DES_SIM_IP=${CONFIGDB_DES_SIM_IP}" # CPS & AAI set up cd $TEST_SCRIPTS_CPS_DIR diff --git a/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh b/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh index 29cd912d..1962ba9a 100644 --- a/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh +++ b/plans/dcaegen2-services-slice-analysis-ms/testsuites/teardown.sh @@ -4,8 +4,8 @@ TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-slice-analysis-ms/testsuites TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai mkdir -p $WORKSPACE/archives -docker container stop configdb_sim -docker container rm configdb_sim +docker container stop configdb_des_sim +docker container rm configdb_des_sim docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml logs > $WORKSPACE/archives/slice-analysis-docker-compose.log docker-compose -f $TEST_SCRIPTS_DIR/docker-compose.yaml down -v docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml down -v diff --git a/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile b/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile deleted file mode 100644 index 52d54a57..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM python:alpine3.7 - -ADD configdb-sim.py / - -ADD ./sim-data / - -RUN pip install Flask --trusted-host pypi.org --trusted-host files.pythonhosted.org - -RUN pip install requests --trusted-host pypi.org --trusted-host files.pythonhosted.org - -EXPOSE 5000 - -CMD ["flask", "run", "--host", "0.0.0.0"] - -CMD [ "python", "./configdb-sim.py" ] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json deleted file mode 100644 index f01f0b98..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_00110.json +++ /dev/null @@ -1,111 +0,0 @@ -{ - -"11":[ - -{ - -"cellLocalId":103593999, - -"operationalState":"ENABLED", - -"administrativeState":"UNLOCKED", - -"cellState":"ACTIVE", - -"pLMNInfoList":[ - -{ - -"pLMNId":"310-410", - -"sNSSAI":{ - -"sNSSAI":"001-00110", - -"status":"ACTIVE", - -"globalSubscriberId":null, - -"subscriptionServiceType":null, - -"configData":{ - -"dLThptPerSlice":20, - -"uLThptPerSlice":15, - -"maxNumberOfConns":null, - -"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" - -} - -} - -} - -], - -"nRPCI":12, - -"nRTAC":310, - -"resourceType":"PRB" - -}, - -{ - -"cellLocalId":103593989, - -"operationalState":"ENABLED", - -"administrativeState":"UNLOCKED", - -"cellState":"ACTIVE", - -"pLMNInfoList":[ - -{ - -"pLMNId":"310-410", - -"sNSSAI":{ - -"sNSSAI":"001-00110", - -"status":"ACTIVE", - -"globalSubscriberId":null, - -"subscriptionServiceType":null, - -"configData":{ - -"dLThptPerSlice":20, - -"uLThptPerSlice":15, - -"maxNumberOfConns":null, - -"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" - -} - -} - -} - -], - -"nRPCI":12, - -"nRTAC":310, - -"resourceType":"PRB" - -} - -] - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json deleted file mode 100644 index 54b2b7c5..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_cell_list_001_010000.json +++ /dev/null @@ -1,323 +0,0 @@ -{ - - "22":[ - - { - - "cellLocalId":112951562, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":112951561, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":112951568, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - } - - ], - - "11":[ - - { - - "cellLocalId":95697174, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":95697175, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":95697155, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - } - - ] - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json deleted file mode 100644 index a4c6f2ff..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_00110.json +++ /dev/null @@ -1,129 +0,0 @@ -[ - -{ - -"gNBDUId":1, - -"gNBId":98763, - -"gNBIdLength":5, - -"gNBDUName":"gnduserver1", - -"pLMNId":"310-410", - -"nFType":"DU", - -"cellDUList":[ - -{ - -"cellLocalId":103593989, - -"operationalState":"ENABLED", - -"administrativeState":"UNLOCKED", - -"cellState":"ACTIVE", - -"pLMNInfoList":[ - -{ - -"pLMNId":"310-410", - -"sNSSAI":{ - -"sNSSAI":"001-00110", - -"status":"ACTIVE", - -"globalSubscriberId":null, - -"subscriptionServiceType":null, - -"configData":{ - -"dLThptPerSlice":20, - -"uLThptPerSlice":15, - -"maxNumberOfConns":null, - -"lastUpdatedTS":"2020-10-13T12:03:56.000+0000" - -} - -} - -} - -], - -"nRPCI":12, - -"nRTAC":310, - -"resourceType":"PRB" - -}, - -{ - -"cellLocalId":103593999, - -"operationalState":"ENABLED", - -"administrativeState":"UNLOCKED", - -"cellState":"ACTIVE", - -"pLMNInfoList":[ - -{ - -"pLMNId":"310-410", - -"sNSSAI":{ - -"sNSSAI":"001-00110", - -"status":"ACTIVE", - -"globalSubscriberId":null, - -"subscriptionServiceType":null, - -"configData":{ - -"dLThptPerSlice":20, - -"uLThptPerSlice":15, - -"maxNumberOfConns":null, - -"lastUpdatedTS":"2020-10-13T07:02:28.000+0000" - -} - -} - -} - -], - -"nRPCI":12, - -"nRTAC":310, - -"resourceType":"PRB" - -} - -], - -"nearRTRICId":null - -} - -] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json deleted file mode 100644 index 82d7fb1a..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/du_list_001_010000.json +++ /dev/null @@ -1,359 +0,0 @@ -[ - - { - - "gNBDUId":2, - - "gNBId":98763, - - "gNBIdLength":5, - - "gNBDUName":"gnduserver2", - - "pLMNId":"310-410", - - "nFType":"DU", - - "cellDUList":[ - - { - - "cellLocalId":95697155, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":95697174, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":95697175, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:13.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - } - - ], - - "nearRTRICId":null - - }, - - { - - "gNBDUId":4, - - "gNBId":98763, - - "gNBIdLength":5, - - "gNBDUName":"gnduserver4", - - "pLMNId":"310-410", - - "nFType":"DU", - - "cellDUList":[ - - { - - "cellLocalId":112951561, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":112951562, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - }, - - { - - "cellLocalId":112951568, - - "operationalState":"ENABLED", - - "administrativeState":"UNLOCKED", - - "cellState":"ACTIVE", - - "pLMNInfoList":[ - - { - - "pLMNId":"310-410", - - "sNSSAI":{ - - "sNSSAI":"001-010000", - - "status":"ACTIVE", - - "globalSubscriberId":null, - - "subscriptionServiceType":null, - - "configData":{ - - "dLThptPerSlice":9, - - "uLThptPerSlice":10, - - "maxNumberOfConns":null, - - "lastUpdatedTS":"2020-11-03T07:41:34.000+0000" - - } - - } - - } - - ], - - "nRPCI":12, - - "nRTAC":310, - - "resourceType":"PRB" - - } - - ], - - "nearRTRICId":null - - } - -] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json deleted file mode 100644 index 533095fc..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_00110.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - -"maxNumberOfConns":3000, - -"dLThptPerSlice":50, - -"uLThptPerSlice":40 - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json deleted file mode 100644 index 422a6fa3..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/profile_config_001_010000.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - - "maxNumberOfConns":3000, - - "dLThptPerSlice":54, - - "uLThptPerSlice":60 - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json deleted file mode 100644 index 013318a2..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_00110.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - -"11":{ - -"dLThptPerSlice":20, - -"uLThptPerSlice":15, - -"maxNumberOfConns":null, - -"lastUpdatedTS":"2020-10-13T12:01:34.000+0000" - -} - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json deleted file mode 100644 index 7d326c20..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/slice_config_001_010000.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - - "22":{ - - "dLThptPerSlice":27, - - "uLThptPerSlice":30, - - "maxNumberOfConns":3000, - - "lastUpdatedTS":"2020-11-03T07:40:45.000+0000" - - }, - - "11":{ - - "dLThptPerSlice":27, - - "uLThptPerSlice":30, - - "maxNumberOfConns":3000, - - "lastUpdatedTS":"2020-11-03T07:40:28.000+0000" - - } - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json deleted file mode 100644 index 5149513e..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_00110.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - -"subscriptionServiceType":"Premium", - -"sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", - -"ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", - -"globalSubscriberId":"Customer-001", - -"sNSSAI":"001-00110" - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json b/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json deleted file mode 100644 index e7026672..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/sim-data/subscriber-details_001_010000.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - - "subscriptionServiceType":"Premium", - - "sliceProfileId":"878f32c0-3699-4dbd-95a3-1f01d6c763fd", - - "ranNFNSSIId":"3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82", - - "globalSubscriberId":"Customer-001", - - "sNSSAI":"001-010000" - -} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile index 52d54a57..71c58398 100644 --- a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/Dockerfile @@ -1,6 +1,6 @@ FROM python:alpine3.7 -ADD configdb-sim.py / +ADD configdb-des-sim.py / ADD ./sim-data / @@ -12,4 +12,4 @@ EXPOSE 5000 CMD ["flask", "run", "--host", "0.0.0.0"] -CMD [ "python", "./configdb-sim.py" ] +CMD [ "python", "./configdb-des-sim.py" ] diff --git a/scripts/dcaegen2-services-slice-analysis-ms/configdb-sim.py b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-des-sim.py index bcda08d5..fb791562 100644 --- a/scripts/dcaegen2-services-slice-analysis-ms/configdb-sim.py +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-des-sim.py @@ -70,6 +70,17 @@ def get_subscriber_details_for_nssai(snssai): return {"Error": "Unable to read file"}, 503 return data, None +def get_pm_data_for_snssai(snssai): + if str(snssai) == 'SM.PrbUsedDl.01-06E442': + with open('pm_data_01_06E442.json') as pm_data: + data = json.load(pm_data) + else: + with open('pm_data_01_B989BD.json') as pm_data: + data = json.load(pm_data) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + @app.route("/api/sdnc-config-db/v4/du-list/<snssai>", methods=["GET"]) def get_du_list(snssai): @@ -111,5 +122,17 @@ def get_subscriber_details(snssai): return jsonify(data) return data, 503 +@app.route("/datalake/v1/exposure/pm_data", + methods=["POST"]) +def get_pm_data(): + request_data = request.get_json() + snssai = None + if request_data: + if 'snssai' in request_data: + snssai = request_data['snssai'] + data, status = get_pm_data_for_snssai(snssai) + if not status: + return jsonify(data) + return data, 503 app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py deleted file mode 100644 index bcda08d5..00000000 --- a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/configdb-sim.py +++ /dev/null @@ -1,115 +0,0 @@ -import flask -import json -from flask import Flask, render_template -from flask import request -from flask import jsonify -import requests -import threading -import time - -app = flask.Flask(__name__) -app.config["DEBUG"] = True - - -def get_du_list_for_nssai(snssai): - if str(snssai) == '001-00110': - with open('du_list_001_00110.json') as du_list: - data = json.load(du_list) - else: - with open('du_list_001_010000.json') as du_list: - data = json.load(du_list) - if not data: - return {"Error": "Unable to read file"}, 503 - return data, None - - -def get_du_cell_list_for_nssai(snssai): - if str(snssai) == '001-00110': - with open('du_cell_list_001_00110.json') as du_cell_list: - data = json.load(du_cell_list) - else: - with open('du_cell_list_001_010000.json') as du_cell_list: - data = json.load(du_cell_list) - if not data: - return {"Error": "Unable to read file"}, 503 - return data, None - - -def get_slice_config_for_nssai(snssai): - if str(snssai) == '001-00110': - with open('slice_config_001_00110.json') as slice_config: - data = json.load(slice_config) - else: - with open('slice_config_001_010000.json') as slice_config: - data = json.load(slice_config) - if not data: - return {"Error": "Unable to read file"}, 503 - return data, None - - -def get_profile_config_for_nssai(snssai): - if str(snssai) == '001-00110': - with open('profile_config_001_00110.json') as profile_config: - data = json.load(profile_config) - else: - with open('profile_config_001_010000.json') as profile_config: - data = json.load(profile_config) - if not data: - return {"Error": "Unable to read file"}, 503 - return data, None - - -def get_subscriber_details_for_nssai(snssai): - if str(snssai) == '001-00110': - with open('subscriber-details_001_00110.json') as subscriber_details: - data = json.load(subscriber_details) - else: - with open('subscriber-details_001_010000.json') as subscriber_details: - data = json.load(subscriber_details) - if not data: - return {"Error": "Unable to read file"}, 503 - return data, None - - -@app.route("/api/sdnc-config-db/v4/du-list/<snssai>", methods=["GET"]) -def get_du_list(snssai): - data, status = get_du_list_for_nssai(snssai) - if not status: - return jsonify(data) - return data, 503 - - -@app.route("/api/sdnc-config-db/v4/du-cell-list/<snssai>", methods=["GET"]) -def get_du_cell_list(snssai): - data, status = get_du_cell_list_for_nssai(snssai) - if not status: - return jsonify(data) - return data, 503 - - -@app.route("/api/sdnc-config-db/v4/slice-config/<snssai>", methods=["GET"]) -def get_slice_config(snssai): - data, status = get_slice_config_for_nssai(snssai) - if not status: - return jsonify(data) - return data, 503 - - -@app.route("/api/sdnc-config-db/v4/profile-config/<snssai>", methods=["GET"]) -def get_profile_config(snssai): - data, status = get_profile_config_for_nssai(snssai) - if not status: - return jsonify(data) - return data, 503 - - -@app.route("/api/sdnc-config-db/v4/subscriber-details/<snssai>", - methods=["GET"]) -def get_subscriber_details(snssai): - data, status = get_subscriber_details_for_nssai(snssai) - if not status: - return jsonify(data) - return data, 503 - - -app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/cps-aai-setup.sh b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/cps-aai-setup.sh index 4cd5e447..65b2c29d 100644 --- a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/cps-aai-setup.sh +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/cps-aai-setup.sh @@ -42,36 +42,63 @@ echo "\nuploading tbdmt-templates" curl --location --request POST \ http://$CPS_TBDMT_IP:8080/templates \ --header 'Content-Type: application/json' \ ---data-raw '{"templateId": "get-nearrtric-config","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true}' +--data-raw '{"templateId": "get-nearrtric-config","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true,"transformParam":"NearRTRIC"}' curl --location --request POST \ http://$CPS_TBDMT_IP:8080/templates \ --header 'Content-Type: application/json' \ ---data-raw '{"templateId": "get-gnbdufunction-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::GNBDUFunction","includeDescendants": true}' +--data-raw '{"templateId": "get-gnbdufunction-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::GNBDUFunction","includeDescendants": true,"transformParam":"GNBDUFunction"}' curl --location --request POST \ http://$CPS_TBDMT_IP:8080/templates \ --header 'Content-Type: application/json' \ ---data-raw '{"templateId": "get-nrcelldu-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true}' +--data-raw '{"templateId": "get-nrcelldu-by-snssai","model": "ran-network","requestType": "query-cps-path","xpathTemplate": "//sNSSAIList[@sNssai='\''{{sNssai}}'\'']/ancestor::NearRTRIC","includeDescendants": true,"transformParam":"NearRTRIC"}' ##Uploading aai data AAI_RESOURCES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' aai-resources ) - echo "\nUploading data to aai-resources" curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer \ --d @sim-data/customers.json +-d @sim-data/customers.json -i curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G \ --d @sim-data/service_subscriptions.json +-d @sim-data/service_subscriptions.json -i curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/3f2f23fa-c567-4dd8-8f15-f95ae3e6fd84 \ --d @sim-data/service_instances.json +-d @sim-data/service_instances.json -i curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ https://$AAI_RESOURCES_IP:8447/aai/v24/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/3f2f23fa-c567-4dd8-8f15-f95ae3e6fd84/slice-profiles/slice-profile/684hf846f-863b-4901-b202-0ab86a638555 \ --d @sim-data/slice_profile.json +-d @sim-data/slice_profile.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/b2ae730f-1d5f-495a-8112-dac017a7348c \ +-d @sim-data/sliceprofile_an_sa1.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/cad8fa36-2d55-4c12-a92e-1bd551517a0c \ +-d @sim-data/sliceprofile_cn_sa1.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/8d0d698e-77f4-4453-8c09-ae2cbe6a9a04 \ +-d @sim-data/sliceprofile_tn_sa1.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/0835fd19-6726-4081-befb-cc8932c47767 \ +-d @sim-data/alloted-resource.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/0835fd19-6726-4081-befb-cc8932c47767/allotted-resources/allotted-resource/530d188d-9087-49af-a44a-90c40e0c2d47 \ +-d @sim-data/alloted-resource-data.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/50f418a6-804f-4453-bf70-21f0efaf6fcd \ +-d @sim-data/nssi.json -i + +curl --request PUT -H "X-FromAppId:AAI " -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k \ +https://$AAI_RESOURCES_IP:8447/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/09cad94e-fbb8-4c70-9c4d-74ec75e97683 \ +-d @sim-data/nsi.json -i diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource-data.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource-data.json new file mode 100644 index 00000000..fa133253 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource-data.json @@ -0,0 +1,4 @@ +{ +"id":"530d188d-9087-49af-a44a-90c40e0c2d47", +"allotted-resource-name":"alloted-resource-sa-1" +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource.json new file mode 100644 index 00000000..9880f495 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/alloted-resource.json @@ -0,0 +1,87 @@ +{ + "service-instance-id":"0835fd19-6726-4081-befb-cc8932c47767", + "service-instance-name":"sa1", + "service-type":"embb", + "service-role":"service-profile", + "environment-context":"01-06E442", + "orchestration-status":"deactivated", + "relationship-list":{ + "relationship":[ + { + "related-to":"service-instance", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/b2ae730f-1d5f-495a-8112-dac017a7348c", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"b2ae730f-1d5f-495a-8112-dac017a7348c" + } + ], + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"sliceprofile_an_sa1" + } + ] + }, + { + "related-to":"service-instance", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/cad8fa36-2d55-4c12-a92e-1bd551517a0c", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"cad8fa36-2d55-4c12-a92e-1bd551517a0c" + } + ], + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"sliceprofile_cn_sa1" + } + ] + }, + { + "related-to":"service-instance", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/8d0d698e-77f4-4453-8c09-ae2cbe6a9a04", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"8d0d698e-77f4-4453-8c09-ae2cbe6a9a04" + } + ], + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"sliceprofile_tn_sa1" + } + ] + } + ] + } +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nsi.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nsi.json new file mode 100644 index 00000000..4f685da8 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nsi.json @@ -0,0 +1,70 @@ +{ + "service-instance-id":"09cad94e-fbb8-4c70-9c4d-74ec75e97683", + "service-instance-name":"nsi_sa1", + "service-type":"embb", + "service-role":"nsi", + "environment-context":"01-06E443", + "orchestration-status":"deactivated", + "service-function":"non-shared", + "relationship-list":{ + "relationship":[ + { + "related-to":"service-instance", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/50f418a6-804f-4453-bf70-21f0efaf6fcd", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"50f418a6-804f-4453-bf70-21f0efaf6fcd" + } + ], + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"nssi_ansa1" + } + ] + }, + { + "related-to":"allotted-resource", + "relationship-label":"org.onap.relationships.inventory.Uses", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/0835fd19-6726-4081-befb-cc8932c47767/allotted-resources/allotted-resource/530d188d-9087-49af-a44a-90c40e0c2d47", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"0835fd19-6726-4081-befb-cc8932c47767" + }, + { + "relationship-key":"allotted-resource.id", + "relationship-value":"530d188d-9087-49af-a44a-90c40e0c2d47" + } + ], + "related-to-property":[ + { + "property-key":"allotted-resource.description" + }, + { + "property-key":"allotted-resource.allotted-resource-name", + "property-value":"Allotted_sa1" + } + ] + } + ] + } +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nssi.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nssi.json new file mode 100644 index 00000000..6cc78c6f --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/nssi.json @@ -0,0 +1,41 @@ +{ + "service-instance-id":"50f418a6-804f-4453-bf70-21f0efaf6fcd", + "service-instance-name":"nssi_ansa1", + "service-type":"embb", + "service-role":"nssi", + "environment-context":"an", + "workload-context":"AN", + "service-instance-location-id":"39-00", + "environment-context":"01-06E443", + "orchestration-status":"deactivated", + "service-function":"non-shared", + "relationship-list":{ + "relationship":[ + { + "related-to":"service-instance", + "relationship-label":"org.onap.relationships.inventory.ComposedOf", + "related-link":"/aai/v21/business/customers/customer/5GCustomer/service-subscriptions/service-subscription/5G/service-instances/service-instance/b2ae730f-1d5f-495a-8112-dac017a7348c", + "relationship-data":[ + { + "relationship-key":"customer.global-customer-id", + "relationship-value":"5GCustomer" + }, + { + "relationship-key":"service-subscription.service-type", + "relationship-value":"5G" + }, + { + "relationship-key":"service-instance.service-instance-id", + "relationship-value":"b2ae730f-1d5f-495a-8112-dac017a7348c" + } + ], + "related-to-property":[ + { + "property-key":"service-instance.service-instance-name", + "property-value":"sliceprofile_an_sa1" + } + ] + } + ] + } +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_an_sa1.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_an_sa1.json new file mode 100644 index 00000000..b96bfdcb --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_an_sa1.json @@ -0,0 +1,12 @@ +{ + "service-instance-id":"b2ae730f-1d5f-495a-8112-dac017a7348c", + "service-instance-name":"sliceprofile_an_sa1", + "service-type":"embb", + "service-role":"slice-profile", + "environment-context":"01-06E442", + "workload-context":"AN", + "created-at":"2022-02-16 09:12:27", + "service-instance-location-id":"39-00", + "orchestration-status":"deactivated", + "service-function":"non-shared" +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_cn_sa1.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_cn_sa1.json new file mode 100644 index 00000000..8216876c --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_cn_sa1.json @@ -0,0 +1,12 @@ +{ + "service-instance-id":"cad8fa36-2d55-4c12-a92e-1bd551517a0c", + "service-instance-name":"sliceprofile_cn_sa1", + "service-type":"embb", + "service-role":"slice-profile", + "environment-context":"01-06E442", + "workload-context":"CN", + "created-at":"2022-02-16 09:14:30", + "service-instance-location-id":"39-00", + "orchestration-status":"deactivated", + "service-function":"non-shared" +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_tn_sa1.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_tn_sa1.json new file mode 100644 index 00000000..5ab42ca2 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/cps-aai/sim-data/sliceprofile_tn_sa1.json @@ -0,0 +1,11 @@ +{ + "service-instance-id":"8d0d698e-77f4-4453-8c09-ae2cbe6a9a04", + "service-instance-name":"sliceprofile_tn_sa1", + "service-type":"embb", + "service-role":"slice-profile", + "environment-context":"01-B989BD", + "workload-context":"TN_BH", + "created-at":"2022-02-16 09:16:32", + "orchestration-status":"deactivated", + "service-function":"non-shared" +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_06E442.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_06E442.json new file mode 100644 index 00000000..1f6b3a60 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_06E442.json @@ -0,0 +1,17 @@ +{ + "result":[ + { + "measValuesList":"[[\"11220\",\"false\",[[1.0,\"75\"],[2.0,\"84\"]]],[\"11221\",\"false\",[[1.0,\"76\"],[2.0,\"85\"]]],[\"11222\",\"false\",[[1.0,\"90\"],[2.0,\"95\"]]]]", + "sMeasTypesList":"[\"SM.PrbUsedDl.01-06E442\",\"SM.PrbUsedUl.01-06E442\"]" + }, + { + "measValuesList":"[[\"11225\",\"false\",[[1.0,\"175\"],[2.0,\"184\"]]],[\"11224\",\"false\",[[1.0,\"176\"],[2.0,\"185\"]]],[\"11222\",\"false\",[[1.0,\"105\"],[2.0,\"100\"]]]]", + "sMeasTypesList":"[\"SM.PrbUsedDl.01-06E442\",\"SM.PrbUsedUl.01-06E442\"]" + } + ], + "request":{ + "snssai":"SM.PrbUsedDl.01-06E442", + "time":"1538478000000" + }, + "result_count":2 +} diff --git a/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_B989BD.json b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_B989BD.json new file mode 100644 index 00000000..b3f32306 --- /dev/null +++ b/scripts/dcaegen2-services-slice-analysis-ms/slice-analysis-ms/sim-data/pm_data_01_B989BD.json @@ -0,0 +1,17 @@ +{ + "result":[ + { + "measValuesList":"[[\"11230\",\"false\",[[1.0,\"85\"],[2.0,\"94\"]]],[\"11231\",\"false\",[[1.0,\"86\"],[2.0,\"95\"]]],[\"11232\",\"false\",[[1.0,\"100\"],[2.0,\"105\"]]]]", + "sMeasTypesList":"[\"SM.PrbUsedDl.01-B989BD\",\"SM.PrbUsedUl.01-B989BD\"]" + }, + { + "measValuesList":"[[\"11235\",\"false\",[[1.0,\"185\"],[2.0,\"194\"]]],[\"11234\",\"false\",[[1.0,\"186\"],[2.0,\"195\"]]],[\"11232\",\"false\",[[1.0,\"115\"],[2.0,\"110\"]]]]", + "sMeasTypesList":"[\"SM.PrbUsedDl.01-B989BD\",\"SM.PrbUsedUl.0-B989BD\"]" + } + ], + "request":{ + "snssai":"SM.PrbUsedDl.01-B989BD", + "time":"1538478000000" + }, + "result_count":2 +} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json new file mode 100644 index 00000000..443e97de --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_request.json @@ -0,0 +1,11 @@ +{ + "sliceIdentifiers": [ + "09cad94e-fbb8-4c70-9c4d-74ec75e97683", + "50f418a6-804f-4453-bf70-21f0efaf6fcd" + ], + "configParams": [ + "dLThptPerSlice", + "uLThptPerSlice", + "maxNumberOfConns" + ] +} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json new file mode 100644 index 00000000..7bc05164 --- /dev/null +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/data/slice_config_response.json @@ -0,0 +1 @@ +{"sliceConfigDetails":[{"sliceIdentifiers":"09cad94e-fbb8-4c70-9c4d-74ec75e97683","aggregatedConfig":{"maxNumberOfConns":null,"dlthptPerSlice":131214207,"ulthptPerSlice":59642989}},{"sliceIdentifiers":"50f418a6-804f-4453-bf70-21f0efaf6fcd","aggregatedConfig":{"maxNumberOfConns":null,"dlthptPerSlice":190857028,"ulthptPerSlice":119285978}}]} diff --git a/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot index 8c4d8e23..d57309cf 100644 --- a/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot +++ b/tests/dcaegen2-services-slice-analysis-ms/testcases/slice-analysis-ms-test-cps-aai.robot @@ -9,11 +9,13 @@ Suite Teardown Delete All Sessions *** Variables *** ${SLICE_ANALYSIS_MS_BASE_URL} http://${SLICE_ANALYSIS_MS_IP}:8080 +${SLICE_CONFIG_ENDPOINT} ${SLICE_ANALYSIS_MS_BASE_URL}/api/v1/slices-config ${HEALTHCHECK_ENDPOINT} /healthcheck ${DMAAP_URL} http://${DMAAP_IP}:3904/events ${unauthenticated.DCAE_CL_OUTPUT} /unauthenticated.DCAE_CL_OUTPUT/23/23 ${POST_DMAAP_EVENT_FOR_ML_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.ML_RESPONSE_TOPIC ${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS +&{headers} Content-Type=application/json *** Test Cases *** @@ -21,7 +23,7 @@ ${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthe HealthCheck Create Session sliceanalysisms ${SLICE_ANALYSIS_MS_BASE_URL} - ${resp}= Get Request sliceanalysisms ${HEALTHCHECK_ENDPOINT} + ${resp}= Get On Session sliceanalysisms ${HEALTHCHECK_ENDPOINT} Should Be Equal As Strings ${resp.status_code} 200 @@ -36,7 +38,7 @@ Post ml notification to dmaap Verify ml notification trigger Create Session dmaap ${DMAAP_URL} FOR ${i} IN RANGE 30 - ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + ${result}= Get On Session dmaap ${unauthenticated.DCAE_CL_OUTPUT} Exit For Loop If ${result.json()} != @{EMPTY} Log Waiting for slice-analysis-ms to handle trigger... console=${True} Sleep 5s @@ -62,7 +64,7 @@ Post pm notification-1 to dmaap Verify pm notification-1 trigger Create Session dmaap ${DMAAP_URL} FOR ${i} IN RANGE 20 - ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + ${result}= Get On Session dmaap ${unauthenticated.DCAE_CL_OUTPUT} Exit For Loop If ${result.json()} != @{EMPTY} Log Waiting for sliceanalysisms to handle trigger... console=${True} Sleep 30s @@ -76,3 +78,11 @@ Verify pm notification-1 trigger ${actual_payload}= Evaluate json.loads("""${actual_payload_str}""") json set to dictionary ${expected_payload['additionalProperties']['nsiInfo']} nsiId=${actual_payload['additionalProperties']['nsiInfo']['nsiId']} Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() + + +Verify slice utilization respose + ${data}= Get File ${TEST_ROBOT_DIR}/data/slice_config_request.json + ${result}= Evaluate requests.get('${SLICE_CONFIG_ENDPOINT}', data=$data, headers=${headers}) + ${expected_slice_config}= Get File ${TEST_ROBOT_DIR}/data/slice_config_response.json + ${actual_slice_config}= Convert To String ${result.content} + Should Be True """${actual_slice_config}""".strip() == """${expected_slice_config}""".strip() |