blob: 1bba4f30ff8710341d2984db6e69cfdd3696ac75 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001#!/bin/bash
LiamBurkecf7c8ca2019-03-15 15:25:23 +00002# Place the scripts in run order:
Gary Wu9abb61c2018-09-27 10:38:50 -07003source ${SCRIPTS}/common_functions.sh
4
LiamBurkea4516192019-02-11 12:28:55 +00005CSIT=TRUE
6if [ ${CSIT} = "TRUE" ] ; then
7####################################################
8#Executes the below setup in an Docker Environment #
9####################################################
10
11echo "CSIT Test get executed in here"
12SFTP_PORT=22
13VESC_PORT=8080
14export VESC_PORT=${VESC_PORT}
15export CLI_EXEC_CLI_DFC="docker exec dfc /bin/sh -c \"ls /target | grep .gz\""
16
Gary Wu9abb61c2018-09-27 10:38:50 -070017# Clone DMaaP Message Router repo
18mkdir -p $WORKSPACE/archives/dmaapmr
19cd $WORKSPACE/archives/dmaapmr
20git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master
LiamBurkeae583be2018-10-16 10:44:12 +000021sed -i 's/enableCadi: false/enableCadi: "false"/g' /$WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/docker-compose.yml
Gary Wu9abb61c2018-09-27 10:38:50 -070022cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose
23cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/
24
25# start DMaaP MR containers with docker compose and configuration from docker-compose.yml
26docker login -u docker -p docker nexus3.onap.org:10001
27docker-compose up -d
28
29ZOOKEEPER=$(docker ps -a -q --filter="name=zookeeper_1")
30KAFKA=$(docker ps -a -q --filter="name=kafka_1")
31DMAAP=$(docker ps -a -q --filter="name=dmaap_1")
32
33# Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper
LiamBurkef708f842018-10-10 09:26:26 +000034for i in {1..10}; do
Gary Wu9abb61c2018-09-27 10:38:50 -070035if [ $(docker inspect --format '{{ .State.Running }}' $KAFKA) ] && \
36[ $(docker inspect --format '{{ .State.Running }}' $ZOOKEEPER) ] && \
37[ $(docker inspect --format '{{ .State.Running }}' $DMAAP) ]
38then
39 echo "DMaaP Service Running"
40 break
41else
42 echo sleep $i
43 sleep $i
44fi
45done
46
47# Get IP address of DMAAP, KAFKA, Zookeeper
48KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA)
49ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER)
50DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP)
51
52sleep 2
53# Shutdown DMAAP Container
54docker kill $DMAAP
55
56# Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites
57sed -i -e '/config.zk.servers=/ s/=.*/='$ZOOKEEPER_IP'/' /var/tmp/MsgRtrApi.properties
58sed -i -e '/kafka.metadata.broker.list=/ s/=.*/='$KAFKA_IP':9092/' /var/tmp/MsgRtrApi.properties
59
60# Start DMaaP MR containers with docker compose and configuration from docker-compose.yml
61docker login -u docker -p docker nexus3.onap.org:10001
62docker-compose up -d
63sleep 5
64
65# Clone DMaaP Data Router repo
66mkdir -p $WORKSPACE/archives/dmaapdr
67cd $WORKSPACE/archives/dmaapdr
68git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master
LiamBurke1344ef22018-10-19 15:22:16 +000069cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources
70mkdir docker-compose
71cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose
72cp $WORKSPACE/plans/usecases/5G-bulkpm/composefile/docker-compose-e2e.yml $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose.yml
73
Gary Wu9abb61c2018-09-27 10:38:50 -070074docker login -u docker -p docker nexus3.onap.org:10001
75docker-compose up -d
LiamBurkeca7df552018-10-26 13:57:21 +000076echo "Disregard the message ERROR: for datarouter-node Container 1234456 is unhealthy, this is expected behaiour at this stage"
Gary Wu9abb61c2018-09-27 10:38:50 -070077docker kill vescollector
LiamBurke3608af72019-03-12 22:50:33 +000078docker kill cbs
LiamBurke248195d2019-04-03 10:21:12 +010079sleep 10
LiamBurke3608af72019-03-12 22:50:33 +000080CONSUL_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' consul )
81sed -i -e '/CONSUL_HOST:/ s/:.*/: '$CONSUL_IP'/' docker-compose.yml
Gary Wu9abb61c2018-09-27 10:38:50 -070082HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
83sed -i -e '/DMAAPHOST:/ s/:.*/: '$HOST_IP'/' docker-compose.yml
84MARIADB=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb )
LiamBurke1344ef22018-10-19 15:22:16 +000085sed -i 's/datarouter-mariadb/'$MARIADB'/g' $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/prov_data/provserver.properties
Gary Wu9abb61c2018-09-27 10:38:50 -070086docker-compose up -d
LiamBurke248195d2019-04-03 10:21:12 +010087sleep 5
88# Get IP address of datarrouger-prov, datarouter-node, fileconsumer-node.
89DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov)
90DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node)
91DR_SUBSCIBER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fileconsumer-node)
92DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov)
93
94echo DR_PROV_IP=${DR_PROV_IP}
95echo DR_NODE_IP=${DR_NODE_IP}
96echo DR_GATEWAY_IP=${DR_GATEWAY_IP}
97echo DR_SUBSCIBER_IP=${DR_SUBSCIBER_IP}
98
99docker kill datarouter-node
100docker kill datarouter-prov
101sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml
102sed -i 's/2.2.2.2/'$DR_PROV_IP'/g' docker-compose.yml
103docker-compose up -d
Gary Wu9abb61c2018-09-27 10:38:50 -0700104
105# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb
LiamBurkef708f842018-10-10 09:26:26 +0000106for i in {1..10}; do
Gary Wu9abb61c2018-09-27 10:38:50 -0700107 if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \
108 [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \
109 [ $(docker inspect --format '{{ .State.Running }}' mariadb) ]
110 then
111 echo "DR Service Running"
112 break
113 else
114 echo sleep $i
115 sleep $i
116 fi
117done
118
119sleep 5
Gary Wu9abb61c2018-09-27 10:38:50 -0700120
121docker 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"
122docker 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"
Gary Wu9abb61c2018-09-27 10:38:50 -0700123docker exec datarouter-node /bin/sh -c "echo '${DR_SUBSCIBER_IP}' dmaap-dr-subscriber >> /etc/hosts"
124
LiamBurke248195d2019-04-03 10:21:12 +0100125
Gary Wu9abb61c2018-09-27 10:38:50 -0700126# Get IP address of DMAAP, KAFKA, Zookeeper
127DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP)
128KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA)
129ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER)
130VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector)
131SFTP_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sftp)
132
133export VESC_IP=${VESC_IP}
134export HOST_IP=${HOST_IP}
135export DMAAP_MR_IP=${DMAAP_MR_IP}
136
LiamBurke3608af72019-03-12 22:50:33 +0000137
LiamBurkef8d0c2e2019-03-13 12:47:16 +0000138# Data File Collector configuration :
139sed -i 's/DR_NODE_IP/'$DR_NODE_IP'/g' docker-compose.yml
140cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/datafile_endpoints.json /tmp/
141sed -i 's/dmaapmrhost/'${DMAAP_MR_IP}'/g' /tmp/datafile_endpoints.json
142sed -i 's/dmaapdrhost/'${DR_PROV_IP}'/g' /tmp/datafile_endpoints.json
143echo data_endpoints.json to be copied onto the DFC containter
144cat /tmp/datafile_endpoints.json
145docker-compose up -d
146sleep 2
147# DFC is now online
148docker cp dfc:/opt/app/datafile/config/datafile_endpoints.json /tmp/datafile_endpoints.json.fromcontainer
149echo data_endpoints.json from DFC containter
150cat /tmp/datafile_endpoints.json.fromcontainer
151docker cp /tmp/datafile_endpoints.json dfc:/opt/app/datafile/config/
152#Increase Logging
LiamBurkeb86a8bc2019-03-26 22:25:10 +0000153docker exec dfc /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml"
LiamBurkef8d0c2e2019-03-13 12:47:16 +0000154docker restart dfc
155sleep 2
156
LiamBurke248195d2019-04-03 10:21:12 +0100157# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb, Consul, CBS
LiamBurke3608af72019-03-12 22:50:33 +0000158for i in {1..10}; do
159 if [ $(docker inspect --format '{{ .State.Running }}' consul) ] && \
LiamBurke248195d2019-04-03 10:21:12 +0100160 [ $(docker inspect --format '{{ .State.Running }}' cbs) ]
LiamBurke3608af72019-03-12 22:50:33 +0000161 then
LiamBurke248195d2019-04-03 10:21:12 +0100162 echo "Data Router, Consul, Config Binding Service Services Running"
LiamBurke3608af72019-03-12 22:50:33 +0000163 break
164 else
165 echo sleep $i
166 sleep $i
167 fi
168done
169sleep 10
170
LiamBurkecf7c8ca2019-03-15 15:25:23 +0000171pip install jsonschema uuid simplejson
Gary Wu9abb61c2018-09-27 10:38:50 -0700172# Wait container ready
173sleep 2
174
Gary Wu9abb61c2018-09-27 10:38:50 -0700175# Update the File Ready Notification with actual sftp ip address and copy pm files to sftp server.
rajendrajaiswal0d357f32018-09-28 10:18:19 +0100176cp $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
Gary Wu13111e92018-09-27 11:31:33 -0700177sed -i 's/sftpserver/'${SFTP_IP}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
LiamBurkea4516192019-02-11 12:28:55 +0000178sed -i 's/sftpport/'${SFTP_PORT}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
Gary Wu13111e92018-09-27 11:31:33 -0700179docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/xNF.pm.xml.gz sftp:/home/admin/
LiamBurkeab2e0982019-04-11 11:43:42 +0100180docker cp $WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz sftp:/home/admin/
Gary Wu9abb61c2018-09-27 10:38:50 -0700181
182# Data Router Configuration:
183# Create default feed and create file consumer subscriber on data router
egernug6f2874b2019-02-06 15:16:54 +0000184curl -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
Gary Wu13111e92018-09-27 11:31:33 -0700185cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/addSubscriber.json /tmp/addSubscriber.json
Gary Wu9abb61c2018-09-27 10:38:50 -0700186sed -i 's/fileconsumer/'${DR_SUBSCIBER_IP}'/g' /tmp/addSubscriber.json
egernug6f2874b2019-02-06 15:16:54 +0000187curl -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
rajendrajaiswalb99eedc2018-10-02 09:42:23 +0100188sleep 10
LiamBurkef708f842018-10-10 09:26:26 +0000189curl -k https://$DR_PROV_IP:8443/internal/prov
LiamBurkea4516192019-02-11 12:28:55 +0000190
LiamBurkef9d624a2019-04-10 10:41:26 +0100191# Consul Configuration for PM Mapper
192cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json /tmp/cbs.json
193sed -i 's/ipaddress/'${CBS_IP}'/g' /tmp/cbs.json
194curl --request PUT --data @/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register
195curl 'http://'$CONSUL_IP':8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/config.json
196
197# PM Mapper startup and configuration
198mkdir /tmp/docker-compose
199cd /tmp/docker-compose
200cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/composefile/docker-compose-pmmapper.yml /tmp/docker-compose/docker-compose.yml
201CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cbs)
202sed -i 's/CBSIP/'$CBS_IP'/g' docker-compose.yml
203sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml
204sed -i 's/4.4.4.4/'$DMAAP_MR_IP'/g' docker-compose.yml
205docker-compose up -d
206
LiamBurkeab2e0982019-04-11 11:43:42 +0100207cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose
208PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper)
209docker kill datarouter-node
210docker kill datarouter-prov
211sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml
212sed -i 's/2.2.2.2/'$DR_PROV_IP'/g' docker-compose.yml
213sed -i 's/3.3.3.3/'$PMMAPPER_IP'/g' docker-compose.yml
214docker-compose up -d
215
LiamBurkef9d624a2019-04-10 10:41:26 +0100216# Setting up PM Mapper certs.
217docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cert.jks.b64 pmmapper:opt/app/pm-mapper/etc/
218docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/jks.pass pmmapper:opt/app/pm-mapper/etc/
219docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.jks.b64 pmmapper:opt/app/pm-mapper/etc/
220docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.pass pmmapper:opt/app/pm-mapper/etc/
221docker restart pmmapper
LiamBurkeab2e0982019-04-11 11:43:42 +0100222sleep 5
LiamBurkef9d624a2019-04-10 10:41:26 +0100223
224# Create PM Mapper feed and create PM Mapper subscriber on data router
LiamBurkeab2e0982019-04-11 11:43:42 +0100225#curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443
LiamBurkef9d624a2019-04-10 10:41:26 +0100226curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" --data-ascii @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/addSubscriber.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1
227
228# Create PM Mapper tocic in Message Router
229curl -v -X POST http://${DMAAP_MR_IP}:3904/topics/create -d @$WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/createTopic.json -H "Content-Type: application/json"
230PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper)
231docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > /tmp/pmmapper.log
232cat /tmp/pmmapper.log
233docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/fetchProv"
234sleep 10
235curl -k https://$DR_PROV_IP:8443/internal/prov
236curl http://${DMAAP_MR_IP}:3904/events/PM_MAPPER/CG1/C1?timeout=1000
237
238#Pass any variables required by Robot test suites in ROBOT_VARIABLES
239ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT} -v DR_SUBSCIBER_IP:${DR_SUBSCIBER_IP} -v SFTP_IP:${SFTP_IP}"
240
LiamBurkea4516192019-02-11 12:28:55 +0000241else
242############################################################
243############################################################
244# Executes the below setup in an ONAP Environment #
245# Make sure the steps in the README are completed first !! #
246############################################################
247############################################################
248SFTP_PORT=2222
249
250cp $WORKSPACE/plans/usecases/5G-bulkpm/teardown.sh $WORKSPACE/plans/usecases/5G-bulkpm/teardown.sh.orig
251cp $WORKSPACE/plans/usecases/5G-bulkpm/onap.teardown.sh $WORKSPACE/plans/usecases/5G-bulkpm/teardown.sh
252
253#Get DataFileCollector POD name in this ONAP Deployment
254DFC_POD=$(kubectl -n onap get pods | grep datafile-collector | awk '{print $1}')
255export DFC_POD=${DFC_POD}
256export CLI_EXEC_CLI_DFC="kubectl exec -n onap ${DFC_POD} -it ls /target | grep .gz"
257
258# Get IP address of datarrouter-prov
259DR_PROV_IP=$(kubectl -n onap -o wide get pods | grep dmaap-dr-prov | awk '{print $6}')
260echo DR_PROV_IP=${DR_PROV_IP}
261DR_NODE_IP=$(kubectl -n onap -o=wide get pods | grep dmaap-dr-node | awk '{print $6}')
262echo DR_NODE_IP=${DR_NODE_IP}
263
264# Get IP address of exposed Ves and its port
265DMAAP_MR_IP=$(kubectl -n onap -o=wide get pods | grep dev-dmaap-message-router | grep -Ev "kafka|zookeeper" | awk '{print $6}')
266VESC_IP=$(kubectl get svc -n onap | grep vesc | awk '{print $4}')
267VESC_PORT=$(kubectl get svc -n onap | grep vesc | awk '{print $5}' | cut -d ":" -f2 | cut -d "/" -f1)
268echo VESC_IP=${VESC_IP}
269echo VESC_PORT=${VESC_PORT}
270
271export VESC_IP=${VESC_IP}
272export VESC_PORT=${VESC_PORT}
273export HOST_IP=${HOST_IP}
274export DMAAP_MR_IP=${DMAAP_MR_IP}
275
276#Get DataFileCollector POD name in this ONAP Deployment
277DFC_POD=$(kubectl -n onap get pods | grep datafile-collector | awk '{print $1}')
278export DFC_POD=${DFC_POD}
279
LiamBurkecf7c8ca2019-03-15 15:25:23 +0000280pip install jsonschema uuid simplejson
LiamBurkea4516192019-02-11 12:28:55 +0000281
282# Clone DMaaP Data Router repo
283mkdir -p $WORKSPACE/archives/dmaapdr
284cd $WORKSPACE/archives/dmaapdr
285git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master
286cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources
287mkdir docker-compose
288cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose
289cp $WORKSPACE/plans/usecases/5G-bulkpm/composefile/onap.docker-compose-e2e $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose/docker-compose.yml
290
291#Statup the SFTP and FileConsumer containers.
292docker login -u docker -p docker nexus3.onap.org:10001
293docker-compose up -d
294
295# Wait container ready
296sleep 2
297HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
298# SFTP Configuration:
299# Update the File Ready Notification with actual sftp ip address and copy pm files to sftp server.
300cp $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
301sed -i 's/sftpserver/'${HOST_IP}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
302sed -i 's/sftpport/'${SFTP_PORT}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json
303docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/xNF.pm.xml.gz sftp:/home/admin/
304
305# Create default feed and create file consumer subscriber on data router
LiamBurkeb86a8bc2019-03-26 22:25:10 +0000306curl -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
LiamBurkea4516192019-02-11 12:28:55 +0000307cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/addSubscriber.json /tmp/addSubscriber.json
308sed -i 's/fileconsumer/'${HOST_IP}'/g' /tmp/addSubscriber.json
LiamBurkeb86a8bc2019-03-26 22:25:10 +0000309curl -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
LiamBurkea4516192019-02-11 12:28:55 +0000310sleep 10
311curl -k https://$DR_PROV_IP:8443/internal/prov
312
313#Pass any variables required by Robot test suites in ROBOT_VARIABLES
314ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v VESC_IP:${VESC_IP} -v VESC_PORT:${VESC_PORT} -v DR_SUBSCIBER_IP:${DR_SUBSCIBER_IP} -v DFC_POD:${DFC_POD} -v HOST_IP:${HOST_IP} "
315
LiamBurkecf7c8ca2019-03-15 15:25:23 +0000316fi;