From 62b8b1254aff20a874a2867fda42bbaf3bb1b193 Mon Sep 17 00:00:00 2001 From: dglFromAtt Date: Sat, 3 Mar 2018 11:57:29 -0500 Subject: Initial CSIT framework for dmaap/buscontroller Change-Id: I068ccaafbeeea0d08949e83cccac56a238901aa3 Signed-off-by: dglFromAtt Issue-ID: DMAAP-318 --- .../scripts/dmaap-buscontroller/.mock-aaf.sh.swp | Bin 0 -> 12288 bytes .../scripts/dmaap-buscontroller/dmaapbc-init.sh | 52 ++++++++++++++++++++ .../scripts/dmaap-buscontroller/dmaapbc-launch.sh | 30 ++++++++++++ .../scripts/dmaap-buscontroller/init-mock-aaf.sh | 53 +++++++++++++++++++++ .../scripts/dmaap-buscontroller/init-mock-drps.sh | 17 +++++++ .../scripts/dmaap-buscontroller/init-mock-mrc.sh | 17 +++++++ test/csit/scripts/dmaap-buscontroller/onapCSIT.env | 18 +++++++ .../csit/scripts/dmaap-buscontroller/start-mock.sh | 48 +++++++++++++++++++ 8 files changed, 235 insertions(+) create mode 100644 test/csit/scripts/dmaap-buscontroller/.mock-aaf.sh.swp create mode 100755 test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh create mode 100755 test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh create mode 100755 test/csit/scripts/dmaap-buscontroller/init-mock-aaf.sh create mode 100755 test/csit/scripts/dmaap-buscontroller/init-mock-drps.sh create mode 100755 test/csit/scripts/dmaap-buscontroller/init-mock-mrc.sh create mode 100644 test/csit/scripts/dmaap-buscontroller/onapCSIT.env create mode 100755 test/csit/scripts/dmaap-buscontroller/start-mock.sh (limited to 'test/csit/scripts/dmaap-buscontroller') diff --git a/test/csit/scripts/dmaap-buscontroller/.mock-aaf.sh.swp b/test/csit/scripts/dmaap-buscontroller/.mock-aaf.sh.swp new file mode 100644 index 000000000..edadfe903 Binary files /dev/null and b/test/csit/scripts/dmaap-buscontroller/.mock-aaf.sh.swp differ diff --git a/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh new file mode 100755 index 000000000..7ec7345d5 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# $1 is the IP address of the buscontroller +# $2 is the IP address of the DRPS +# $3 is the IP address of the MRC + +# INITIALIZE: dmaap object +JSON=/tmp/$$.dmaap +cat << EOF > $JSON +{ + "version": "1", + "topicNsRoot": "org.onap.dmaap", + "drProvUrl": "http://${2}:8080", + "dmaapName": "onapCSIT", + "bridgeAdminTopic": "MM_AGENT_PROV" + +} +EOF + +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap + + + +# INITIALIZE: dcaeLocation object +JSON=/tmp/$$.loc +cat << EOF > $JSON +{ + "dcaeLocationName": "csit-sanfrancisco", + "dcaeLayer": "central-cloud", + "clli": "CSIT12345", + "zone": "zoneA" + +} +EOF + +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations + + +# INITIALIZE: MR object in 1 site +JSON=/tmp/$$.mrc +cat << EOF > $JSON +{ + "dcaeLocationName": "csit-sanfrancisco", + "fqdn": "$3", + "hosts" : [ "$3", "$3", "$3" ], + "protocol" : "https", + "port": "3094" + +} +EOF + +curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/mr_clusters diff --git a/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh b/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh new file mode 100755 index 000000000..f8f8c24e0 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# script to launch DMaaP buscontroller docker container +# sets global var IP with assigned IP address + +function dmaapbc_launch() { + TAG=dmaap/buscontroller + CONTAINER_NAME=dmaapbc + IP="" + + cd ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller + + TMP_CFG=/tmp/docker-databys-controller.conf + . ./onapCSIT.env > $TMP_CFG + docker run -d --name $CONTAINER_NAME -v $TMP_CFG:/opt/app/config/conf $TAG + IP=`get-instance-ip.sh ${CONTAINER_NAME}` + + # Wait for initialization + for i in {1..10}; do + curl -sS ${IP}:8080 && break + echo sleep $i + sleep $i + done + + set -x + ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh ${IP} + set +x + + +} diff --git a/test/csit/scripts/dmaap-buscontroller/init-mock-aaf.sh b/test/csit/scripts/dmaap-buscontroller/init-mock-aaf.sh new file mode 100755 index 000000000..f25404ce3 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/init-mock-aaf.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# $1 is the IP address of the AAF mock server + +#curl -v -X PUT -d @- http://$1:1080/expectation << EOF +#{ +# "httpRequest": { +# "method": "GET", +# "path": "/hello" +# }, +# "httpResponse": { +# "body": "Hello world!", +# "statusCode": 200 +# }, +# "times" : { +# "unlimited" : true +# } +#} +#EOF +# "httpRequest": { +# "method": "POST", +# "path": "/proxy/authz/.*" +# }, + +curl -v -X PUT -d @- http://$1:1080/expectation << EOF +{ + "httpRequest": { + "method": ".*", + "path": "/.*" + }, + "httpResponse": { + "body": "Hello world!", + "statusCode": 200 + }, + "times" : { + "unlimited" : true + } +} +EOF + +#curl -v -X PUT -d @- http://$1:1080/expectation << EOF +#{ +# "httpRequest": { +# "method": "POST", +# "path": "/proxy/authz/role/perm" +# }, +# "httpResponse": { +# "body": "Hello world!", +# "statusCode": 200 +# } +#} +#EOF + diff --git a/test/csit/scripts/dmaap-buscontroller/init-mock-drps.sh b/test/csit/scripts/dmaap-buscontroller/init-mock-drps.sh new file mode 100755 index 000000000..e0f1d0f19 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/init-mock-drps.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# $1 is the IP address of the DRPS (Data Router Provisioning Server) mock server + +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/test/csit/scripts/dmaap-buscontroller/init-mock-mrc.sh b/test/csit/scripts/dmaap-buscontroller/init-mock-mrc.sh new file mode 100755 index 000000000..75c1a419a --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/init-mock-mrc.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# $1 is the IP address of the MRC (MR Central) mock server + +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/test/csit/scripts/dmaap-buscontroller/onapCSIT.env b/test/csit/scripts/dmaap-buscontroller/onapCSIT.env new file mode 100644 index 000000000..58432e6a7 --- /dev/null +++ b/test/csit/scripts/dmaap-buscontroller/onapCSIT.env @@ -0,0 +1,18 @@ +#!/bin/bash +# +# environment settings for Dmaap Bus Controller Integration Test. +# assumes args are: +# $1 - FQDN of AAF server +# $2 - FQDN of MR server +# $3 - FQDN of DRPS Server +# Only need to set values where defaults aren't appropriate +# +cat <