Added functional tests for unauthenticated MR

NOTE: because these tests are all related, this commit
also addresses DMAAP-294,495, 297, 301 and 302.

Change-Id: I862f459e34517c838413728e6193e53a5ab20bc3
Signed-off-by: Dominic Lunanuova <dgl@research.att.com>
Issue-ID: DMAAP-293
diff --git a/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh
index 7ec7345..96ac40f 100755
--- a/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh
+++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh
@@ -17,6 +17,7 @@
 }
 EOF
 
+echo "Initializing /dmaap endpoint"
 curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dmaap 
 
 
@@ -33,20 +34,28 @@
 }
 EOF
 
+echo "Initializing /dcaeLocations endpoint"
 curl -v -X POST -d @${JSON} -H "Content-Type: application/json" http://$1:8080/webapi/dcaeLocations 
 
 
 # INITIALIZE: MR object in 1 site
+# since MR is currently deployed via docker-compose, its IP doesn't seem
+# to be routable from DBCL. Fortunately, the MR port is mapped from the docker bridge IP address.
+# Found this article for how to deterine the docker bridge IP so using it as a workaround.
+# https://stackoverflow.com/questions/22944631/how-to-get-the-ip-address-of-the-docker-host-from-inside-a-docker-container
+# Used the following snippet found buried in a comment to an answer and then modified for only 1 value.
+DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -1 )
+# Perhaps there is a better way...
 JSON=/tmp/$$.mrc
 cat << EOF > $JSON
 {
 	"dcaeLocationName": "csit-sanfrancisco",
-	"fqdn": "$3",
-	"hosts" : [ "$3", "$3", "$3" ],
-	"protocol" : "https",
-	"port": "3094"
+	"fqdn": "$DOCKER_HOST",
+	"topicProtocol" : "http",
+	"topicPort": "3904"
 
 }
 EOF
 
+echo "Initializing /mr_clusters endpoint"
 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
index 72c4438..688ce7d 100755
--- a/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh
+++ b/test/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh
@@ -4,13 +4,13 @@
 # sets global var IP with assigned IP address
 
 function dmaapbc_launch() {
-	TAG=onap/dmaap/buscontroller
+	TAG="nexus3.onap.org:10001/onap/dmaap/buscontroller"
 	CONTAINER_NAME=dmaapbc
 	IP=""
 
 	cd ${WORKSPACE}/test/csit/scripts/dmaap-buscontroller
 
-	TMP_CFG=/tmp/docker-databys-controller.conf
+	TMP_CFG=/tmp/docker-databus-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}`
@@ -22,9 +22,4 @@
     	sleep $i
 	done
 
-	set -x
-	${WORKSPACE}/test/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh ${IP}
-	set +x
-
-	
 }