diff options
Diffstat (limited to 'plans')
-rw-r--r-- | plans/ccsdk/healthcheck/health_check.sh | 2 | ||||
-rw-r--r-- | plans/ccsdk/healthcheck/setup.sh | 17 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json | 7 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/assets/config.json | 1 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml | 61 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/setup.sh | 118 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/teardown.sh | 10 | ||||
-rw-r--r-- | plans/dcaegen2-pmmapper/pmmapper/testplan.txt | 3 | ||||
-rw-r--r-- | plans/usecases/5G-bulkpm/setup.sh | 4 |
9 files changed, 210 insertions, 13 deletions
diff --git a/plans/ccsdk/healthcheck/health_check.sh b/plans/ccsdk/healthcheck/health_check.sh index ffc766fe..58ccb42a 100644 --- a/plans/ccsdk/healthcheck/health_check.sh +++ b/plans/ccsdk/healthcheck/health_check.sh @@ -19,7 +19,7 @@ echo $SCRIPTS unset http_proxy https_proxy -response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8383/restconf/operations/SLI-API:healthcheck ) +response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"input":{"dummy":"dummy"}}' http://localhost:8383/restconf/operations/SLI-API:healthcheck ) if [ "$response" == "200" ]; then echo "CCSDK health check passed." diff --git a/plans/ccsdk/healthcheck/setup.sh b/plans/ccsdk/healthcheck/setup.sh index c073acd6..32f172b9 100644 --- a/plans/ccsdk/healthcheck/setup.sh +++ b/plans/ccsdk/healthcheck/setup.sh @@ -25,7 +25,7 @@ export NEXUS_DOCKER_REPO="nexus3.onap.org:10001" export NEXUS_USERNAME=docker export NEXUS_PASSWD=docker export DMAAP_TOPIC=AUTO -export CCSDK_DOCKER_IMAGE_VERSION=0.3-STAGING-latest +export CCSDK_DOCKER_IMAGE_VERSION=0.4-STAGING-latest if [ "$MTU" == "" ]; then export MTU="1450" @@ -44,14 +44,14 @@ cd $WORKSPACE/archives/ccsdk/src/main/yaml sed -i "s/DMAAP_TOPIC_ENV=.*/DMAAP_TOPIC_ENV="AUTO"/g" docker-compose.yml docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odl-image:$CCSDK_DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odl-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odl-image:0.3-STAGING-latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-alpine-image:$CCSDK_DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-alpine-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odlsli-alpine-image:0.4-STAGING-latest docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:0.3-STAGING-latest +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:0.4-STAGING-latest docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-image:$CCSDK_DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odlsli-image:0.3-STAGING-latest +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-odlsli-image:$CCSDK_DOCKER_IMAGE_VERSION onap/ccsdk-odlsli-image:0.4-STAGING-latest # start CCSDK containers with docker compose and configuration from docker-compose.yml curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > docker-compose @@ -63,7 +63,7 @@ TIME_OUT=500 INTERVAL=30 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-ccsdk" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8383/restconf/operations/SLI-API:healthcheck ); echo $response + response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-ccsdk" -H "X-TransactionId: csit-ccsdk" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"input":{"dummy":"dummy"}}' http://localhost:8383/restconf/operations/SLI-API:healthcheck ); echo $response if [ "$response" == "200" ]; then echo CCSDK started in $TIME seconds @@ -86,12 +86,9 @@ INTERVAL=60 TIME=0 while [ "$TIME" -lt "$TIME_OUT" ]; do -docker exec ccsdk_odlsli_container rm -f /opt/opendaylight/current/etc/host.key response=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client system:start-level) -docker exec ccsdk_odlsli_container rm -f /opt/opendaylight/current/etc/host.key -num_bundles=$(docker exec ccsdk_odlsli_container /opt/opendaylight/current/bin/client bundle:list | tail -1 | cut -d\| -f1) - if [ "$response" == "Level 100" ] && [ "$num_bundles" -ge 333 ]; then + if [ "$response" == "Level 100" ] ; then echo CCSDK karaf started in $TIME seconds break; fi diff --git a/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json b/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json new file mode 100644 index 00000000..a29956fb --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json @@ -0,0 +1,7 @@ +{ + "ID": "cbs", + "Name": "config_binding_service", + "Tags": ["cbs"], + "Address": "ipaddress", + "Port": 10000 +}
\ No newline at end of file diff --git a/plans/dcaegen2-pmmapper/pmmapper/assets/config.json b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json new file mode 100644 index 00000000..2fe128ba --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/assets/config.json @@ -0,0 +1 @@ +{"pm-mapper-filter": "{ \"filters\":[]}", "3GPP.schema.file": "{\"3GPP_Schema\":\"./etc/3GPP_relaxed_schema.xsd\"}", "streams_subscribes": {}, "streams_publishes": {"pm_mapper_handle_out": {"type": "message_router", "aaf_password": null, "dmaap_info": {"topic_url": "https://we-are-message-router.us:3905/events/some-topic", "client_role": null, "location": null, "client_id": null}, "aaf_username": null}}, "streams_subscribes.pm_mapper_handle_out.message_router_topic": "unauthenticated.PM_VES_OUTPUT", "streams_subscribes.pm_mapper_handle_in.feed_id": "1", "services_calls": {}}
\ No newline at end of file diff --git a/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml new file mode 100644 index 00000000..af987f79 --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml @@ -0,0 +1,61 @@ +version: '2.1' +services: + datarouter-prov: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov + container_name: datarouter-prov + hostname: dmaap-dr-prov + ports: + - "443:8443" + - "8443:8443" + - "8080:8080" + volumes: + - ../prov_data/provserver.properties:/opt/app/datartr/etc/provserver.properties + - ../prov_data/addSubscriber.txt:/opt/app/datartr/addSubscriber.txt + - ../prov_data/addFeed3.txt:/opt/app/datartr/addFeed3.txt + depends_on: + mariadb_container: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"] + interval: 10s + timeout: 10s + retries: 5 + + datarouter-node: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-node + container_name: datarouter-node + hostname: dmaap-dr-node + ports: + - "9443:8443" + - "9090:8080" + volumes: + - ../node_data/node.properties:/opt/app/datartr/etc/node.properties + depends_on: + datarouter-prov: + condition: service_healthy + + mariadb_container: + image: mariadb:10.2.14 + container_name: mariadb + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: datarouter + MYSQL_DATABASE: datarouter + MYSQL_USER: datarouter + MYSQL_PASSWORD: datarouter + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "--silent"] + interval: 10s + timeout: 30s + retries: 5 + + consul: + container_name: consul + image: nexus3.onap.org:10001/consul:latest + + cbs: + container_name: cbs + image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:latest + environment: + CONSUL_HOST: diff --git a/plans/dcaegen2-pmmapper/pmmapper/setup.sh b/plans/dcaegen2-pmmapper/pmmapper/setup.sh new file mode 100644 index 00000000..326b4ac5 --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/setup.sh @@ -0,0 +1,118 @@ +#!/bin/bash +# Place the scripts in run order: +source ${SCRIPTS}/common_functions.sh + +# Clone DMaaP Message Router repo +mkdir -p $WORKSPACE/archives/dmaapmr +cd $WORKSPACE/archives/dmaapmr +git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master +sed -i 's/enableCadi: false/enableCadi: "false"/g' /$WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/docker-compose.yml +cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose +cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ + +# start DMaaP MR containers with docker compose and configuration from docker-compose.yml +docker login -u docker -p docker nexus3.onap.org:10001 +docker-compose up -d + +ZOOKEEPER=$(docker ps -a -q --filter="name=zookeeper_1") +KAFKA=$(docker ps -a -q --filter="name=kafka_1") +DMAAP=$(docker ps -a -q --filter="name=dmaap_1") + +# Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper +for i in {1..10}; do +if [ $(docker inspect --format '{{ .State.Running }}' $KAFKA) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' $ZOOKEEPER) ] && \ +[ $(docker inspect --format '{{ .State.Running }}' $DMAAP) ] +then + echo "DMaaP Service Running" + break +else + echo sleep $i + sleep $i +fi +done + +# Get IP address of DMAAP, KAFKA, Zookeeper +KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA) +ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER) +DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) + +sleep 2 +# Shutdown DMAAP Container +docker kill $DMAAP + +# Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites +sed -i -e '/config.zk.servers=/ s/=.*/='$ZOOKEEPER_IP'/' /var/tmp/MsgRtrApi.properties +sed -i -e '/kafka.metadata.broker.list=/ s/=.*/='$KAFKA_IP':9092/' /var/tmp/MsgRtrApi.properties + +# Start DMaaP MR containers with docker compose and configuration from docker-compose.yml +docker login -u docker -p docker nexus3.onap.org:10001 +docker-compose up -d +sleep 5 + +# Clone DMaaP Data Router repo +mkdir -p $WORKSPACE/archives/dmaapdr +cd $WORKSPACE/archives/dmaapdr +git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master +cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources +mkdir docker-compose +cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose +cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-e2e.yml $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose.yml + +docker login -u docker -p docker nexus3.onap.org:10001 +docker-compose up -d +echo "Disregard the message ERROR: for datarouter-node Container 1234456 is unhealthy, this is expected behaiour at this stage" +docker kill datarouter-prov +docker kill datarouter-node +docker kill cbs +CONSUL_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' consul ) +sed -i -e '/CONSUL_HOST:/ s/:.*/: '$CONSUL_IP'/' docker-compose.yml +MARIADB=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb ) +sed -i 's/datarouter-mariadb/'$MARIADB'/g' $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/prov_data/provserver.properties +docker-compose up -d + +# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb +for i in {1..10}; do + if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] + then + echo "DR Service Running" + break + else + echo sleep $i + sleep $i + fi +done + +sleep 5 + +# Get IP address of datarrouger-prov, datarouter-node, fileconsumer-node. +DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) +DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) +DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) + +# Get IP address of DMAAP, KAFKA, Zookeeper, ConfigBindingService +DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) +KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA) +ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER) +CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cbs) + +# Data Router Configuration: +# Create default feed on data router +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" +docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" +docker exec datarouter-prov /bin/sh -c "echo '${DR_NODE_IP}' dmaap-dr-node >> /etc/hosts" +docker exec datarouter-node /bin/sh -c "echo '${DR_PROV_IP}' dmaap-dr-prov >> /etc/hosts" +curl -v -X POST -H "Content-Type:application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF:dradmin" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443 +sleep 5 +curl -k https://$DR_PROV_IP:8443/internal/prov + +# Consul Configuration for PM Mapper +cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json /tmp/cbs.json +sed -i 's/ipaddress/'${CBS_IP}'/g' /tmp/cbs.json +curl --request PUT --data @/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register +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/plans/dcaegen2-pmmapper/pmmapper/assets/config.json + +#Pass any variables required by Robot test suites in ROBOT_VARIABLES +ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v DR_SUBSCIBER_IP:${DR_SUBSCIBER_IP}" diff --git a/plans/dcaegen2-pmmapper/pmmapper/teardown.sh b/plans/dcaegen2-pmmapper/pmmapper/teardown.sh new file mode 100644 index 00000000..5b910121 --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/teardown.sh @@ -0,0 +1,10 @@ +#!/bin/bash +echo "Starting teardown script" +kill-instance.sh $DMAAP +kill-instance.sh $KAFKA +kill-instance.sh $ZOOKEEPER +kill-instance.sh datarouter-node +kill-instance.sh datarouter-prov +kill-instance.sh mariadb +kill-instance.sh cbs +kill-instance.sh consul
\ No newline at end of file diff --git a/plans/dcaegen2-pmmapper/pmmapper/testplan.txt b/plans/dcaegen2-pmmapper/pmmapper/testplan.txt new file mode 100644 index 00000000..f874b4df --- /dev/null +++ b/plans/dcaegen2-pmmapper/pmmapper/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [integration/csit.git]/tests/. +# Place the suites in run order. +dcaegen2-pmmapper/pmmapper diff --git a/plans/usecases/5G-bulkpm/setup.sh b/plans/usecases/5G-bulkpm/setup.sh index 64ffac17..012c7330 100644 --- a/plans/usecases/5G-bulkpm/setup.sh +++ b/plans/usecases/5G-bulkpm/setup.sh @@ -140,9 +140,9 @@ docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/xNF.pm.xml.gz sftp:/home/ad # Data Router Configuration: # Create default feed and create file consumer subscriber on data router -curl -v -X POST -H "Content-Type:application/vnd.att-dr.feed" -H "X-ATT-DR-ON-BEHALF-OF:dradmin" --data-ascii @$WORKSPACE/plans/usecases/5G-bulkpm/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443 +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" --data-ascii @$WORKSPACE/plans/usecases/5G-bulkpm/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443 cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/addSubscriber.json /tmp/addSubscriber.json sed -i 's/fileconsumer/'${DR_SUBSCIBER_IP}'/g' /tmp/addSubscriber.json -curl -v -X POST -H "Content-Type:application/vnd.att-dr.subscription" -H "X-ATT-DR-ON-BEHALF-OF:dradmin" --data-ascii @/tmp/addSubscriber.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:dradmin" --data-ascii @/tmp/addSubscriber.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 sleep 10 curl -k https://$DR_PROV_IP:8443/internal/prov |