aboutsummaryrefslogtreecommitdiffstats
path: root/plans/dcaegen2-services-son-handler
diff options
context:
space:
mode:
Diffstat (limited to 'plans/dcaegen2-services-son-handler')
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/config/dmaap/MsgRtrApi.properties172
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/config/sonhms/config_all.json134
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/docker-compose.yaml94
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/setup.sh61
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/teardown.sh9
-rw-r--r--plans/dcaegen2-services-son-handler/testsuites/testplan.txt3
6 files changed, 473 insertions, 0 deletions
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