diff options
167 files changed, 6422 insertions, 982 deletions
diff --git a/plans/ccsdk/oran/functionality1/setup.sh b/plans/ccsdk/oran/functionality1/setup.sh new file mode 100755 index 00000000..f9fe0c55 --- /dev/null +++ b/plans/ccsdk/oran/functionality1/setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Place the scripts in run order: +source ${WORKSPACE}/scripts/ccsdk/script1.sh + +# CLI internet speed test +curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python - + +# Test download a 100 MB file to check network speed to nexus.onap.org +wget -O /dev/null https://nexus.onap.org/content/repositories/releases/org/onap/appc/appc-dg-shared-installer/1.3.0/appc-dg-shared-installer-1.3.0.zip + +# Test download a 100 MB file to check network speed to nexus3.onap.org +wget -O /dev/null https://nexus3.onap.org/repository/docker.release/v2/-/blobs/sha256:04dc4b8163487bb1c40df1ce16f349b507c262d6e2f202baa2e66a42eb8c64a1 + diff --git a/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh b/plans/ccsdk/oran/functionality1/teardown.sh index 29700bc5..acf2d097 100755 --- a/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh +++ b/plans/ccsdk/oran/functionality1/teardown.sh @@ -13,11 +13,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +# + +kill-instance.sh i-mock + -docker exec vesc /opt/app/VESCollector/bin/appController.sh stop -sleep 2 -docker cp ${WORKSPACE}/tests/dcaegen2/testcases/resources/collector.properties vesc:/opt/app/VESCollector/etc -sleep 10 -docker exec vesc /opt/app/VESCollector/bin/appController.sh start -sleep 5 -echo "VES Collector Restarted with certBasicAuth" diff --git a/plans/ccsdk/oran/functionality1/testplan.txt b/plans/ccsdk/oran/functionality1/testplan.txt new file mode 100644 index 00000000..e9485b8c --- /dev/null +++ b/plans/ccsdk/oran/functionality1/testplan.txt @@ -0,0 +1,5 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +# Temporary change to trigger verify job. +ccsdk/oran/suite1 +ccsdk/oran/suite2 diff --git a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json index 6b12a831..6c2c4809 100644 --- a/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json +++ b/plans/dcaegen2-services-pmsh/testsuite/assets/mr_sim/mr-initializer.json @@ -1,7 +1,7 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "path": "/events/AAI_EVENT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -13,7 +13,7 @@ "application/json" ] }, - "body": "{}" + "body": [] } }, { @@ -30,15 +30,12 @@ "application/json" ] }, - "body": { - "type": "JSON", - "json": {} - } + "body": [] } }, { "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -50,10 +47,7 @@ "application/json" ] }, - "body": { - "type": "JSON", - "json": {} - } + "body": [] } } ] diff --git a/plans/dcaegen2-services-son-handler/testsuites/config/dmaap/MsgRtrApi.properties b/plans/dcaegen2-services-son-handler/testsuites/config/dmaap/MsgRtrApi.properties new file mode 100644 index 00000000..712cbcb1 --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/config/dmaap/MsgRtrApi.properties @@ -0,0 +1,172 @@ +# LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020 Wipro Limited. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +############################################################################### +############################################################################### +## +## Cambria API Server config +## +## - Default values are shown as commented settings. +## + +############################################################################### +## +## HTTP service +## +## - 3904 is standard as of 7/29/14. +# +## Zookeeper Connection +## +## Both Cambria and Kafka make use of Zookeeper. +## +#config.zk.servers=172.18.1.1 +config.zk.servers=zookeeper:2181 +#config.zk.root=/fe3c/cambria/config + + +############################################################################### +## +## Kafka Connection +## +## Items below are passed through to Kafka's producer and consumer +## configurations (after removing "kafka.") +## if you want to change request.required.acks it can take this one value +#kafka.metadata.broker.list=localhost:9092,localhost:9093 +kafka.metadata.broker.list=kafka:9092 +##kafka.request.required.acks=-1 +#kafka.client.zookeeper=${config.zk.servers} +consumer.timeout.ms=100 +zookeeper.connection.timeout.ms=6000 +zookeeper.session.timeout.ms=20000 +zookeeper.sync.time.ms=2000 +auto.commit.interval.ms=1000 +fetch.message.max.bytes =1000000 +auto.commit.enable=false + +#(backoff*retries > zksessiontimeout) +kafka.rebalance.backoff.ms=10000 +kafka.rebalance.max.retries=6 + + +############################################################################### +## +## Secured Config +## +## Some data stored in the config system is sensitive -- API keys and secrets, +## for example. to protect it, we use an encryption layer for this section +## of the config. +## +## The key is a base64 encode AES key. This must be created/configured for +## each installation. +#cambria.secureConfig.key= +## +## The initialization vector is a 16 byte value specific to the secured store. +## This must be created/configured for each installation. +#cambria.secureConfig.iv= + +## Southfield Sandbox +cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q== +cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw== +authentication.adminSecret=fe3cCompound +#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw== +#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q== + + +############################################################################### +## +## Consumer Caching +## +## Kafka expects live connections from the consumer to the broker, which +## obviously doesn't work over connectionless HTTP requests. The Cambria +## server proxies HTTP requests into Kafka consumer sessions that are kept +## around for later re-use. Not doing so is costly for setup per request, +## which would substantially impact a high volume consumer's performance. +## +## This complicates Cambria server failover, because we often need server +## A to close its connection before server B brings up the replacement. +## + +## The consumer cache is normally enabled. +#cambria.consumer.cache.enabled=true + +## Cached consumers are cleaned up after a period of disuse. The server inspects +## consumers every sweepFreqSeconds and will clean up any connections that are +## dormant for touchFreqMs. +#cambria.consumer.cache.sweepFreqSeconds=15 +cambria.consumer.cache.touchFreqMs=120000 +##stickforallconsumerrequests=false +## The cache is managed through ZK. The default value for the ZK connection +## string is the same as config.zk.servers. +#cambria.consumer.cache.zkConnect=${config.zk.servers} + +## +## Shared cache information is associated with this node's name. The default +## name is the hostname plus the HTTP service port this host runs on. (The +## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(), +## which is not always adequate.) You can set this value explicitly here. +## +#cambria.api.node.identifier=<use-something-unique-to-this-instance> + +#cambria.rateLimit.maxEmptyPollsPerMinute=30 +#cambria.rateLimitActual.delay.ms=10 + +############################################################################### +## +## Metrics Reporting +## +## This server can report its metrics periodically on a topic. +## +#metrics.send.cambria.enabled=true +#metrics.send.cambria.topic=cambria.apinode.metrics #msgrtr.apinode.metrics.dmaap +#metrics.send.cambria.sendEverySeconds=60 + +cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache +consumer.timeout=17 +default.partitions=3 +default.replicas=3 +############################################################################## +#100mb +maxcontentlength=10000 + + +############################################################################## +#AAF Properties +msgRtr.namespace.aaf=org.onap.dmaap.mr.topic +msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +enforced.topic.name.AAF=org.onap +forceAAF=false +transidUEBtopicreqd=false +defaultNSforUEB=org.onap.dmaap.mr +############################################################################## +#Mirror Maker Agent +msgRtr.mirrormakeradmin.aaf=com.onap.dmaap.mr.dev.mirrormaker|*|admin +msgRtr.mirrormakeruser.aaf=com.onap.dmaap.mr.dev.mirrormaker|*|user +msgRtr.mirrormakeruser.aaf.create=com.onap.dmaap.mr.dev.topicFactory|:com.onap.dmaap.mr.dev.topic: +msgRtr.mirrormaker.timeout=15000 +msgRtr.mirrormaker.topic=com.onap.dmaap.mr.prod.mm.agent +msgRtr.mirrormaker.consumergroup=mmagentserver +msgRtr.mirrormaker.consumerid=1 + +kafka.max.poll.interval.ms=300000 +kafka.heartbeat.interval.ms=60000 +kafka.session.timeout.ms=240000 +kafka.max.poll.records=1000 + + diff --git a/plans/dcaegen2-services-son-handler/testsuites/config/sonhms/config_all.json b/plans/dcaegen2-services-son-handler/testsuites/config/sonhms/config_all.json new file mode 100644 index 00000000..8372142d --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/config/sonhms/config_all.json @@ -0,0 +1,134 @@ +{ + "config": { + "sonhandler.badCountThreshold": 1, + "streams_subscribes": { + "performance_management_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.VES_MEASUREMENT_OUTPUT", + "client_role": "son-subscriber", + "location": "onap", + "client_id": "sdnr-son-1" + }, + "aaf_username": null + }, + "fault_management_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.SEC_FAULT_OUTPUT", + "client_role": "son-subscriber", + "location": "onap", + "client_id": "sdnr-son-1" + }, + "aaf_username": null + }, + "nbr_list_change_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/PCI-NOTIF-TOPIC-NGHBR-LIST-CHANGE-INFO", + "client_role": "son-subscriber", + "location": "onap", + "client_id": "sdnr-son-1" + }, + "aaf_username": null + }, + "dcae_cl_response_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/DCAE_CL_RSP", + "client_role": "son-subscriber", + "location": "onap", + "client_id": "sdnr-son-1" + }, + "aaf_username": null + } + }, + "postgres.port": "5432", + "sonhandler.pciOptimizer": "pci", + "sonhandler.maximumClusters": 5, + "sonhandler.numSolutions": 5, + "sonhandler.poorCountThreshold": 1, + "sonhandler.minCollision": 5, + "streams_publishes": { + "CL_topic": { + "aaf_password": null, + "type": "message-router", + "dmaap_info": { + "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.DCAE_CL_OUTPUT", + "client_role": "son-subscriber", + "location": "onap", + "client_id": "sdnr-son-1" + }, + "aaf_username": null + } + }, + "sonhandler.namespace": "onap", + "sonhandler.oof.endpoint": "/api/oof/v1/pci", + "postgres.password": "postgres", + "sonhandler.minConfusion": 5, + "sonhandler.sourceId": "SONHMS", + "postgres.username": "sonhms_admin", + "postgres.host": "postgres", + "sonhandler.policyRespTimer": 10, + "sonhandler.dmaap.server": [ + "dmaap" + ], + "sonhandler.poorThreshold": 70, + "sonhandler.oofTriggerCountTimer": 30, + "cbsPollingInterval": 60, + "sonhandler.cg": "sonhms-cg", + "sonhandler.pollingInterval": 20, + "sonhandler.badThreshold": 50, + "sonhandler.bufferTime": 60, + "sonhandler.cid": "sonhms-cid", + "sonhandler.configDb.service": "http://configdb_oof_sim:5000", + "sonhandler.oofTriggerCountThreshold": 5, + "sonhandler.oof.service": "http://configdb_oof_sim:5000", + "sonhandler.pciAnrOptimizer": "pci_anr", + "sonhandler.policyNegativeAckThreshold": 1, + "sonhandler.policyFixedPciTimeInterval": 10000, + "sonhandler.pollingTimeout": 60, + "sonhandler.nfNamingCode": "RansimAgent", + "service_calls": { + "sdnr-getpnfname": [], + "sdnr-getpci": [], + "sdnr-getnbrlist": [], + "sdnr-getcelllist": [], + "oof-req": [], + "policy-req": [] + } + }, + "policies": { + "event": { + "action": "gathered", + "timestamp": "2019-09-18T14:57:55.320Z", + "update_id": "dbb88da8-8df1-489d-b51d-8d5cbbfbcd99", + "policies_count": 1 + }, + "items": [ + { + "policyName": "com.Config_PCIMS_CONFIG_POLICY.1.xml", + "name": "com.Config_PCIMS_CONFIG_POLICY", + "config": { + "PCI_SDNR_TARGET_NAME": "SDNR", + "PCI_OPTMIZATION_ALGO_CATEGORY_IN_OOF": "OOF-PCI-OPTIMIZATION", + "PCI_NEIGHBOR_CHANGE_CLUSTER_TIMEOUT_IN_SECS": 60, + "PCI_MODCONFIGANR_POLICY_NAME": "ControlLoop-vSONH-7d4baf04-8875-4d1f-946d-06b874048b61", + "PCI_MODCONFIG_POLICY_NAME": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459" + }, + "type_version": "1.0.0", + "version": "1.0.0", + "policyVersion": "1", + "type": "onap.policies.monitoring.docker.sonhandler.app", + "metadata": { + "policy-id": "com.Config_PCIMS_CONFIG_POLICY", + "policy-version": "1" + } + } + ] + } +} diff --git a/plans/dcaegen2-services-son-handler/testsuites/docker-compose.yaml b/plans/dcaegen2-services-son-handler/testsuites/docker-compose.yaml new file mode 100644 index 00000000..43784399 --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/docker-compose.yaml @@ -0,0 +1,94 @@ +# ============LICENSE_START======================================================= +# son-handler +# ================================================================================ +# Copyright (C) 2020 Wipro Limited. +# ============================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= + +version: '3.3' +networks: + sonhms-default: + driver: bridge + driver_opts: + com.docker.network.driver.mtu: 1400 + +services: + zookeeper: + image: wurstmeister/zookeeper + container_name: zookeeper + ports: + - "2181:2181" + networks: + - sonhms-default + kafka: + image: wurstmeister/kafka + container_name: kafka + ports: + - "9092:9092" + environment: + KAFKA_ADVERTISED_HOST_NAME: "kafka" + KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true' + KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181" + KAFKA_ADVERTISED_LISTENERS: "PLAINTEXT://kafka:9092" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + depends_on: + - zookeeper + networks: + - sonhms-default + dmaap: + image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.8 + container_name: dmaap + ports: + - "3904:3904" + - "3905:3905" + volumes: + - ./config/dmaap/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties + depends_on: + - zookeeper + - kafka + networks: + - sonhms-default + postgres: + image: 'postgres:12-alpine' + container_name: sonhms-postgres + hostname: postgres + environment: + - POSTGRES_USER=sonhms_admin + - POSTGRES_PASSWORD=postgres + - POSTGRES_DB=sonhms + ports: + - 5432 + healthcheck: + test: ["CMD", "nc", "-z", "localhost", "5432"] + interval: 30s + timeout: 10s + retries: 5 + networks: + - sonhms-default + sonhms: + image: "nexus3.onap.org:10003/onap/org.onap.dcaegen2.services.son-handler:2.1.1-20200730T023738Z" + container_name: sonhms.onap + hostname: sonhms + environment: + - STANDALONE=true + - CONFIG_FILE=/etc/config_all.json + ports: + - "8080:8080" + volumes: + - ./config/sonhms/config_all.json:/etc/config_all.json + depends_on: + - postgres + networks: + - sonhms-default diff --git a/plans/dcaegen2-services-son-handler/testsuites/setup.sh b/plans/dcaegen2-services-son-handler/testsuites/setup.sh new file mode 100644 index 00000000..6f895a1e --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/setup.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +docker login -u docker -p docker nexus3.onap.org:10001 + +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-son-handler/testsuites +TEST_SCRIPTS_DIR=$WORKSPACE/scripts/dcaegen2-services-son-handler/sonhandler +TEST_ROBOT_DIR=$WORKSPACE/tests/dcaegen2-services-son-handler/testcases + +docker-compose up -d + +ZOOKEEPER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' zookeeper) +KAFKA_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' kafka) +DMAAP_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' dmaap) +SONHMS_POSTGRES_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms-postgres) +SONHMS_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sonhms.onap) + +echo "Waiting for dmaap to come up ..." +for i in {1..10}; do + dmaap_state=$(curl --write-out '%{http_code}' --silent --output /dev/null $DMAAP_IP:3904/topics) + if [ $dmaap_state == "200" ] + then + break + else + sleep 60 + fi +done + +#create topics +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "DCAE_CL_RSP"}' \ +http://$DMAAP_IP:3904/events/DCAE_CL_RSP + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "unauthenticated.SEC_FAULT_OUTPUT"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.SEC_FAULT_OUTPUT + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "unauthenticated.VES_MEASUREMENT_OUTPUT"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT + +curl --header "Content-type: application/json" \ +--request POST \ +--data '{"topicName": "unauthenticated.DCAE_CL_OUTPUT"}' \ +http://$DMAAP_IP:3904/events/unauthenticated.DCAE_CL_OUTPUT +echo "topics created" + +#build configdb-oof-sim image +cd $TEST_SCRIPTS_DIR +docker build -t configdb_oof_sim . + +#run configdb-oof-sim +docker run -d --name configdb_oof_sim --network=testsuites_sonhms-default -p "5000:5000" configdb_oof_sim:latest; +sleep 60 +CONFIGDB_OOF_SIM_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' configdb_oof_sim) +echo "CONFIGDB_OOF_SIM_IP=${CONFIGDB_OOF_SIM_IP}" + + +ROBOT_VARIABLES="-v ZOOKEEPER_IP:${ZOOKEEPER_IP} -v KAFKA_IP:${KAFKA_IP} -v DMAAP_IP:${DMAAP_IP} -v SONHMS_POSTGRES_IP:${SONHMS_POSTGRES_IP} -v SONHMS_IP:${SONHMS_IP} -v CONFIGDB_OOF_SIM_IP:${CONFIGDB_OOF_SIM_IP} -v TEST_ROBOT_DIR:${TEST_ROBOT_DIR}" diff --git a/plans/dcaegen2-services-son-handler/testsuites/teardown.sh b/plans/dcaegen2-services-son-handler/testsuites/teardown.sh new file mode 100644 index 00000000..7db3d2f6 --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/teardown.sh @@ -0,0 +1,9 @@ +#!/bin/bash +echo "Starting teardown script" +TEST_PLANS_DIR=$WORKSPACE/plans/dcaegen2-services-son-handler/testsuites +mkdir -p $WORKSPACE/archives + +docker container stop configdb_oof_sim +docker container rm configdb_oof_sim +docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml logs > $WORKSPACE/archives/sonhandler-docker-compose.log +docker-compose -f $TEST_PLANS_DIR/docker-compose.yaml down -v diff --git a/plans/dcaegen2-services-son-handler/testsuites/testplan.txt b/plans/dcaegen2-services-son-handler/testsuites/testplan.txt new file mode 100644 index 00000000..2f8b7606 --- /dev/null +++ b/plans/dcaegen2-services-son-handler/testsuites/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +dcaegen2-services-son-handler/testcases diff --git a/plans/dcaegen2/testsuites/setup.sh b/plans/dcaegen2/testsuites/setup.sh index 26585c20..88767b19 100755 --- a/plans/dcaegen2/testsuites/setup.sh +++ b/plans/dcaegen2/testsuites/setup.sh @@ -21,7 +21,7 @@ #get current host IP addres HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') -VESC_IMAGE=nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:latest +VESC_IMAGE=nexus3.onap.org:10003/onap/org.onap.dcaegen2.collectors.ves.vescollector:latest echo VESC_IMAGE=${VESC_IMAGE} diff --git a/plans/modeling-etsicatalog/sanity-check/setup.sh b/plans/modeling-etsicatalog/sanity-check/setup.sh index 9157c41d..2e494167 100644 --- a/plans/modeling-etsicatalog/sanity-check/setup.sh +++ b/plans/modeling-etsicatalog/sanity-check/setup.sh @@ -33,9 +33,9 @@ docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e " MSB_IP==`get-instance-ip.sh msb_internal_apigateway` echo MSB_IP=${MSB_IP} -docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db -VFC_DB_IP=`get-instance-ip.sh vfc-db` -echo VFC_DB_IP=${VFC_DB_IP} +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_USER="etsicatalog" -e MYSQL_PASSWORD="etsicatalog" -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE="etsicatalog" nexus3.onap.org:10001/library/mariadb +DB_IP=`get-instance-ip.sh vfc-db` +echo DB_IP=${DB_IP} # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do @@ -46,7 +46,7 @@ done # Wait for initialization(3306 DB) for i in {1..3}; do - curl -sS -m 1 ${VFC_DB_IP}:3306 && break + curl -sS -m 1 ${DB_IP}:3306 && break echo sleep $i sleep $i done @@ -56,7 +56,7 @@ echo sleep 60 sleep 60 # start modeling-etsicatalog -docker run -d --name modeling-etsicatalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/modeling/etsicatalog +docker run -d --name modeling-etsicatalog -v /var/lib/mysql -e MSB_ADDR=${DISCOVERY_IP}:10081 -e DB_IP=${DB_IP} nexus3.onap.org:10001/onap/modeling/etsicatalog EtsiCatalog_IP=`get-instance-ip.sh modeling-etsicatalog` for i in {1..10}; do curl -sS -m 1 ${EtsiCatalog_IP}:8806 && break diff --git a/plans/aaf/certservice/certs/Makefile b/plans/oom-platform-cert-service/certservice/certs/Makefile index 126e0533..ea90c5c7 100644 --- a/plans/aaf/certservice/certs/Makefile +++ b/plans/oom-platform-cert-service/certservice/certs/Makefile @@ -63,16 +63,16 @@ step_8: #Generate certService private and public keys step_9: @echo "Generate certService private and public keys" - keytool -genkeypair -v -alias aaf-cert-service -keyalg RSA -keysize 2048 -validity 730 \ + keytool -genkeypair -v -alias oom-cert-service -keyalg RSA -keysize 2048 -validity 730 \ -keystore certServiceServer-keystore.jks -storetype JKS \ - -dname "CN=aaf-cert-service,OU=certServiceServer company,O=certServiceServer org,L=Wroclaw,ST=Dolny Slask,C=PL" \ + -dname "CN=oom-cert-service,OU=certServiceServer company,O=certServiceServer org,L=Wroclaw,ST=Dolny Slask,C=PL" \ -keypass secret -storepass secret -ext BasicConstraints:critical="ca:false" @echo "####done####" #Generate certificate signing request for certService step_10: @echo "Generate certificate signing request for certService" - keytool -certreq -keystore certServiceServer-keystore.jks -alias aaf-cert-service -storepass secret -file certServiceServer.csr + keytool -certreq -keystore certServiceServer-keystore.jks -alias oom-cert-service -storepass secret -file certServiceServer.csr @echo "####done####" #Sign certService certificate by root CA @@ -80,7 +80,7 @@ step_11: @echo "Sign certService certificate by root CA" keytool -gencert -v -keystore root-keystore.jks -storepass secret -alias root -infile certServiceServer.csr \ -outfile certServiceServerByRoot.crt -rfc -ext bc=0 -ext ExtendedkeyUsage="serverAuth,clientAuth" \ - -ext SubjectAlternativeName:="DNS:aaf-cert-service,DNS:localhost" + -ext SubjectAlternativeName:="DNS:oom-cert-service,DNS:localhost" @echo "####done####" #Import root certificate into server @@ -92,7 +92,7 @@ step_12: #Import signed certificate into certService step_13: @echo "Import signed certificate into certService" - keytool -importcert -file certServiceServerByRoot.crt -destkeystore certServiceServer-keystore.jks -alias aaf-cert-service \ + keytool -importcert -file certServiceServerByRoot.crt -destkeystore certServiceServer-keystore.jks -alias oom-cert-service \ -storepass secret -noprompt @echo "####done####" diff --git a/plans/aaf/certservice/cmpServers.json b/plans/oom-platform-cert-service/certservice/cmpServers.json index d6557c52..72564949 100644 --- a/plans/aaf/certservice/cmpServers.json +++ b/plans/oom-platform-cert-service/certservice/cmpServers.json @@ -2,7 +2,7 @@ "cmpv2Servers": [ { "caName": "Client", - "url": "http://aafcert-ejbca:8080/ejbca/publicweb/cmp/cmp", + "url": "http://oomcert-ejbca:8080/ejbca/publicweb/cmp/cmp", "issuerDN": "CN=ManagementCA", "caMode": "CLIENT", "authentication": { @@ -12,7 +12,7 @@ }, { "caName": "RA", - "url": "http://aafcert-ejbca:8080/ejbca/publicweb/cmp/cmpRA", + "url": "http://oomcert-ejbca:8080/ejbca/publicweb/cmp/cmpRA", "issuerDN": "CN=ManagementCA", "caMode": "RA", "authentication": { diff --git a/plans/aaf/certservice/docker-compose.yml b/plans/oom-platform-cert-service/certservice/docker-compose.yml index dcac7df0..b281101a 100644 --- a/plans/aaf/certservice/docker-compose.yml +++ b/plans/oom-platform-cert-service/certservice/docker-compose.yml @@ -4,7 +4,7 @@ services: ejbca: image: primekey/ejbca-ce:6.15.2.5 hostname: cahostname - container_name: aafcert-ejbca + container_name: oomcert-ejbca ports: - "80:8080" - "443:8443" @@ -18,22 +18,22 @@ services: networks: - certservice - aaf-cert-service: - image: nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-api:latest + oom-cert-service: + image: nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-certservice-api:latest volumes: - - $CONFIGURATION_PATH:/etc/onap/aaf/certservice/cmpServers.json - - ./certs/truststore.jks:/etc/onap/aaf/certservice/certs/truststore.jks - - ./certs/root.crt:/etc/onap/aaf/certservice/certs/root.crt - - ./certs/certServiceServer-keystore.jks:/etc/onap/aaf/certservice/certs/certServiceServer-keystore.jks - - ./certs/certServiceServer-keystore.p12:/etc/onap/aaf/certservice/certs/certServiceServer-keystore.p12 - container_name: aafcert-service + - $CONFIGURATION_PATH:/etc/onap/oom/certservice/cmpServers.json + - ./certs/truststore.jks:/etc/onap/oom/certservice/certs/truststore.jks + - ./certs/root.crt:/etc/onap/oom/certservice/certs/root.crt + - ./certs/certServiceServer-keystore.jks:/etc/onap/oom/certservice/certs/certServiceServer-keystore.jks + - ./certs/certServiceServer-keystore.p12:/etc/onap/oom/certservice/certs/certServiceServer-keystore.p12 + container_name: oomcert-service ports: - "8443:8443" depends_on: ejbca: condition: service_healthy healthcheck: - test: ["CMD-SHELL", "curl https://localhost:8443/actuator/health --cacert /etc/onap/aaf/certservice/certs/root.crt --cert-type p12 --cert /etc/onap/aaf/certservice/certs/certServiceServer-keystore.p12 --pass secret"] + test: ["CMD-SHELL", "curl https://localhost:8443/actuator/health --cacert /etc/onap/oom/certservice/certs/root.crt --cert-type p12 --cert /etc/onap/oom/certservice/certs/certServiceServer-keystore.p12 --pass secret"] interval: 10s timeout: 3s retries: 15 diff --git a/plans/aaf/certservice/scripts/ejbca-configuration.sh b/plans/oom-platform-cert-service/certservice/scripts/ejbca-configuration.sh index 77f5c555..77f5c555 100755 --- a/plans/aaf/certservice/scripts/ejbca-configuration.sh +++ b/plans/oom-platform-cert-service/certservice/scripts/ejbca-configuration.sh diff --git a/plans/aaf/certservice/setup.sh b/plans/oom-platform-cert-service/certservice/setup.sh index 1200e964..bee54cde 100644 --- a/plans/aaf/certservice/setup.sh +++ b/plans/oom-platform-cert-service/certservice/setup.sh @@ -20,7 +20,7 @@ SCRIPT=`realpath $0` CURRENT_WORKDIR_PATH=`dirname $SCRIPT` -PROJECT_DIRECTORY="plans/aaf/certservice" +PROJECT_DIRECTORY="plans/oom-platform-cert-service/certservice" SCRIPTS_DIRECTORY="scripts" @@ -75,35 +75,35 @@ export CONFIGURATION_PATH=${CONFIGURATION_PATH} export SCRIPTS_PATH=${SCRIPTS_PATH} #Generate keystores, truststores, certificates and keys -mkdir -p ${WORKSPACE}/tests/aaf/certservice/assets/certs/ +mkdir -p ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/ make all -C ./certs/ -cp ${WORKSPACE}/plans/aaf/certservice/certs/root.crt ${WORKSPACE}/tests/aaf/certservice/assets/certs/root.crt +cp ${WORKSPACE}/plans/oom-platform-cert-service/certservice/certs/root.crt ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/root.crt echo "Generated keystores" -openssl pkcs12 -in ${WORKSPACE}/plans/aaf/certservice/certs/certServiceServer-keystore.p12 -clcerts -nokeys -password pass:secret | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ${WORKSPACE}/tests/aaf/certservice/assets/certs/certServiceServer.crt +openssl pkcs12 -in ${WORKSPACE}/plans/oom-platform-cert-service/certservice/certs/certServiceServer-keystore.p12 -clcerts -nokeys -password pass:secret | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/certServiceServer.crt echo "Generated server certificate" -openssl pkcs12 -in ${WORKSPACE}/plans/aaf/certservice/certs/certServiceServer-keystore.p12 -nocerts -nodes -password pass:secret| sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > ${WORKSPACE}/tests/aaf/certservice/assets/certs/certServiceServer.key +openssl pkcs12 -in ${WORKSPACE}/plans/oom-platform-cert-service/certservice/certs/certServiceServer-keystore.p12 -nocerts -nodes -password pass:secret| sed -ne '/-BEGIN PRIVATE KEY-/,/-END PRIVATE KEY-/p' > ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/certServiceServer.key echo "Generated server key" docker-compose up -d -AAFCERT_IP='none' +OOMCERT_IP='none' # Wait container ready for i in {1..9} do - AAFCERT_IP=`get-instance-ip.sh aafcert-service` + OOMCERT_IP=`get-instance-ip.sh oomcert-service` RESP_CODE=$(curl -s https://localhost:8443/actuator/health --cacert ./certs/root.crt --cert-type p12 --cert ./certs/certServiceServer-keystore.p12 --pass secret | \ python2 -c 'import json,sys;obj=json.load(sys.stdin);print obj["status"]') if [[ "$RESP_CODE" == "UP" ]]; then - echo 'AAF Cert Service is ready' - export AAFCERT_IP=${AAFCERT_IP} - docker exec aafcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh + echo 'OOM Cert Service is ready' + export OOMCERT_IP=${OOMCERT_IP} + docker exec oomcert-ejbca /opt/primekey/scripts/ejbca-configuration.sh break fi - echo 'Waiting for AAF Cert Service to start up...' + echo 'Waiting for OOM Cert Service to start up...' sleep 30s done -if [ "$AAFCERT_IP" == 'none' -o "$AAFCERT_IP" == '' ]; then - echo "AAF Cert Service is not ready!" +if [ "$OOMCERT_IP" == 'none' -o "$OOMCERT_IP" == '' ]; then + echo "OOM Cert Service is not ready!" exit 1 # Return error code fi diff --git a/plans/aaf/certservice/teardown.sh b/plans/oom-platform-cert-service/certservice/teardown.sh index 71e20b7c..f531180e 100644 --- a/plans/aaf/certservice/teardown.sh +++ b/plans/oom-platform-cert-service/certservice/teardown.sh @@ -19,7 +19,7 @@ docker-compose down make clear -C ./certs/ echo "Removed old keystores" -rm -rf ${WORKSPACE}/tests/aaf/certservice/assets/certs +rm -rf ${WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs echo "Removed old certificates" kill-instance.sh ${ClientContainerName}
\ No newline at end of file diff --git a/plans/aaf/certservice/testplan.txt b/plans/oom-platform-cert-service/certservice/testplan.txt index 270fc6d4..ed9ee127 100755 --- a/plans/aaf/certservice/testplan.txt +++ b/plans/oom-platform-cert-service/certservice/testplan.txt @@ -1,3 +1,3 @@ # Test suites are relative paths under [integration/csit.git]/tests/. # Place the suites in run order. -aaf/certservice +oom-platform-cert-service/certservice diff --git a/plans/oom-platform-cert-service/truststoremerger/setup.sh b/plans/oom-platform-cert-service/truststoremerger/setup.sh new file mode 100644 index 00000000..9f618406 --- /dev/null +++ b/plans/oom-platform-cert-service/truststoremerger/setup.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2020 Nokia. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +#export container name +export MergerContainerName=TrustStoreMerger + +#install docker sdk +echo "Uninstall docker-py and reinstall docker." +pip uninstall -y docker-py +pip uninstall -y docker +pip install -U docker==2.7.0 + +#install pyjks for .jks files management +pip install pyjks diff --git a/plans/oom-platform-cert-service/truststoremerger/teardown.sh b/plans/oom-platform-cert-service/truststoremerger/teardown.sh new file mode 100644 index 00000000..a0ee4d26 --- /dev/null +++ b/plans/oom-platform-cert-service/truststoremerger/teardown.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# Copyright 2017 ZTE, Inc. and others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +kill-instance.sh ${MergerContainerName} diff --git a/plans/oom-platform-cert-service/truststoremerger/testplan.txt b/plans/oom-platform-cert-service/truststoremerger/testplan.txt new file mode 100755 index 00000000..11e00832 --- /dev/null +++ b/plans/oom-platform-cert-service/truststoremerger/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +oom-platform-cert-service/truststoremerger diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/aai.cert b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/aai.cert index 9acb8bb9..266a8f21 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/aai.cert +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/cds/resources/aai.cert @@ -1,31 +1,36 @@ Bag Attributes - friendlyName: so@so.onap.org - localKeyID: 54 69 6D 65 20 31 35 36 34 30 35 32 33 31 34 37 38 34 -subject=CN = aai-simulator, emailAddress = , OU = so@so.onap.org, OU = OSAAF, O = ONAP, C = US + friendlyName: aai-cert + localKeyID: 59 C6 CE 53 FF 25 7B 6F 86 4D E4 3A 2D EB 48 98 E0 20 B9 54 +subject=C = US, O = ONAP, OU = OSAAF, CN = aai-simulator -issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 +issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediate -----BEGIN CERTIFICATE----- -MIIEBzCCAu+gAwIBAgIIdC1kel7DdnYwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UE -BhMCVVMxDTALBgNVBAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRkwFwYDVQQDDBBp -bnRlcm1lZGlhdGVDQV85MB4XDTE5MDcyNTEwNTgzNFoXDTIwMDcyNTEwNTgzNFow -bjEWMBQGA1UEAwwNYWFpLXNpbXVsYXRvcjEPMA0GCSqGSIb3DQEJARYAMRcwFQYD -VQQLDA5zb0Bzby5vbmFwLm9yZzEOMAwGA1UECwwFT1NBQUYxDTALBgNVBAoMBE9O -QVAxCzAJBgNVBAYTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -185xCE6cmsY6XB5Dd/5GlfuWjN05KKk3akymxhbJLa9ektlusmuTPt4cnxD+e4b6 -dymqHzQ6C206TBK1jaDzcF07Ag7VTpxmlgaSukQ+aZoXfIcs80lWCLnNvC2MrOuh -9uhUILAmuddo01cIHJvti5R2g6BEirCGsVKBSwmXRotxHyzUg9IwOpeGy0G1ZDjU -OiMqY5qOonVTEz1AganctdiWK1/eZ5IBD7gQwckS5n1a6RYMVSnr1vKLoiZq76Bp -wKy3EBX16jlmQMC5Aj9/GDezJg0bPvlikL3VUsC76DRShucsxS3SzVxeAJ5nsH8S -qUElpbe3uabhFG2qKmtvdwIDAQABo4HPMIHMMAkGA1UdEwQCMAAwDgYDVR0PAQH/ -BAQDAgXgMCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBUBgNVHSME -TTBLgBSB95lbELnIjN7zUl7qTmmgQz6s3aEwpC4wLDEOMAwGA1UECwwFT1NBQUYx -DTALBgNVBAoMBE9OQVAxCzAJBgNVBAYTAlVTggEHMB0GA1UdDgQWBBSQ54p+SID0 -2p21lUHY9YC1ZZfkZTAYBgNVHREEETAPgg1hYWktc2ltdWxhdG9yMA0GCSqGSIb3 -DQEBCwUAA4IBAQBRGK6Iyjc/0bC3+qjPuNwSlu1pUcgHtgxP/oTU5f9xMSkSjIP0 -weVnIEGOwlW8GRbDPQza14AHETTxJ17rv6p6h7l/dZZmbMPl2S+QXGptgDWR6zY7 -q5ROecGcQzgto6lTMcKgBMW+ct3Tb3khMqP6ewzGz85SY7BgyVE7HFG9M5BM3NhX -ovAcj93C24DFKLDKxHrrsVIROlFk6QW2+kb0zo1YzVc6NNJY2ViXBrM5zrG21tDj -VEv0JaHKPYhzWCb7ZcSSo/ftZ2yDsRGS8r6DK5sYCfLifloMVJhF04hOC+ZbxiiB -JgYniQPmb0Zj5BfXWovdAe/89wr5aokQ3GZL +MIIE/TCCAuUCAQIwDQYJKoZIhvcNAQELBQAwQzELMAkGA1UEBhMCVVMxDTALBgNV +BAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRUwEwYDVQQDDAxpbnRlcm1lZGlhdGUw +IBcNMjAwODEzMTUxMDI5WhgPMjEyMDA3MjAxNTEwMjlaMEQxCzAJBgNVBAYTAlVT +MQ0wCwYDVQQKDARPTkFQMQ4wDAYDVQQLDAVPU0FBRjEWMBQGA1UEAwwNYWFpLXNp +bXVsYXRvcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAM/5ReR7rfi1 +KKJSOKSzq+B+jLDOSeBzg6XtuSwcxW9glm09GzxRz7TGTdIRmGz3Y2SRY1En40Ep +ZwEoyPgTBBNNR5hC+da9amvjFil/cvB1GqPS5v5PSNR38kmYjMGCUPtgqFv3Nl3L +zAdgBBwrS4vitDXfq3oDyArGiY2DU1JZzGhPbLdrt8CNetk4csz5v/yHlcY3IMTz +DYyuxfCRNBZvQd1rdusGo/FARLTRD4btMY3i/0/u0weXAsZrzjwiYiuA0i2qjmv7 +AeakNYLBC/nK/UTZFpwoZzFiAzcMs9fUwTDUhWm4nKoVSxRnkjlJoUx/vsctJbSl ++KKJBUYXrznkAQw34BhEZGQdjsUrpoIYti/pZ2w1O0xxfWMz98NE1qZH4TKKirNo +cG7BZJ7EjqO25Ye6rZjfFdUa+Ri7pY7JBNobK8htR72BBX8+j1e8q3IuJ+GjUi9K +fcSH1qK3ypztS8qjfFxYjehBktNt95MgaQdAvz2Xkyzpuj565+54B4YZtv+mfa98 +M/Osc11eox9GTY0nMw/8oohdNt9mzlgsUmCR3rK/3O5xkbmaOyWrgNj/0QlyjVsn +w0pnmHTPmL321U/N5OQe21E54r0PI40DD6pfzUQ9CY/9j45o2f+eD29el4gjTf3l +Bx4+9Hm116oHA9CxFqN7OOySAgrvLm5vAgMBAAEwDQYJKoZIhvcNAQELBQADggIB +ALDeWIRGGVWLgYi1hbvTF/YrZyEPaHW2DSAZHVq+B6YE5O7hpcr5xesT52/zKwVJ +wkithWEeYRkr3/zOtBWYA1luGNf3eQ3MbbaNfatGrv1NrMtp+x7QsLT8u1+YArwj +Vr2Z4h7MHIO9EjdgH5IEMJRaUnOLRTZvvkNESJwVVy+Jlw3NVPvkw+wJcZF2n8Wf +SNdE/FIBLLhJtX2/tiYeO+npn1WAcqifT5k0nOIRxZYEk0GdIq2P53nuaJ74GcWC +enNI/CHjkJKix3yk8GlJPZkL/PfUbne6UwuNmAovoOcnd9hRbzv/IFXnJkmp4aun +pdaSDpbWHyN/pEQBiSPN6QdgNzR7l+zkn+tprZtR143zAvsRBRf2JhpHQqI0EJLV +HPVOGX9ph8f7Dixbka7EiCwy1yoaFuewQ0h/Ofqa8Nw7LPkTi3rp+FWZbZoZahlk +A3k8StZwVOFvUIbvoj0bP3e2nJgnJKwfWppX29m6M0xUTn54hIm2TRkMy2SSIIHl +7jYcaNKbmPibVeaW9Y8bjwBPkvvLbS7ZFb8QTYpYQbBUwLpkbuPImaQq+V4VqRJl +Jzb5ZY7rSk/sp+vu2PuU4QkGGLC1X0bNCIi7ucwt9ie8uNCsYdNfQLYRy3x/BrWq +BsmHg+f5zPyVmKd+qXBwfa7UeT2zJLs3IlFwBeg4sk3f -----END CERTIFICATE----- diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/pnf-sw-upgrade.yang b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/pnf-sw-upgrade.yang index 3cba9cf0..cbad3c57 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/pnf-sw-upgrade.yang +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/pnf-sw-upgrade.yang @@ -73,6 +73,10 @@ module pnf-sw-upgrade { description "Free-text description of the UP."; } + leaf node-health { + type string; + description "Reflect Node Health Status"; + } } } }
\ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/startup.xml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/startup.xml index e1ce243c..ebf2af37 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/startup.xml +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/simulators/pnfsim/pnf-sw-upgrade/startup.xml @@ -1,12 +1,13 @@ <?xml version='1.0' encoding='UTF-8'?> <software-upgrade xmlns="http://onap.org/pnf-sw-upgrade"> - <upgrade-package> - <id>sw-id-1</id> - <current-status>CREATED</current-status> - <software-version>test_software_1</software-version> - <uri>sftp://127.0.0.1/test_software_1.img</uri> - <user>test_user</user> - <password>test_password</password> - <user-label>trial software update</user-label> - </upgrade-package> + <upgrade-package> + <id>sw-id-1</id> + <current-status>CREATED</current-status> + <software-version>test_software_1</software-version> + <uri>sftp://127.0.0.1/test_software_1.img</uri> + <user>test_user</user> + <password>test_password</password> + <user-label>trial software update</user-label> + <node-health>Ok</node-health> + </upgrade-package> </software-upgrade>
\ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/aai-certificate/aai.cert b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/aai-certificate/aai.cert index 9acb8bb9..266a8f21 100755..100644 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/aai-certificate/aai.cert +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/aai-certificate/aai.cert @@ -1,31 +1,36 @@ Bag Attributes - friendlyName: so@so.onap.org - localKeyID: 54 69 6D 65 20 31 35 36 34 30 35 32 33 31 34 37 38 34 -subject=CN = aai-simulator, emailAddress = , OU = so@so.onap.org, OU = OSAAF, O = ONAP, C = US + friendlyName: aai-cert + localKeyID: 59 C6 CE 53 FF 25 7B 6F 86 4D E4 3A 2D EB 48 98 E0 20 B9 54 +subject=C = US, O = ONAP, OU = OSAAF, CN = aai-simulator -issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 +issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediate -----BEGIN CERTIFICATE----- -MIIEBzCCAu+gAwIBAgIIdC1kel7DdnYwDQYJKoZIhvcNAQELBQAwRzELMAkGA1UE -BhMCVVMxDTALBgNVBAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRkwFwYDVQQDDBBp -bnRlcm1lZGlhdGVDQV85MB4XDTE5MDcyNTEwNTgzNFoXDTIwMDcyNTEwNTgzNFow -bjEWMBQGA1UEAwwNYWFpLXNpbXVsYXRvcjEPMA0GCSqGSIb3DQEJARYAMRcwFQYD -VQQLDA5zb0Bzby5vbmFwLm9yZzEOMAwGA1UECwwFT1NBQUYxDTALBgNVBAoMBE9O -QVAxCzAJBgNVBAYTAlVTMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -185xCE6cmsY6XB5Dd/5GlfuWjN05KKk3akymxhbJLa9ektlusmuTPt4cnxD+e4b6 -dymqHzQ6C206TBK1jaDzcF07Ag7VTpxmlgaSukQ+aZoXfIcs80lWCLnNvC2MrOuh -9uhUILAmuddo01cIHJvti5R2g6BEirCGsVKBSwmXRotxHyzUg9IwOpeGy0G1ZDjU -OiMqY5qOonVTEz1AganctdiWK1/eZ5IBD7gQwckS5n1a6RYMVSnr1vKLoiZq76Bp -wKy3EBX16jlmQMC5Aj9/GDezJg0bPvlikL3VUsC76DRShucsxS3SzVxeAJ5nsH8S -qUElpbe3uabhFG2qKmtvdwIDAQABo4HPMIHMMAkGA1UdEwQCMAAwDgYDVR0PAQH/ -BAQDAgXgMCAGA1UdJQEB/wQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBUBgNVHSME -TTBLgBSB95lbELnIjN7zUl7qTmmgQz6s3aEwpC4wLDEOMAwGA1UECwwFT1NBQUYx -DTALBgNVBAoMBE9OQVAxCzAJBgNVBAYTAlVTggEHMB0GA1UdDgQWBBSQ54p+SID0 -2p21lUHY9YC1ZZfkZTAYBgNVHREEETAPgg1hYWktc2ltdWxhdG9yMA0GCSqGSIb3 -DQEBCwUAA4IBAQBRGK6Iyjc/0bC3+qjPuNwSlu1pUcgHtgxP/oTU5f9xMSkSjIP0 -weVnIEGOwlW8GRbDPQza14AHETTxJ17rv6p6h7l/dZZmbMPl2S+QXGptgDWR6zY7 -q5ROecGcQzgto6lTMcKgBMW+ct3Tb3khMqP6ewzGz85SY7BgyVE7HFG9M5BM3NhX -ovAcj93C24DFKLDKxHrrsVIROlFk6QW2+kb0zo1YzVc6NNJY2ViXBrM5zrG21tDj -VEv0JaHKPYhzWCb7ZcSSo/ftZ2yDsRGS8r6DK5sYCfLifloMVJhF04hOC+ZbxiiB -JgYniQPmb0Zj5BfXWovdAe/89wr5aokQ3GZL +MIIE/TCCAuUCAQIwDQYJKoZIhvcNAQELBQAwQzELMAkGA1UEBhMCVVMxDTALBgNV +BAoMBE9OQVAxDjAMBgNVBAsMBU9TQUFGMRUwEwYDVQQDDAxpbnRlcm1lZGlhdGUw +IBcNMjAwODEzMTUxMDI5WhgPMjEyMDA3MjAxNTEwMjlaMEQxCzAJBgNVBAYTAlVT +MQ0wCwYDVQQKDARPTkFQMQ4wDAYDVQQLDAVPU0FBRjEWMBQGA1UEAwwNYWFpLXNp +bXVsYXRvcjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAM/5ReR7rfi1 +KKJSOKSzq+B+jLDOSeBzg6XtuSwcxW9glm09GzxRz7TGTdIRmGz3Y2SRY1En40Ep +ZwEoyPgTBBNNR5hC+da9amvjFil/cvB1GqPS5v5PSNR38kmYjMGCUPtgqFv3Nl3L +zAdgBBwrS4vitDXfq3oDyArGiY2DU1JZzGhPbLdrt8CNetk4csz5v/yHlcY3IMTz +DYyuxfCRNBZvQd1rdusGo/FARLTRD4btMY3i/0/u0weXAsZrzjwiYiuA0i2qjmv7 +AeakNYLBC/nK/UTZFpwoZzFiAzcMs9fUwTDUhWm4nKoVSxRnkjlJoUx/vsctJbSl ++KKJBUYXrznkAQw34BhEZGQdjsUrpoIYti/pZ2w1O0xxfWMz98NE1qZH4TKKirNo +cG7BZJ7EjqO25Ye6rZjfFdUa+Ri7pY7JBNobK8htR72BBX8+j1e8q3IuJ+GjUi9K +fcSH1qK3ypztS8qjfFxYjehBktNt95MgaQdAvz2Xkyzpuj565+54B4YZtv+mfa98 +M/Osc11eox9GTY0nMw/8oohdNt9mzlgsUmCR3rK/3O5xkbmaOyWrgNj/0QlyjVsn +w0pnmHTPmL321U/N5OQe21E54r0PI40DD6pfzUQ9CY/9j45o2f+eD29el4gjTf3l +Bx4+9Hm116oHA9CxFqN7OOySAgrvLm5vAgMBAAEwDQYJKoZIhvcNAQELBQADggIB +ALDeWIRGGVWLgYi1hbvTF/YrZyEPaHW2DSAZHVq+B6YE5O7hpcr5xesT52/zKwVJ +wkithWEeYRkr3/zOtBWYA1luGNf3eQ3MbbaNfatGrv1NrMtp+x7QsLT8u1+YArwj +Vr2Z4h7MHIO9EjdgH5IEMJRaUnOLRTZvvkNESJwVVy+Jlw3NVPvkw+wJcZF2n8Wf +SNdE/FIBLLhJtX2/tiYeO+npn1WAcqifT5k0nOIRxZYEk0GdIq2P53nuaJ74GcWC +enNI/CHjkJKix3yk8GlJPZkL/PfUbne6UwuNmAovoOcnd9hRbzv/IFXnJkmp4aun +pdaSDpbWHyN/pEQBiSPN6QdgNzR7l+zkn+tprZtR143zAvsRBRf2JhpHQqI0EJLV +HPVOGX9ph8f7Dixbka7EiCwy1yoaFuewQ0h/Ofqa8Nw7LPkTi3rp+FWZbZoZahlk +A3k8StZwVOFvUIbvoj0bP3e2nJgnJKwfWppX29m6M0xUTn54hIm2TRkMy2SSIIHl +7jYcaNKbmPibVeaW9Y8bjwBPkvvLbS7ZFb8QTYpYQbBUwLpkbuPImaQq+V4VqRJl +Jzb5ZY7rSk/sp+vu2PuU4QkGGLC1X0bNCIi7ucwt9ie8uNCsYdNfQLYRy3x/BrWq +BsmHg+f5zPyVmKd+qXBwfa7UeT2zJLs3IlFwBeg4sk3f -----END CERTIFICATE----- diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/root-certificate/root.crt b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/root-certificate/root.crt new file mode 100644 index 00000000..03f676e4 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/config/certificates/root-certificate/root.crt @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFbTCCA1WgAwIBAgIUcuJ40Js2R5pukZRainsbfHjZMc8wDQYJKoZIhvcNAQEL +BQAwPTEPMA0GA1UEAwwGUm9vdENBMQ4wDAYDVQQLDAVPU0FBRjENMAsGA1UECgwE +T05BUDELMAkGA1UEBhMCVVMwIBcNMjAwODEzMTQ1ODM2WhgPMjEyMDA3MjAxNDU4 +MzZaMD0xDzANBgNVBAMMBlJvb3RDQTEOMAwGA1UECwwFT1NBQUYxDTALBgNVBAoM +BE9OQVAxCzAJBgNVBAYTAlVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC +AgEA1hsnL+g+86ZvckGH2FF8etyyHkre0NioqsR2ppPXQmejhcL03yGjFPNNVsb5 +eXYmAets4sbNbgjbcEiNVYbj0KkYZvXN+YHPys3W7LADE0d+RyIvuw2v1OdZbAZU +BexGDYIW+bz1Bvrw5Vw7n7mCGVgZgbTj6hXDKMOb8EyhhzOQj4trasuz63/kZPtZ +NzlzXh7AU+FOVOkfWEGsAKzyOwqsTLD5IlD85vahYiSe8xMVYdMz+JAFwNvMdOGH +uVdwFEa0bGh+GAonGK1bRhfqjrronOfhnVhMccS3uFyHHhRzT3JmifXRih0/v9Le +EPyc1GwUJd1lMI1iITCAsxlOSwINr0H4FrhV576hUBlZCZxRYQ1Srt04BNP1NjrB +wDQKPQhhlFZYwxn4YCG7T/ktN4ANtFiPa5/ZP4OSYHjF+v6L97vIGQ4DlQ+rvvsY +6/HhRcDhnKm0v3DMY4rF2gPzVZQTVnHgQY3hXaILi7p2kGMVyD5J4lFMGNwYseXP +wxtQL03vlXdLIOcxYP0WjeFyHe7mTZMAS++xzIkcwXPZBTZzOzzxB15V4Hl2WeNE +DSTizLQjKw3vcSkmTEoLVCR/GelVhpXP3WmqmbtbMM6V8g6u+csmiERmoAyGR6hI +h/9pKIBznJChEAdGKLZvsNCC2MjbLDa/n160Ho8G5zLKz5cCAwEAAaNjMGEwHQYD +VR0OBBYEFFFA2kBuZQ5ypVzKvp5CSMztpaDdMB8GA1UdIwQYMBaAFFFA2kBuZQ5y +pVzKvp5CSMztpaDdMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0G +CSqGSIb3DQEBCwUAA4ICAQCezmNt0W5hHUMLCAYfvzw5C85HslIW1OsdYtv7Ck6Q ++qrVqku36/7EesziQfBhB1BYOoGkUbAizrkFVCSvHSenRYaukVirPR5EfmWtAocD +1Tg8EepiFG7FeSWLBflyHbeoq66opVIqooJ9EZT6SDQRc/bYojMu+ZRQ6CJe9mlL +1JAnfWpJJc4c/WevcXo6LqumB4JGA+Dg+ca2ELfEaGNjJs32mDDeWHcKeFzXOk/g +jkfwuDmOc//j/M0ehT3RSnI1b3YXw5gHP0Axne/fFooXtoR8A4ofw8pCu/OsJIdD +AgBtu81klFbPmXZtlcN0lC34KqcUZUkGPcBbKg741wFAmjqCl40FUSofhaARm4gS +zn6CcDx11+JWtAu8kgr7gLtFFYm+pnQdHTnzL7Rd4Wuk4V5i8I/Vx9SCJEHWQx1V +d0EQzZMbLxMxlg8eEUDHm8RBVQahbAmTLPtLxiPtw/a2YY5Ck2ilH1L0CPkJtlvB +AW2uZFJ4DNaIQBDB4hbJgRuVK3K3hzZ5SHyJKmMO0XZ2O+zoQJ4Tl+yasu30lsZU +0qiDgP+WjhzZh+pCS1WkxGZGL7HG0P0HVXkqW2yrzThGurrc5ACAN15UUhrYcuUT +bgfv0R7oe+bp+ZtUQ/d8rU9vR+OcIL0pENfI9vIwtfmNpIWizeJLWc9Kafqd+c8j +kw== +-----END CERTIFICATE----- diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml index bea0dca4..0886d9d5 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/docker-compose.yml @@ -170,9 +170,9 @@ services: - "8081:8081" volumes: - /etc/localtime:/etc/localtime:ro - - ${TEST_LAB_DIR}/volumes/so/ca-certificates/onapheat:/app/ca-certificates - ${CONFIG_DIR_PATH}/override-files/bpmn-infra/onapheat:/app/config - ${CONFIG_DIR_PATH}/certificates/aai-certificate/aai.cert:/app/ca-certificates/aai.cert + - ${CONFIG_DIR_PATH}/certificates/root-certificate/root.crt:/app/ca-certificates/root.crt environment: - APP=bpmn-infra - JVM_ARGS=-Xms64m -Xmx512m diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/application.yaml b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/application.yaml index 205abe40..3a40848f 100755 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/application.yaml +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/application.yaml @@ -3,8 +3,8 @@ server: tomcat: max-threads: 4 ssl: - key-store: classpath:keystore/org.onap.so.p12 - key-store-password: u!@JQoYD])@ykq.NKM,O7iA. + key-store: classpath:keystore/keystore.p12 + key-store-password: mYHC98!qX}7h?W}jRv}MIXTJ keyStoreType: PKCS12 ssl-enable: true spring: @@ -21,5 +21,5 @@ spring: http: client: ssl: - trust-store: classpath:truststore/org.onap.so.trust.jks - trust-store-password: '[)3KV.k*!IlkFhWEq0Nv2dDa'
\ No newline at end of file + trust-store: classpath:truststore/truststore.jks + trust-store-password: '*TQH?Lnszprs4LmlAj38yds('
\ No newline at end of file diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/keystore.p12 b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/keystore.p12 Binary files differnew file mode 100644 index 00000000..6b4340d4 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/keystore.p12 diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/org.onap.so.p12 b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/org.onap.so.p12 Binary files differdeleted file mode 100755 index 015f2bf6..00000000 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/keystore/org.onap.so.p12 +++ /dev/null diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/truststore/truststore.jks b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/truststore/truststore.jks Binary files differnew file mode 100644 index 00000000..d219aaf5 --- /dev/null +++ b/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/truststore/truststore.jks diff --git a/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh b/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh index f82f228a..3fd82d29 100755 --- a/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh +++ b/plans/vfc-gvnfm-vnflcm/sanity-check/setup.sh @@ -32,10 +32,16 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} -docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db +# Start Mysql +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_USER="gvnfm" -e MYSQL_PASSWORD="gvnfm" -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE="gvnfm" nexus3.onap.org:10001/library/mariadb VFC_DB_IP=`get-instance-ip.sh vfc-db` echo VFC_DB_IP=${VFC_DB_IP} +# Start Redis +docker run -d -p 6379:6379 --name vfc-redis redis +VFC_REDIS_IP=`get-instance-ip.sh vfc-redis` +echo VFC_REDIS_IP=${VFC_REDIS_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -55,7 +61,7 @@ echo sleep 30 sleep 30 # start vfc-vnflcm -docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnflcm +docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} nexus3.onap.org:10001/onap/vfc/vnflcm VNFLCM_IP=`get-instance-ip.sh vfc-vnflcm` # Wait for initialization diff --git a/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh b/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh index 22dd8ae3..b66662b9 100755 --- a/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh +++ b/plans/vfc-gvnfm-vnfmgr/sanity-check/setup.sh @@ -19,7 +19,6 @@ source ${SCRIPTS}/common_functions.sh - #start msb docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` @@ -31,10 +30,16 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} -docker run -d -p 3306:3306 --name vfc-db nexus3.onap.org:10001/onap/vfc/db +# Start Mysql +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_USER="gvnfm" -e MYSQL_PASSWORD="gvnfm" -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE="gvnfm" nexus3.onap.org:10001/library/mariadb VFC_DB_IP=`get-instance-ip.sh vfc-db` echo VFC_DB_IP=${VFC_DB_IP} +# Start Redis +docker run -d -p 6379:6379 --name vfc-redis redis +VFC_REDIS_IP=`get-instance-ip.sh vfc-redis` +echo VFC_REDIS_IP=${VFC_REDIS_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -54,7 +59,7 @@ echo sleep 60 sleep 60 # start vfc-vnflcm -docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnflcm +docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} nexus3.onap.org:10001/onap/vfc/vnflcm VNFLCM_IP=`get-instance-ip.sh vfc-vnflcm` # Wait for initialization @@ -65,7 +70,7 @@ for i in {1..10}; do done # start vfc-vnfres -docker run -d --name vfc-vnfmgr -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnfmgr +docker run -d --name vfc-vnfmgr -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} nexus3.onap.org:10001/onap/vfc/vnfmgr VNFMGR_IP=`get-instance-ip.sh vfc-vnfmgr` # Wait for initialization diff --git a/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh b/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh index e2ab2594..358fa6cc 100755 --- a/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh +++ b/plans/vfc-gvnfm-vnfres/sanity-check/setup.sh @@ -19,7 +19,6 @@ source ${SCRIPTS}/common_functions.sh - #start msb docker run -d -p 8500:8500 --name msb_consul consul:0.9.3 MSB_CONSUL_IP=`get-instance-ip.sh msb_consul` @@ -31,10 +30,16 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} -docker run -d -p 3306:3306 --name vfc-db nexus3.onap.org:10001/onap/vfc/db +# Start Mysql +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_USER="gvnfm" -e MYSQL_PASSWORD="gvnfm" -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE="gvnfm" nexus3.onap.org:10001/library/mariadb VFC_DB_IP=`get-instance-ip.sh vfc-db` echo VFC_DB_IP=${VFC_DB_IP} +# Start Redis +docker run -d -p 6379:6379 --name vfc-redis redis +VFC_REDIS_IP=`get-instance-ip.sh vfc-redis` +echo VFC_REDIS_IP=${VFC_REDIS_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -54,7 +59,7 @@ echo sleep 60 sleep 60 # start vfc-vnflcm -docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnflcm +docker run -d --name vfc-vnflcm -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} nexus3.onap.org:10001/onap/vfc/vnflcm VNFLCM_IP=`get-instance-ip.sh vfc-vnflcm` # Wait for initialization @@ -65,7 +70,7 @@ for i in {1..10}; do done # start vfc-vnfres -docker run -d --name vfc-vnfres -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 nexus3.onap.org:10001/onap/vfc/vnfres +docker run -d --name vfc-vnfres -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} nexus3.onap.org:10001/onap/vfc/vnfres VNFRES_IP=`get-instance-ip.sh vfc-vnfres` # Wait for initialization diff --git a/plans/vfc-nfvo-lcm/sanity-check/setup.sh b/plans/vfc-nfvo-lcm/sanity-check/setup.sh index 394a8afd..6ed146ff 100755 --- a/plans/vfc-nfvo-lcm/sanity-check/setup.sh +++ b/plans/vfc-nfvo-lcm/sanity-check/setup.sh @@ -32,10 +32,16 @@ docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway` echo MSB_IAG_IP=${MSB_IAG_IP} -docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql nexus3.onap.org:10001/onap/vfc/db +# Mysql +docker run -d -p 3306:3306 --name vfc-db -v /var/lib/mysql -e MYSQL_USER="vfcnfvolcm" -e MYSQL_PASSWORD="vfcnfvolcm" -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE="vfcnfvolcm" nexus3.onap.org:10001/library/mariadb VFC_DB_IP=`get-instance-ip.sh vfc-db` echo VFC_DB_IP=${VFC_DB_IP} +# Redis +docker run -d -p 6379:6379 --name vfc-redis redis +VFC_REDIS_IP=`get-instance-ip.sh vfc-redis` +echo VFC_REDIS_IP=${VFC_REDIS_IP} + # Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway) for i in {1..10}; do curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break @@ -61,7 +67,7 @@ echo sleep 60 sleep 60 # start vfc-nslcm -docker run -d --name vfc-nslcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REG_TO_MSB_WHEN_START=true nexus3.onap.org:10001/onap/vfc/nslcm +docker run -d --name vfc-nslcm -v /var/lib/mysql -e MSB_ADDR=${MSB_IAG_IP}:80 -e MYSQL_ADDR=${VFC_DB_IP}:3306 -e REDIS_HOST=${VFC_REDIS_IP} -e REG_TO_MSB_WHEN_START=true nexus3.onap.org:10001/onap/vfc/nslcm NSLCM_IP=`get-instance-ip.sh vfc-nslcm` # Wait for initialization diff --git a/scripts/ccsdk/oran/mock-hello.sh b/scripts/ccsdk/oran/mock-hello.sh new file mode 100755 index 00000000..a40f8bf9 --- /dev/null +++ b/scripts/ccsdk/oran/mock-hello.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +curl -v -X PUT -d @- http://$1:1080/expectation <<EOF +{ + "httpRequest": { + "method": "GET", + "path": "/hello" + }, + "httpResponse": { + "body": "Hello world!", + "statusCode": 200 + } +} +EOF + diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/Dockerfile b/scripts/dcaegen2-services-son-handler/sonhandler/Dockerfile new file mode 100644 index 00000000..688a2fe0 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/Dockerfile @@ -0,0 +1,15 @@ +FROM python:alpine3.7 + +ADD configdb-oof-sim.py / + +ADD ./sim-data / + +RUN pip install Flask + +RUN pip install requests + +EXPOSE 5000 + +CMD ["flask", "run", "--host", "0.0.0.0"] + +CMD [ "python", "./configdb-oof-sim.py" ] diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/configdb-oof-sim.py b/scripts/dcaegen2-services-son-handler/sonhandler/configdb-oof-sim.py new file mode 100644 index 00000000..7a51c951 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/configdb-oof-sim.py @@ -0,0 +1,98 @@ +import flask +import json +from flask import request +import requests +import threading +import time + +app = flask.Flask(__name__) +app.config["DEBUG"] = True + + +def get_neighbour_cell_list_for_cell_id(): + with open('cell_list.json') as cell_list: + data = json.load(cell_list) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + +def get_pci_for_cell_id(): + with open('pci_value.json') as pci_value: + data = json.load(pci_value) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + +def get_cell_data_for_cell_id(): + with open('cell_data.json') as cell_data: + data = json.load(cell_data) + if not data: + return {"Error": "Unable to read file"}, 503 + return data, None + +def get_oof_sync_response(): + with open('oof_syn_response.json') as syncRes: + data = json.load(syncRes) + if not data: + return {"Error": "Unale to read file"}, 503 + return data, None + +def get_oof_async_response(callback_url, transaction_id): + time.sleep(10) + with open('oof_async_response.json') as asyncRes: + data = json.load(asyncRes) + data['transactionId'] = transaction_id + if not data: + return {"Error": "Unable to read file"}, 503 + res = requests.post(callback_url, json=data) + print('response from server:',res.text) + return res + +@app.route("/api/sdnc-config-db/v3/getNbrList/<cell_id>/<ts>", methods=["GET"]) +def get_neighbour_list(cell_id, ts): + data, status = get_neighbour_cell_list_for_cell_id() + if not status: + return data + return data, 503 + +@app.route("/api/sdnc-config-db/v3/getPCI/<cell_id>/<ts>", methods=["GET"]) +def get_pci(cell_id, ts): + data, status = get_pci_for_cell_id() + if not status: + return data + return data, 503 +@app.route("/api/sdnc-config-db/v3/getPnfId/<cell_id>/<ts>", methods=["GET"]) +def get_pnf_id(cell_id, ts): + data, status = get_pci_for_cell_id() + data['value'] = 'ncserver5' + if not status: + return data + return data, 503 + +@app.route("/api/sdnc-config-db/v3/getCell/<cell_id>", methods=["GET"]) +def get_cell_data(cell_id): + data, status = get_cell_data_for_cell_id() + if not status: + return data + return data, 503 + +@app.route("/api/oof/v1/pci",methods=["POST"]) +def oof_optimizatio_result(): + content = request.get_json() + callback_url = content['requestInfo']['callbackUrl'] + transaction_id = content['requestInfo']['transactionId'] + try: + task = threading.Thread(target=get_oof_async_response, args=(callback_url,transaction_id,)) + task.daemon = True + task.start() + except: + print("Error: Unable to start thread") + + data, status = get_oof_sync_response() + + if not status: + return data, 202 + return data, 503 + + +app.run(host='0.0.0.0') diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_data.json b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_data.json new file mode 100644 index 00000000..0e4e73f4 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_data.json @@ -0,0 +1,13 @@ +{ + "neighbor": ["Chn0066", "Chn0067", "Chn0068", "Chn0069", "Chn0070", "Chn0072", "Chn0073", "Chn0074", "Chn0075", "Chn0076", "Chn0077", "Chn0078", "Chn0079", "Chn0080"], + "Cell": { + "networkId": "ran-1", + "nodeId": "Chn0071", + "physicalCellId": 1, + "pnfId": "ncserver5", + "sectorNumber": null, + "latitude": "27.55626304907802", + "longitude": "-58.48690415723466", + "notes": "NA" + } +}
\ No newline at end of file diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_list.json b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_list.json new file mode 100644 index 00000000..4f961ae2 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/cell_list.json @@ -0,0 +1,60 @@ +{ + "cellId": "Chn0071", + "nbrList": [{ + "targetCellId": "Chn0066", + "pciValue": 0, + "ho": true + }, { + "targetCellId": "Chn0067", + "pciValue": 1, + "ho": true + }, { + "targetCellId": "Chn0068", + "pciValue": 2, + "ho": true + }, { + "targetCellId": "Chn0069", + "pciValue": 3, + "ho": true + }, { + "targetCellId": "Chn0070", + "pciValue": 4, + "ho": true + }, { + "targetCellId": "Chn0072", + "pciValue": 6, + "ho": true + }, { + "targetCellId": "Chn0073", + "pciValue": 7, + "ho": true + }, { + "targetCellId": "Chn0074", + "pciValue": 8, + "ho": true + }, { + "targetCellId": "Chn0075", + "pciValue": 9, + "ho": true + }, { + "targetCellId": "Chn0076", + "pciValue": 10, + "ho": true + }, { + "targetCellId": "Chn0077", + "pciValue": 11, + "ho": true + }, { + "targetCellId": "Chn0078", + "pciValue": 12, + "ho": true + }, { + "targetCellId": "Chn0079", + "pciValue": 13, + "ho": true + }, { + "targetCellId": "Chn0080", + "pciValue": 14, + "ho": true + }] +}
\ No newline at end of file diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_async_response.json b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_async_response.json new file mode 100644 index 00000000..99f54cb4 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_async_response.json @@ -0,0 +1,14 @@ +{ + "transactionId": "fff33db3-8fc9-4e29-89ff-7419c85900bd", + "requestId": "742b9e6a-aa55-487e-9d71-a4a5e05b3981", + "requestStatus": "completed", + "statusMessage": "success", + "solutions": { + "networkId": "ran-1", + "pciSolutions": [{ + "cellId": "Chn0071", + "pci": "5" + }], + "anrSolutions": [] + } +}
\ No newline at end of file diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_syn_response.json b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_syn_response.json new file mode 100644 index 00000000..c9260bbc --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/oof_syn_response.json @@ -0,0 +1,6 @@ +{ + "requestId": "742b9e6a-aa55-487e-9d71-a4a5e05b3981", + "transactionId": "fff33db3-8fc9-4e29-89ff-7419c85900bd", + "requestStatus": "accepted", + "statusMessage": "" +}
\ No newline at end of file diff --git a/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/pci_value.json b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/pci_value.json new file mode 100644 index 00000000..6b6d4475 --- /dev/null +++ b/scripts/dcaegen2-services-son-handler/sonhandler/sim-data/pci_value.json @@ -0,0 +1,4 @@ +{ + "attributeName": "PCIvalue", + "value": "5" +}
\ No newline at end of file diff --git a/tests/aaf/certservice/resources/cert-service-properties.robot b/tests/aaf/certservice/resources/cert-service-properties.robot deleted file mode 100644 index 54ddec11..00000000 --- a/tests/aaf/certservice/resources/cert-service-properties.robot +++ /dev/null @@ -1,31 +0,0 @@ -*** Variables *** - -${CERT_SERVICE_CONTAINER_NAME} aaf-cert-service -${CERT_SERVICE_PORT} 8443 -${AAFCERT_URL} https://localhost:${cert_service_port} -${CLIENT_CA_NAME} Client -${RA_CA_NAME} RA -${CERT_SERVICE_ENDPOINT} /v1/certificate/ -${ROOTCA} %{WORKSPACE}/tests/aaf/certservice/assets/certs/root.crt -${CERTSERVICE_SERVER_CRT} %{WORKSPACE}/tests/aaf/certservice/assets/certs/certServiceServer.crt -${CERTSERVICE_SERVER_KEY} %{WORKSPACE}/tests/aaf/certservice/assets/certs/certServiceServer.key -${VALID_CLIENT_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client.csr -${VALID_CLIENT_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client.pk -${VALID_RA_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_ra.csr -${VALID_RA_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_ra.pk -${INVALID_CSR_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid.csr -${INVALID_PK_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid.key - - -${CERT_SERVICE_ADDRESS} https://${CERT_SERVICE_CONTAINER_NAME}:${CERT_SERVICE_PORT} -${VALID_ENV_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client_docker.env -${VALID_ENV_FILE_JKS} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client_docker_jks.env -${VALID_ENV_FILE_P12} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client_docker_p12.env -${VALID_ENV_FILE_PEM} %{WORKSPACE}/tests/aaf/certservice/assets/valid_client_docker_pem.env -${INVALID_ENV_FILE_OUTPUT_TYPE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid_client_docker_output_type.env -${INVALID_ENV_FILE} %{WORKSPACE}/tests/aaf/certservice/assets/invalid_client_docker.env -${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.aaf.certservice.aaf-certservice-client:latest -${CLIENT_CONTAINER_NAME} %{ClientContainerName} -${CERT_SERVICE_NETWORK} certservice_certservice -${MOUNT_PATH} %{WORKSPACE}/tests/aaf/certservice/tmp -${TRUSTSTORE_PATH} %{WORKSPACE}/plans/aaf/certservice/certs diff --git a/tests/ccsdk/oran/suite1/__init__.robot b/tests/ccsdk/oran/suite1/__init__.robot new file mode 100644 index 00000000..09aa0315 --- /dev/null +++ b/tests/ccsdk/oran/suite1/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Ccsdk Oran - Suite 1 diff --git a/tests/ccsdk/oran/suite1/test1.robot b/tests/ccsdk/oran/suite1/test1.robot new file mode 100644 index 00000000..10e68521 --- /dev/null +++ b/tests/ccsdk/oran/suite1/test1.robot @@ -0,0 +1,30 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary + +*** Variables *** +${MESSAGE} Hello, world! + +*** Test Cases *** +String Equality Test + Should Be Equal ${MESSAGE} Hello, world! + +Dir Test + [Documentation] Check if /tmp exists + Log ${MESSAGE} + CheckDir /tmp + +Url Test + [Documentation] Check if google.com can be reached + CheckUrl http://www.google.com + +*** Keywords *** +CheckDir + [Arguments] ${path} + Directory Should Exist ${path} + +CheckUrl + [Arguments] ${url} + Create Session session ${url} + ${resp}= Get Request session / + Should Be Equal As Integers ${resp.status_code} 200 diff --git a/tests/ccsdk/oran/suite2/__init__.robot b/tests/ccsdk/oran/suite2/__init__.robot new file mode 100644 index 00000000..c9bbad32 --- /dev/null +++ b/tests/ccsdk/oran/suite2/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Ccsdk Oran - Suite 2 diff --git a/tests/ccsdk/oran/suite2/test1.robot b/tests/ccsdk/oran/suite2/test1.robot new file mode 100644 index 00000000..5d354dde --- /dev/null +++ b/tests/ccsdk/oran/suite2/test1.robot @@ -0,0 +1,30 @@ +*** Settings *** +Library OperatingSystem +Library RequestsLibrary + +*** Variables *** +${MESSAGE} Hello, world! + +*** Test Cases *** +String Equality Test + Should Be Equal ${MESSAGE} Hello, world! + +Dir Test + [Documentation] Check if /tmp exists + Log ${MESSAGE} + CheckDir /tmp + +Url Test + [Documentation] Check if www.onap.org can be reached + Create Session openo http://www.onap.org + CheckUrl openo / + +*** Keywords *** +CheckDir + [Arguments] ${path} + Directory Should Exist ${path} + +CheckUrl + [Arguments] ${session} ${path} + ${resp}= Get Request ${session} ${path} + Should Be Equal As Integers ${resp.status_code} 200 diff --git a/tests/ccsdk/oran/vCPE/__init__.robot b/tests/ccsdk/oran/vCPE/__init__.robot new file mode 100644 index 00000000..f6230ae5 --- /dev/null +++ b/tests/ccsdk/oran/vCPE/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Ccsdk Oran - vCPE diff --git a/tests/ccsdk/oran/vCPE/test1.robot b/tests/ccsdk/oran/vCPE/test1.robot new file mode 100644 index 00000000..d07bf6e4 --- /dev/null +++ b/tests/ccsdk/oran/vCPE/test1.robot @@ -0,0 +1,60 @@ +*** Settings *** +Suite Setup Suite Setup +Suite Teardown Suite Teardown +Library OperatingSystem +Library RequestsLibrary +Library Process +Library ONAPLibrary.Utilities + +*** Variables *** +${GLOBAL_APPLICATION_ID} csit-vCPE +${GLOBAL_MSO_USERNAME} InfraPortalClient +${GLOBAL_MSO_PASSWORD} password1$ + +*** Test Cases *** +SO ServiceInstance health check + ${auth}= Create List ${GLOBAL_MSO_USERNAME} ${GLOBAL_MSO_PASSWORD} + ${session}= Create Session so http://${SO_IP}:8080 + ${uuid}= Generate UUID4 + ${headers}= Create Dictionary Accept=text/html Content-Type=text/html X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} + ${resp}= Get Request so /ecomp/mso/infra/globalhealthcheck headers=${headers} + &{headers}= Create Dictionary Authorization=Basic SW5mcmFQb3J0YWxDbGllbnQ6cGFzc3dvcmQxJA== Content-Type=application/json Accept=application/json + ${resp}= Get Request so /ecomp/mso/infra/orchestrationRequests/v2 headers=${headers} + Should Not Contain ${resp.content} null + +*** Keywords *** +Run Docker + [Arguments] ${image} ${name} ${parameters}=${EMPTY} + ${result}= Run Process docker run --name ${name} ${parameters} -d ${image} shell=True + Should Be Equal As Integers ${result.rc} 0 + Log ${result.stdout} + ${result}= Run Process docker inspect --format '{{ .NetworkSettings.IPAddress }}' ${name} shell=True + Should Be Equal As Integers ${result.rc} 0 + Log ${result.stdout} + [Return] ${result.stdout} + +Kill Docker + [Arguments] ${name} + ${result}= Run Process docker logs ${name} shell=True + Should Be Equal As Integers ${result.rc} 0 + Log ${result.stdout} + ${result}= Run Process docker kill ${name} shell=True + Should Be Equal As Integers ${result.rc} 0 + Log ${result.stdout} + ${result}= Run Process docker rm ${name} shell=True + Should Be Equal As Integers ${result.rc} 0 + Log ${result.stdout} + +CheckUrl + [Arguments] ${url} + Create Session session ${url} disable_warnings=True + ${resp}= Get Request session / + Should Be Equal As Integers ${resp.status_code} 200 + +Suite Setup + ${SO_IP}= Run Docker nexus3.onap.org:10001/openecomp/mso i-so + Wait Until Keyword Succeeds 1 min 5 sec CheckUrl http://${SO_IP}:8080 + Set Suite Variable ${SO_IP} + +Suite Teardown + Kill Docker i-so diff --git a/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml new file mode 100644 index 00000000..8d42d62c --- /dev/null +++ b/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?xml-stylesheet type="text/xsl" href="MeasDataCollection.xsl"?> +<measDataFile xmlns="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData http://www.3gpp.org/ftp/specs/archive/28_series/28.532#measData"> + <fileHeader fileFormatVersion="28.532 V7.0" vendorName="Company NN" dnPrefix="DC=a1.companyNN.com,SubNetwork=1,IRPAgent=1"> + <fileSender senderName="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1"/> + <measData beginTime="2000-03-01T14:00:00+02:00"/> + </fileHeader> + <measData> + <measEntity localDn="SubNetwork=CountryNN,MeContext=MEC-Gbg-1,ManagedElement=RNC-Gbg-1" userLabel="RNC Telecomville"/> + <measInfo> + <job jobId="1231"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures</measType> + <measType p="2">succTCHSeizures</measType> + <measType p="3">attImmediateAssignProcs</measType> + <measType p="4">succImmediateAssignProcs</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">234</r> + <r p="2">345</r> + <r p="3">567</r> + <r p="4">789</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">890</r> + <r p="2">901</r> + <r p="3">123</r> + <r p="4">234</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">456</r> + <r p="2">567</r> + <r p="3">678</r> + <r p="4">789</r> + <suspect>true</suspect> + </measValue> + </measInfo> + <measInfo measInfoId="ENodeBFunction"> + <job jobId="1232"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures1</measType> + <measType p="2">succTCHSeizures2</measType> + <measType p="3">attImmediateAssignProcs3</measType> + <measType p="4">succImmediateAssignProcs4</measType> + <measValue measObjLdn="ManagedElement=RNC-Gbg-1,ENodeBFunction=1"> + <r p="1">4</r> + <r p="2">86,87,2,6,77,96,75,33,24</r> + <r p="3">40</r> + <r p="4">90</r> + <suspect>false</suspect> + </measValue> + </measInfo> + <measInfo> + <job jobId="1233"/> + <granPeriod duration="PT900S" endTime="2000-03-01T14:14:30+02:00"/> + <repPeriod duration="PT1800S"/> + <measType p="1">attTCHSeizures5</measType> + <measType p="2">succTCHSeizures6</measType> + <measType p="3">attImmediateAssignProcs7</measType> + <measType p="4">succImmediateAssignProcs8</measType> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-997"> + <r p="1">238</r> + <r p="2">344</r> + <r p="3">563</r> + <r p="4">787</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-998"> + <r p="1">898</r> + <r p="2">905</r> + <r p="3">127</r> + <r p="4">238</r> + </measValue> + <measValue measObjLdn="RncFunction=RF-1,UtranCell=Gbg-999"> + <r p="1">454</r> + <r p="2">569</r> + <r p="3">672</r> + <r p="4">785</r> + <suspect>true</suspect> + </measValue> + </measInfo> + </measData> + <fileFooter> + <measData endTime="2000-03-01T14:15:00+02:00"/> + </fileFooter> +</measDataFile> diff --git a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot index 0b18320f..4c9afb03 100644 --- a/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot +++ b/tests/dcaegen2-pmmapper/pmmapper/pmmapper.robot @@ -7,8 +7,7 @@ Library Process Library String Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL} -Test Teardown Delete All Sessions - +Test Teardown CleanSessionsAndLogs *** Variables *** ${CLI_EXEC_CLI_CONFIG} { head -n 10 | tail -5;} < /tmp/pmmapper.log @@ -23,12 +22,14 @@ ${VALID_METADATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pm ${NR_VALID_METADATA_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/valid_metadata.json ${DIFF_VENDOR_METADATA} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/diff_vendor_metadata.json ${NON_XML_FILE} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/diff_vendor_metadata.json -${CLI_EXEC_CLI_PM_LOG} docker exec pmmapper /bin/sh -c "tail -15 /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${CLI_EXEC_CLI_PM_LOG} docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${CLI_EXEC_CLI_PM_LOG_CLEAR} docker exec pmmapper /bin/sh -c "echo -n "" > /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" ${PUBLISH_NODE_URL} https://${DR_NODE_IP}:8443/publish/1 ${TYPE-A_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml ${TYPE-C_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/C20190328.0000-0015.xml ${NR-TYPE-A_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml ${NR-TYPE-C_PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/C20190329.0000-0015.xml +${NR-TYPE-PM_DATA_FILE_PATH} %{WORKSPACE}/tests/dcaegen2-pmmapper/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml ${CLI_EXEC_VENDOR_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/vendor_filter_config.json ${CLI_EXEC_PM_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_config.json ${CLI_EXEC_PM_FILTER_regex} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/pm_filter_regex_config.json @@ -40,7 +41,7 @@ ${CLI_MR_LOG} cat /tmp/mr.log Verify PM Mapper Receive Configuraton From Config Binding Service [Tags] PM_MAPPER_01 [Documentation] Verify 3gpp pm mapper successfully receive config data from CBS - CheckLog ${CLI_EXEC_CLI_CONFIG} Response code: 200, Server Response Received + CheckLog ${CLI_EXEC_CLI_CONFIG} Received pm-mapper configuration from ConfigBinding Service Verify Health Check returns 200 when a REST GET request to healthcheck url [Tags] PM_MAPPER_02 @@ -53,43 +54,43 @@ Verify 3GPP PM Mapper responds appropriately when no metadata is provided [Tags] PM_MAPPER_03 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided [Timeout] 1 minute - ${headers}= Create Dictionary X-ONAP-RequestID=1 Content-Type=application/xml + ${headers}= Create Dictionary X-ONAP-RequestID=3 Content-Type=application/xml ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers} VerifyResponse ${resp.status_code} 400 VerifyResponse ${resp.content} Missing Metadata. - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=1 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=3 Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided [Tags] PM_MAPPER_04 [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided [Timeout] 1 minute - ${headers}= Create Dictionary X-ONAP-RequestID=2 X-DMAAP-DR-META='not metadata' Content-Type=application/xml + ${headers}= Create Dictionary X-ONAP-RequestID=4 X-DMAAP-DR-META='not metadata' Content-Type=application/xml ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers} VerifyResponse ${resp.status_code} 400 VerifyResponse ${resp.content} Malformed Metadata. - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=2 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=4 Verify that PM Mapper logs successful when a file that contains no measdata is provided [Tags] PM_MAPPER_05 [Documentation] Verify that PM Mapper logs successful when a file that contains no measdata is provided [Timeout] 1 minute - SendToDatarouter ${NO_MEASDATA_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=3 + SendToDatarouter ${NO_MEASDATA_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=5 CheckLog ${CLI_EXEC_CLI_PM_LOG} MeasData is empty - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=3 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=5 Verify that PM Mapper throws Event failed validation against schema error when no managed element content is provided [Tags] PM_MAPPER_06 [Documentation] Verify 3gpp pm mapper responds with an error when no managed element content is provided [Timeout] 1 minute - SendToDatarouter ${NO_MANAGED_ELEMENT_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=4 + SendToDatarouter ${NO_MANAGED_ELEMENT_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=6 CheckLog ${CLI_EXEC_CLI_PM_LOG} XML validation failed - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=4 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=6 Verify that PM Mapper maps Type-C xml file and publish 3gpp perf VES evnets to message router [Tags] PM_MAPPER_07 [Documentation] Verify that PM Mapper maps Type-C xml file and publish 3gpp perf VES evnets to message router. [Timeout] 1 minute - SendToDatarouter ${TYPE-C_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=5 + SendToDatarouter ${TYPE-C_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=7 CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter Verify 3GPP PM Mapper maps Type-A file based on counter filtering and publish 3gpp perf VES evnets to message router @@ -99,7 +100,7 @@ Verify 3GPP PM Mapper maps Type-A file based on counter filtering and publish 3g ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER} shell=yes ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} Sleep 5s - SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=6 + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=8 CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter Verify that PM Mapper correctly identifies a file that should not be mapped based on metadata filtering. @@ -110,17 +111,17 @@ Verify that PM Mapper correctly identifies a file that should not be mapped base Should Be Equal As Strings ${cli_cmd_output.rc} 0 ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} Sleep 5s - SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${DIFF_VENDOR_METADATA} X-ONAP-RequestID=7 + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${DIFF_VENDOR_METADATA} X-ONAP-RequestID=9 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=9 CheckLog ${CLI_EXEC_CLI_PM_LOG} Metadata does not match any filters - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=7 Verify that PM Mapper correctly identifies a non-xml file. [Tags] PM_MAPPER_10 [Documentation] Verify that PM Mapper correctly identifies a non-xml file. [Timeout] 1 minute - SendToDatarouter ${NON_XML_FILE} ${VALID_METADATA_PATH} X-ONAP-RequestID=8 + SendToDatarouter ${NON_XML_FILE} ${VALID_METADATA_PATH} X-ONAP-RequestID=10 CheckLog ${CLI_EXEC_CLI_PM_LOG} PM measurement file must have an extension of .xml - CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=8 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=10 Verify that PM Mapper correctly maps an NR Type-A file based on counter filtering and publish 3gpp perf VES events to message router. [Tags] PM_MAPPER_11 @@ -129,15 +130,15 @@ Verify that PM Mapper correctly maps an NR Type-A file based on counter filterin ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER} shell=yes ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} Sleep 5s - SendToDatarouter ${NR-TYPE-A_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=11 + SendToDatarouter ${NR-TYPE-A_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=11 CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter Verify that PM Mapper correctly maps an NR Type-C file based on counter filtering and publish 3gpp perf VES events to message router. [Tags] PM_MAPPER_12 [Documentation] Verify that PM Mapper maps an NR Type-C xml file and publish 3gpp perf VES evnets to message router. [Timeout] 1 minute - SendToDatarouter ${NR-TYPE-C_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=12 - CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + SendToDatarouter ${NR-TYPE-C_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=12 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter Verify 3GPP PM Mapper maps Type-A file based on counter filtering with regexp [Tags] PM_MAPPER_13 @@ -146,7 +147,7 @@ Verify 3GPP PM Mapper maps Type-A file based on counter filtering with regexp ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER_regex} shell=yes ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} Sleep 5s - SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=6 + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=13 CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter Verify that password receive from CBS are successfully encrypted @@ -155,6 +156,14 @@ Verify that password receive from CBS are successfully encrypted CheckLog ${CLI_EXEC_CLI_CONFIG} "aaf_password": ***** CheckLog ${CLI_EXEC_CLI_CONFIG} "password": ***** +Verify that PM Mapper correctly maps an NR Type-PM file based on counter filtering and publish 3gpp perf VES events to message router. + [Tags] PM_MAPPER_15 + [Documentation] Verify that PM Mapper maps an NR Type-PM xml file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + SendToDatarouter ${NR-TYPE-PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=15 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=15 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + *** Keywords *** SendToDatarouter @@ -182,3 +191,10 @@ CheckLog VerifyResponse [Arguments] ${actual_response_value} ${expected_response_value} Should Be Equal As Strings ${actual_response_value} ${expected_response_value} + +ClearLogs + Run Process ${CLI_EXEC_CLI_PM_LOG_CLEAR} shell=yes + +CleanSessionsAndLogs + Delete All Sessions + ClearLogs diff --git a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py index c58e67e2..640b33b0 100644 --- a/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py +++ b/tests/dcaegen2-services-bbs-event-processor/bbs-testcases/resources/BbsLibrary.py @@ -18,7 +18,7 @@ class BbsLibrary(object): alog = container.logs(stream=False, tail=1000) try: - alog = alog.decode() + alog = alog.decode('utf-8').strip() except AttributeError: pass diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json index b70b41d1..bad79d5f 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -84,7 +84,7 @@ "dmaap_info": { "client_id": "1475976809466", "client_role": "org.onap.dcae.pmPublisher", - "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url": "https://mr-sim:3095/events/unauthenticated.DCAE_CL_OUTPUT", "location": "san-francisco" }, "type": "message_router" @@ -103,7 +103,7 @@ "policy_pm_subscriber": { "dmaap_info": { "location": "san-francisco", - "topic_url": "https://mr-sim:3095/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS", + "topic_url": "https://mr-sim:3095/events/unauthenticated.PMSH_CL_INPUT", "client_role": "org.onap.dcae.pmSubscriber", "client_id": "1575876809456" }, diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json index 1a027f21..860672f4 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json @@ -1,7 +1,7 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "path": "/events/AAI_EVENT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -24,7 +24,7 @@ }, { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "path": "/events/AAI_EVENT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -36,7 +36,7 @@ "application/json" ] }, - "body": "{}" + "body": [] } } ] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json index e5c4dd84..8dd58188 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json @@ -1,7 +1,7 @@ [ { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "path": "/events/AAI_EVENT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -24,7 +24,7 @@ }, { "httpRequest": { - "path": "/events/AAI_EVENT/dcae_pmsh_cg/dcae_pmsh_aai_event", + "path": "/events/AAI_EVENT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -36,7 +36,7 @@ "application/json" ] }, - "body": "{}" + "body": [] } } ] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json index eba4e4ee..cd75deb3 100644 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json +++ b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json @@ -1,7 +1,7 @@ [ { "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -24,7 +24,7 @@ }, { "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", + "path": "/events/unauthenticated.PMSH_CL_INPUT/.*", "queryStringParameters" : { "timeout" : [ "1000" ] } @@ -36,10 +36,7 @@ "application/json" ] }, - "body": { - "type": "JSON", - "json": {} - } + "body": [] } } ] diff --git a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json b/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json deleted file mode 100644 index f73fee82..00000000 --- a/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json +++ /dev/null @@ -1,45 +0,0 @@ -[ - { - "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": [ - "{\"name\": \"ResponseEvent\", \"nameSpace\": \"org.onap.policy.apex.onap.pmcontrol\", \"source\": \"APEX\", \"target\": \"DCAE\", \"version\": \"0.0.1\", \"status\": {\"subscriptionName\": \"ExtraPM-All-gNB-R2B\", \"nfName\": \"pnf_new\", \"changeType\": \"CREATE\", \"message\": \"success\"}}" - ] - }, - "times": { - "remainingTimes": 1, - "unlimited": false - } - }, - { - "httpRequest": { - "path": "/events/unauthenticated.PMSH_CL_INPUT/dcae_pmsh_cg/dcae_pmsh_policy_cl_input", - "queryStringParameters" : { - "timeout" : [ "1000" ] - } - }, - "httpResponse": { - "statusCode": 200, - "headers": { - "content-type": [ - "application/json" - ] - }, - "body": { - "type": "JSON", - "json": {} - } - } - } -] diff --git a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot index a2b8cad6..def53caa 100644 --- a/tests/dcaegen2-services-pmsh/testcases/pmsh.robot +++ b/tests/dcaegen2-services-pmsh/testcases/pmsh.robot @@ -21,7 +21,6 @@ ${SUBSCRIPTIONS_ENDPOINT} /subscriptions ${MR_EXPECTATION_AAI_PNF_CREATED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-created.json ${MR_EXPECTATION_AAI_PNF_REMOVED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-aai-pnf-deleted.json -${MR_EXPECTATION_POLICY_RESPONSE_PNF_NEW} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-new.json ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/mr-expectation-policy-subscription-created-pnf-existing.json ${CBS_EXPECTATION_ADMIN_STATE_UNLOCKED} %{WORKSPACE}/tests/dcaegen2-services-pmsh/testcases/assets/cbs-expectation-unlocked-config.json @@ -62,18 +61,18 @@ Verify PNF detected in AAI when administrative state unlocked Verify Policy response on MR is handled [Tags] PMSH_04 [Documentation] Verify policy response on MR is handled - [Timeout] 40 seconds + [Timeout] 60 seconds SimulatePolicyResponse ${MR_EXPECTATION_POLICY_RESPONSE_PNF_EXISTING} - Sleep 15 seconds Ensure Policy response on MR is picked up + Sleep 31 seconds Ensure Policy response on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][0]['nf_sub_status']} CREATED Verify AAI event on MR detailing new PNF being detected is handled [Tags] PMSH_05 [Documentation] Verify PNF created AAI event on MR is handled - [Timeout] 30 seconds + [Timeout] 60 seconds SimulateNewPNF - Sleep 15 seconds Ensure AAI event on MR is picked up + Sleep 31 seconds Ensure AAI event on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['nf_name']} pnf_newly_discovered Should Be Equal As Strings ${resp.json()[0]['network_functions'][1]['orchestration_status']} Active @@ -82,9 +81,9 @@ Verify AAI event on MR detailing new PNF being detected is handled Verify AAI event on MR detailing PNF being deleted is handled [Tags] PMSH_06 [Documentation] Verify PNF deleted AAI event on MR is handled - [Timeout] 30 seconds + [Timeout] 60 seconds SimulateDeletedPNF - Sleep 12 seconds Ensure AAI event on MR is picked up + Sleep 31 seconds Ensure AAI event on MR is picked up ${resp}= Get Request pmsh_session ${SUBSCRIPTIONS_ENDPOINT} Should Not Contain ${resp.text} pnf_newly_discovered diff --git a/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_fm.json b/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_fm.json new file mode 100644 index 00000000..d542a7dd --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_fm.json @@ -0,0 +1 @@ +{"Configurations":[{"data":{"FAPService":{"alias":"Chn0071","X0005b9Lte":{"phyCellIdInUse":5,"pnfName":"ncserver5"},"CellConfig":{"LTE":{"RAN":{"Common":{"CellIdentity":"Chn0071"}}}}}}}]} diff --git a/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_pm.json b/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_pm.json new file mode 100644 index 00000000..2a56f2cc --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/data/expected_payload_pm.json @@ -0,0 +1 @@ +{"Configurations":[{"data":{"FAPService":{"alias":"Chn0002","CellConfig":{"LTE":{"RAN":{"Common":{"CellIdentity":"Chn0002"},"NeighborListInUse":{"LTECell":[{"PNFName":"ncserver1","PLMNID":"plmnid1","CID":"Chn0004","PhyCellID":0,"Blacklisted":"true"},{"PNFName":"ncserver1","CID":"Chn0001","PhyCellID":0,"Blacklisted":"true"}],"LTECellNumberOfEntries":"2"}}}}}}}]} diff --git a/tests/dcaegen2-services-son-handler/testcases/data/fault_notification.json b/tests/dcaegen2-services-son-handler/testcases/data/fault_notification.json new file mode 100644 index 00000000..e5a327ad --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/data/fault_notification.json @@ -0,0 +1,35 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": "Fault_RansimAgent-Wipro_RanPCIProblem", + "eventId": "fault000001", + "sequence": 1, + "priority": "High", + "reportingEntityId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "reportingEntityName": "ncserver5", + "sourceId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "sourceName": "Chn0071", + "startEpochMicrosec": 1451772223000000, + "lastEpochMicrosec": 1451772403000000, + "timeZoneOffset": "UTC-05:30", + "nfNamingCode": "RansimAgent", + "nfVendorName": "Wipro" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "RanPciCollisionConfusionOccurred", + "eventSourceType": "other", + "specificProblem": "Collision", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "networkId": "ran-1", + "collisions": "1", + "confusions": "0" + } + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2-services-son-handler/testcases/data/negative_ack_from_policy.json b/tests/dcaegen2-services-son-handler/testcases/data/negative_ack_from_policy.json new file mode 100644 index 00000000..8988f1cd --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/data/negative_ack_from_policy.json @@ -0,0 +1,10 @@ +{ + "requestID": "d9a6d3de-c7b9-4dc7-bbb3-54953c62f7a9", + "closedLoopControlName": "ControlLoop-vPCI-fb41f388-a5f2-11e8-98d0-529269fb1459", + "version": "1.0.2", + "target": "DCAE", + "from": "SDNR", + "policyName": "PCI", + "policyVersion": "1.0.2", + "payload": " { \"Configurations\":[{ \"Status\": { \"Code\": 400, \"Value\": \"FAILURE\" }, \"data\":{\"FAPService\":{\"alias\":\"Chn0071\",\"X0005b9Lte\":{\"phyCellIdInUse\":5,\"pnfName\":\"ncserver5\"},\"CellConfig\":{\"LTE\":{\"RAN\":{\"Common\":{\"CellIdentity\":\"Chn0071\"}}}}}}} ]}" +} diff --git a/tests/dcaegen2-services-son-handler/testcases/data/performance_notification.json b/tests/dcaegen2-services-son-handler/testcases/data/performance_notification.json new file mode 100644 index 00000000..7721163a --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/data/performance_notification.json @@ -0,0 +1,42 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0", + "domain": "measurement", + "eventName": "Measurement_RansimAgent-Wipro_HandoffMetric", + "eventId": "measurement000002", + "sequence": 0, + "priority": "Normal", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e544567", + "reportingEntityName": "ncserver1", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546456", + "sourceName": "Chn0002", + "startEpochMicrosec": 1551772223000000, + "lastEpochMicrosec": 1551790542000000, + "nfNamingCode": "RansimAgent", + "nfVendorName": "Wipro", + "vesEventListenerVersion": "7.0.1", + "timeZoneOffset": "UTC-05:30" + }, + "measurementFields": { + "measurementInterval": 180, + "measurementFieldsVersion": "4.0", + "additionalMeasurements": [{ + "hashMap": { + "networkId": "plmnid1", + "InterEnbOutAtt_X2HO": "300", + "InterEnbOutSucc_X2HO": "90" + }, + "name": "Chn0004" + }, + { + "hashMap": { + "InterEnbOutAtt_X2HO": "250", + "InterEnbOutSucc_X2HO": "70" + }, + "name": "Chn0001" + } + ] + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2-services-son-handler/testcases/sonhandler-test.robot b/tests/dcaegen2-services-son-handler/testcases/sonhandler-test.robot new file mode 100644 index 00000000..6e93ffb9 --- /dev/null +++ b/tests/dcaegen2-services-son-handler/testcases/sonhandler-test.robot @@ -0,0 +1,95 @@ +*** Settings *** +Library Collections +Library Process +Library RequestsLibrary +Library String +Library OperatingSystem + +Suite Teardown Delete All Sessions + +*** Variables *** +${SON_HANDLER_BASE_URL} http://${SONHMS_IP}:8080 +${HEALTHCHECK_ENDPOINT} /healthcheck +${DMAAP_URL} http://${DMAAP_IP}:3904/events +${unauthenticated.DCAE_CL_OUTPUT} /unauthenticated.DCAE_CL_OUTPUT/23/23 +${POST_DMAAP_EVENT_FOR_FM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.SEC_FAULT_OUTPUT +${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL} http://${DMAAP_IP}:3904/events/unauthenticated.VES_MEASUREMENT_OUTPUT +${POST_DMAAP_EVENT_FOR_POLICY_RESPONSE} http://${DMAAP_IP}:3904/events/DCAE_CL_RSP + +*** Test Cases *** + +HealthCheck + + Create Session sonhms ${SON_HANDLER_BASE_URL} + ${resp}= Get Request sonhms ${HEALTHCHECK_ENDPOINT} + Should Be Equal As Strings ${resp.status_code} 200 + + +Post fm notification to dmaap + Create Session dmaap ${DMAAP_URL} + ${headers}= Create Dictionary Content-Type application/json + ${data}= Get File ${TEST_ROBOT_DIR}/data/fault_notification.json + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_FM_NOTIF_URL}', data=$data) + Should Be Equal As Strings ${response.status_code} 200 + + +Verify fm notification trigger in sonhms + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 10 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for sonhms to handle trigger... console=${True} + Sleep 30s + END + ${expected_payload}= Get File ${TEST_ROBOT_DIR}/data/expected_payload_fm.json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload}= Set Variable ${actual_data['payload']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() + + +Post pm notification to dmaap + ${data}= Get File ${TEST_ROBOT_DIR}/data/performance_notification.json + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_PM_NOTIF_URL}', data=$data) + Should Be Equal As Strings ${response.status_code} 200 + + +Verify pm notification trigger in sonhms + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 5 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for sonhms to handle trigger... console=${True} + Sleep 30s + END + ${expected_payload}= Get File ${TEST_ROBOT_DIR}/data/expected_payload_pm.json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload}= Set Variable ${actual_data['payload']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() + + +Post policy negative acknowledgement to dmaap + ${data}= Get File ${TEST_ROBOT_DIR}/data/negative_ack_from_policy.json + FOR ${i} IN RANGE 3 + ${response}= Evaluate requests.post('${POST_DMAAP_EVENT_FOR_POLICY_RESPONSE}', data=$data) + END + Should Be Equal As Strings ${response.status_code} 200 + + +Oof trigger for fixed Pci cells + Create Session dmaap ${DMAAP_URL} + FOR ${i} IN RANGE 15 + ${result}= Get Request dmaap ${unauthenticated.DCAE_CL_OUTPUT} + Exit For Loop If ${result.json()} != @{EMPTY} + Log Waiting for sonhms to handle trigger... console=${True} + Sleep 30s + END + ${expected_payload}= Get File ${TEST_ROBOT_DIR}/data/expected_payload_fm.json + ${result}= Convert To String ${result.content} + ${result_string}= Get Substring ${result} 2 -2 + ${actual_data}= Evaluate json.loads("""${result_string}""") json + ${actual_payload}= Set Variable ${actual_data['payload']} + Should Be True """${actual_payload}""".strip() == """${expected_payload}""".strip() diff --git a/tests/dcaegen2/testcases/01__no_auth_tests.robot b/tests/dcaegen2/testcases/01__no_auth_tests.robot index 7e7f9767..1bb51cb8 100644 --- a/tests/dcaegen2/testcases/01__no_auth_tests.robot +++ b/tests/dcaegen2/testcases/01__no_auth_tests.robot @@ -14,7 +14,7 @@ Publish Single VES VNF Measurement Event API V7 Publish Single VES VNF Measurement Event with Standard Defined Fields API V7 [Tags] DCAE-VESC-R1 [Documentation] Post single event with valid data with Standard Defined Fields to /eventListener/v7 endpoint and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost unauthenticated.SEC_OTHER_OUTPUT + Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT Publish Single VES VNF Measurement Event with wrong JSON [Tags] DCAE-VESC-R1 diff --git a/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot b/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot index 1e221ce9..dcc94de3 100644 --- a/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot +++ b/tests/dcaegen2/testcases/02__cert_basic_auth_tests.robot @@ -4,7 +4,7 @@ Resource ./resources/dcae_keywords.robot Enable VESC HTTPS with certBasicAuth [Tags] DCAE-VESC-R1 DCAE-VESC-HC [Documentation] Enable VESC Https and Authentication and Run Health Check - Enable VESC with certBasicAuth + Override Collector Properties ${VES_CERT_BASIC_AUTH_COLLECTOR_PROPERTIES} Run Healthcheck ${https_basic_auth_session} VES Collector HTTP Health Check with certBasicAuth @@ -53,12 +53,6 @@ Publish Single VES VNF Measurement Event with certBasicAuth over HTTPS [Documentation] Post single event with valid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7} 202 ab305d54-85b4-a31b-7db2-fb6b9e546015 -Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS - [Tags] DCAE-VESC-R1 - [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code - Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost - - Publish Single VES VNF Measurement Event over HTTPS with wrong JSON [Tags] DCAE-VESC-R1 [Documentation] Post single event with invalid data and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 400 Response Status Code diff --git a/tests/dcaegen2/testcases/03__stndDefined_tests.robot b/tests/dcaegen2/testcases/03__stndDefined_tests.robot new file mode 100644 index 00000000..ddd11fa8 --- /dev/null +++ b/tests/dcaegen2/testcases/03__stndDefined_tests.robot @@ -0,0 +1,87 @@ +*** Settings *** +Resource ./resources/dcae_keywords.robot +*** Test Cases *** + +################################################### +# Section for tests with stndDefined validation ON +################################################### +Publish Single VES VNF Measurement Event with Standard Defined Fields with certBasicAuth over HTTPS + [Tags] DCAE-VESC-R1 + [Documentation] Post single event with valid data with Standard Defined Fields and valid username/password to /eventListener/v7 endpoint over HTTPS and expect 202 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost + +Publish VES Event With Empty Stnd Domain Namespace Parameter + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with invalid data (empty stnd namespace parameter) to /eventListener/v7 endpoint, expect 400 Response Status Code and "Mandatory input %1 %2 is empty in request" message + Send Request And Validate Response And Error Message Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_EMPTY_NAMESPACE} 400 Mandatory input %1 %2 is empty in request + +Publish VES Event With Missing Stnd Domain Namespace Parameter + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with invalid data (missing stnd namespace parameter) to /eventListener/v7 endpoint, expect 400 Response Status Code and "Mandatory input %1 %2 is missing from request" message + Send Request And Validate Response And Error Message Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_MISSING_NAMESPACE} 400 Mandatory input %1 %2 is missing from request + +Publish Single VES Event With Empty JSON + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with empty json and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_EMPTY_JSON} 400 + +Publish Single VES Event With Missing SourceName Parameter + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with empty json and expect 400 Response Status Code + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_NAMESPACE_3GPP_PROVISIONING_MISSING_SOURCENAME} 400 + +Publish Single VES Event With stndDefinedNamespace = 3GPP-Provisioning + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with stndDefinedNamespace = 3GPP-Provisioning and event should routed to topic unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_3GPP_PROVISIONING} 202 unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT + +Publish Single VES Event With stndDefinedNamespace = 3GPP-Heartbeat + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with stndDefinedNamespace = 3GPP-Heartbeat and event should routed to topic unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_3GPP_HEARTBEAT} 202 unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT + +Publish Single VES Event With stndDefinedNamespace = 3GPP-PerformanceAssurance + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with stndDefinedNamespace = 3GPP-PerformanceAssurance and event should routed to topic unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_3GPP_PERFORMANCE_ASSURANCE} 202 unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT + +Publish Single VES Event With stndDefinedNamespace = 3GPP-FaultSupervision + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with stndDefinedNamespace = 3GPP-FaultSupervision and event should routed to topic unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_3GPP_FAULTSUPERVISION} 202 unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT + +Publish Single VES Event With SchemaReference Field Not Set + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with schemaReference not set and not perform stndDefined validation, but pass general validation stage + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_INVALID_DATA_NO_SCHEMA_REF} 202 unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT + +Publish Single VES Event With Incorrect Schema Reference + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with incorrect schemaReference and return error + Send Request And Validate Response And Error Message Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_INCORRECT_SCHEMA_REF} 400 Invalid input value for %1 %2: %3 + +Publish Single VES Event With Empty StndDefined Data Field + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with Empty stndDefined data field and return error + Send Request And Validate Response And Error Message Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_EMPTY_DATA} 400 The following service error occurred: %1. Error code is %2 + +Publish Single VES Event With Invalid Type Of Multiply StndDefined Data Fields + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with invalid stndDefined data fields and return error + Send Request And Validate Response And Error Message Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_INVALID_TYPE_DATA} 400 The following service error occurred: %1. Error code is %2 + + +##################################################### +## Section for tests with stndDefined validation OFF +##################################################### +Disable VESC StndDefined Validation Checkflag + [Tags] DCAE-VESC-R1 DCAE-VESC-HC DCAE-VESC-STNDDEFINED + [Documentation] Disable VESC StndDefined Validation Checkflag and Run Health Check + Override Collector Properties ${VES_DISABLED_STNDDEFINED_COLLECTOR_PROPERTIES} + Run Healthcheck ${https_basic_auth_session} + +Publish Single VES Event With Incorrect StndDefined Data + [Tags] DCAE-VESC-R1 DCAE-VESC-STNDDEFINED + [Documentation] Post single event with incorrect stndDefined data + Send Request And Validate Response Publish Event To VES Collector ${https_basic_auth_session} ${VES_EVENTLISTENER_V7} ${VES_STND_DEFINED_INVALID_TYPE_DATA} 202 + diff --git a/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.2_ONAP.json b/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.2_ONAP.json new file mode 100644 index 00000000..6aee0d56 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.2_ONAP.json @@ -0,0 +1,3087 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "VES Event Listener Common Event Format", + "type": "object", + "properties": { + "event": { + "$ref": "#/definitions/event" + }, + "eventList": { + "$ref": "#/definitions/eventList" + } + }, + "definitions": { + "schemaHeaderBlock": { + "description": "schema date, version, author and associated API", + "type": "object", + "properties": { + "associatedApi": { + "description": "VES Event Listener", + "type": "string" + }, + "lastUpdatedBy": { + "description": "tl2972", + "type": "string" + }, + "schemaDate": { + "description": "June 2, 2020", + "type": "string" + }, + "schemaVersion": { + "description": "30.2.0", + "type": "number" + } + } + }, + "schemaLicenseAndCopyrightNotice": { + "description": "Copyright (c) 2020, AT&T Intellectual Property. All rights reserved", + "type": "object", + "properties": { + "apacheLicense2.0": { + "description": "Licensed under the Apache License, Version 2.0 (the 'License'); you may not use this file except in compliance with the License. You may obtain a copy of the License at:", + "type": "string" + }, + "licenseUrl": { + "description": "http://www.apache.org/licenses/LICENSE-2.0", + "type": "string" + }, + "asIsClause": { + "description": "Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.", + "type": "string" + }, + "permissionsAndLimitations": { + "description": "See the License for the specific language governing permissions and limitations under the License.", + "type": "string" + } + } + }, + "arrayOfJsonObject": { + "description": "array of json objects described by name, schema and other meta-information", + "type": "array", + "items": { + "$ref": "#/definitions/jsonObject" + } + }, + "arrayOfNamedHashMap": { + "description": "array of named hashMaps", + "type": "array", + "items": { + "$ref": "#/definitions/namedHashMap" + } + }, + "codecsInUse": { + "description": "number of times an identified codec was used over the measurementInterval", + "type": "object", + "properties": { + "codecIdentifier": { + "type": "string" + }, + "numberInUse": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "codecIdentifier", + "numberInUse" + ] + }, + "commonEventHeader": { + "description": "fields common to all events", + "type": "object", + "properties": { + "domain": { + "description": "the eventing domain associated with the event", + "type": "string", + "enum": [ + "fault", + "heartbeat", + "measurement", + "mobileFlow", + "notification", + "other", + "perf3gpp", + "pnfRegistration", + "sipSignaling", + "stateChange", + "stndDefined", + "syslog", + "thresholdCrossingAlert", + "voiceQuality" + ] + }, + "eventId": { + "description": "event key that is unique to the event source", + "type": "string" + }, + "eventName": { + "description": "unique event name", + "type": "string" + }, + "eventType": { + "description": "for example - applicationNf, guestOS, hostOS, platform", + "type": "string" + }, + "internalHeaderFields": { + "$ref": "#/definitions/internalHeaderFields" + }, + "lastEpochMicrosec": { + "description": "the latest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds", + "type": "number" + }, + "nfcNamingCode": { + "description": "3 character network function component type, aligned with vfc naming standards", + "type": "string" + }, + "nfNamingCode": { + "description": "4 character network function type, aligned with nf naming standards", + "type": "string" + }, + "nfVendorName": { + "description": "network function vendor name", + "type": "string" + }, + "priority": { + "description": "processing priority", + "type": "string", + "enum": [ + "High", + "Medium", + "Normal", + "Low" + ] + }, + "reportingEntityId": { + "description": "UUID identifying the entity reporting the event, for example an OAM VM; must be populated by the ATT enrichment process", + "type": "string" + }, + "reportingEntityName": { + "description": "name of the entity reporting the event, for example, an EMS name; may be the same as sourceName", + "type": "string" + }, + "sequence": { + "description": "ordering of events communicated by an event source instance or 0 if not needed", + "type": "integer" + }, + "sourceId": { + "description": "UUID identifying the entity experiencing the event issue; must be populated by the ATT enrichment process", + "type": "string" + }, + "sourceName": { + "description": "name of the entity experiencing the event issue", + "type": "string" + }, + "startEpochMicrosec": { + "description": "the earliest unix time aka epoch time associated with the event from any component--as microseconds elapsed since 1 Jan 1970 not including leap seconds", + "type": "number" + }, + "stndDefinedNamespace": { + "description": "Standards organization defined event namespace; expected usage includes event routing by the event listener", + "type": "string" + }, + "timeZoneOffset": { + "description": "UTC offset for the local time zone of the device as UTC+/-hh.mm", + "type": "string" + }, + "version": { + "description": "version of the event header", + "type": "string", + "enum": [ + "4.0", + "4.0.1", + "4.1" + ] + }, + "vesEventListenerVersion": { + "description": "version of the VES Event Listener API", + "type": "string", + "enum": [ + "7.0", + "7.0.1", + "7.1", + "7.1.1", + "7.2" + ] + } + }, + "additionalProperties": false, + "required": [ + "domain", + "eventId", + "eventName", + "lastEpochMicrosec", + "priority", + "reportingEntityName", + "sequence", + "sourceName", + "startEpochMicrosec", + "version", + "vesEventListenerVersion" + ] + }, + "counter": { + "description": "performance counter", + "type": "object", + "properties": { + "criticality": { + "type": "string", + "enum": [ + "CRIT", + "MAJ" + ] + }, + "hashMap": { + "$ref": "#/definitions/hashMap" + }, + "thresholdCrossed": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "criticality", + "hashMap", + "thresholdCrossed" + ] + }, + "cpuUsage": { + "description": "usage of an identified CPU", + "type": "object", + "properties": { + "cpuCapacityContention": { + "description": "the amount of time the CPU cannot run due to contention, in milliseconds over the measurementInterval", + "type": "number" + }, + "cpuDemandAvg": { + "description": "the total CPU time that the NF/NFC/VM could use if there was no contention, in milliseconds over the measurementInterval", + "type": "number" + }, + "cpuDemandMhz": { + "description": "CPU demand in megahertz", + "type": "number" + }, + "cpuDemandPct": { + "description": "CPU demand as a percentage of the provisioned capacity", + "type": "number" + }, + "cpuIdentifier": { + "description": "cpu identifer", + "type": "string" + }, + "cpuIdle": { + "description": "percentage of CPU time spent in the idle task", + "type": "number" + }, + "cpuLatencyAvg": { + "description": "percentage of time the VM is unable to run because it is contending for access to the physical CPUs", + "type": "number" + }, + "cpuOverheadAvg": { + "description": "the overhead demand above available allocations and reservations, in milliseconds over the measurementInterval", + "type": "number" + }, + "cpuSwapWaitTime": { + "description": "swap wait time. in milliseconds over the measurementInterval", + "type": "number" + }, + "cpuUsageInterrupt": { + "description": "percentage of time spent servicing interrupts", + "type": "number" + }, + "cpuUsageNice": { + "description": "percentage of time spent running user space processes that have been niced", + "type": "number" + }, + "cpuUsageSoftIrq": { + "description": "percentage of time spent handling soft irq interrupts", + "type": "number" + }, + "cpuUsageSteal": { + "description": "percentage of time spent in involuntary wait which is neither user, system or idle time and is effectively time that went missing", + "type": "number" + }, + "cpuUsageSystem": { + "description": "percentage of time spent on system tasks running the kernel", + "type": "number" + }, + "cpuUsageUser": { + "description": "percentage of time spent running un-niced user space processes", + "type": "number" + }, + "cpuWait": { + "description": "percentage of CPU time spent waiting for I/O operations to complete", + "type": "number" + }, + "percentUsage": { + "description": "aggregate cpu usage of the virtual machine on which the xNFC reporting the event is running", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "cpuIdentifier", + "percentUsage" + ] + }, + "diskUsage": { + "description": "usage of an identified disk", + "type": "object", + "properties": { + "diskBusResets": { + "description": "number of bus resets over the measurementInterval", + "type": "number" + }, + "diskCommandsAborted": { + "description": "number of disk commands aborted over the measurementInterval", + "type": "number" + }, + "diskCommandsAvg": { + "description": "average number of commands per second over the measurementInterval", + "type": "number" + }, + "diskFlushRequests": { + "description": "total flush requests of the disk cache over the measurementInterval", + "type": "number" + }, + "diskFlushTime": { + "description": "milliseconds spent on disk cache flushing over the measurementInterval", + "type": "number" + }, + "diskIdentifier": { + "description": "disk identifier", + "type": "string" + }, + "diskIoTimeAvg": { + "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the average over the measurement interval", + "type": "number" + }, + "diskIoTimeLast": { + "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the last value measurement within the measurement interval", + "type": "number" + }, + "diskIoTimeMax": { + "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the maximum value measurement within the measurement interval", + "type": "number" + }, + "diskIoTimeMin": { + "description": "milliseconds spent doing input/output operations over 1 sec; treat this metric as a device load percentage where 1000ms matches 100% load; provide the minimum value measurement within the measurement interval", + "type": "number" + }, + "diskMergedReadAvg": { + "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskMergedReadLast": { + "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the last value measurement within the measurement interval", + "type": "number" + }, + "diskMergedReadMax": { + "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the maximum value measurement within the measurement interval", + "type": "number" + }, + "diskMergedReadMin": { + "description": "number of logical read operations that were merged into physical read operations, e.g., two logical reads were served by one physical disk access; provide the minimum value measurement within the measurement interval", + "type": "number" + }, + "diskMergedWriteAvg": { + "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskMergedWriteLast": { + "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the last value measurement within the measurement interval", + "type": "number" + }, + "diskMergedWriteMax": { + "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the maximum value measurement within the measurement interval", + "type": "number" + }, + "diskMergedWriteMin": { + "description": "number of logical write operations that were merged into physical write operations, e.g., two logical writes were served by one physical disk access; provide the minimum value measurement within the measurement interval", + "type": "number" + }, + "diskOctetsReadAvg": { + "description": "number of octets per second read from a disk or partition; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskOctetsReadLast": { + "description": "number of octets per second read from a disk or partition; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskOctetsReadMax": { + "description": "number of octets per second read from a disk or partition; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskOctetsReadMin": { + "description": "number of octets per second read from a disk or partition; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskOctetsWriteAvg": { + "description": "number of octets per second written to a disk or partition; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskOctetsWriteLast": { + "description": "number of octets per second written to a disk or partition; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskOctetsWriteMax": { + "description": "number of octets per second written to a disk or partition; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskOctetsWriteMin": { + "description": "number of octets per second written to a disk or partition; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskOpsReadAvg": { + "description": "number of read operations per second issued to the disk; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskOpsReadLast": { + "description": "number of read operations per second issued to the disk; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskOpsReadMax": { + "description": "number of read operations per second issued to the disk; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskOpsReadMin": { + "description": "number of read operations per second issued to the disk; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskOpsWriteAvg": { + "description": "number of write operations per second issued to the disk; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskOpsWriteLast": { + "description": "number of write operations per second issued to the disk; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskOpsWriteMax": { + "description": "number of write operations per second issued to the disk; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskOpsWriteMin": { + "description": "number of write operations per second issued to the disk; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskPendingOperationsAvg": { + "description": "queue size of pending I/O operations per second; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskPendingOperationsLast": { + "description": "queue size of pending I/O operations per second; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskPendingOperationsMax": { + "description": "queue size of pending I/O operations per second; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskPendingOperationsMin": { + "description": "queue size of pending I/O operations per second; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskReadCommandsAvg": { + "description": "average number of read commands issued per second to the disk over the measurementInterval", + "type": "number" + }, + "diskTime": { + "description": "nanoseconds spent on disk cache reads/writes within the measurement interval", + "type": "number" + }, + "diskTimeReadAvg": { + "description": "milliseconds a read operation took to complete; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskTimeReadLast": { + "description": "milliseconds a read operation took to complete; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskTimeReadMax": { + "description": "milliseconds a read operation took to complete; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskTimeReadMin": { + "description": "milliseconds a read operation took to complete; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskTimeWriteAvg": { + "description": "milliseconds a write operation took to complete; provide the average measurement within the measurement interval", + "type": "number" + }, + "diskTimeWriteLast": { + "description": "milliseconds a write operation took to complete; provide the last measurement within the measurement interval", + "type": "number" + }, + "diskTimeWriteMax": { + "description": "milliseconds a write operation took to complete; provide the maximum measurement within the measurement interval", + "type": "number" + }, + "diskTimeWriteMin": { + "description": "milliseconds a write operation took to complete; provide the minimum measurement within the measurement interval", + "type": "number" + }, + "diskTotalReadLatencyAvg": { + "description": "average read time from the perspective of a Guest OS: sum of the Kernel Read Latency and Physical Device Read Latency in milliseconds over the measurement interval", + "type": "number" + }, + "diskTotalWriteLatencyAvg": { + "description": "average write time from the perspective of a Guest OS: sum of the Kernel Write Latency and Physical Device Write Latency in milliseconds over the measurement interval", + "type": "number" + }, + "diskWeightedIoTimeAvg": { + "description": "measure in ms over 1 sec of both I/O completion time and the backlog that may be accumulating; value is the average within the collection interval", + "type": "number" + }, + "diskWeightedIoTimeLast": { + "description": "measure in ms over 1 sec of both I/O completion time and the backlog that may be accumulating; value is the last within the collection interval", + "type": "number" + }, + "diskWeightedIoTimeMax": { + "description": "measure in ms over 1 sec of both I/O completion time and the backlog that may be accumulating; value is the maximum within the collection interval", + "type": "number" + }, + "diskWeightedIoTimeMin": { + "description": "measure in ms over 1 sec of both I/O completion time and the backlog that may be accumulating; value is the minimum within the collection interval", + "type": "number" + }, + "diskWriteCommandsAvg": { + "description": "average number of write commands issued per second to the disk over the measurementInterval", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "diskIdentifier" + ] + }, + "endOfCallVqmSummaries": { + "description": "provides end of call voice quality metrics", + "type": "object", + "properties": { + "adjacencyName": { + "description": " adjacency name", + "type": "string" + }, + "endpointAverageJitter": { + "description": "endpoint average jitter", + "type": "number" + }, + "endpointDescription": { + "description": "either Caller or Callee", + "type": "string", + "enum": [ + "Caller", + "Callee" + ] + }, + "endpointMaxJitter": { + "description": "endpoint maximum jitter", + "type": "number" + }, + "endpointRtpOctetsDiscarded": { + "description": "", + "type": "number" + }, + "endpointRtpOctetsLost": { + "description": "endpoint RTP octets lost", + "type": "number" + }, + "endpointRtpOctetsReceived": { + "description": "", + "type": "number" + }, + "endpointRtpOctetsSent": { + "description": "", + "type": "number" + }, + "endpointRtpPacketsDiscarded": { + "description": "", + "type": "number" + }, + "endpointRtpPacketsLost": { + "description": "endpoint RTP packets lost", + "type": "number" + }, + "endpointRtpPacketsReceived": { + "description": "", + "type": "number" + }, + "endpointRtpPacketsSent": { + "description": "", + "type": "number" + }, + "localAverageJitter": { + "description": "Local average jitter", + "type": "number" + }, + "localAverageJitterBufferDelay": { + "description": "Local average jitter delay", + "type": "number" + }, + "localMaxJitter": { + "description": "Local maximum jitter", + "type": "number" + }, + "localMaxJitterBufferDelay": { + "description": "Local maximum jitter delay", + "type": "number" + }, + "localRtpOctetsDiscarded": { + "description": "", + "type": "number" + }, + "localRtpOctetsLost": { + "description": "Local RTP octets lost", + "type": "number" + }, + "localRtpOctetsReceived": { + "description": "", + "type": "number" + }, + "localRtpOctetsSent": { + "description": "", + "type": "number" + }, + "localRtpPacketsDiscarded": { + "description": "", + "type": "number" + }, + "localRtpPacketsLost": { + "description": "Local RTP packets lost", + "type": "number" + }, + "localRtpPacketsReceived": { + "description": "", + "type": "number" + }, + "localRtpPacketsSent": { + "description": "", + "type": "number" + }, + "mosCqe": { + "description": "1-5 1dp", + "type": "number" + }, + "oneWayDelay": { + "description": "one-way path delay in milliseconds", + "type": "number" + }, + "packetLossPercent": { + "description": "Calculated percentage packet loss based on Endpoint RTP packets lost (as reported in RTCP) and Local RTP packets sent. Direction is based on Endpoint description (Caller, Callee). Decimal (2 dp)", + "type": "number" + }, + "rFactor": { + "description": "0-100", + "type": "number" + }, + "roundTripDelay": { + "description": "millisecs", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "adjacencyName", + "endpointDescription" + ] + }, + "event": { + "description": "the root level of the common event format", + "type": "object", + "properties": { + "commonEventHeader": { + "$ref": "#/definitions/commonEventHeader" + }, + "faultFields": { + "$ref": "#/definitions/faultFields" + }, + "heartbeatFields": { + "$ref": "#/definitions/heartbeatFields" + }, + "measurementFields": { + "$ref": "#/definitions/measurementFields" + }, + "mobileFlowFields": { + "$ref": "#/definitions/mobileFlowFields" + }, + "notificationFields": { + "$ref": "#/definitions/notificationFields" + }, + "otherFields": { + "$ref": "#/definitions/otherFields" + }, + "perf3gppFields": { + "$ref": "#/definitions/perf3gppFields" + }, + "pnfRegistrationFields": { + "$ref": "#/definitions/pnfRegistrationFields" + }, + "sipSignalingFields": { + "$ref": "#/definitions/sipSignalingFields" + }, + "stateChangeFields": { + "$ref": "#/definitions/stateChangeFields" + }, + "stndDefinedFields": { + "$ref": "#/definitions/stndDefinedFields" + }, + "syslogFields": { + "$ref": "#/definitions/syslogFields" + }, + "thresholdCrossingAlertFields": { + "$ref": "#/definitions/thresholdCrossingAlertFields" + }, + "voiceQualityFields": { + "$ref": "#/definitions/voiceQualityFields" + } + }, + "additionalProperties": false, + "required": [ + "commonEventHeader" + ] + }, + "eventList": { + "description": "array of events", + "type": "array", + "items": { + "$ref": "#/definitions/event" + } + }, + "faultFields": { + "description": "fields specific to fault events", + "type": "object", + "properties": { + "alarmAdditionalInformation": { + "$ref": "#/definitions/hashMap" + }, + "alarmCondition": { + "description": "alarm condition reported by the device", + "type": "string" + }, + "alarmInterfaceA": { + "description": "card, port, channel or interface name of the device generating the alarm", + "type": "string" + }, + "eventCategory": { + "description": "Event category, for example: license, link, routing, security, signaling", + "type": "string" + }, + "eventSeverity": { + "description": "event severity", + "type": "string", + "enum": [ + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" + ] + }, + "eventSourceType": { + "description": "type of event source; examples: card, host, other, port, portThreshold, router, slotThreshold, switch, virtualMachine, virtualNetworkFunction", + "type": "string" + }, + "faultFieldsVersion": { + "description": "version of the faultFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "specificProblem": { + "description": "short description of the alarm or problem", + "type": "string" + }, + "vfStatus": { + "description": "virtual function status enumeration", + "type": "string", + "enum": [ + "Active", + "Idle", + "Preparing to terminate", + "Ready to terminate", + "Requesting termination" + ] + } + }, + "additionalProperties": false, + "required": [ + "alarmCondition", + "eventSeverity", + "eventSourceType", + "faultFieldsVersion", + "specificProblem", + "vfStatus" + ] + }, + "filesystemUsage": { + "description": "disk usage of an identified virtual machine in gigabytes and/or gigabytes per second", + "type": "object", + "properties": { + "blockConfigured": { + "type": "number" + }, + "blockIops": { + "type": "number" + }, + "blockUsed": { + "type": "number" + }, + "ephemeralConfigured": { + "type": "number" + }, + "ephemeralIops": { + "type": "number" + }, + "ephemeralUsed": { + "type": "number" + }, + "filesystemName": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "blockConfigured", + "blockIops", + "blockUsed", + "ephemeralConfigured", + "ephemeralIops", + "ephemeralUsed", + "filesystemName" + ] + }, + "gtpPerFlowMetrics": { + "description": "Mobility GTP Protocol per flow metrics", + "type": "object", + "properties": { + "avgBitErrorRate": { + "description": "average bit error rate", + "type": "number" + }, + "avgPacketDelayVariation": { + "description": "Average packet delay variation or jitter in milliseconds for received packets: Average difference between the packet timestamp and time received for all pairs of consecutive packets", + "type": "number" + }, + "avgPacketLatency": { + "description": "average delivery latency", + "type": "number" + }, + "avgReceiveThroughput": { + "description": "average receive throughput", + "type": "number" + }, + "avgTransmitThroughput": { + "description": "average transmit throughput", + "type": "number" + }, + "durConnectionFailedStatus": { + "description": "duration of failed state in milliseconds, computed as the cumulative time between a failed echo request and the next following successful error request, over this reporting interval", + "type": "number" + }, + "durTunnelFailedStatus": { + "description": "Duration of errored state, computed as the cumulative time between a tunnel error indicator and the next following non-errored indicator, over this reporting interval", + "type": "number" + }, + "flowActivatedBy": { + "description": "Endpoint activating the flow", + "type": "string" + }, + "flowActivationEpoch": { + "description": "Time the connection is activated in the flow (connection) being reported on, or transmission time of the first packet if activation time is not available", + "type": "number" + }, + "flowActivationMicrosec": { + "description": "Integer microseconds for the start of the flow connection", + "type": "number" + }, + "flowActivationTime": { + "description": "time the connection is activated in the flow being reported on, or transmission time of the first packet if activation time is not available; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "flowDeactivatedBy": { + "description": "Endpoint deactivating the flow", + "type": "string" + }, + "flowDeactivationEpoch": { + "description": "Time for the start of the flow connection, in integer UTC epoch time aka UNIX time", + "type": "number" + }, + "flowDeactivationMicrosec": { + "description": "Integer microseconds for the start of the flow connection", + "type": "number" + }, + "flowDeactivationTime": { + "description": "Transmission time of the first packet in the flow connection being reported on; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "flowStatus": { + "description": "connection status at reporting time as a working / inactive / failed indicator value", + "type": "string" + }, + "gtpConnectionStatus": { + "description": "Current connection state at reporting time", + "type": "string" + }, + "gtpTunnelStatus": { + "description": "Current tunnel state at reporting time", + "type": "string" + }, + "ipTosCountList": { + "$ref": "#/definitions/hashMap" + }, + "ipTosList": { + "description": "Array of unique IP Type-of-Service values observed in the flow where values range from '0' to '255'", + "type": "array", + "items": { + "type": "string" + } + }, + "largePacketRtt": { + "description": "large packet round trip time", + "type": "number" + }, + "largePacketThreshold": { + "description": "large packet threshold being applied", + "type": "number" + }, + "maxPacketDelayVariation": { + "description": "Maximum packet delay variation or jitter in milliseconds for received packets: Maximum of the difference between the packet timestamp and time received for all pairs of consecutive packets", + "type": "number" + }, + "maxReceiveBitRate": { + "description": "maximum receive bit rate", + "type": "number" + }, + "maxTransmitBitRate": { + "description": "maximum transmit bit rate", + "type": "number" + }, + "mobileQciCosCountList": { + "$ref": "#/definitions/hashMap" + }, + "mobileQciCosList": { + "description": "Array of unique LTE QCI or UMTS class-of-service values observed in the flow", + "type": "array", + "items": { + "type": "string" + } + }, + "numActivationFailures": { + "description": "Number of failed activation requests, as observed by the reporting node", + "type": "number" + }, + "numBitErrors": { + "description": "number of errored bits", + "type": "number" + }, + "numBytesReceived": { + "description": "number of bytes received, including retransmissions", + "type": "number" + }, + "numBytesTransmitted": { + "description": "number of bytes transmitted, including retransmissions", + "type": "number" + }, + "numDroppedPackets": { + "description": "number of received packets dropped due to errors per virtual interface", + "type": "number" + }, + "numGtpEchoFailures": { + "description": "Number of Echo request path failures where failed paths are defined in 3GPP TS 29.281 sec 7.2.1 and 3GPP TS 29.060 sec. 11.2", + "type": "number" + }, + "numGtpTunnelErrors": { + "description": "Number of tunnel error indications where errors are defined in 3GPP TS 29.281 sec 7.3.1 and 3GPP TS 29.060 sec. 11.1", + "type": "number" + }, + "numHttpErrors": { + "description": "Http error count", + "type": "number" + }, + "numL7BytesReceived": { + "description": "number of tunneled layer 7 bytes received, including retransmissions", + "type": "number" + }, + "numL7BytesTransmitted": { + "description": "number of tunneled layer 7 bytes transmitted, excluding retransmissions", + "type": "number" + }, + "numLostPackets": { + "description": "number of lost packets", + "type": "number" + }, + "numOutOfOrderPackets": { + "description": "number of out-of-order packets", + "type": "number" + }, + "numPacketErrors": { + "description": "number of errored packets", + "type": "number" + }, + "numPacketsReceivedExclRetrans": { + "description": "number of packets received, excluding retransmission", + "type": "number" + }, + "numPacketsReceivedInclRetrans": { + "description": "number of packets received, including retransmission", + "type": "number" + }, + "numPacketsTransmittedInclRetrans": { + "description": "number of packets transmitted, including retransmissions", + "type": "number" + }, + "numRetries": { + "description": "number of packet retries", + "type": "number" + }, + "numTimeouts": { + "description": "number of packet timeouts", + "type": "number" + }, + "numTunneledL7BytesReceived": { + "description": "number of tunneled layer 7 bytes received, excluding retransmissions", + "type": "number" + }, + "roundTripTime": { + "description": "round trip time", + "type": "number" + }, + "tcpFlagCountList": { + "$ref": "#/definitions/hashMap" + }, + "tcpFlagList": { + "description": "Array of unique TCP Flags observed in the flow", + "type": "array", + "items": { + "type": "string" + } + }, + "timeToFirstByte": { + "description": "Time in milliseconds between the connection activation and first byte received", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "avgBitErrorRate", + "avgPacketDelayVariation", + "avgPacketLatency", + "avgReceiveThroughput", + "avgTransmitThroughput", + "flowActivationEpoch", + "flowActivationMicrosec", + "flowDeactivationEpoch", + "flowDeactivationMicrosec", + "flowDeactivationTime", + "flowStatus", + "maxPacketDelayVariation", + "numActivationFailures", + "numBitErrors", + "numBytesReceived", + "numBytesTransmitted", + "numDroppedPackets", + "numL7BytesReceived", + "numL7BytesTransmitted", + "numLostPackets", + "numOutOfOrderPackets", + "numPacketErrors", + "numPacketsReceivedExclRetrans", + "numPacketsReceivedInclRetrans", + "numPacketsTransmittedInclRetrans", + "numRetries", + "numTimeouts", + "numTunneledL7BytesReceived", + "roundTripTime", + "timeToFirstByte" + ] + }, + "hashMap": { + "description": "an associative array which is an array of key:value pairs", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "default": {} + }, + "heartbeatFields": { + "description": "optional field block for fields specific to heartbeat events", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "heartbeatFieldsVersion": { + "description": "version of the heartbeatFields block", + "type": "string", + "enum": [ + "3.0" + ] + }, + "heartbeatInterval": { + "description": "current heartbeat interval in seconds", + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "heartbeatFieldsVersion", + "heartbeatInterval" + ] + }, + "hugePages": { + "description": "metrics on system hugepages", + "type": "object", + "properties": { + "bytesFree": { + "description": "number of free hugepages in bytes", + "type": "number" + }, + "bytesUsed": { + "description": "number of used hugepages in bytes", + "type": "number" + }, + "hugePagesIdentifier": { + "description": "hugePages identifier", + "type": "string" + }, + "percentFree": { + "description": "number of free hugepages in percent", + "type": "number" + }, + "percentUsed": { + "description": "number of free hugepages in percent", + "type": "number" + }, + "vmPageNumberFree": { + "description": "number of free vmPages in numbers", + "type": "number" + }, + "vmPageNumberUsed": { + "description": "number of used vmPages in numbers", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "hugePagesIdentifier" + ] + }, + "internalHeaderFields": { + "description": "enrichment fields for internal VES Event Listener service use only, not supplied by event sources", + "type": "object" + }, + "ipmi": { + "description": "intelligent platform management interface metrics", + "type": "object", + "properties": { + "exitAirTemperature": { + "description": "system fan exit air flow temperature in celsius", + "type": "number" + }, + "frontPanelTemperature": { + "description": "front panel temperature in celsius", + "type": "number" + }, + "ioModuleTemperature": { + "description": "io module temperature in celsius", + "type": "number" + }, + "ipmiBaseboardTemperatureArray": { + "description": "array of ipmiBaseboardTemperature objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiBaseboardTemperature" + } + }, + "ipmiBaseboardVoltageRegulatorArray": { + "description": "array of ipmiBaseboardVoltageRegulator objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiBaseboardVoltageRegulator" + } + }, + "ipmiBatteryArray": { + "description": "array of ipmiBattery objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiBattery" + } + }, + "ipmiFanArray": { + "description": "array of ipmiFan objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiFan" + } + }, + "ipmiHsbpArray": { + "description": "array of ipmiHsbp objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiHsbp" + } + }, + "ipmiGlobalAggregateTemperatureMarginArray": { + "description": "array of ipmiGlobalAggregateTemperatureMargin objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiGlobalAggregateTemperatureMargin" + } + }, + "ipmiNicArray": { + "description": "array of ipmiNic objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiNic" + } + }, + "ipmiPowerSupplyArray": { + "description": "array of ipmiPowerSupply objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiPowerSupply" + } + }, + "ipmiProcessorArray": { + "description": "array of ipmiProcessor objects", + "type": "array", + "items": { + "$ref": "#/definitions/ipmiProcessor" + } + }, + "systemAirflow": { + "description": "airfflow in cubic feet per minute (cfm)", + "type": "number" + } + }, + "additionalProperties": false + }, + "ipmiBaseboardTemperature": { + "description": "intelligent platform management interface (ipmi) baseboard temperature metrics", + "type": "object", + "properties": { + "baseboardTemperatureIdentifier": { + "description": "identifier for the location where the temperature is taken", + "type": "string" + }, + "baseboardTemperature": { + "description": "baseboard temperature in celsius", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "baseboardTemperatureIdentifier" + ] + }, + "ipmiBaseboardVoltageRegulator": { + "description": "intelligent platform management interface (ipmi) baseboard voltage regulator metrics", + "type": "object", + "properties": { + "baseboardVoltageRegulatorIdentifier": { + "description": "identifier for the baseboard voltage regulator", + "type": "string" + }, + "voltageRegulatorTemperature": { + "description": "voltage regulator temperature in celsius", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "baseboardVoltageRegulatorIdentifier" + ] + }, + "ipmiBattery": { + "description": "intelligent platform management interface (ipmi) battery metrics", + "type": "object", + "properties": { + "batteryIdentifier": { + "description": "identifier for the battery", + "type": "string" + }, + "batteryType": { + "description": "type of battery", + "type": "string" + }, + "batteryVoltageLevel": { + "description": "battery voltage level", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "batteryIdentifier" + ] + }, + "ipmiFan": { + "description": "intelligent platform management interface (ipmi) fan metrics", + "type": "object", + "properties": { + "fanIdentifier": { + "description": "identifier for the fan", + "type": "string" + }, + "fanSpeed": { + "description": "fan speed in revolutions per minute (rpm)", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "fanIdentifier" + ] + }, + "ipmiGlobalAggregateTemperatureMargin": { + "description": "intelligent platform management interface (ipmi) global aggregate temperature margin", + "type": "object", + "properties": { + "globalAggregateTemperatureMarginIdentifier": { + "description": "identifier for the ipmi global aggregate temperature margin metrics", + "type": "string" + }, + "globalAggregateTemperatureMargin": { + "description": "the difference between the current global aggregate temperature, in celsius, and the global aggregate throttling thermal trip point", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "globalAggregateTemperatureMarginIdentifier", + "globalAggregateTemperatureMargin" + ] + }, + "ipmiHsbp": { + "description": "intelligent platform management interface (ipmi) hot swap backplane power metrics", + "type": "object", + "properties": { + "hsbpIdentifier": { + "description": "identifier for the hot swap backplane power unit", + "type": "string" + }, + "hsbpTemperature": { + "description": "hot swap backplane power temperature in celsius", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "hsbpIdentifier" + ] + }, + "ipmiNic": { + "description": "intelligent platform management interface (ipmi) network interface control card (nic) metrics", + "type": "object", + "properties": { + "nicIdentifier": { + "description": "identifier for the network interface control card", + "type": "string" + }, + "nicTemperature": { + "description": "nic temperature in celsius", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "nicIdentifier" + ] + }, + "ipmiPowerSupply": { + "description": "intelligent platform management interface (ipmi) power supply metrics", + "type": "object", + "properties": { + "powerSupplyIdentifier": { + "description": "identifier for the power supply", + "type": "string" + }, + "powerSupplyInputPower": { + "description": "input power in watts", + "type": "number" + }, + "powerSupplyCurrentOutputPercent": { + "description": "current output voltage as a percentage of the design specified level", + "type": "number" + }, + "powerSupplyTemperature": { + "description": "power supply temperature in celsius", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "powerSupplyIdentifier" + ] + }, + "ipmiProcessor": { + "description": "intelligent platform management interface processor metrics", + "type": "object", + "properties": { + "processorIdentifier": { + "description": "identifier for an ipmi processor", + "type": "string" + }, + "processorThermalControlPercent": { + "description": "io module temperature in celsius", + "type": "number" + }, + "processorDtsThermalMargin": { + "description": "front panel temperature in celsius", + "type": "number" + }, + "processorDimmAggregateThermalMarginArray": { + "description": "array of processorDimmAggregateThermalMargin objects", + "type": "array", + "items": { + "$ref": "#/definitions/processorDimmAggregateThermalMargin" + } + } + }, + "additionalProperties": false, + "required": [ + "processorIdentifier" + ] + }, + "jsonObject": { + "description": "json object schema, name and other meta-information along with one or more object instances", + "type": "object", + "properties": { + "objectInstances": { + "description": "one or more instances of the jsonObject", + "type": "array", + "items": { + "$ref": "#/definitions/jsonObjectInstance" + } + }, + "objectName": { + "description": "name of the JSON Object", + "type": "string" + }, + "objectSchema": { + "description": "json schema for the object", + "type": "string" + }, + "objectSchemaUrl": { + "description": "Url to the json schema for the object", + "type": "string" + }, + "nfSubscribedObjectName": { + "description": "name of the object associated with the nfSubscriptonId", + "type": "string" + }, + "nfSubscriptionId": { + "description": "identifies an openConfig telemetry subscription on a network function, which configures the network function to send complex object data associated with the jsonObject", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "objectInstances", + "objectName" + ] + }, + "jsonObjectInstance": { + "description": "meta-information about an instance of a jsonObject along with the actual object instance", + "type": "object", + "properties": { + "jsonObject": { + "$ref": "#/definitions/jsonObject" + }, + "objectInstance": { + "description": "an instance conforming to the jsonObject objectSchema", + "type": "object" + }, + "objectInstanceEpochMicrosec": { + "description": "the unix time aka epoch time associated with this objectInstance--as microseconds elapsed since 1 Jan 1970 not including leap seconds", + "type": "number" + }, + "objectKeys": { + "description": "an ordered set of keys that identifies this particular instance of jsonObject", + "type": "array", + "items": { + "$ref": "#/definitions/key" + } + } + }, + "additionalProperties": false + }, + "key": { + "description": "tuple which provides the name of a key along with its value and relative order", + "type": "object", + "properties": { + "keyName": { + "description": "name of the key", + "type": "string" + }, + "keyOrder": { + "description": "relative sequence or order of the key with respect to other keys", + "type": "integer" + }, + "keyValue": { + "description": "value of the key", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "keyName" + ] + }, + "latencyBucketMeasure": { + "description": "number of counts falling within a defined latency bucket", + "type": "object", + "properties": { + "countsInTheBucket": { + "type": "number" + }, + "highEndOfLatencyBucket": { + "type": "number" + }, + "lowEndOfLatencyBucket": { + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "countsInTheBucket" + ] + }, + "load": { + "description": "/proc/loadavg cpu utilization and io utilization metrics", + "type": "object", + "properties": { + "longTerm": { + "description": "number of jobs in the run queue (state R, cpu utilization) or waiting for disk I/O (state D, io utilization) averaged over 15 minutes using /proc/loadavg", + "type": "number" + }, + "midTerm": { + "description": "number of jobs in the run queue (state R, cpu utilization) or waiting for disk I/O (state D, io utilization) averaged over 5 minutes using /proc/loadavg", + "type": "number" + }, + "shortTerm": { + "description": "number of jobs in the run queue (state R, cpu utilization) or waiting for disk I/O (state D, io utilization) averaged over 1 minute using /proc/loadavg", + "type": "number" + } + }, + "additionalProperties": false + }, + "machineCheckException": { + "description": "metrics on vm machine check exceptions", + "type": "object", + "properties": { + "correctedMemoryErrors": { + "description": "total hardware errors that were corrected by the hardware (e.g. data corruption corrected via ECC) over the measurementInterval", + "type": "number" + }, + "correctedMemoryErrorsIn1Hr": { + "description": "total hardware errors that were corrected by the hardware over the last one hour", + "type": "number" + }, + "uncorrectedMemoryErrors": { + "description": "total uncorrected hardware errors that were detected by the hardware (e.g., causing data corruption) over the measurementInterval", + "type": "number" + }, + "uncorrectedMemoryErrorsIn1Hr": { + "description": "total uncorrected hardware errors that were detected by the hardware over the last one hour", + "type": "number" + }, + "vmIdentifier": { + "description": "virtual machine identifier associated with the machine check exception", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "vmIdentifier" + ] + }, + "measDataCollection": { + "description": "3GPP measurement collection structure aligned with 3GPP PM format", + "type": "object", + "properties": { + "formatVersion": { + "description": "3gpp PM reporting file format version from pre-standard TS 28.550 v2.0.0", + "type": "string" + }, + "granularityPeriod": { + "description": "granularity period for the PM report in seconds", + "type": "number" + }, + "measInfoList": { + "description": "array of measurements", + "type": "array", + "items": { + "$ref": "#/definitions/measInfo" + } + }, + "measObjInstIdList": { + "description": "array of monitored object local distinguished name ids per 3GPP TS 32.300", + "type": "array", + "items": { + "type": "string" + } + }, + "measuredEntityDn": { + "description": "distinguished name per 3GPP TS 28.550", + "type": "string" + }, + "measuredEntitySoftwareVersion": { + "description": "software version for the NF providing the PM data as specified in 3GPP TS 28.550", + "type": "string" + }, + "measuredEntityUserName": { + "description": "user definable name for the measured object per 3GPP TS 28.550", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "granularityPeriod", + "measInfoList", + "measuredEntityDn" + ] + }, + "measInfo": { + "description": "measurement information.", + "type": "object", + "properties": { + "jobId": { + "description": "name of the measurement job", + "type": "string" + }, + "measInfoId": { + "description": "measurement group identifier", + "oneOf": [ + { + "$ref": "#/definitions/measInfoIdInteger" + }, + { + "$ref": "#/definitions/measInfoIdString" + } + ] + }, + "measTypes": { + "oneOf": [ + { + "$ref": "#/definitions/measTypesInteger" + }, + { + "$ref": "#/definitions/measTypesString" + } + ] + }, + "measValuesList": { + "description": "an array of measurement values", + "type": "array", + "items": { + "$ref": "#/definitions/measValues" + } + } + }, + "additionalProperties": false, + "required": [ + "measTypes", + "measValuesList" + ] + }, + "measInfoIdInteger": { + "description": "integer measurement group identifier", + "type": "object", + "properties": { + "iMeasInfoId": { + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "iMeasInfoId" + ] + }, + "measInfoIdString": { + "description": "string measurement group identifier", + "type": "object", + "properties": { + "sMeasInfoId": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "sMeasInfoId" + ] + }, + "measResultInteger": { + "description": "integer 3GPP PM measurement result", + "type": "object", + "properties": { + "p": { + "description": "integer reference to the counter", + "type": "integer" + }, + "iValue": { + "description": "integer counter value", + "type": "integer" + } + }, + "additionalProperties": false, + "required": [ + "p", + "iValue" + ] + }, + "measResultNull": { + "description": "null 3GPP PM measurement result", + "type": "object", + "properties": { + "p": { + "description": "integer reference to the counter", + "type": "integer" + }, + "isNull": { + "description": "true if the counter has no value", + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + "additionalProperties": false, + "required": [ + "p", + "isNull" + ] + }, + "measResultNumber": { + "description": "number 3GPP PM measurement result", + "type": "object", + "properties": { + "p": { + "description": "integer reference to the counter", + "type": "integer" + }, + "rValue": { + "description": "numeric counter value", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "p", + "rValue" + ] + }, + "measResultString": { + "description": "string 3GPP PM measurement result", + "type": "object", + "properties": { + "p": { + "description": "integer reference to the counter", + "type": "integer" + }, + "sValue": { + "description": "string counter value", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "p", + "sValue" + ] + }, + "measTypesInteger": { + "description": "object containing an array of integer measurement identifiers associated with the measurement results", + "type": "object", + "properties": { + "iMeasTypesList": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "additionalProperties": false, + "required": [ + "iMeasTypesList" + ] + }, + "measTypesString": { + "description": "object containing an array of string measurement identifiers associated with the measurement results", + "type": "object", + "properties": { + "sMeasTypesList": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "additionalProperties": false, + "required": [ + "sMeasTypesList" + ] + }, + "measurementFields": { + "description": "measurement fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "additionalMeasurements": { + "$ref": "#/definitions/arrayOfNamedHashMap" + }, + "additionalObjects": { + "$ref": "#/definitions/arrayOfJsonObject" + }, + "codecUsageArray": { + "description": "array of codecs in use", + "type": "array", + "items": { + "$ref": "#/definitions/codecsInUse" + } + }, + "concurrentSessions": { + "description": "peak concurrent sessions for the VM or xNF over the measurementInterval", + "type": "integer" + }, + "configuredEntities": { + "description": "over the measurementInterval, peak total number of: users, subscribers, devices, adjacencies, etc., for the VM, or subscribers, devices, etc., for the xNF", + "type": "integer" + }, + "cpuUsageArray": { + "description": "usage of an array of CPUs", + "type": "array", + "items": { + "$ref": "#/definitions/cpuUsage" + } + }, + "diskUsageArray": { + "description": "usage of an array of disks", + "type": "array", + "items": { + "$ref": "#/definitions/diskUsage" + } + }, + "featureUsageArray": { + "$ref": "#/definitions/hashMap" + }, + "filesystemUsageArray": { + "description": "filesystem usage of the VM on which the xNFC reporting the event is running", + "type": "array", + "items": { + "$ref": "#/definitions/filesystemUsage" + } + }, + "hugePagesArray": { + "description": "array of metrics on hugepPages", + "type": "array", + "items": { + "$ref": "#/definitions/hugePages" + } + }, + "ipmi": { + "$ref": "#/definitions/ipmi" + }, + "latencyDistribution": { + "description": "array of integers representing counts of requests whose latency in milliseconds falls within per-xNF configured ranges", + "type": "array", + "items": { + "$ref": "#/definitions/latencyBucketMeasure" + } + }, + "loadArray": { + "description": "array of system load metrics", + "type": "array", + "items": { + "$ref": "#/definitions/load" + } + }, + "machineCheckExceptionArray": { + "description": "array of machine check exceptions", + "type": "array", + "items": { + "$ref": "#/definitions/machineCheckException" + } + }, + "meanRequestLatency": { + "description": "mean seconds required to respond to each request for the VM on which the xNFC reporting the event is running", + "type": "number" + }, + "measurementInterval": { + "description": "interval over which measurements are being reported in seconds", + "type": "number" + }, + "measurementFieldsVersion": { + "description": "version of the measurementFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "memoryUsageArray": { + "description": "memory usage of an array of VMs", + "type": "array", + "items": { + "$ref": "#/definitions/memoryUsage" + } + }, + "numberOfMediaPortsInUse": { + "description": "number of media ports in use", + "type": "integer" + }, + "requestRate": { + "description": "peak rate of service requests per second to the xNF over the measurementInterval", + "type": "number" + }, + "nfcScalingMetric": { + "description": "represents busy-ness of the network function from 0 to 100 as reported by the xNFC", + "type": "integer" + }, + "nicPerformanceArray": { + "description": "usage of an array of network interface cards", + "type": "array", + "items": { + "$ref": "#/definitions/nicPerformance" + } + }, + "processStatsArray": { + "description": "array of metrics on system processes", + "type": "array", + "items": { + "$ref": "#/definitions/processStats" + } + } + }, + "additionalProperties": false, + "required": [ + "measurementInterval", + "measurementFieldsVersion" + ] + }, + "measValues": { + "description": "3GPP measurement values", + "type": "object", + "properties": { + "measObjAddlFlds": { + "$ref": "#/definitions/hashMap" + }, + "measObjInstId": { + "description": "monitored object local distinguished name per 3GPP TS 32.300 and 3GPP TS 32.432", + "type": "string" + }, + "measResults": { + "description": "array of results", + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/definitions/measResultInteger" + }, + { + "$ref": "#/definitions/measResultNull" + }, + { + "$ref": "#/definitions/measResultNumber" + }, + { + "$ref": "#/definitions/measResultString" + } + ] + } + }, + "suspectFlag": { + "description": "indicates if the values are suspect", + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + "additionalProperties": false, + "required": [ + "measObjInstId", + "measResults" + ] + }, + "memoryUsage": { + "description": "memory usage of an identified virtual machine", + "type": "object", + "properties": { + "memoryBuffered": { + "description": "kibibytes of temporary storage for raw disk blocks", + "type": "number" + }, + "memoryCached": { + "description": "kibibytes of memory used for cache", + "type": "number" + }, + "memoryConfigured": { + "description": "kibibytes of memory configured in the virtual machine on which the xNFC reporting the event is running", + "type": "number" + }, + "memoryDemand": { + "description": "host demand in kibibytes", + "type": "number" + }, + "memoryFree": { + "description": "kibibytes of physical RAM left unused by the system", + "type": "number" + }, + "memoryLatencyAvg": { + "description": "Percentage of time the VM is waiting to access swapped or compressed memory", + "type": "number" + }, + "memorySharedAvg": { + "description": "shared memory in kilobytes", + "type": "number" + }, + "memorySlabRecl": { + "description": "the part of the slab that can be reclaimed such as caches measured in kibibytes", + "type": "number" + }, + "memorySlabUnrecl": { + "description": "the part of the slab that cannot be reclaimed even when lacking memory measured in kibibytes", + "type": "number" + }, + "memorySwapInAvg": { + "description": "Amount of memory swapped-in from host cache in kibibytes", + "type": "number" + }, + "memorySwapInRateAvg": { + "description": "rate at which memory is swapped from disk into active memory during the interval in kilobytes per second", + "type": "number" + }, + "memorySwapOutAvg": { + "description": "Amount of memory swapped-out to host cache in kibibytes", + "type": "number" + }, + "memorySwapOutRateAvg": { + "description": "rate at which memory is being swapped from active memory to disk during the current interval in kilobytes per second", + "type": "number" + }, + "memorySwapUsedAvg": { + "description": "space used for caching swapped pages in the host cache in kibibytes", + "type": "number" + }, + "memoryUsed": { + "description": "total memory minus the sum of free, buffered, cached and slab memory measured in kibibytes", + "type": "number" + }, + "percentMemoryUsage": { + "description": "Percentage of memory usage; value = (memoryUsed / (memoryUsed + memoryFree) x 100 if denomintor is nonzero, or 0, if otherwise", + "type": "number" + }, + "vmIdentifier": { + "description": "virtual machine identifier associated with the memory metrics", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "memoryFree", + "memoryUsed", + "vmIdentifier" + ] + }, + "mobileFlowFields": { + "description": "mobileFlow fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "applicationType": { + "description": "Application type inferred", + "type": "string" + }, + "appProtocolType": { + "description": "application protocol", + "type": "string" + }, + "appProtocolVersion": { + "description": "application protocol version", + "type": "string" + }, + "cid": { + "description": "cell id", + "type": "string" + }, + "connectionType": { + "description": "Abbreviation referencing a 3GPP reference point e.g., S1-U, S11, etc", + "type": "string" + }, + "ecgi": { + "description": "Evolved Cell Global Id", + "type": "string" + }, + "flowDirection": { + "description": "Flow direction, indicating if the reporting node is the source of the flow or destination for the flow", + "type": "string" + }, + "gtpPerFlowMetrics": { + "$ref": "#/definitions/gtpPerFlowMetrics" + }, + "gtpProtocolType": { + "description": "GTP protocol", + "type": "string" + }, + "gtpVersion": { + "description": "GTP protocol version", + "type": "string" + }, + "httpHeader": { + "description": "HTTP request header, if the flow connects to a node referenced by HTTP", + "type": "string" + }, + "imei": { + "description": "IMEI for the subscriber UE used in this flow, if the flow connects to a mobile device", + "type": "string" + }, + "imsi": { + "description": "IMSI for the subscriber UE used in this flow, if the flow connects to a mobile device", + "type": "string" + }, + "ipProtocolType": { + "description": "IP protocol type e.g., TCP, UDP, RTP...", + "type": "string" + }, + "ipVersion": { + "description": "IP protocol version e.g., IPv4, IPv6", + "type": "string" + }, + "lac": { + "description": "location area code", + "type": "string" + }, + "mcc": { + "description": "mobile country code", + "type": "string" + }, + "mnc": { + "description": "mobile network code", + "type": "string" + }, + "mobileFlowFieldsVersion": { + "description": "version of the mobileFlowFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "msisdn": { + "description": "MSISDN for the subscriber UE used in this flow, as an integer, if the flow connects to a mobile device", + "type": "string" + }, + "otherEndpointIpAddress": { + "description": "IP address for the other endpoint, as used for the flow being reported on", + "type": "string" + }, + "otherEndpointPort": { + "description": "IP Port for the reporting entity, as used for the flow being reported on", + "type": "integer" + }, + "otherFunctionalRole": { + "description": "Functional role of the other endpoint for the flow being reported on e.g., MME, S-GW, P-GW, PCRF...", + "type": "string" + }, + "rac": { + "description": "routing area code", + "type": "string" + }, + "radioAccessTechnology": { + "description": "Radio Access Technology e.g., 2G, 3G, LTE", + "type": "string" + }, + "reportingEndpointIpAddr": { + "description": "IP address for the reporting entity, as used for the flow being reported on", + "type": "string" + }, + "reportingEndpointPort": { + "description": "IP port for the reporting entity, as used for the flow being reported on", + "type": "integer" + }, + "sac": { + "description": "service area code", + "type": "string" + }, + "samplingAlgorithm": { + "description": "Integer identifier for the sampling algorithm or rule being applied in calculating the flow metrics if metrics are calculated based on a sample of packets, or 0 if no sampling is applied", + "type": "integer" + }, + "tac": { + "description": "transport area code", + "type": "string" + }, + "tunnelId": { + "description": "tunnel identifier", + "type": "string" + }, + "vlanId": { + "description": "VLAN identifier used by this flow", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "flowDirection", + "gtpPerFlowMetrics", + "ipProtocolType", + "ipVersion", + "mobileFlowFieldsVersion", + "otherEndpointIpAddress", + "otherEndpointPort", + "reportingEndpointIpAddr", + "reportingEndpointPort" + ] + }, + "namedHashMap": { + "description": "a hashMap which is associated with and described by a name", + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "hashMap": { + "$ref": "#/definitions/hashMap" + } + }, + "additionalProperties": false, + "required": [ + "name", + "hashMap" + ] + }, + "nicPerformance": { + "description": "describes the performance and errors of an identified network interface card", + "type": "object", + "properties": { + "administrativeState": { + "description": "administrative state", + "type": "string", + "enum": [ + "inService", + "outOfService" + ] + }, + "nicIdentifier": { + "description": "nic identification", + "type": "string" + }, + "operationalState": { + "description": "operational state", + "type": "string", + "enum": [ + "inService", + "outOfService" + ] + }, + "receivedBroadcastPacketsAccumulated": { + "description": "Cumulative count of broadcast packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedBroadcastPacketsDelta": { + "description": "Count of broadcast packets received within the measurement interval", + "type": "number" + }, + "receivedDiscardedPacketsAccumulated": { + "description": "Cumulative count of discarded packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedDiscardedPacketsDelta": { + "description": "Count of discarded packets received within the measurement interval", + "type": "number" + }, + "receivedErrorPacketsAccumulated": { + "description": "Cumulative count of error packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedErrorPacketsDelta": { + "description": "Count of error packets received within the measurement interval", + "type": "number" + }, + "receivedMulticastPacketsAccumulated": { + "description": "Cumulative count of multicast packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedMulticastPacketsDelta": { + "description": "Count of multicast packets received within the measurement interval", + "type": "number" + }, + "receivedOctetsAccumulated": { + "description": "Cumulative count of octets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedOctetsDelta": { + "description": "Count of octets received within the measurement interval", + "type": "number" + }, + "receivedTotalPacketsAccumulated": { + "description": "Cumulative count of all packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedPercentDiscard": { + "description": "Percentage of discarded packets received; value = (receivedDiscardedPacketsDelta / receivedTotalPacketsDelta) x 100, if denominator is nonzero, or 0, if otherwise", + "type": "number" + }, + "receivedPercentError": { + "description": "Percentage of error packets received; value = (receivedErrorPacketsDelta / receivedTotalPacketsDelta) x 100, if denominator is nonzero, or 0, if otherwise.", + "type": "number" + }, + "receivedTotalPacketsDelta": { + "description": "Count of all packets received within the measurement interval", + "type": "number" + }, + "receivedUnicastPacketsAccumulated": { + "description": "Cumulative count of unicast packets received as read at the end of the measurement interval", + "type": "number" + }, + "receivedUnicastPacketsDelta": { + "description": "Count of unicast packets received within the measurement interval", + "type": "number" + }, + "receivedUtilization": { + "description": "Percentage of utilization received; value = (receivedOctetsDelta / (speed x (lastEpochMicrosec - startEpochMicrosec))) x 100, if denominator is nonzero, or 0, if otherwise", + "type": "number" + }, + "speed": { + "description": "Speed configured in mbps", + "type": "number" + }, + "transmittedBroadcastPacketsAccumulated": { + "description": "Cumulative count of broadcast packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedBroadcastPacketsDelta": { + "description": "Count of broadcast packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedDiscardedPacketsAccumulated": { + "description": "Cumulative count of discarded packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedDiscardedPacketsDelta": { + "description": "Count of discarded packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedErrorPacketsAccumulated": { + "description": "Cumulative count of error packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedErrorPacketsDelta": { + "description": "Count of error packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedMulticastPacketsAccumulated": { + "description": "Cumulative count of multicast packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedMulticastPacketsDelta": { + "description": "Count of multicast packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedOctetsAccumulated": { + "description": "Cumulative count of octets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedOctetsDelta": { + "description": "Count of octets transmitted within the measurement interval", + "type": "number" + }, + "transmittedTotalPacketsAccumulated": { + "description": "Cumulative count of all packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedTotalPacketsDelta": { + "description": "Count of all packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedUnicastPacketsAccumulated": { + "description": "Cumulative count of unicast packets transmitted as read at the end of the measurement interval", + "type": "number" + }, + "transmittedUnicastPacketsDelta": { + "description": "Count of unicast packets transmitted within the measurement interval", + "type": "number" + }, + "transmittedPercentDiscard": { + "description": "Percentage of discarded packets transmitted; value = (transmittedDiscardedPacketsDelta / transmittedTotalPacketsDelta) x 100, if denominator is nonzero, or 0, if otherwise", + "type": "number" + }, + "transmittedPercentError": { + "description": "Percentage of error packets received; value = (transmittedErrorPacketsDelta / transmittedTotalPacketsDelta) x 100, if denominator is nonzero, or 0, if otherwise", + "type": "number" + }, + "transmittedUtilization": { + "description": "Percentage of utilization transmitted; value = (transmittedOctetsDelta / (speed x (lastEpochMicrosec - startEpochMicrosec))) x 100, if denominator is nonzero, or 0, if otherwise.", + "type": "number" + }, + "valuesAreSuspect": { + "description": "Indicates whether vNicPerformance values are likely inaccurate due to counter overflow or other condtions", + "type": "string", + "enum": [ + "true", + "false" + ] + } + }, + "additionalProperties": false, + "required": [ + "nicIdentifier", + "valuesAreSuspect" + ] + }, + "notificationFields": { + "description": "notification fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "arrayOfNamedHashMap": { + "$ref": "#/definitions/arrayOfNamedHashMap" + }, + "changeContact": { + "description": "identifier for a contact related to the change", + "type": "string" + }, + "changeIdentifier": { + "description": "system or session identifier associated with the change", + "type": "string" + }, + "changeType": { + "description": "describes what has changed for the entity", + "type": "string" + }, + "newState": { + "description": "new state of the entity", + "type": "string" + }, + "oldState": { + "description": "previous state of the entity", + "type": "string" + }, + "notificationFieldsVersion": { + "description": "version of the notificationFields block", + "type": "string", + "enum": [ + "2.0" + ] + }, + "stateInterface": { + "description": "card or port name of the entity that changed state", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "changeIdentifier", + "changeType", + "notificationFieldsVersion" + ] + }, + "otherFields": { + "description": "fields for events belonging to the 'other' domain of the commonEventHeader domain enumeration", + "type": "object", + "properties": { + "arrayOfNamedHashMap": { + "$ref": "#/definitions/arrayOfNamedHashMap" + }, + "hashMap": { + "$ref": "#/definitions/hashMap" + }, + "jsonObjects": { + "$ref": "#/definitions/arrayOfJsonObject" + }, + "otherFieldsVersion": { + "description": "version of the otherFields block", + "type": "string", + "enum": [ + "3.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "otherFieldsVersion" + ] + }, + "perf3gppFields": { + "description": "fields for 3GPP PM format events, based on 3GPP TS 28.550, belonging to the 'perf3gpp' domain of the commonEventHeader domain enumeration", + "type": "object", + "properties": { + "eventAddlFields": { + "$ref": "#/definitions/hashMap" + }, + "measDataCollection": { + "$ref": "#/definitions/measDataCollection" + }, + "perf3gppFieldsVersion": { + "description": "version of the perf3gppFields block", + "type": "string", + "enum": [ + "1.0", + "1.0.1" + ] + } + }, + "additionalProperties": false, + "required": [ + "measDataCollection", + "perf3gppFieldsVersion" + ] + }, + "pnfRegistrationFields": { + "description": "hardware device registration fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "lastServiceDate": { + "description": "TS 32.692 dateOfLastService = date of last service; e.g. 15022017", + "type": "string" + }, + "macAddress": { + "description": "MAC address of OAM interface of the unit", + "type": "string" + }, + "manufactureDate": { + "description": "TS 32.692 dateOfManufacture = manufacture date of the unit; 24032016", + "type": "string" + }, + "modelNumber": { + "description": "TS 32.692 versionNumber = version of the unit from vendor; e.g. AJ02. Maps to AAI equip-model", + "type": "string" + }, + "oamV4IpAddress": { + "description": "IPv4 m-plane IP address to be used by the manager to contact the PNF", + "type": "string" + }, + "oamV6IpAddress": { + "description": "IPv6 m-plane IP address to be used by the manager to contact the PNF", + "type": "string" + }, + "pnfRegistrationFieldsVersion": { + "description": "version of the pnfRegistrationFields block", + "type": "string", + "enum": [ + "2.0" + ] + }, + "serialNumber": { + "description": "TS 32.692 serialNumber = serial number of the unit; e.g. 6061ZW3", + "type": "string" + }, + "softwareVersion": { + "description": "TS 32.692 swName = active SW running on the unit; e.g. 5gDUv18.05.201", + "type": "string" + }, + "unitFamily": { + "description": "TS 32.692 vendorUnitFamilyType = general type of HW unit; e.g. BBU", + "type": "string" + }, + "unitType": { + "description": "TS 32.692 vendorUnitTypeNumber = vendor name for the unit; e.g. Airscale", + "type": "string" + }, + "vendorName": { + "description": "TS 32.692 vendorName = name of manufacturer; e.g. Nokia. Maps to AAI equip-vendor", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "pnfRegistrationFieldsVersion" + ] + }, + "processorDimmAggregateThermalMargin": { + "description": "intelligent platform management interface (ipmi) processor dual inline memory module aggregate thermal margin metrics", + "type": "object", + "properties": { + "processorDimmAggregateThermalMarginIdentifier": { + "description": "identifier for the aggregate thermal margin metrics from the processor dual inline memory module", + "type": "string" + }, + "thermalMargin": { + "description": "the difference between the DIMM's current temperature, in celsius, and the DIMM's throttling thermal trip point", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "processorDimmAggregateThermalMarginIdentifier", + "thermalMargin" + ] + }, + "processStats": { + "description": "metrics on system processes", + "type": "object", + "properties": { + "forkRate": { + "description": "the number of threads created since the last reboot", + "type": "number" + }, + "processIdentifier": { + "description": "processIdentifier", + "type": "string" + }, + "psStateBlocked": { + "description": "the number of processes in a blocked state", + "type": "number" + }, + "psStatePaging": { + "description": "the number of processes in a paging state", + "type": "number" + }, + "psStateRunning": { + "description": "the number of processes in a running state", + "type": "number" + }, + "psStateSleeping": { + "description": "the number of processes in a sleeping state", + "type": "number" + }, + "psStateStopped": { + "description": "the number of processes in a stopped state", + "type": "number" + }, + "psStateZombie": { + "description": "the number of processes in a zombie state", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "processIdentifier" + ] + }, + "requestError": { + "description": "standard request error data structure", + "type": "object", + "properties": { + "messageId": { + "description": "Unique message identifier of the format ABCnnnn where ABC is either SVC for Service Exceptions or POL for Policy Exception", + "type": "string" + }, + "text": { + "description": "Message text, with replacement variables marked with %n, where n is an index into the list of <variables> elements, starting at 1", + "type": "string" + }, + "url": { + "description": "Hyperlink to a detailed error resource e.g., an HTML page for browser user agents", + "type": "string" + }, + "variables": { + "description": "List of zero or more strings that represent the contents of the variables used by the message text", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "messageId", + "text" + ] + }, + "sipSignalingFields": { + "description": "sip signaling fields", + "type": "object", + "properties": { + "additionalInformation": { + "$ref": "#/definitions/hashMap" + }, + "compressedSip": { + "description": "the full SIP request/response including headers and bodies", + "type": "string" + }, + "correlator": { + "description": "this is the same for all events on this call", + "type": "string" + }, + "localIpAddress": { + "description": "IP address on xNF", + "type": "string" + }, + "localPort": { + "description": "port on xNF", + "type": "string" + }, + "remoteIpAddress": { + "description": "IP address of peer endpoint", + "type": "string" + }, + "remotePort": { + "description": "port of peer endpoint", + "type": "string" + }, + "sipSignalingFieldsVersion": { + "description": "version of the sipSignalingFields block", + "type": "string", + "enum": [ + "3.0" + ] + }, + "summarySip": { + "description": "the SIP Method or Response ('INVITE', '200 OK', 'BYE', etc)", + "type": "string" + }, + "vendorNfNameFields": { + "$ref": "#/definitions/vendorNfNameFields" + } + }, + "additionalProperties": false, + "required": [ + "correlator", + "localIpAddress", + "localPort", + "remoteIpAddress", + "remotePort", + "sipSignalingFieldsVersion", + "vendorNfNameFields" + ] + }, + "stateChangeFields": { + "description": "stateChange fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "newState": { + "description": "new state of the entity", + "type": "string", + "enum": [ + "inService", + "maintenance", + "outOfService" + ] + }, + "oldState": { + "description": "previous state of the entity", + "type": "string", + "enum": [ + "inService", + "maintenance", + "outOfService" + ] + }, + "stateChangeFieldsVersion": { + "description": "version of the stateChangeFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "stateInterface": { + "description": "card or port name of the entity that changed state", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "newState", + "oldState", + "stateChangeFieldsVersion", + "stateInterface" + ] + }, + "stndDefinedFields": { + "description": "stndDefined fields", + "type": "object", + "properties": { + "schemaReference": { + "description": "a uri of a standards-defined JSON object schema; used to valide the stndDefinedFields.data property contents", + "type": "string", + "format": "uri" + }, + "data": { + "description": "a native standards-defined JSON notification", + "type": "object" + }, + "stndDefinedFieldsVersion": { + "description": "version of stndDefinedFields block", + "type": "string", + "enum": [ + "1.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "data", + "stndDefinedFieldsVersion" + ] + }, + "syslogFields": { + "description": "sysLog fields", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "eventSourceHost": { + "description": "hostname of the device", + "type": "string" + }, + "eventSourceType": { + "description": "type of event source; examples: other, router, switch, host, card, port, slotThreshold, portThreshold, virtualMachine, virtualNetworkFunction", + "type": "string" + }, + "syslogFacility": { + "description": "numeric code from 0 to 23 for facility--see table in documentation", + "type": "integer" + }, + "syslogFieldsVersion": { + "description": "version of the syslogFields block", + "type": "string", + "enum": [ + "4.0" + ] + }, + "syslogMsg": { + "description": "syslog message", + "type": "string" + }, + "syslogMsgHost": { + "description": "hostname parsed from non-VES syslog message", + "type": "string" + }, + "syslogPri": { + "description": "0-192 combined severity and facility", + "type": "integer" + }, + "syslogProc": { + "description": "identifies the application that originated the message", + "type": "string" + }, + "syslogProcId": { + "description": "a change in the value of this field indicates a discontinuity in syslog reporting", + "type": "number" + }, + "syslogSData": { + "description": "syslog structured data consisting of a structured data Id followed by a set of key value pairs", + "type": "string" + }, + "syslogSdId": { + "description": "0-32 char in format name@number for example ourSDID@32473", + "type": "string" + }, + "syslogSev": { + "description": "numerical Code for severity derived from syslogPri as remaider of syslogPri / 8", + "type": "string", + "enum": [ + "Alert", + "Critical", + "Debug", + "Emergency", + "Error", + "Info", + "Notice", + "Warning" + ] + }, + "syslogTag": { + "description": "msgId indicating the type of message such as TCPOUT or TCPIN; NILVALUE should be used when no other value can be provided", + "type": "string" + }, + "syslogTs": { + "description": "timestamp parsed from non-VES syslog message", + "type": "string" + }, + "syslogVer": { + "description": "IANA assigned version of the syslog protocol specification - typically 1", + "type": "number" + } + }, + "additionalProperties": false, + "required": [ + "eventSourceType", + "syslogFieldsVersion", + "syslogMsg", + "syslogTag" + ] + }, + "thresholdCrossingAlertFields": { + "description": "fields specific to threshold crossing alert events", + "type": "object", + "properties": { + "additionalFields": { + "$ref": "#/definitions/hashMap" + }, + "additionalParameters": { + "description": "performance counters", + "type": "array", + "items": { + "$ref": "#/definitions/counter" + } + }, + "alertAction": { + "description": "Event action", + "type": "string", + "enum": [ + "CLEAR", + "CONT", + "SET" + ] + }, + "alertDescription": { + "description": "Unique short alert description such as IF-SHUB-ERRDROP", + "type": "string" + }, + "alertType": { + "description": "Event type", + "type": "string", + "enum": [ + "CARD-ANOMALY", + "ELEMENT-ANOMALY", + "INTERFACE-ANOMALY", + "SERVICE-ANOMALY" + ] + }, + "alertValue": { + "description": "Calculated API value (if applicable)", + "type": "string" + }, + "associatedAlertIdList": { + "description": "List of eventIds associated with the event being reported", + "type": "array", + "items": { + "type": "string" + } + }, + "collectionTimestamp": { + "description": "Time when the performance collector picked up the data; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "dataCollector": { + "description": "Specific performance collector instance used", + "type": "string" + }, + "elementType": { + "description": "type of network element - internal ATT field", + "type": "string" + }, + "eventSeverity": { + "description": "event severity or priority", + "type": "string", + "enum": [ + "CRITICAL", + "MAJOR", + "MINOR", + "WARNING", + "NORMAL" + ] + }, + "eventStartTimestamp": { + "description": "Time closest to when the measurement was made; with RFC 2822 compliant format: Sat, 13 Mar 2010 11:29:05 -0800", + "type": "string" + }, + "interfaceName": { + "description": "Physical or logical port or card (if applicable)", + "type": "string" + }, + "networkService": { + "description": "network name - internal ATT field", + "type": "string" + }, + "possibleRootCause": { + "description": "Reserved for future use", + "type": "string" + }, + "thresholdCrossingFieldsVersion": { + "description": "version of the thresholdCrossingAlertFields block", + "type": "string", + "enum": [ + "4.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "additionalParameters", + "alertAction", + "alertDescription", + "alertType", + "collectionTimestamp", + "eventSeverity", + "eventStartTimestamp", + "thresholdCrossingFieldsVersion" + ] + }, + "vendorNfNameFields": { + "description": "provides vendor, nf and nfModule identifying information", + "type": "object", + "properties": { + "vendorName": { + "description": "network function vendor name", + "type": "string" + }, + "nfModuleName": { + "description": "name of the nfModule generating the event", + "type": "string" + }, + "nfName": { + "description": "name of the network function generating the event", + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "vendorName" + ] + }, + "voiceQualityFields": { + "description": "provides statistics related to customer facing voice products", + "type": "object", + "properties": { + "additionalInformation": { + "$ref": "#/definitions/hashMap" + }, + "calleeSideCodec": { + "description": "callee codec for the call", + "type": "string" + }, + "callerSideCodec": { + "description": "caller codec for the call", + "type": "string" + }, + "correlator": { + "description": "this is the same for all events on this call", + "type": "string" + }, + "endOfCallVqmSummaries": { + "$ref": "#/definitions/endOfCallVqmSummaries" + }, + "phoneNumber": { + "description": "phone number associated with the correlator", + "type": "string" + }, + "midCallRtcp": { + "description": "Base64 encoding of the binary RTCP data excluding Eth/IP/UDP headers", + "type": "string" + }, + "vendorNfNameFields": { + "$ref": "#/definitions/vendorNfNameFields" + }, + "voiceQualityFieldsVersion": { + "description": "version of the voiceQualityFields block", + "type": "string", + "enum": [ + "4.0" + ] + } + }, + "additionalProperties": false, + "required": [ + "calleeSideCodec", + "callerSideCodec", + "correlator", + "midCallRtcp", + "vendorNfNameFields", + "voiceQualityFieldsVersion" + ] + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json index 5d40b9d9..99b7ce37 100644 --- a/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json +++ b/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields.json @@ -1,47 +1,52 @@ { "event": { "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", "domain": "stndDefined", "eventId": "stndDefined-gNB_Nokia000001", "eventName": "stndDefined-gNB-Nokia-PowerLost", "stndDefinedNamespace": "3GPP-FaultSupervision", - "lastEpochMicrosec": 1234567890, - "priority": "Normal", - "reportingEntityName": "Nokia123456", - "sequence": 0, - "sourceName": "Nokia123456", - "startEpochMicrosec": 1234567890, - "version": "4.1", - "vesEventListenerVersion": "7.2" + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" }, "stndDefinedFields": { - "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", "data": { - "header": { - "uri": "xyz", - "notificationId": "xyz", - "notificationType": "notifyNewAlarm", - "eventTime": "xyz", - "systemDN": "xyz" + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" }, - "body": { - "probableCause": "xyz", - "perceivedSeverity": "Major", - "rootCauseIndicator": false, - "specificProblem": "xyz", - "correlatedNotifications": [], - "backedUpStatus": true, - "backUpObject": "xyz", - "trendIndication": "No change", - "thresholdInfo": {}, - "stateChangeDefinition": [], - "monitoredAttributes": [], - "proposedRepairActions": "xyz", - "additionalText": "xyz", - "additionalInformation": [], - "alarmId": "xyz", - "alarmType": "Environmental Alarm" - } + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" }, "stndDefinedFieldsVersion": "1.0" } diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json new file mode 100644 index 00000000..0d749f30 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json new file mode 100644 index 00000000..414904f5 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Heartbeat", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json new file mode 100644 index 00000000..8e1f697f --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-PerformanceAssurance", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json new file mode 100644 index 00000000..bb37d1e2 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Provisioning", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json new file mode 100644 index 00000000..2ffe17c7 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json @@ -0,0 +1,44 @@ +{ + "event": { + "commonEventHeader": { + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-Provisioning", + "lastEpochMicrosec": 1234567890, + "priority": "Normal", + "reportingEntityName": "Nokia123456", + "sequence": 0, + "startEpochMicrosec": 1234567890, + "version": "4.1", + "vesEventListenerVersion": "7.2" + }, + "stndDefinedFields": { + "schemaReference": "https://www.3gpp.org/Rel-16/TS28532_generic_fault_supervision.json#definitions/schemas/notifyNewAlarm-NotifType", + "data": { + "uri": "xyz", + "notificationId": "xyz", + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": "xyz", + "perceivedSeverity": "Major", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "No change", + "thresholdInfo": {}, + "stateChangeDefinition": [], + "monitoredAttributes": [], + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": [], + "alarmId": "xyz", + "alarmType": "Environmental Alarm" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json new file mode 100644 index 00000000..963d8763 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json @@ -0,0 +1,23 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": {}, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json new file mode 100644 index 00000000..49812e80 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json new file mode 100644 index 00000000..bacc7a51 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/invalid-ref.json", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_data_fields_no_schema_ref.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_data_fields_no_schema_ref.json new file mode 100644 index 00000000..33342c6c --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_data_fields_no_schema_ref.json @@ -0,0 +1,22 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "data": {}, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json new file mode 100644 index 00000000..5e9a8b35 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": 123, + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": "false", + "specificProblem": "xyz", + "correlatedNotifications": 123, + "backedUpStatus": "true", + "backUpObject": 123, + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": "123" + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": 1, + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json new file mode 100644 index 00000000..a5a16d12 --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json @@ -0,0 +1,53 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json new file mode 100644 index 00000000..4fee7a1e --- /dev/null +++ b/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "stndDefined-gNB-Nokia-PowerLost", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/blob/REL-16/OpenAPI/invalid-ref.json", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": , + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +}
\ No newline at end of file diff --git a/tests/dcaegen2/testcases/resources/DMaaP.py b/tests/dcaegen2/testcases/resources/DMaaP.py deleted file mode 100644 index 4c245614..00000000 --- a/tests/dcaegen2/testcases/resources/DMaaP.py +++ /dev/null @@ -1,418 +0,0 @@ -''' -Created on Aug 15, 2017 - -@author: sw6830 -''' -import os -import posixpath -import BaseHTTPServer -import urllib -import urlparse -import cgi -import sys -import shutil -import mimetypes -from jsonschema import validate -import jsonschema -import json -import DcaeVariables -import SimpleHTTPServer - -try: - from cStringIO import StringIO -except ImportError: - from StringIO import StringIO - -EvtSchema = None -DMaaPHttpd = None - - -def clean_up_event(): - sz = DcaeVariables.VESEventQ.qsize() - for i in range(sz): - try: - self.evtQueue.get_nowait() - except: - pass - - -def enque_event(evt): - if DcaeVariables.VESEventQ is not None: - try: - DcaeVariables.VESEventQ.put(evt) - return True - except Exception as e: - print (str(e)) - return False - return False - - -def deque_event(wait_sec=25): - if DcaeVariables.IsRobotRun: - pass - try: - evt = DcaeVariables.VESEventQ.get(True, wait_sec) - return evt - except Exception as e: - if DcaeVariables.IsRobotRun: - pass - - else: - print("DMaaP Event dequeue timeout") - return None - - -class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): - - def do_PUT(self): - self.send_response(405) - return - - def do_POST(self): - resp_code = 0 - # Parse the form data posted - ''' - form = cgi.FieldStorage( - fp=self.rfile, - headers=self.headers, - environ={'REQUEST_METHOD':'POST', - 'CONTENT_TYPE':self.headers['Content-Type'], - }) - - - form = cgi.FieldStorage( - fp=self.rfile, - headers=self.headers, - environ={"REQUEST_METHOD": "POST"}) - - for item in form.list: - print "%s=%s" % (item.name, item.value) - - ''' - - if 'POST' not in self.requestline: - resp_code = 405 - - ''' - if resp_code == 0: - if '/eventlistener/v5' not in self.requestline and '/eventlistener/v5/eventBatch' not in self.requestline and \ - '/eventlistener/v5/clientThrottlingState' not in self.requestline: - resp_code = 404 - - - if resp_code == 0: - if 'Y29uc29sZTpaakprWWpsbE1qbGpNVEkyTTJJeg==' not in str(self.headers): - resp_code = 401 - ''' - - if resp_code == 0: - topic = self.extract_topic_from_path() - content_len = int(self.headers.getheader('content-length', 0)) - post_body = self.rfile.read(content_len) - - indx = post_body.index("{") - if indx != 0: - post_body = post_body[indx:] - - event = "\""+topic+"\":" + post_body - if not enque_event(event): - print "enque event fails" - - global EvtSchema - try: - if EvtSchema is None: - with open(DcaeVariables.CommonEventSchema) as opened_file: - EvtSchema = json.load(opened_file) - decoded_body = json.loads(post_body) - jsonschema.validate(decoded_body, EvtSchema) - except: - resp_code = 400 - - # Begin the response - if not DcaeVariables.IsRobotRun: - print ("Response Message:") - - ''' - { - "200" : { - "description" : "Success", - "schema" : { - "$ref" : "#/definitions/DR_Pub" - } - } - - rspStr = "{'responses' : {'200' : {'description' : 'Success'}}}" - rspStr1 = "{'count': 1, 'serverTimeMs': 3}" - - ''' - - if resp_code == 0: - if 'clientThrottlingState' in self.requestline: - self.send_response(204) - else: - self.send_response(200) - self.send_header('Content-Type', 'application/json') - self.end_headers() - self.wfile.write("{'count': 1, 'serverTimeMs': 3}") - self.wfile.close() - else: - self.send_response(resp_code) - - ''' - self.end_headers() - self.wfile.write('Client: %s\n' % str(self.client_address)) - self.wfile.write('User-agent: %s\n' % str(self.headers['user-agent'])) - self.wfile.write('Path: %s\n' % self.path) - self.wfile.write('Form data:\n') - self.wfile.close() - - # Echo back information about what was posted in the form - for field in form.keys(): - field_item = form[field] - if field_item.filename: - # The field contains an uploaded file - file_data = field_item.file.read() - file_len = len(file_data) - del file_data - self.wfile.write('\tUploaded %s as "%s" (%d bytes)\n' % \ - (field, field_item.filename, file_len)) - else: - # Regular form value - self.wfile.write('\t%s=%s\n' % (field, form[field].value)) - ''' - return - - def extract_topic_from_path(self): - return self.path["/events/".__len__():] - - def do_GET(self): - """Serve a GET request.""" - f = self.send_head() - if f: - try: - self.copyfile(f, self.wfile) - finally: - f.close() - - def do_HEAD(self): - """Serve a HEAD request.""" - f = self.send_head() - if f: - f.close() - - def send_head(self): - """Common code for GET and HEAD commands. - - This sends the response code and MIME headers. - - Return value is either a file object (which has to be copied - to the outputfile by the caller unless the command was HEAD, - and must be closed by the caller under all circumstances), or - None, in which case the caller has nothing further to do. - - """ - path = self.translate_path(self.path) - if os.path.isdir(path): - parts = urlparse.urlsplit(self.path) - if not parts.path.endswith('/'): - # redirect browser - doing basically what apache does - self.send_response(301) - new_parts = (parts[0], parts[1], parts[2] + '/', - parts[3], parts[4]) - new_url = urlparse.urlunsplit(new_parts) - self.send_header("Location", new_url) - self.end_headers() - return None - for index in "index.html", "index.htm": - index = os.path.join(path, index) - if os.path.exists(index): - path = index - break - else: - return self.list_directory(path) - ctype = self.guess_type(path) - try: - # Always read in binary mode. Opening files in text mode may cause - # newline translations, making the actual size of the content - # transmitted *less* than the content-length! - f = open(path, 'rb') - except IOError: - self.send_error(404, "File not found") - return None - try: - self.send_response(200) - self.send_header("Content-type", ctype) - fs = os.fstat(f.fileno()) - self.send_header("Content-Length", str(fs[6])) - self.send_header("Last-Modified", self.date_time_string(fs.st_mtime)) - self.end_headers() - return f - except: - f.close() - raise - - def list_directory(self, path): - """Helper to produce a directory listing (absent index.html). - - Return value is either a file object, or None (indicating an - error). In either case, the headers are sent, making the - interface the same as for send_head(). - - """ - try: - list_dir = os.listdir(path) - except os.error: - self.send_error(404, "No permission to list directory") - return None - list_dir.sort(key=lambda a: a.lower()) - f = StringIO() - displaypath = cgi.escape(urllib.unquote(self.path)) - f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">') - f.write("<html>\n<title>Directory listing for %s</title>\n" % displaypath) - f.write("<body>\n<h2>Directory listing for %s</h2>\n" % displaypath) - f.write("<hr>\n<ul>\n") - for name in list_dir: - fullname = os.path.join(path, name) - displayname = linkname = name - # Append / for directories or @ for symbolic links - if os.path.isdir(fullname): - displayname = name + "/" - linkname = name + "/" - if os.path.islink(fullname): - displayname = name + "@" - # Note: a link to a directory displays with @ and links with / - f.write('<li><a href="%s">%s</a>\n' - % (urllib.quote(linkname), cgi.escape(displayname))) - f.write("</ul>\n<hr>\n</body>\n</html>\n") - length = f.tell() - f.seek(0) - self.send_response(200) - encoding = sys.getfilesystemencoding() - self.send_header("Content-type", "text/html; charset=%s" % encoding) - self.send_header("Content-Length", str(length)) - self.end_headers() - return f - - @staticmethod - def translate_path(path): - """Translate a /-separated PATH to the local filename syntax. - - Components that mean special things to the local file system - (e.g. drive or directory names) are ignored. (XXX They should - probably be diagnosed.) - - """ - # abandon query parameters - path = path.split('?', 1)[0] - path = path.split('#', 1)[0] - # Don't forget explicit trailing slash when normalizing. Issue17324 - trailing_slash = path.rstrip().endswith('/') - path = posixpath.normpath(urllib.unquote(path)) - words = path.split('/') - words = filter(None, words) - path = os.getcwd() - for word in words: - if os.path.dirname(word) or word in (os.curdir, os.pardir): - # Ignore components that are not a simple file/directory name - continue - path = os.path.join(path, word) - if trailing_slash: - path += '/' - return path - - @staticmethod - def copyfile(source, outputfile): - """Copy all data between two file objects. - - The SOURCE argument is a file object open for reading - (or anything with a read() method) and the DESTINATION - argument is a file object open for writing (or - anything with a write() method). - - The only reason for overriding this would be to change - the block size or perhaps to replace newlines by CRLF - -- note however that this the default server uses this - to copy binary data as well. - - """ - shutil.copyfileobj(source, outputfile) - - def guess_type(self, path): - """Guess the type of a file. - - Argument is a PATH (a filename). - - Return value is a string of the form type/subtype, - usable for a MIME Content-type header. - - The default implementation looks the file's extension - up in the table self.extensions_map, using application/octet-stream - as a default; however it would be permissible (if - slow) to look inside the data to make a better guess. - - """ - - base, ext = posixpath.splitext(path) - if ext in self.extensions_map: - return self.extensions_map[ext] - ext = ext.lower() - if ext in self.extensions_map: - return self.extensions_map[ext] - else: - return self.extensions_map[''] - - if not mimetypes.inited: - mimetypes.init() # try to read system mime.types - extensions_map = mimetypes.types_map.copy() - extensions_map.update({ - '': 'application/octet-stream', # Default - '.py': 'text/plain', - '.c': 'text/plain', - '.h': 'text/plain', - }) - - -def test(handler_class=DMaaPHandler, server_class=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0", port=3904): - print "Load event schema file: " + DcaeVariables.CommonEventSchema - with open(DcaeVariables.CommonEventSchema) as opened_file: - global EvtSchema - EvtSchema = json.load(opened_file) - - server_address = ('', port) - - handler_class.protocol_version = protocol - httpd = server_class(server_address, handler_class) - - global DMaaPHttpd - DMaaPHttpd = httpd - DcaeVariables.HTTPD = httpd - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - # httpd.serve_forever() - - -def _main_(handler_class=DMaaPHandler, server_class=BaseHTTPServer.HTTPServer, protocol="HTTP/1.0"): - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 3904 - - print "Load event schema file: " + DcaeVariables.CommonEventSchema - with open(DcaeVariables.CommonEventSchema) as opened_file: - global EvtSchema - EvtSchema = json.load(opened_file) - - server_address = ('', port) - - handler_class.protocol_version = protocol - httpd = server_class(server_address, handler_class) - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - httpd.serve_forever() - - -if __name__ == '__main__': - _main_() diff --git a/tests/dcaegen2/testcases/resources/DcaeLibrary.py b/tests/dcaegen2/testcases/resources/DcaeLibrary.py deleted file mode 100644 index a9d5def8..00000000 --- a/tests/dcaegen2/testcases/resources/DcaeLibrary.py +++ /dev/null @@ -1,184 +0,0 @@ -''' -Created on Aug 18, 2017 - -@author: sw6830 -''' -from robot.api import logger -from Queue import Queue -import uuid -import time -import datetime -import json -import threading -import os -import platform -import subprocess -import paramiko -import DcaeVariables -import DMaaP - - -class DcaeLibrary(object): - - def __init__(self): - pass - - @staticmethod - def setup_dmaap_server(port_num=3904): - if DcaeVariables.HttpServerThread is not None: - DMaaP.clean_up_event() - logger.console("Clean up event from event queue before test") - logger.info("DMaaP Server already started") - return "true" - - DcaeVariables.IsRobotRun = True - DMaaP.test(port=port_num) - try: - DcaeVariables.VESEventQ = Queue() - DcaeVariables.HttpServerThread = threading.Thread(name='DMAAP_HTTPServer', target=DMaaP.DMaaPHttpd.serve_forever) - DcaeVariables.HttpServerThread.start() - logger.console("DMaaP Mockup Sever started") - time.sleep(2) - return "true" - except Exception as e: - print (str(e)) - return "false" - - @staticmethod - def shutdown_dmaap(): - if DcaeVariables.HTTPD is not None: - DcaeVariables.HTTPD.shutdown() - logger.console("DMaaP Server shut down") - time.sleep(3) - return "true" - else: - return "false" - - @staticmethod - def cleanup_ves_events(): - if DcaeVariables.HttpServerThread is not None: - DMaaP.clean_up_event() - logger.console("DMaaP event queue is cleaned up") - return "true" - logger.console("DMaaP server not started yet") - return "false" - - @staticmethod - def enable_vesc_with_certBasicAuth(): - global client - if 'Windows' in platform.system(): - try: - client = paramiko.SSHClient() - client.load_system_host_keys() - # client.set_missing_host_key_policy(paramiko.WarningPolicy) - client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - - client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD']) - stdin, stdout, stderr = client.exec_command('%{WORKSPACE}/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh') - logger.console(stdout.read()) - finally: - client.close() - return - ws = os.environ['WORKSPACE'] - script2run = ws + "/tests/dcaegen2/testcases/resources/vesc_enable_https_auth.sh" - logger.info("Running script: " + script2run) - logger.console("Running script: " + script2run) - subprocess.call(script2run) - time.sleep(5) - return - - @staticmethod - def dmaap_message_receive_on_topic(evtobj, topic): - - evt_str = DMaaP.deque_event() - while evt_str != None: - if evtobj in evt_str and topic in evt_str: - logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) - logger.info("On Expected Topic:\n" + topic) - return 'true' - evt_str = DMaaP.deque_event() - return 'false' - - @staticmethod - def dmaap_message_receive(evtobj, action='contain'): - - evt_str = DMaaP.deque_event() - while evt_str != None: - if action == 'contain': - if evtobj in evt_str: - logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) - return 'true' - if action == 'sizematch': - if len(evtobj) == len(evt_str): - return 'true' - if action == 'dictmatch': - evt_dict = json.loads(evt_str) - if cmp(evtobj, evt_dict) == 0: - return 'true' - evt_str = DMaaP.deque_event() - return 'false' - - @staticmethod - def is_json_empty(resp): - logger.info("Enter is_json_empty: resp.text: " + resp.text) - if resp.text is None or len(resp.text) < 2: - return 'True' - return 'False' - - @staticmethod - def generate_uuid(): - """generate a uuid""" - return uuid.uuid4() - - @staticmethod - def get_json_value_list(jsonstr, keyval): - logger.info("Enter Get_Json_Key_Value_List") - if jsonstr is None or len(jsonstr) < 2: - logger.info("No Json data found") - return [] - try: - data = json.loads(jsonstr) - nodelist = [] - for item in data: - nodelist.append(item[keyval]) - return nodelist - except Exception as e: - logger.info("Json data parsing fails") - print str(e) - return [] - - @staticmethod - def generate_millitimestamp_uuid(): - """generate a millisecond timestamp uuid""" - then = datetime.datetime.now() - return int(time.mktime(then.timetuple())*1e3 + then.microsecond/1e3) - - @staticmethod - def test(): - import json - from pprint import pprint - - with open('robot/assets/dcae/ves_volte_single_fault_event.json') as data_file: - data = json.load(data_file) - - data['event']['commonEventHeader']['version'] = '5.0' - pprint(data) - - -if __name__ == '__main__': - ''' - dictStr = "action=getTable,Accept=application/json,Content-Type=application/json,X-FromAppId=1234908903284" - cls = DcaeLibrary() - #dict = cls.create_header_from_string(dictStr) - #print str(dict) - jsonStr = "[{'Node': 'onapfcnsl00', 'CheckID': 'serfHealth', 'Name': 'Serf Health Status', 'ServiceName': '', 'Notes': '', 'ModifyIndex': 6, 'Status': 'passing', 'ServiceID': '', 'ServiceTags': [], 'Output': 'Agent alive and reachable', 'CreateIndex': 6}]" - lsObj = cls.get_json_value_list(jsonStr, 'Status') - print lsObj - ''' - - lib = DcaeLibrary() - lib.enable_vesc_https_auth() - - ret = lib.setup_dmaap_server() - print ret - time.sleep(100000) diff --git a/tests/dcaegen2/testcases/resources/collector.properties b/tests/dcaegen2/testcases/resources/collector_basic_auth.properties index 71a38737..cd417635 100755 --- a/tests/dcaegen2/testcases/resources/collector.properties +++ b/tests/dcaegen2/testcases/resources/collector_basic_auth.properties @@ -50,8 +50,18 @@ collector.truststore.passwordfile=etc/trustpasswordfile collector.schema.checkflag=1 collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2_ONAP.json\"} -## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile -collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|stndDefined=ves-other +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.checkflag=1 +collector.externalSchema.schemasLocation=./etc/externalRepo/ +collector.externalSchema.mappingFileLocation=./etc/externalRepo/schema-map.json +event.externalSchema.schemaRefPath=/event/stndDefinedFields/schemaReference +event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance collector.dmaapfile=./etc/DmaapConfig.json ## Event transformation Flag - when set expects configurable transformation diff --git a/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties b/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties new file mode 100644 index 00000000..9712dff5 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties @@ -0,0 +1,73 @@ +############################################################################### +## +## Collector Server config +## +## - Default values are shown as commented settings. +## +############################################################################### +## +## HTTP(S) service +## +## Normally: +## +## - 8080 is http service +## - https is disabled by default +## +## - At this time, the server always binds to 0.0.0.0 +## +## +collector.service.port=8080 + +## Authentication is only supported via secure port +## When enabled - require valid keystore defined +collector.service.secure.port=8443 + +# auth.method flags: +# +# noAuth - default option - no security (http) +# certBasicAuth - auth by certificate and basic auth username / password (https) +auth.method=certBasicAuth + +## Combination of userid,hashPassword encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +## Password is generated by crypt-password library using BCrypt algorithm stored in dcaegen2/sdk package +## or https://nexus.onap.org/#nexus-search;quick~crypt-password +header.authlist=sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6 + +## The keystore must be setup per installation when secure port is configured +collector.keystore.file.location=etc/keystore +collector.keystore.passwordfile=etc/passwordfile + +collector.cert.subject.matcher=etc/certSubjectMatcher.properties + +## The truststore must be setup per installation when mutual tls support is configured +collector.truststore.file.location=etc/truststore +collector.truststore.passwordfile=etc/trustpasswordfile + +## Schema Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schemafile location must be specified +collector.schema.checkflag=1 +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2_ONAP.json\"} + +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.checkflag=-1 +collector.externalSchema.schemasLocation=./etc/externalRepo/ +collector.externalSchema.mappingFileLocation=./etc/externalRepo/schema-map.json +event.externalSchema.schemaRefPath=/event/stndDefinedFields/schemaReference +event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance +collector.dmaapfile=./etc/DmaapConfig.json + +## Event transformation Flag - when set expects configurable transformation +## defined under ./etc/eventTransform.json +## Enabled by default; to disable set to 0 +event.transform.flag=1 + +# Describes at what frequency (measured in minutes) should application try to fetch config from CBS +collector.dynamic.config.update.frequency=5 diff --git a/tests/dcaegen2/testcases/resources/dcae_keywords.robot b/tests/dcaegen2/testcases/resources/dcae_keywords.robot index 059372fb..b45ee57d 100644 --- a/tests/dcaegen2/testcases/resources/dcae_keywords.robot +++ b/tests/dcaegen2/testcases/resources/dcae_keywords.robot @@ -1,13 +1,14 @@ *** Settings *** Documentation The main interface for interacting with DCAE. It handles low level stuff like managing the http request library and DCAE required fields +Library robot_library.DcaeLibrary +Library robot_library.DmaapLibrary +Library robot_library.CertsLibrary Library RequestsLibrary -Library DcaeLibrary Library OperatingSystem Library Collections -Library CertsLibrary -Variables ../resources/DcaeVariables.py +Variables ./robot_library/DcaeVariables.py Resource ../../../common.robot -Resource ../resources/dcae_properties.robot +Resource ./dcae_properties.robot *** Keywords *** Create sessions @@ -139,8 +140,15 @@ Publish Event To VES Collector With Put Method ${resp}= Put Request ${session} ${evtpath} data=${evtdata} headers=${suite_headers} [Return] ${resp} +Send Request And Validate Response And Error Message + [Documentation] Post single event to passed url and validate received response code and content + [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_content} + ${resp}= Send Request And Validate Response ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} + ${error_message}= Set Variable ${resp.json()['requestError']['ServiceException']['text']} + Should Be Equal As Strings ${msg_content} ${error_message} + Send Request And Validate Response - [Documentation] Post singel event to passed url with passed data and validate received response + [Documentation] Post single event to passed url with passed data and validate received response [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None ${topic}=None ${evtdata}= Get Data From File ${evtjson} ${resp}= Run Keyword ${keyword} ${session} ${evtpath} ${evtdata} @@ -149,9 +157,10 @@ Send Request And Validate Response ${isEmpty}= Is Json Empty ${resp} Run Keyword If '${isEmpty}' == False Log ${resp.json()} Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} ${topic} + [Return] ${resp} Check Whether Message Received - [Documentation] Validare if message has been received + [Documentation] Validate if message has been received [Arguments] ${msg_code} ${topic} ${ret}= Run Keyword If '${topic}' != 'None' DMaaP Message Receive On Topic ${msg_code} ${topic} ... ELSE DMaaP Message Receive ${msg_code} diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index e9626411..65eba841 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -46,6 +46,20 @@ ${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/tests/dcaegen2/testcases/a ${EVENT_PNF_REGISTRATION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json ${EVENT_PNF_REGISTRATION_V7} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_pnf_registration_event.json ${DCAE_HEALTH_CHECK_BODY} %{WORKSPACE}/tests/dcae/testcases/assets/json_events/dcae_healthcheck.json +${VES_STND_DEFINED_EMPTY_NAMESPACE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_namespace.json +${VES_STND_DEFINED_MISSING_NAMESPACE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_missing_namespace.json +${VES_NAMESPACE_3GPP_PROVISIONING_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning_missing_sourceName.json +${VES_STND_DEFINED_3GPP_PROVISIONING} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Provisioning.json +${VES_STND_DEFINED_3GPP_HEARTBEAT} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-Heartbeat.json +${VES_STND_DEFINED_3GPP_FAULTSUPERVISION} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-FaultSupervision.json +${VES_STND_DEFINED_3GPP_PERFORMANCE_ASSURANCE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_3GPP-PerformanceAssurance.json +${VES_STND_DEFINED_EMPTY_DATA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_empty_data_fields.json +${VES_STND_DEFINED_INVALID_DATA_NO_SCHEMA_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_data_fields_no_schema_ref.json +${VES_STND_DEFINED_INCORRECT_SCHEMA_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_incorrect_schema_ref.json +${VES_STND_DEFINED_NO_VALUE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_no_value.json +${VES_STND_DEFINED_INVALID_TYPE_DATA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json +${VES_CERT_BASIC_AUTH_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_basic_auth.properties +${VES_DISABLED_STNDDEFINED_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties #DCAE Health Check ${CONFIG_BINDING_URL} http://localhost:8443 diff --git a/tests/dcaegen2/testcases/resources/override_collector_properties.sh b/tests/dcaegen2/testcases/resources/override_collector_properties.sh new file mode 100755 index 00000000..f6a46e13 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/override_collector_properties.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +if [ $# -ne 1 ]; then + echo "Incorrect number of parameters" + exit 1 +fi + +LOCAL_COLLECTOR_PROPERTIES_PATH=$1 +FILENAME=$(basename $LOCAL_COLLECTOR_PROPERTIES_PATH) +ETC_PATH=/opt/app/VESCollector/etc +APP_CONTROLLER_PATH=/opt/app/VESCollector/bin/appController.sh + +docker exec vesc $APP_CONTROLLER_PATH stop +sleep 2 +docker cp $LOCAL_COLLECTOR_PROPERTIES_PATH vesc:$ETC_PATH +sleep 10 +docker exec vesc mv $ETC_PATH/$FILENAME $ETC_PATH/collector.properties +docker exec vesc $APP_CONTROLLER_PATH start +sleep 5 +echo "VES Collector Restarted with overridden collector.properties" diff --git a/tests/dcaegen2/testcases/resources/CertsLibrary.py b/tests/dcaegen2/testcases/resources/robot_library/CertsLibrary.py index b8189422..b8189422 100644 --- a/tests/dcaegen2/testcases/resources/CertsLibrary.py +++ b/tests/dcaegen2/testcases/resources/robot_library/CertsLibrary.py diff --git a/tests/dcaegen2/testcases/resources/robot_library/DcaeLibrary.py b/tests/dcaegen2/testcases/resources/robot_library/DcaeLibrary.py new file mode 100644 index 00000000..d5dd9721 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/DcaeLibrary.py @@ -0,0 +1,112 @@ +''' +Created on Aug 18, 2017 + +@author: sw6830 +''' +from robot.api import logger +import uuid +import time +import datetime +import json +import os +import platform +import subprocess +import paramiko + + +class DcaeLibrary(object): + + def __init__(self): + pass + + @staticmethod + def override_collector_properties(properties_path): + global client + if 'Windows' in platform.system(): + try: + DcaeLibrary.change_properties_for_windows_platform_system(properties_path) + finally: + client.close() + return + DcaeLibrary.change_properties_for_non_windows_platform_system(properties_path) + return + + @staticmethod + def change_properties_for_non_windows_platform_system(properties_path): + ws = os.environ['WORKSPACE'] + script2run = ws + '/tests/dcaegen2/testcases/resources/override_collector_properties.sh' + logger.info("Running script: " + script2run) + logger.console("Running script: " + script2run) + subprocess.call([script2run, properties_path]) + time.sleep(5) + + @staticmethod + def change_properties_for_windows_platform_system(properties_path): + global client + client = paramiko.SSHClient() + client.load_system_host_keys() + client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + client.connect(os.environ['CSIT_IP'], port=22, username=os.environ['CSIT_USER'], password=os.environ['CSIT_PD']) + stdin, stdout, stderr = client.exec_command( + '%{WORKSPACE}' + '/tests/dcaegen2/testcases/resources/override_collector_properties.sh', properties_path) + logger.console(stdout.read()) + + @staticmethod + def is_json_empty(resp): + logger.info("Enter is_json_empty: resp.text: " + resp.text) + if resp.text is None or len(resp.text) < 2: + return 'True' + return 'False' + + @staticmethod + def generate_uuid(): + """generate a uuid""" + return uuid.uuid4() + + @staticmethod + def get_json_value_list(jsonstr, keyval): + logger.info("Enter Get_Json_Key_Value_List") + if jsonstr is None or len(jsonstr) < 2: + logger.info("No Json data found") + return [] + try: + return DcaeLibrary.extract_list_of_items_from_json_string(jsonstr, keyval) + except Exception as e: + logger.info("Json data parsing fails") + print str(e) + return [] + + @staticmethod + def extract_list_of_items_from_json_string(jsonstr, keyval): + data = json.loads(jsonstr) + nodelist = [] + for item in data: + nodelist.append(item[keyval]) + return nodelist + + @staticmethod + def generate_millitimestamp_uuid(): + """generate a millisecond timestamp uuid""" + then = datetime.datetime.now() + return int(time.mktime(then.timetuple())*1e3 + then.microsecond/1e3) + + @staticmethod + def test(): + import json + from pprint import pprint + + with open('robot/assets/dcae/ves_volte_single_fault_event.json') as data_file: + data = json.load(data_file) + + data['event']['commonEventHeader']['version'] = '5.0' + pprint(data) + + +if __name__ == '__main__': + + lib = DcaeLibrary() + lib.enable_vesc_https_auth() + + ret = lib.setup_dmaap_server() + print ret + time.sleep(100000) diff --git a/tests/dcaegen2/testcases/resources/DcaeVariables.py b/tests/dcaegen2/testcases/resources/robot_library/DcaeVariables.py index 84d06ae0..47d169f1 100644 --- a/tests/dcaegen2/testcases/resources/DcaeVariables.py +++ b/tests/dcaegen2/testcases/resources/robot_library/DcaeVariables.py @@ -8,10 +8,6 @@ def get_environment_variable(env_varstr): DCAE_HEALTH_CHECK_URL = "http://135.205.228.129:8500" DCAE_HEALTH_CHECK_URL1 = "http://135.205.228.170:8500" -CommonEventSchema = get_environment_variable('WORKSPACE') + "/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.1.1.json" +CommonEventSchema = get_environment_variable('WORKSPACE') + "/tests/dcaegen2/testcases/assets/json_events/CommonEventFormat_30.2_ONAP.json" -HttpServerThread = None -HTTPD = None -VESEventQ = None IsRobotRun = False - diff --git a/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py b/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py new file mode 100644 index 00000000..c9a0ff7b --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py @@ -0,0 +1,79 @@ +from Queue import Queue + +import robot.api.logger as logger +import threading +import time + +import DcaeVariables +from robot_library.dmaap_simulator import DMaaPServer +from robot_library.dmaap_simulator.DMaaPQueue import DMaaPQueue + +class DmaapLibrary(object): + + dmaap_queue = None + dmaap_server = None + server_thread = None + + def __init__(self): + pass + + @staticmethod + def setup_dmaap_server(port_num=3904): + try: + DmaapLibrary.start_dmaap_server_on_new_thread(port_num) + return "true" + except Exception as e: + print (str(e)) + return "false" + + @staticmethod + def start_dmaap_server_on_new_thread(port_num): + DmaapLibrary.dmaap_queue = DMaaPQueue(Queue()) + DmaapLibrary.dmaap_server = DMaaPServer.create_dmaap_server(DmaapLibrary.dmaap_queue, port=port_num) + DmaapLibrary.server_thread = threading.Thread(name='DMAAP_HTTPServer', + target=DmaapLibrary.dmaap_server.serve_forever) + DmaapLibrary.server_thread.start() + logger.console("DMaaP Mockup Sever started") + DcaeVariables.IsRobotRun = True + time.sleep(2) + + @staticmethod + def shutdown_dmaap(): + if DmaapLibrary.dmaap_server is not None: + DmaapLibrary.dmaap_server.shutdown() + logger.console("DMaaP Server shut down") + time.sleep(3) + return "true" + else: + return "false" + + @staticmethod + def cleanup_ves_events(): + if DmaapLibrary.server_thread is not None: + DmaapLibrary.dmaap_queue.clean_up_event() + logger.console("DMaaP event queue is cleaned up") + return "true" + logger.console("DMaaP server not started yet") + return "false" + + @staticmethod + def dmaap_message_receive_on_topic(evtobj, topic): + + evt_str = DmaapLibrary.dmaap_queue.deque_event() + while evt_str != None: + if evtobj in evt_str and topic in evt_str: + logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) + logger.info("On Expected Topic:\n" + topic) + return 'true' + evt_str = DmaapLibrary.dmaap_queue.deque_event() + return 'false' + + @staticmethod + def dmaap_message_receive(evtobj): + evt_str = DmaapLibrary.dmaap_queue.deque_event() + while evt_str != None: + if evtobj in evt_str: + logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str) + return 'true' + evt_str = DmaapLibrary.dmaap_queue.deque_event() + return 'false' diff --git a/tests/dcaegen2/testcases/resources/robot_library/README.md b/tests/dcaegen2/testcases/resources/robot_library/README.md new file mode 100644 index 00000000..ac432f79 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/README.md @@ -0,0 +1,14 @@ +# Robot Library +This catalog contains python files used in Robot tests for dcaegen2.ves. + +# DMaaP Simulator +Catalog dmaap_simulator contains python implementation of DMaaP simulator. It uses python BaseHTTPServer to expose endpoints. + +# DMaaP Tests +Catalog dmaap_test contains tests that are used to validate DMaaP simulator. Test are using "pytest" and "MagicMock". + +### In order to run tests: +1. create virtual environemnt with Python 2.7; +2. install requirements from file requirements.txt located in dmaap_test; +3. set environement variable WORKSPACE to point root csit catalog +4. run py.test command in catalog dmaap_test diff --git a/tests/dcaegen2/testcases/resources/robot_library/__init__.py b/tests/dcaegen2/testcases/resources/robot_library/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/__init__.py diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py new file mode 100644 index 00000000..f1c46e19 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py @@ -0,0 +1,73 @@ +''' +Created on Aug 15, 2017 + +@author: sw6830 +''' +import os +import posixpath +import BaseHTTPServer +import urllib +import urlparse +import cgi +import sys +import shutil +import mimetypes +from robot_library import DcaeVariables + +try: + from cStringIO import StringIO +except ImportError: + from StringIO import StringIO + + +class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): + + def __init__(self, dmaap_simulator, *args): + self.dmaap_simulator = dmaap_simulator + BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args) + + def do_POST(self): + if 'POST' not in self.requestline: + resp_code = 405 + else: + resp_code = self.parse_the_posted_data() + + if resp_code == 0: + self.send_successful_response() + else: + self.send_response(resp_code) + + def parse_the_posted_data(self): + topic = self.extract_topic_from_path() + content_len = self.get_content_length() + post_body = self.rfile.read(content_len) + post_body = self.get_json_part_of_post_body(post_body) + event = "{\"" + topic + "\":" + post_body + "}" + if self.dmaap_simulator.enque_event(event): + resp_code = 0 + else: + print "enque event fails" + resp_code = 500 + return resp_code + + def get_json_part_of_post_body(self, post_body): + indx = post_body.index("{") + if indx != 0: + post_body = post_body[indx:] + return post_body + + def extract_topic_from_path(self): + return self.path["/events/".__len__():] + + def get_content_length(self): + return int(self.headers.getheader('content-length', 0)) + + def send_successful_response(self): + if 'clientThrottlingState' in self.requestline: + self.send_response(204) + else: + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + self.wfile.write("{'count': 1, 'serverTimeMs': 3}") + self.wfile.close() diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPQueue.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPQueue.py new file mode 100644 index 00000000..3d3a81fa --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPQueue.py @@ -0,0 +1,48 @@ +class DMaaPQueue(object): + + def __init__(self, event_queue, wait_timeout_sec=25): + self.event_queue = event_queue + self.wait_timeout_sec = wait_timeout_sec + + def set_deque_event_timeout(self, wait_timeout_sec): + self.wait_timeout_sec = wait_timeout_sec + + def clean_up_event(self): + if self.queue_is_valid(): + with self.event_queue.mutex: + try: + self.event_queue.queue.clear() + except: + pass + + def enque_event(self, event): + event_placed_on_queue = False + if self.queue_is_valid(): + event_placed_on_queue = self._enque_event(event, event_placed_on_queue) + return event_placed_on_queue + + def _enque_event(self, event, event_placed_on_queue): + try: + self.event_queue.put(event) + event_placed_on_queue = True + except Exception as e: + print (str(e)) + return event_placed_on_queue + + def deque_event(self, wait_sec=None): + if wait_sec is None: + wait_sec = self.wait_timeout_sec + event_from_queue = None + if self.queue_is_valid(): + event_from_queue = self._deque_event(event_from_queue, wait_sec) + return event_from_queue + + def _deque_event(self, event_from_queue, wait_sec): + try: + event_from_queue = self.event_queue.get(True, wait_sec) + except Exception as e: + print("DMaaP Event dequeue timeout") + return event_from_queue + + def queue_is_valid(self): + return self.event_queue is not None diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py new file mode 100644 index 00000000..37499be8 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py @@ -0,0 +1,22 @@ +import BaseHTTPServer +import DMaaPHandler + + +class DMaaPServer(BaseHTTPServer.HTTPServer): + + def __init__(self, server_address, protocol, dmaap_simulator): + + def handler_class_constructor(*args): + DMaaPHandler.DMaaPHandler(dmaap_simulator, *args) + DMaaPHandler.protocol_version = protocol + BaseHTTPServer.HTTPServer.__init__(self, server_address, handler_class_constructor) + + serer_address = self.socket.getsockname() + print "Serving HTTP on", serer_address[0], "port", serer_address[1], "..." + + +def create_dmaap_server(dmaap_simulator, protocol="HTTP/1.0", port=3904): + server_address = ('', port) + httpd = DMaaPServer(server_address, protocol, dmaap_simulator) + + return httpd diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/__init__.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/__init__.py diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/__init__.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/__init__.py diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/requirements.txt b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/requirements.txt new file mode 100644 index 00000000..7a687204 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/requirements.txt @@ -0,0 +1,23 @@ +atomicwrites==1.4.0 +attrs==19.3.0 +backports.functools-lru-cache==1.6.1 +configparser==4.0.2 +contextlib2==0.6.0.post1 +funcsigs==1.0.2 +httplib2==0.18.1 +importlib-metadata==1.7.0 +magicmock==0.3 +mock==3.0.5 +mocker==1.1.1 +more-itertools==5.0.0 +packaging==20.4 +pathlib2==2.3.5 +pluggy==0.13.1 +py==1.9.0 +pyparsing==2.4.7 +pytest==4.6.11 +pytest-mock==2.0.0 +scandir==1.10.0 +six==1.15.0 +wcwidth==0.2.5 +zipp==1.2.0 diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSQueue.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSQueue.py new file mode 100644 index 00000000..f278a391 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSQueue.py @@ -0,0 +1,52 @@ +from Queue import Queue +import pytest +from robot_library.dmaap_simulator.DMaaPQueue import DMaaPQueue + +wait_sec_for_dequeing_event = 0.1 +test_event = "\"topic\":{\"test\":123}" + + +class TestDMaaPQueue: + + dmaap_simulator = None + + @pytest.fixture(autouse=True, scope="function") + def initiate_dmaap_simulator(self): + TestDMaaPQueue.dmaap_simulator = DMaaPQueue(Queue()) + TestDMaaPQueue.dmaap_simulator.set_deque_event_timeout(wait_sec_for_dequeing_event) + yield + + def test_when_queue_is_empty_then_deque_returns_none(self): + # when + event = TestDMaaPQueue.dmaap_simulator.deque_event() + + # then + assert event is None + + def test_when_enque_event_then_dequeue_return_same_event(self): + # when + TestDMaaPQueue.dmaap_simulator.enque_event(test_event) + event = TestDMaaPQueue.dmaap_simulator.deque_event() + + # then + assert event == test_event + + def test_when_enque_and_dequeue_event_then_deque_return_none(self): + # when + TestDMaaPQueue.dmaap_simulator.enque_event(test_event) + TestDMaaPQueue.dmaap_simulator.deque_event() + event = TestDMaaPQueue.dmaap_simulator.deque_event() + + # then + assert event is None + + def test_when_enque_few_events_and_clean_up_then_dequeu_return_none(self): + # when + TestDMaaPQueue.dmaap_simulator.enque_event(test_event) + TestDMaaPQueue.dmaap_simulator.enque_event(test_event) + TestDMaaPQueue.dmaap_simulator.enque_event(test_event) + TestDMaaPQueue.dmaap_simulator.clean_up_event() + event = TestDMaaPQueue.dmaap_simulator.deque_event() + + # then + assert event is None diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSimulator.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSimulator.py new file mode 100644 index 00000000..82f95ff8 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_test/test_DMaaPSimulator.py @@ -0,0 +1,62 @@ +import sys +import pytest +from mock import MagicMock + +sys.modules['robot'] = MagicMock() +sys.modules['robot.api'] = MagicMock() +sys.modules['robot.api.logger'] = MagicMock() +from robot_library.DmaapLibrary import DmaapLibrary + +wait_sec_for_dequeing_event = 0.1 +test_event = "{\"test\":\"123\"}" +test_topic = "topic" +test_message = "\"" + test_topic + "\":" + test_event + + +class TestDMaaPSimulator: + + @pytest.fixture(autouse=True, scope="class") + def initiate_dmaap_simulator(self): + DmaapLibrary.setup_dmaap_server() + DmaapLibrary.dmaap_queue.set_deque_event_timeout(wait_sec_for_dequeing_event) + yield + assert DmaapLibrary.shutdown_dmaap() == "true" + + @pytest.fixture(autouse=True, scope="function") + def clear_dmaap_simulator(self): + yield + DmaapLibrary.cleanup_ves_events() + + def test_start_stop_dmaap_server(self): + # when / then + assert DmaapLibrary.dmaap_queue is not None + assert DmaapLibrary.dmaap_server is not None + assert DmaapLibrary.server_thread is not None + + def test_dmaap_server_returns_true_when_event_is_present_on_queue(self): + # when + DmaapLibrary.dmaap_queue.enque_event(test_message) + + # then + assert DmaapLibrary.dmaap_message_receive(test_event) == 'true' + + def test_dmaap_server_returns_true_when_event_is_present_on_given_topic_on_queue(self): + # when + DmaapLibrary.dmaap_queue.enque_event(test_message) + + # then + assert DmaapLibrary.dmaap_message_receive_on_topic(test_event, test_topic) == 'true' + + def test_dmaap_server_returns_timeout_when_event_is_not_present_on_queue(self): + # when / then + assert DmaapLibrary.dmaap_message_receive(test_event) == 'false' + + def test_dmaap_server_returns_false_when_queue_was_cleared(self): + # when + DmaapLibrary.dmaap_queue.enque_event(test_message) + DmaapLibrary.dmaap_queue.enque_event(test_message) + DmaapLibrary.dmaap_queue.enque_event(test_message) + DmaapLibrary.cleanup_ves_events() + + # then + assert DmaapLibrary.dmaap_message_receive_on_topic(test_event, test_topic) == 'false' diff --git a/tests/aaf/certservice/assets/invalid.csr b/tests/oom-platform-cert-service/certservice/assets/invalid.csr index 7284ab4d..7284ab4d 100644 --- a/tests/aaf/certservice/assets/invalid.csr +++ b/tests/oom-platform-cert-service/certservice/assets/invalid.csr diff --git a/tests/aaf/certservice/assets/invalid.key b/tests/oom-platform-cert-service/certservice/assets/invalid.key index 6484fb6f..6484fb6f 100644 --- a/tests/aaf/certservice/assets/invalid.key +++ b/tests/oom-platform-cert-service/certservice/assets/invalid.key diff --git a/tests/aaf/certservice/assets/invalid_client_docker.env b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env index e96237ca..4f19a9e7 100644 --- a/tests/aaf/certservice/assets/invalid_client_docker.env +++ b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env @@ -2,9 +2,9 @@ REQUEST_TIMEOUT=5000 OUTPUT_PATH=/var/certs CA_NAME=Invalid -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/invalid_client_docker_output_type.env b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env index cff46646..4cdcd9ed 100644 --- a/tests/aaf/certservice/assets/invalid_client_docker_output_type.env +++ b/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env @@ -3,9 +3,9 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA OUTPUT_TYPE=INV -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/valid_client.csr b/tests/oom-platform-cert-service/certservice/assets/valid_client.csr index 59e5c6af..59e5c6af 100644 --- a/tests/aaf/certservice/assets/valid_client.csr +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client.csr diff --git a/tests/aaf/certservice/assets/valid_client.pk b/tests/oom-platform-cert-service/certservice/assets/valid_client.pk index c84908ff..c84908ff 100644 --- a/tests/aaf/certservice/assets/valid_client.pk +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client.pk diff --git a/tests/aaf/certservice/assets/valid_client_docker.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env index 55fefa3e..6fad6d21 100644 --- a/tests/aaf/certservice/assets/valid_client_docker.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env @@ -2,9 +2,9 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/valid_client_docker_jks.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env index 19de0750..0e2d8367 100644 --- a/tests/aaf/certservice/assets/valid_client_docker_jks.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env @@ -3,9 +3,9 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA OUTPUT_TYPE=JKS -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/valid_client_docker_p12.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env index 0f1cfc28..c3ed729f 100644 --- a/tests/aaf/certservice/assets/valid_client_docker_p12.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env @@ -3,9 +3,9 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA OUTPUT_TYPE=P12 -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/valid_client_docker_pem.env b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env index f704f21e..aca2a54b 100644 --- a/tests/aaf/certservice/assets/valid_client_docker_pem.env +++ b/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env @@ -3,9 +3,9 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA OUTPUT_TYPE=PEM -KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks +KEYSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret -TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks +TRUSTSTORE_PATH=/etc/onap/oom-platform-cert-service/certservice/certs/truststore.jks TRUSTSTORE_PASSWORD=secret #Csr config envs COMMON_NAME=onap.org diff --git a/tests/aaf/certservice/assets/valid_ra.csr b/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr index 5decd8ee..5decd8ee 100644 --- a/tests/aaf/certservice/assets/valid_ra.csr +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr diff --git a/tests/aaf/certservice/assets/valid_ra.pk b/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk index b1ad633a..b1ad633a 100644 --- a/tests/aaf/certservice/assets/valid_ra.pk +++ b/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk diff --git a/tests/aaf/certservice/cert-service-test.robot b/tests/oom-platform-cert-service/certservice/cert-service-test.robot index ddf7a174..58e8a7e3 100644 --- a/tests/aaf/certservice/cert-service-test.robot +++ b/tests/oom-platform-cert-service/certservice/cert-service-test.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation AAF Cert Service API test case scenarios +Documentation OOM Cert Service API test case scenarios Library RequestsLibrary Resource ./resources/cert-service-keywords.robot @@ -9,82 +9,82 @@ Suite Setup Create sessions *** Test Cases *** Health Check - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Service is up and running Run health check Reload Configuration - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Configuration was changed Send Get Request And Validate Response /reload 200 Check if application is ready - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request to /ready endpoint and expect 200 Send Get Request And Validate Response /ready 200 Generate Certificate In RA Mode For CA Name - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} endpoint and expect 200 Send Get Request with Header And Expect Success ${CERT_SERVICE_ENDPOINT}${RA_CA_NAME} ${VALID_RA_CSR_FILE} ${VALID_RA_PK_FILE} Report Not Found Error When Path To Service Is Not Valid - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT} endpoint and expect 404 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT} ${VALID_CLIENT_CSR_FILE} ${VALID_CLIENT_PK_FILE} 404 Report Bad Request Error When Header Is Missing In Request - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request without header to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400 Send Get Request And Validate Response ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} 400 Report Bad Request Error When CSR Is Not Valid - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} ${INVALID_CSR_FILE} ${VALID_CLIENT_PK_FILE} 400 Report Bad Request Error When PK Is Not Valid - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Send request to ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} endpoint and expect 400 Send Get Request with Header And Expect Error ${CERT_SERVICE_ENDPOINT}${CLIENT_CA_NAME} ${VALID_CLIENT_CSR_FILE} ${INVALID_PK_FILE} 400 Cert Service Client successfully creates keystore.p12 and truststore.p12 - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and expected exit code 0 Run Cert Service Client And Validate PKCS12 File Creation And Client Exit Code ${VALID_ENV_FILE} 0 Cert Service Client successfully creates keystore.jks and truststore.jks - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and expected exit code 0 Run Cert Service Client And Validate JKS File Creation And Client Exit Code ${VALID_ENV_FILE_JKS} 0 Cert Service Client successfully creates keystore and truststore with expected data with no OUTPUT_TYPE - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and PKCS12 files created with correct data Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE} 0 Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=JKS - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and JKS files created with correct data Run Cert Service Client And Validate JKS Files Contain Expected Data ${VALID_ENV_FILE_JKS} 0 Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=P12 - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and PKCS12 files created with correct data Run Cert Service Client And Validate PKCS12 Files Contain Expected Data ${VALID_ENV_FILE_P12} 0 Cert Service Client successfully creates keystore and truststore with expected data with OUTPUT_TYPE=PEM - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with correct env and PEM files created with correct data Run Cert Service Client And Validate PEM Files Contain Expected Data ${VALID_ENV_FILE_PEM} 0 Cert Service Client reports error when OUTPUT_TYPE is invalid - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with invalid OUTPUT_TYPE env and expected exit code 1 Run Cert Service Client And Validate Client Exit Code ${INVALID_ENV_FILE_OUTPUT_TYPE} 1 Run Cert Service Client Container And Validate Exit Code And API Response - [Tags] AAF-CERT-SERVICE + [Tags] OOM-CERT-SERVICE [Documentation] Run with invalid CaName env and expected exit code 5 Run Cert Service Client And Validate Http Response Code And Client Exit Code ${INVALID_ENV_FILE} 404 5 diff --git a/tests/aaf/certservice/libraries/ArtifactParser.py b/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py index 54e8d0ff..54e8d0ff 100644 --- a/tests/aaf/certservice/libraries/ArtifactParser.py +++ b/tests/oom-platform-cert-service/certservice/libraries/ArtifactParser.py diff --git a/tests/aaf/certservice/libraries/CertClientManager.py b/tests/oom-platform-cert-service/certservice/libraries/CertClientManager.py index a4a0df23..46d69bb8 100644 --- a/tests/aaf/certservice/libraries/CertClientManager.py +++ b/tests/oom-platform-cert-service/certservice/libraries/CertClientManager.py @@ -29,7 +29,7 @@ class CertClientManager: network=network, user='root', # Run container as root to avoid permission issues with volume mount access mounts=[Mount(target='/var/certs', source=self.mount_path, type='bind'), - Mount(target='/etc/onap/aaf/certservice/certs/', source=self.truststore_path, type='bind')], + Mount(target='/etc/onap/oom-platform-cert-service/certservice/certs/', source=self.truststore_path, type='bind')], detach=True ) exitcode = container.wait() diff --git a/tests/aaf/certservice/libraries/EnvsReader.py b/tests/oom-platform-cert-service/certservice/libraries/EnvsReader.py index cc60eed6..cc60eed6 100644 --- a/tests/aaf/certservice/libraries/EnvsReader.py +++ b/tests/oom-platform-cert-service/certservice/libraries/EnvsReader.py diff --git a/tests/aaf/certservice/libraries/JksArtifactsValidator.py b/tests/oom-platform-cert-service/certservice/libraries/JksArtifactsValidator.py index e2fdde91..e2fdde91 100644 --- a/tests/aaf/certservice/libraries/JksArtifactsValidator.py +++ b/tests/oom-platform-cert-service/certservice/libraries/JksArtifactsValidator.py diff --git a/tests/aaf/certservice/libraries/P12ArtifactsValidator.py b/tests/oom-platform-cert-service/certservice/libraries/P12ArtifactsValidator.py index b0701718..b0701718 100644 --- a/tests/aaf/certservice/libraries/P12ArtifactsValidator.py +++ b/tests/oom-platform-cert-service/certservice/libraries/P12ArtifactsValidator.py diff --git a/tests/aaf/certservice/libraries/PemArtifactsValidator.py b/tests/oom-platform-cert-service/certservice/libraries/PemArtifactsValidator.py index 46e0357e..46e0357e 100644 --- a/tests/aaf/certservice/libraries/PemArtifactsValidator.py +++ b/tests/oom-platform-cert-service/certservice/libraries/PemArtifactsValidator.py diff --git a/tests/aaf/certservice/resources/cert-service-keywords.robot b/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot index 39c26a6a..fea210b5 100644 --- a/tests/aaf/certservice/resources/cert-service-keywords.robot +++ b/tests/oom-platform-cert-service/certservice/resources/cert-service-keywords.robot @@ -15,7 +15,7 @@ Library ../libraries/PemArtifactsValidator.py ${MOUNT_PATH} Create sessions [Documentation] Create all required sessions ${certs}= Create List ${CERTSERVICE_SERVER_CRT} ${CERTSERVICE_SERVER_KEY} - Create Client Cert Session alias ${AAFCERT_URL} client_certs=${certs} verify=${ROOTCA} + Create Client Cert Session alias ${OOMCERT_URL} client_certs=${certs} verify=${ROOTCA} Set Suite Variable ${https_valid_cert_session} alias Run Healthcheck diff --git a/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot b/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot new file mode 100644 index 00000000..ff0500a2 --- /dev/null +++ b/tests/oom-platform-cert-service/certservice/resources/cert-service-properties.robot @@ -0,0 +1,31 @@ +*** Variables *** + +${CERT_SERVICE_CONTAINER_NAME} oom-cert-service +${CERT_SERVICE_PORT} 8443 +${OOMCERT_URL} https://localhost:${cert_service_port} +${CLIENT_CA_NAME} Client +${RA_CA_NAME} RA +${CERT_SERVICE_ENDPOINT} /v1/certificate/ +${ROOTCA} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/root.crt +${CERTSERVICE_SERVER_CRT} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/certServiceServer.crt +${CERTSERVICE_SERVER_KEY} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/certs/certServiceServer.key +${VALID_CLIENT_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client.csr +${VALID_CLIENT_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client.pk +${VALID_RA_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra.csr +${VALID_RA_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_ra.pk +${INVALID_CSR_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid.csr +${INVALID_PK_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid.key + + +${CERT_SERVICE_ADDRESS} https://${CERT_SERVICE_CONTAINER_NAME}:${CERT_SERVICE_PORT} +${VALID_ENV_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker.env +${VALID_ENV_FILE_JKS} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_jks.env +${VALID_ENV_FILE_P12} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_p12.env +${VALID_ENV_FILE_PEM} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/valid_client_docker_pem.env +${INVALID_ENV_FILE_OUTPUT_TYPE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker_output_type.env +${INVALID_ENV_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/assets/invalid_client_docker.env +${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-certservice-client:latest +${CLIENT_CONTAINER_NAME} %{ClientContainerName} +${CERT_SERVICE_NETWORK} certservice_certservice +${MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/certservice/tmp +${TRUSTSTORE_PATH} %{WORKSPACE}/plans/oom-platform-cert-service/certservice/certs diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks b/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks Binary files differnew file mode 100644 index 00000000..1c9f111a --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem b/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem new file mode 100644 index 00000000..978e682d --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem @@ -0,0 +1,63 @@ +-----BEGIN CERTIFICATE----- +MIIEszCCAxugAwIBAgIUZrzliCEcld8Q7Fa20QOooFrkewAwDQYJKoZIhvcNAQEL +BQAwYTEjMCEGCgmSJomT8ixkAQEME2MtMGI4NDYyNzkzMDkyYzFhZGYxFTATBgNV +BAMMDE1hbmFnZW1lbnRDQTEjMCEGA1UECgwaRUpCQ0EgQ29udGFpbmVyIFF1aWNr +c3RhcnQwHhcNMjAwNzE1MTI1NTI1WhcNMzAwNzE1MTI1NTI1WjBhMSMwIQYKCZIm +iZPyLGQBAQwTYy0wYjg0NjI3OTMwOTJjMWFkZjEVMBMGA1UEAwwMTWFuYWdlbWVu +dENBMSMwIQYDVQQKDBpFSkJDQSBDb250YWluZXIgUXVpY2tzdGFydDCCAaIwDQYJ +KoZIhvcNAQEBBQADggGPADCCAYoCggGBAPKU+p62gXve2rCo2ojyyKcy9T/yEZJi +9eZJoawets18FNKzWgXDz3ZK+dgc8hVHZahmIzfh9ovcEALYvCx1bLKN5tqbV7O0 +lUFGI+DGlP9QzGKopCh/uMXas4/lfVNogEB7cXu62ak6FuIuaKHETeqez5wC0d1d +KcilG4loaN3tGXn8j1rnUq1fVu4QyxYfDekRzFiLOvdGeYfZlMkGcVYq3jDV9/sH +5wKUKIxRwa+t1GlvzJqjVY6K3UvxS8ZBrNYTAtsvI/s6fd8Ah4FIM0Zsc8X1CIb4 +rxqhU6CDx1fQCgKyO6FG/3kVA9Y6+VLeRXsa/VaZxRwQWn0XfVrVpajiD+q3m9xd +/NJUEAu1xEyfZw43ZSduGjrf5pwHR871noo+7pEbTDlM92ktDFW3go1DowrhEUlf +XaU6C25yuzThl8f9pFD9/Bo82nHL5n8BENLCmaYrioVWQBAmrQKo1Y3uFgY+fP7y +CL1POlJTuoXO++KhnEvhGfiIVBlzwdBATwIDAQABo2MwYTAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFAZ6Sy3QQ0dNORdnfg5ppmOI6ngpMB0GA1UdDgQWBBQG +ekst0ENHTTkXZ34OaaZjiOp4KTAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL +BQADggGBAM8MyROdYt0458uCRM/8KZYU9q5xRDGXUGXVpEcGyu1hVlnzlnv7YJSX +BWQenl092IVM7B0hsttpQIAXK4lS3hQ1fTaYWub0TPbK7xORGwi2uTDEagWXMc5e +c2J6Sb9IFl2UqX8cERRCJNuENnuf10MU3rXa2TfydaELDXxr49KPPx3tgl/OfbtY +MmFWLiyxo1jIZ/LeIiaN1m0OtGskkR8TF2D/ZA7YPzEWl2R3PhYNR1gkfAtYPWya +DTXgiQwXuWDhdSTqiN3QuxRDVXFiQgoV0wqjgkqh4NiOXWB2ryaPvqiYRCvoM6Ly +OcYy4LidGz9J+jQGAJPh4fI/1G4SgwVAT0bgYREy4IP6Y8R4zGoU0rGKnknfL70E +t4Xm2ASu5jEcne2l1UOPPctFmei+QHmZ0c8V8HNmP5XRf+47OSi+ryCrRQfKrkyw +UgvoB49yV3M1+IgCx18daEQCYal98hhQMn/3NVrOJeOjzDcF6Gxb679Cu/biZ8Wx +li7RV0Xt1g== +-----END CERTIFICATE----- +Bag Attributes + friendlyName: trusted-certificate-1 + 2.16.840.1.113894.746875.1.1: <Unsupported tag 6> +subject=UID = c-0b8462793092c1adf, CN = ManagementCA, O = EJBCA Container Quickstart + +issuer=UID = c-0b8462793092c1adf, CN = ManagementCA, O = EJBCA Container Quickstart + +-----BEGIN CERTIFICATE----- +MIIEszCCAxugAwIBAgIUZrzliCEcld8Q7Fa20QOooFrkewAwDQYJKoZIhvcNAQEL +BQAwYTEjMCEGCgmSJomT8ixkAQEME2MtMGI4NDYyNzkzMDkyYzFhZGYxFTATBgNV +BAMMDE1hbmFnZW1lbnRDQTEjMCEGA1UECgwaRUpCQ0EgQ29udGFpbmVyIFF1aWNr +c3RhcnQwHhcNMjAwNzE1MTI1NTI1WhcNMzAwNzE1MTI1NTI1WjBhMSMwIQYKCZIm +iZPyLGQBAQwTYy0wYjg0NjI3OTMwOTJjMWFkZjEVMBMGA1UEAwwMTWFuYWdlbWVu +dENBMSMwIQYDVQQKDBpFSkJDQSBDb250YWluZXIgUXVpY2tzdGFydDCCAaIwDQYJ +KoZIhvcNAQEBBQADggGPADCCAYoCggGBAPKU+p62gXve2rCo2ojyyKcy9T/yEZJi +9eZJoawets18FNKzWgXDz3ZK+dgc8hVHZahmIzfh9ovcEALYvCx1bLKN5tqbV7O0 +lUFGI+DGlP9QzGKopCh/uMXas4/lfVNogEB7cXu62ak6FuIuaKHETeqez5wC0d1d +KcilG4loaN3tGXn8j1rnUq1fVu4QyxYfDekRzFiLOvdGeYfZlMkGcVYq3jDV9/sH +5wKUKIxRwa+t1GlvzJqjVY6K3UvxS8ZBrNYTAtsvI/s6fd8Ah4FIM0Zsc8X1CIb4 +rxqhU6CDx1fQCgKyO6FG/3kVA9Y6+VLeRXsa/VaZxRwQWn0XfVrVpajiD+q3m9xd +/NJUEAu1xEyfZw43ZSduGjrf5pwHR871noo+7pEbTDlM92ktDFW3go1DowrhEUlf +XaU6C25yuzThl8f9pFD9/Bo82nHL5n8BENLCmaYrioVWQBAmrQKo1Y3uFgY+fP7y +CL1POlJTuoXO++KhnEvhGfiIVBlzwdBATwIDAQABo2MwYTAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFAZ6Sy3QQ0dNORdnfg5ppmOI6ngpMB0GA1UdDgQWBBQG +ekst0ENHTTkXZ34OaaZjiOp4KTAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL +BQADggGBAM8MyROdYt0458uCRM/8KZYU9q5xRDGXUGXVpEcGyu1hVlnzlnv7YJSX +BWQenl092IVM7B0hsttpQIAXK4lS3hQ1fTaYWub0TPbK7xORGwi2uTDEagWXMc5e +c2J6Sb9IFl2UqX8cERRCJNuENnuf10MU3rXa2TfydaELDXxr49KPPx3tgl/OfbtY +MmFWLiyxo1jIZ/LeIiaN1m0OtGskkR8TF2D/ZA7YPzEWl2R3PhYNR1gkfAtYPWya +DTXgiQwXuWDhdSTqiN3QuxRDVXFiQgoV0wqjgkqh4NiOXWB2ryaPvqiYRCvoM6Ly +OcYy4LidGz9J+jQGAJPh4fI/1G4SgwVAT0bgYREy4IP6Y8R4zGoU0rGKnknfL70E +t4Xm2ASu5jEcne2l1UOPPctFmei+QHmZ0c8V8HNmP5XRf+47OSi+ryCrRQfKrkyw +UgvoB49yV3M1+IgCx18daEQCYal98hhQMn/3NVrOJeOjzDcF6Gxb679Cu/biZ8Wx +li7RV0Xt1g== +-----END CERTIFICATE----- diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env new file mode 100644 index 00000000..9edfaa41 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env new file mode 100644 index 00000000..f98b3366 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.jks +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:/var/certs/truststoreJks.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env new file mode 100644 index 00000000..95c00fc2 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/empty.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=:/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env new file mode 100644 index 00000000..840728bb --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS= diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env new file mode 100644 index 00000000..5b971616 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.txt:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env new file mode 100644 index 00000000..1a195116 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env new file mode 100644 index 00000000..b397f9ac --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks_invalid.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env new file mode 100644 index 00000000..52fa88c6 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/invalid/truststore.jks:/invalid/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass:/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/empty.pem b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/empty.pem new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/empty.pem diff --git a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/truststore/org.onap.so.trust.jks b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks Binary files differindex 88d61846..3bd85a06 100755..100644 --- a/plans/usecases-pnf-sw-upgrade/pnf-sw-upgrade/sorch/simulator/aai-simulator/src/main/resources/truststore/org.onap.so.trust.jks +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 Binary files differnew file mode 100644 index 00000000..3a98c4a2 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem new file mode 100644 index 00000000..8815d6cb --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIEszCCAxugAwIBAgIUZrzliCEcld8Q7Fa20QOooFrkewAwDQYJKoZIhvcNAQEL +BQAwYTEjMCEGCgmSJomT8ixkAQEME2MtMGI4NDYyNzkzMDkyYzFhZGYxFTATBgNV +BAMMDE1hbmFnZW1lbnRDQTEjMCEGA1UECgwaRUpCQ0EgQ29udGFpbmVyIFF1aWNr +c3RhcnQwHhcNMjAwNzE1MTI1NTI1WhcNMzAwNzE1MTI1NTI1WjBhMSMwIQYKCZIm +iZPyLGQBAQwTYy0wYjg0NjI3OTMwOTJjMWFkZjEVMBMGA1UEAwwMTWFuYWdlbWVu +dENBMSMwIQYDVQQKDBpFSkJDQSBDb250YWluZXIgUXVpY2tzdGFydDCCAaIwDQYJ +KoZIhvcNAQEBBQADggGPADCCAYoCggGBAPKU+p62gXve2rCo2ojyyKcy9T/yEZJi +9eZJoawets18FNKzWgXDz3ZK+dgc8hVHZahmIzfh9ovcEALYvCx1bLKN5tqbV7O0 +lUFGI+DGlP9QzGKopCh/uMXas4/lfVNogEB7cXu62ak6FuIuaKHETeqez5wC0d1d +KcilG4loaN3tGXn8j1rnUq1fVu4QyxYfDekRzFiLOvdGeYfZlMkGcVYq3jDV9/sH +5wKUKIxRwa+t1GlvzJqjVY6K3UvxS8ZBrNYTAtsvI/s6fd8Ah4FIM0Zsc8X1CIb4 +rxqhU6CDx1fQCgKyO6FG/3kVA9Y6+VLeRXsa/VaZxRwQWn0XfVrVpajiD+q3m9xd +/NJUEAu1xEyfZw43ZSduGjrf5pwHR871noo+7pEbTDlM92ktDFW3go1DowrhEUlf +XaU6C25yuzThl8f9pFD9/Bo82nHL5n8BENLCmaYrioVWQBAmrQKo1Y3uFgY+fP7y +CL1POlJTuoXO++KhnEvhGfiIVBlzwdBATwIDAQABo2MwYTAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFAZ6Sy3QQ0dNORdnfg5ppmOI6ngpMB0GA1UdDgQWBBQG +ekst0ENHTTkXZ34OaaZjiOp4KTAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL +BQADggGBAM8MyROdYt0458uCRM/8KZYU9q5xRDGXUGXVpEcGyu1hVlnzlnv7YJSX +BWQenl092IVM7B0hsttpQIAXK4lS3hQ1fTaYWub0TPbK7xORGwi2uTDEagWXMc5e +c2J6Sb9IFl2UqX8cERRCJNuENnuf10MU3rXa2TfydaELDXxr49KPPx3tgl/OfbtY +MmFWLiyxo1jIZ/LeIiaN1m0OtGskkR8TF2D/ZA7YPzEWl2R3PhYNR1gkfAtYPWya +DTXgiQwXuWDhdSTqiN3QuxRDVXFiQgoV0wqjgkqh4NiOXWB2ryaPvqiYRCvoM6Ly +OcYy4LidGz9J+jQGAJPh4fI/1G4SgwVAT0bgYREy4IP6Y8R4zGoU0rGKnknfL70E +t4Xm2ASu5jEcne2l1UOPPctFmei+QHmZ0c8V8HNmP5XRf+47OSi+ryCrRQfKrkyw +UgvoB49yV3M1+IgCx18daEQCYal98hhQMn/3NVrOJeOjzDcF6Gxb679Cu/biZ8Wx +li7RV0Xt1g== +-----END CERTIFICATE----- diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass new file mode 100644 index 00000000..817b6194 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass @@ -0,0 +1 @@ +WkTGRmhSe%PM;it?NRY888Ak
\ No newline at end of file diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreP12.pass b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreP12.pass new file mode 100644 index 00000000..48036abd --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreP12.pass @@ -0,0 +1 @@ +0TZd_x#qp$78hJsm0wzc1dm_
\ No newline at end of file diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env b/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env new file mode 100644 index 00000000..4afa1a27 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks:/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass::/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env b/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env new file mode 100644 index 00000000..e0240a74 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.pem:/var/certs/truststore.p12 +TRUSTSTORES_PASSWORDS_PATHS=:/var/certs/truststoreP12.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env b/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env new file mode 100644 index 00000000..66b6f66f --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env @@ -0,0 +1,2 @@ +TRUSTSTORES_PATHS=/var/certs/truststore.jks +TRUSTSTORES_PASSWORDS_PATHS=/var/certs/truststoreJks.pass diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/EnvsReader.py b/tests/oom-platform-cert-service/truststoremerger/libraries/EnvsReader.py new file mode 100644 index 00000000..cc60eed6 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/libraries/EnvsReader.py @@ -0,0 +1,11 @@ + +class EnvsReader: + + def read_env_list_from_file(self, path): + f = open(path, "r") + r_list = [] + for line in f: + line = line.strip() + if line[0] != "#": + r_list.append(line) + return r_list diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py b/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py new file mode 100644 index 00000000..e18ca12c --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/libraries/JksTruststoreValidator.py @@ -0,0 +1,18 @@ + +import jks + +class JksTruststoreValidator: + + def get_truststore(self, truststore_path, password_path): + truststore = jks.KeyStore.load(truststore_path, open(password_path, 'rb').read()) + return truststore.certs + + def assert_jks_truststores_equal(self, result_truststore_path, password_path, expected_truststore_path): + result_certs = self.get_truststore(result_truststore_path, password_path) + expected_certs = self.get_truststore(expected_truststore_path, password_path) + if len(result_certs) != len(expected_certs): + return False + for k in result_certs: + if not (k in expected_certs and result_certs[k].cert == expected_certs[k].cert): + return False + return True diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/PemTruststoreValidator.py b/tests/oom-platform-cert-service/truststoremerger/libraries/PemTruststoreValidator.py new file mode 100644 index 00000000..8dc9623d --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/libraries/PemTruststoreValidator.py @@ -0,0 +1,19 @@ +import re + +BEGIN_CERT = "-----BEGIN CERTIFICATE-----" +END_CERT = "-----END CERTIFICATE-----" + +class PemTruststoreValidator: + + def assert_pem_truststores_equal(self, result_pem_path, expected_pem_path): + result_certs = self.get_list_of_pem_certificates(result_pem_path) + expected_certs = self.get_list_of_pem_certificates(expected_pem_path) + result_certs.sort() + expected_certs.sort() + if len(result_certs) != len(expected_certs): + return False + return result_certs == expected_certs + + + def get_list_of_pem_certificates(self, path): + return re.findall(BEGIN_CERT + '(.+?)' + END_CERT, open(path, 'rb').read(), re.DOTALL) diff --git a/tests/oom-platform-cert-service/truststoremerger/libraries/TrustMergerManager.py b/tests/oom-platform-cert-service/truststoremerger/libraries/TrustMergerManager.py new file mode 100644 index 00000000..f7a493c4 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/libraries/TrustMergerManager.py @@ -0,0 +1,47 @@ +import docker +import os +import shutil +from EnvsReader import EnvsReader +from docker.types import Mount + +ARCHIVES_PATH = os.getenv("WORKSPACE") + "/archives/" + + +class TrustMergerManager: + + def __init__(self, mount_path, truststores_path): + self.mount_path = mount_path + self.truststores_path = truststores_path + + def run_merger_container(self, merger_image, merger_name, path_to_env): + self.remove_mount_dir() + shutil.copytree(self.truststores_path, self.mount_path) + client = docker.from_env() + environment = EnvsReader().read_env_list_from_file(path_to_env) + container = client.containers.run( + image=merger_image, + name=merger_name, + environment=environment, + user='root', # Run container as root to avoid permission issues with volume mount access + mounts=[Mount(target='/var/certs', source=self.mount_path, type='bind')], + detach=True + ) + exitcode = container.wait() + return exitcode + + def create_mount_dir(self): + if not os.path.exists(self.mount_path): + os.makedirs(self.mount_path) + + def remove_mount_dir(self): + if os.path.exists(self.mount_path): + shutil.rmtree(self.mount_path) + + def remove_merger_container_and_save_logs(self, container_name, log_file_name): + client = docker.from_env() + container = client.containers.get(container_name) + text_file = open(ARCHIVES_PATH + "merger_container_" + log_file_name + ".log", "w") + text_file.write(container.logs()) + text_file.close() + container.remove() + self.remove_mount_dir() diff --git a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot new file mode 100644 index 00000000..1040afab --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-keywords.robot @@ -0,0 +1,34 @@ +*** Settings *** + +Resource ../../../common.robot +Resource ./trust-merger-properties.robot +Library ../libraries/TrustMergerManager.py ${MOUNT_PATH} ${TRUSTSTORES_PATH} +Library ../libraries/JksTruststoreValidator.py +Library ../libraries/PemTruststoreValidator.py + +*** Keywords *** + +Run Trust Merger And Expect Error + [Documentation] Run Truststore Merger Container And Validate Exit Code + [Arguments] ${env_file} ${expected_exit_code} + ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} + Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} negative_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + +Run Trust Merger And Merge Truststore Files To Jks + [Documentation] Run Truststore Merger Container And Validate Exit Code And Files + [Arguments] ${env_file} ${expected_exit_code} ${jks_path} ${jks_password} ${expected_jks_path} + ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} + ${files_equal}= Assert Jks Truststores Equal ${jks_path} ${jks_password} ${expected_jks_path} + Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} positive_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + Should Be True ${files_equal} + +Run Trust Merger And Merge Truststore Files To Pem + [Documentation] Run Truststore Merger Container And Validate Exit Code And Files + [Arguments] ${env_file} ${expected_exit_code} ${pem_path} ${expected_pem_path} + ${exit_code}= Run Merger Container ${DOCKER_MERGER_IMAGE} ${MERGER_CONTAINER_NAME} ${env_file} + ${files_equal}= Assert Pem Truststores Equal ${pem_path} ${expected_pem_path} + Remove Merger Container And Save Logs ${MERGER_CONTAINER_NAME} positive_path + Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return unexpected exit code return: ${exitcode} , but expected: ${expected_exit_code} + Should Be True ${files_equal} diff --git a/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot new file mode 100644 index 00000000..d356f604 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/resources/trust-merger-properties.robot @@ -0,0 +1,35 @@ +*** Variables *** + +${DOCKER_MERGER_IMAGE} nexus3.onap.org:10001/onap/org.onap.oom.platform.cert-service.oom-truststore-merger:latest +${MERGER_CONTAINER_NAME} %{MergerContainerName} +${MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp +${TRUSTSTORES_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores +${EXPECTED_TRUSTSTORES_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores + +${JKS_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.jks +${JKS_PASSWORD_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststoreJks.pass +${P12_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.p12 +${P12_PASSWORD_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststoreP12.pass +${PEM_TRUSTSTORE_MOUNT_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/tmp/truststore.pem + +${JKS_TRUSTSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/jksAndPemAndP12.jks +${PEM_TRUSTSTORE_EXPECTED_PATH} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/expected_truststores/pemAndP12.pem + +${INVALID_ENV_EMPTY_FILE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_file.env +${INVALID_ENV_LIST_SIZE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_different_lists_size.env +${INVALID_ENV_EMPTY_PASSWORDS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_passwords.env +${INVALID_PASSWORD_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_password_path.env +${INVALID_ENV_TRUSTSTORE_PATHS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_truststore_paths.env +${INVALID_ENV_FILE_PASSWORD} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_file_password_pair.env +${INVALID_ENV_EXTENSION} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_extension.env +${INVALID_ENV_DUPLICATED_ALIASES} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_duplicated_aliases.env +${INVALID_ENV_EMPTY_CERTS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/invalid_empty_certs.env +${VALID_ENV_JKS_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_jks_pem_p12.env +${VALID_ENV_PEM_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_pem_p12.env +${VALID_ENV_SINGLE_TRUSTSTORE} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/valid_single_truststore.env + +${TRUSTSTORE_JKS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.jks +${TRUSTSTORE_JKS_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststoreJks.pass +${TRUSTSTORE_P12} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.p12 +${TRUSTSTORE_P12_PASS} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pass +${TRUSTSTORE_PEM} %{WORKSPACE}/tests/oom-platform-cert-service/truststoremerger/assets/truststores/truststore.pem diff --git a/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot b/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot new file mode 100644 index 00000000..966a4243 --- /dev/null +++ b/tests/oom-platform-cert-service/truststoremerger/trust-merger-test.robot @@ -0,0 +1,67 @@ +*** Settings *** + +Documentation Truststore merger test case scenarios +Library RequestsLibrary +Resource ./resources/trust-merger-keywords.robot + +*** Test Cases *** + +Trust Merger fails when file extension is invalid + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with invalid truststore extension env and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_EXTENSION} 1 + +Trust Merger fails when truststore and passwords envs not provided + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with invalid empty envs and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_FILE} 1 + +Trust Merger fails when list sizes are different + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with different truststore and password envs size and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_LIST_SIZE} 2 + +Trust Merger fails when a variable is empty + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with empty truststore password path env and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_PASSWORDS} 2 + +Trust Merger fails when truststore paths are invalid + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with invalid truststore path and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_TRUSTSTORE_PATHS} 3 + +Trust Merger fails when password path is invalid + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with invalid password path and expect error code + Run Trust Merger And Expect Error ${INVALID_PASSWORD_PATHS} 4 + +Trust Merger fails when password file pair is invalid + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with incorrect password env and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_FILE_PASSWORD} 7 + +Trust Merger fails when pem does not contain cert + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with empty pem truststore and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_EMPTY_CERTS} 9 + +Trust Merger fails when aliases are duplicated + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with duplicated aliases in truststores and expect error code + Run Trust Merger And Expect Error ${INVALID_ENV_DUPLICATED_ALIASES} 10 + +Trust Merger merges successfully jks pem p12 + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with valid env file and expect merged certs from jks, pem and p12 + Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_JKS_PEM_P12} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${JKS_TRUSTSTORE_EXPECTED_PATH} + +Trust Merger merges successfully pem p12 + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with valid env file and expect merged certs from pem and p12 + Run Trust Merger And Merge Truststore Files To Pem ${VALID_ENV_PEM_P12} 0 ${PEM_TRUSTSTORE_MOUNT_PATH} ${PEM_TRUSTSTORE_EXPECTED_PATH} + +Trust Merger ends successfully with single truststore + [Tags] OOM-TRUST-STORE-MERGER + [Documentation] Run with one truststore in env file and expect code 0 + Run Trust Merger And Merge Truststore Files To Jks ${VALID_ENV_SINGLE_TRUSTSTORE} 0 ${JKS_TRUSTSTORE_MOUNT_PATH} ${TRUSTSTORE_JKS_PASS} ${TRUSTSTORE_JKS} diff --git a/tests/policy/api/api-test.robot b/tests/policy/api/api-test.robot index d3df9cc9..c229bcf5 100644 --- a/tests/policy/api/api-test.robot +++ b/tests/policy/api/api-test.robot @@ -41,7 +41,7 @@ RetrievePolicyTypes CreateTCAPolicyTypeV1 [Documentation] Create TCA Policy Type Version 1. Trying to create an existing policy type with any change and same version should cause error. ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json + ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v1.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -52,7 +52,7 @@ CreateTCAPolicyTypeV1 CreateTCAPolicyTypeV2 [Documentation] Create TCA Policy Type Version 2 ${auth}= Create List healthcheck zb!XztG34 - ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json + ${postjson}= Get file ${CURDIR}/data/onap.policy.monitoring.tcagen2.v2.json Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -82,7 +82,7 @@ CreateNewMonitoringPolicyV1 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers} + ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} Log Received response from policy ${resp.text} ${postjsonobject} To Json ${postjson} Should Be Equal As Strings ${resp.status_code} 200 @@ -121,7 +121,7 @@ RetrievePoliciesOfType Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies headers=${headers} + ${resp}= Get Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies headers=${headers} Log Received response from policy ${resp.text} ${expjsonobject} To Json ${expjson} Should Be Equal As Strings ${resp.status_code} 200 @@ -173,10 +173,10 @@ DeleteSpecificPolicyV2 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies/onap.restart.tca/versions/2.0.0 headers=${headers} Should Be Equal As Strings ${resp.status_code} 404 DeleteSpecificPolicyTypeV1 @@ -185,10 +185,10 @@ DeleteSpecificPolicyTypeV1 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0 headers=${headers} Should Be Equal As Strings ${resp.status_code} 404 DeleteSpecificPolicyTypeV2 @@ -197,8 +197,8 @@ DeleteSpecificPolicyTypeV2 Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers} Log Received response from policy ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 - ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/2.0.0 headers=${headers} + ${resp}= Delete Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/2.0.0 headers=${headers} Should Be Equal As Strings ${resp.status_code} 404 diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json index 15c20458..a2e2ddc9 100644 --- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v1.json +++ b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v1.json @@ -6,11 +6,11 @@ "version": "1.0.0", "description": "a base policy type for all policies that governs monitoring provisioning" }, - "onap.policies.monitoring.cdap.tca.hi.lo.app": { + "onap.policies.monitoring.tcagen2": { "derived_from": "onap.policies.Monitoring", "version": "1.0.0", "properties": { - "tca_policy": { + "tca.policy": { "type": "onap.datatypes.monitoring.tca_policy", "description": "TCA Policy JSON" } diff --git a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json index a7a801a8..d86749ef 100644 --- a/tests/policy/api/data/onap.policy.monitoring.cdap.tca.hi.lo.app.v2.json +++ b/tests/policy/api/data/onap.policy.monitoring.tcagen2.v2.json @@ -1,11 +1,11 @@ { "tosca_definitions_version": "tosca_simple_yaml_1_1_0", "policy_types": { - "onap.policies.monitoring.cdap.tca.hi.lo.app": { + "onap.policies.monitoring.tcagen2": { "derived_from": "onap.policies.Monitoring", "version": "2.0.0", "properties": { - "tca_policy": { + "tca.policy": { "type": "onap.datatypes.monitoring.tca_policy", "description": "TCA Policy JSON" } diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json index 1079c7c1..d57a64cb 100644 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1.json @@ -4,14 +4,14 @@ "policies": [ { "onap.restart.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "type": "onap.policies.monitoring.tcagen2", "version": "1.0.0", "type_version": "1.0.0", "metadata": { "policy-id": "onap.restart.tca" }, "properties": { - "tca_policy" : { + "tca.policy" : { "domain": "measurementsForVfScaling", "metricsPerEventName": [ { diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json index 35ad3c54..12e066ea 100644 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v1_2.json @@ -4,7 +4,7 @@ "policies": [ { "onap.restart.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "type": "onap.policies.monitoring.tcagen2", "version": "1.0.0", "type_version": "1.0.0", "description": "monitoring policy", @@ -12,7 +12,7 @@ "policy-id": "onap.restart.tca" }, "properties": { - "tca_policy" : { + "tca.policy" : { "domain": "measurementsForVfScaling", "metricsPerEventName": [ { diff --git a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json index c6b2ad2d..cd4be203 100644 --- a/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json +++ b/tests/policy/api/data/vCPE.policy.monitoring.input.tosca.v2.json @@ -4,14 +4,14 @@ "policies": [ { "onap.restart.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "type": "onap.policies.monitoring.tcagen2", "version": "2.0.0", "type_version": "1.0.0", "metadata": { "policy-id": "onap.restart.tca" }, "properties": { - "tca_policy" : { + "tca.policy" : { "domain": "measurementsForVfScaling", "metricsPerEventName": [ { diff --git a/tests/policy/pap/data/create.group.request.json b/tests/policy/pap/data/create.group.request.json index ea04c0e5..1b63563f 100644 --- a/tests/policy/pap/data/create.group.request.json +++ b/tests/policy/pap/data/create.group.request.json @@ -13,7 +13,7 @@ "properties": {}, "supportedPolicyTypes": [ { - "name": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "name": "onap.policies.monitoring.tcagen2", "version": "1.0.0" } ], @@ -25,7 +25,7 @@ "properties": {}, "supportedPolicyTypes": [ { - "name": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "name": "onap.policies.monitoring.tcagen2", "version": "1.0.0" } ], diff --git a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json index 3003d9a8..8ec03fe5 100644 --- a/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json +++ b/tests/policy/pap/data/vCPE.policy.monitoring.input.tosca.json @@ -4,14 +4,14 @@ "policies": [ { "onap.restart.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "type": "onap.policies.monitoring.tcagen2", "version": "1.0.0", "type_version": "1.0.0", "metadata": { "policy-id": "onap.restart.tca" }, "properties": { - "tca_policy": { + "tca.policy": { "domain": "measurementsForVfScaling", "metricsPerEventName": [ { diff --git a/tests/policy/pap/pap-test.robot b/tests/policy/pap/pap-test.robot index 67a57828..5387e85f 100644 --- a/tests/policy/pap/pap-test.robot +++ b/tests/policy/pap/pap-test.robot @@ -12,7 +12,7 @@ LoadPolicy ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json ${postjson}= Get file ${CURDIR}/data/vCPE.policy.monitoring.input.tosca.json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers} + ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} Log Received response from API ${resp.text} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json b/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json index 3003d9a8..8ec03fe5 100644 --- a/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json +++ b/tests/policy/xacml-pdp/data/vCPE.policy.monitoring.input.tosca.json @@ -4,14 +4,14 @@ "policies": [ { "onap.restart.tca": { - "type": "onap.policies.monitoring.cdap.tca.hi.lo.app", + "type": "onap.policies.monitoring.tcagen2", "version": "1.0.0", "type_version": "1.0.0", "metadata": { "policy-id": "onap.restart.tca" }, "properties": { - "tca_policy": { + "tca.policy": { "domain": "measurementsForVfScaling", "metricsPerEventName": [ { diff --git a/tests/policy/xacml-pdp/xacml-pdp-test.robot b/tests/policy/xacml-pdp/xacml-pdp-test.robot index 6e2fa008..150c97e6 100644 --- a/tests/policy/xacml-pdp/xacml-pdp-test.robot +++ b/tests/policy/xacml-pdp/xacml-pdp-test.robot @@ -52,7 +52,7 @@ CreateMonitorPolicy Log Creating session https://${POLICY_API_IP}:6969 ${session}= Create Session policy https://${POLICY_API_IP}:6969 auth=${auth} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app/versions/1.0.0/policies data=${postjson} headers=${headers} + ${resp}= Post Request policy /policy/api/v1/policytypes/onap.policies.monitoring.tcagen2/versions/1.0.0/policies data=${postjson} headers=${headers} Log Received response from policy4 ${resp.text} ${postjsonobject} To Json ${postjson} Should Be Equal As Strings ${resp.status_code} 200 diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env b/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env index 57894753..5d647de6 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/csr/sdnc_csr.env @@ -2,7 +2,7 @@ REQUEST_TIMEOUT=30000 OUTPUT_PATH=/var/certs CA_NAME=RA -OUTPUT_TYPE=JKS +OUTPUT_TYPE=PEM KEYSTORE_PATH=/etc/onap/aaf/certservice/certs/certServiceClient-keystore.jks KEYSTORE_PASSWORD=secret TRUSTSTORE_PATH=/etc/onap/aaf/certservice/certs/truststore.jks diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py index b2399dfb..b1c024ff 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/ClientManager.py @@ -25,7 +25,6 @@ import shutil import subprocess import docker -import jks from OpenSSL import crypto from docker.types import Mount @@ -39,13 +38,14 @@ class ClientManager: def __init__(self, mount_path, truststore_path): self.mount_path = mount_path self.truststore_path = truststore_path + self.keyPem = mount_path + '/key.pem' self.caCertPem = mount_path + '/ca.pem' self.serverKeyPem = mount_path + '/server_key.pem' self.serverCertPem = mount_path + '/server_cert.pem' - self.keystoreJksPath = mount_path + '/keystore.jks' + self.keystorePemPath = mount_path + '/keystore.pem' self.keystoreP12Path = mount_path + '/keystore.p12' self.keystorePassPath = mount_path + '/keystore.pass' - self.truststoreJksPath = mount_path + '/truststore.jks' + self.truststorePemPath = mount_path + '/truststore.pem' self.truststoreP12Path = mount_path + '/truststore.p12' self.truststorePassPath = mount_path + '/truststore.pass' @@ -71,18 +71,19 @@ class ClientManager: # Function to validate keystore/truststore can be opened with generated pass-phrase. def can_open_keystore_and_truststore_with_pass(self, container_name): if container_name != NETCONF_PNP_SIM_CONTAINER_NAME: - return self.can_open_keystore_and_truststore_jks_files() + return self.can_open_keystore_and_truststore_pem_files() else: return self.can_open_keystore_and_truststore_p12_files() - # Function to validate keystore.jks/truststore.jks can be opened with generated pass-phrase. - def can_open_keystore_and_truststore_jks_files(self): + # Function to validate keystore.pem/truststore.pem exist and are not empty. + def can_open_keystore_and_truststore_pem_files(self): try: - jks.KeyStore.load(self.keystoreJksPath, open(self.keystorePassPath, 'rb').read()) - jks.KeyStore.load(self.truststoreJksPath, open(self.truststorePassPath, 'rb').read()) - return True + private_key = self.file_exist_and_not_empty(self.keyPem) + keystore_pem = self.file_exist_and_not_empty(self.keystorePemPath) + truststore_pem = self.file_exist_and_not_empty(self.truststorePemPath) + return private_key and keystore_pem and truststore_pem except Exception as e: - print("UnExpected Error in validating keystore.jks/truststore.jks: {0}".format(e)) + print("UnExpected Error in validating keystore.pem/truststore.pem: {0}".format(e)) return False # Function to validate keystore.p12/truststore.p12 can be opened with generated pass-phrase. @@ -93,12 +94,14 @@ class ClientManager: # Method for Uploading Certificate in SDNC-Container. # Creating/Uploading Server-key, Server-cert, Ca-cert PEM files in Netconf-Pnp-Simulator. - def can_install_keystore_and_truststore_certs(self, cmd, container_name): + def can_install_keystore_and_truststore_certs(self, cmd, cmd_tls, container_name): continue_exec = True if container_name == NETCONF_PNP_SIM_CONTAINER_NAME: print("Generating PEM files for {0} from P12 files".format(container_name)) continue_exec = self.create_pem(self.keystorePassPath, self.keystoreP12Path, self.truststorePassPath, self.truststoreP12Path) + else: + cmd = cmd_tls if continue_exec: print("Initiate Configuration Push for : {0}".format(container_name)) resp_code = self.execute_bash_config(cmd, container_name) @@ -165,6 +168,9 @@ class ClientManager: def remove_mount_dir(self): shutil.rmtree(self.mount_path) + def file_exist_and_not_empty(self, path_to_file): + return os.path.isfile(path_to_file) and os.path.getsize(path_to_file) > 0 + @staticmethod def get_pkcs12(pass_file_path, p12_file_path): # Load PKCS12 Object diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh new file mode 100755 index 00000000..323f8100 --- /dev/null +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/libraries/config_tls.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# ============LICENSE_START======================================================= +# Copyright (C) 2020 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= + +set -o errexit +set -o pipefail +set -o nounset +[ "${SHELL_XTRACE:-false}" = "true" ] && set -o xtrace + +CONFIG=${CONFIG:-"${WORKSPACE}"/tests/sdnc/sdnc_netconf_tls_post_deploy/cert-data} +CONTAINER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' sdnc) +ODL_URL=${ODL_URL:-http://"${CONTAINER_IP}":8282} +PROC_NAME=${0##*/} +PROC_NAME=${PROC_NAME%.sh} + +function now_ms() { + # Requires coreutils package + date +"%Y-%m-%d %H:%M:%S.%3N" +} + +function log() { + local level=$1 + shift + local message="$*" + printf "%s %-5s [%s] %s\n" "$(now_ms)" $level $PROC_NAME "$message" +} + +# Extracts the body of a PEM file by removing the dashed header and footer +pem_body() { + grep -Fv -- ----- $1 +} + +CA_CERT_ID=xNF_CA_certificate_0_0 +CA_CERT=$(pem_body $CONFIG/truststore.pem) + +SERVER_PRIV_KEY_ID=ODL_private_key_0 +SERVER_KEY=$(pem_body $CONFIG/key.pem) +SERVER_CERT=$(pem_body $CONFIG/keystore.pem) + +RESTCONF_URL=$ODL_URL/restconf +NETCONF_KEYSTORE_PATH=$RESTCONF_URL/config/netconf-keystore:keystore + +xcurl() { + curl -s -o /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -w %{http_code} "$@" +} + +log INFO Delete Keystore +sc=$(xcurl -X DELETE $NETCONF_KEYSTORE_PATH) + +if [ "$sc" != "200" -a "$sc" != "404" ]; then + log ERROR "Keystore deletion failed with SC=$sc" + exit 1 +fi + +log INFO Load CA certificate +sc=$(xcurl -X POST $NETCONF_KEYSTORE_PATH --header "Content-Type: application/json" --data " +{ + \"trusted-certificate\": [ + { + \"name\": \"$CA_CERT_ID\", + \"certificate\": \"$CA_CERT\" + } + ] +} +") + +if [ "$sc" != "200" -a "$sc" != "204" ]; then + log ERROR Trusted-certificate update failed with SC=$sc + exit 1 +fi + +log INFO Load server private key and certificate +sc=$(xcurl -X POST $NETCONF_KEYSTORE_PATH --header "Content-Type: application/json" --data " +{ + \"private-key\": { + \"name\": \"$SERVER_PRIV_KEY_ID\", + \"certificate-chain\": [ + \"$SERVER_CERT\" + ], + \"data\": \"$SERVER_KEY\" + } +} +") + +if [ "$sc" != "200" -a "$sc" != "204" ]; then + log ERROR Private-key update failed with SC=$sc + exit 1 +fi
\ No newline at end of file diff --git a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot index a7fbcccc..52cc5d2f 100644 --- a/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot +++ b/tests/sdnc/sdnc_netconf_tls_post_deploy/resources/sdnc-keywords.robot @@ -77,7 +77,7 @@ Run Cert Service Client And Validate JKS File Creation And Client Exit Code [Arguments] ${env_file} ${CONTAINER_NAME} ${expected_exit_code} ${exit_code}= Run Client Container ${DOCKER_CLIENT_IMAGE} ${CLIENT_CONTAINER_NAME} ${env_file} ${CERT_SERVICE_ADDRESS}${CERT_SERVICE_ENDPOINT} ${CERT_SERVICE_NETWORK} ${can_open}= Can Open Keystore And Truststore With Pass ${CONTAINER_NAME} - ${install_certs}= Can Install Keystore And Truststore Certs ${CONF_SCRIPT} ${CONTAINER_NAME} + ${install_certs}= Can Install Keystore And Truststore Certs ${CONF_SCRIPT} ${CONF_TLS_SCRIPT} ${CONTAINER_NAME} Remove Client Container And Save Logs ${CLIENT_CONTAINER_NAME} positive_path Should Be Equal As Strings ${exit_code} ${expected_exit_code} Client return: ${exitcode} exit code, but expected: ${expected_exit_code} Should Be True ${can_open} Cannot Open Keystore/TrustStore by Passphrase |