Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | #!/bin/bash |
LiamBurke | cf7c8ca | 2019-03-15 15:25:23 +0000 | [diff] [blame] | 2 | # Place the scripts in run order: |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 3 | source ${SCRIPTS}/common_functions.sh |
LiamBurke | a451619 | 2019-02-11 12:28:55 +0000 | [diff] [blame] | 4 | SFTP_PORT=22 |
| 5 | VESC_PORT=8080 |
| 6 | export VESC_PORT=${VESC_PORT} |
| 7 | export CLI_EXEC_CLI_DFC="docker exec dfc /bin/sh -c \"ls /target | grep .gz\"" |
| 8 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 9 | # Clone DMaaP Message Router repo |
| 10 | mkdir -p $WORKSPACE/archives/dmaapmr |
| 11 | cd $WORKSPACE/archives/dmaapmr |
| 12 | git clone --depth 1 http://gerrit.onap.org/r/dmaap/messagerouter/messageservice -b master |
LiamBurke | ae583be | 2018-10-16 10:44:12 +0000 | [diff] [blame] | 13 | sed -i 's/enableCadi: false/enableCadi: "false"/g' /$WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose/docker-compose.yml |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 14 | cd $WORKSPACE/archives/dmaapmr/messageservice/src/main/resources/docker-compose |
| 15 | cp $WORKSPACE/archives/dmaapmr/messageservice/bundleconfig-local/etc/appprops/MsgRtrApi.properties /var/tmp/ |
| 16 | |
| 17 | # start DMaaP MR containers with docker compose and configuration from docker-compose.yml |
| 18 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 19 | docker-compose up -d |
| 20 | |
| 21 | ZOOKEEPER=$(docker ps -a -q --filter="name=zookeeper_1") |
| 22 | KAFKA=$(docker ps -a -q --filter="name=kafka_1") |
| 23 | DMAAP=$(docker ps -a -q --filter="name=dmaap_1") |
| 24 | |
| 25 | # Wait for initialization of Docker contaienr for DMaaP MR, Kafka and Zookeeper |
LiamBurke | f708f84 | 2018-10-10 09:26:26 +0000 | [diff] [blame] | 26 | for i in {1..10}; do |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 27 | if [ $(docker inspect --format '{{ .State.Running }}' $KAFKA) ] && \ |
| 28 | [ $(docker inspect --format '{{ .State.Running }}' $ZOOKEEPER) ] && \ |
| 29 | [ $(docker inspect --format '{{ .State.Running }}' $DMAAP) ] |
| 30 | then |
| 31 | echo "DMaaP Service Running" |
| 32 | break |
| 33 | else |
| 34 | echo sleep $i |
| 35 | sleep $i |
| 36 | fi |
| 37 | done |
| 38 | |
| 39 | # Get IP address of DMAAP, KAFKA, Zookeeper |
| 40 | KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA) |
| 41 | ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER) |
| 42 | DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) |
| 43 | |
| 44 | sleep 2 |
| 45 | # Shutdown DMAAP Container |
| 46 | docker kill $DMAAP |
| 47 | |
| 48 | # Initial docker-compose up and down is for populating kafka and zookeeper IPs in /var/tmp/MsgRtrApi.properites |
| 49 | sed -i -e '/config.zk.servers=/ s/=.*/='$ZOOKEEPER_IP'/' /var/tmp/MsgRtrApi.properties |
| 50 | sed -i -e '/kafka.metadata.broker.list=/ s/=.*/='$KAFKA_IP':9092/' /var/tmp/MsgRtrApi.properties |
| 51 | |
| 52 | # Start DMaaP MR containers with docker compose and configuration from docker-compose.yml |
| 53 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 54 | docker-compose up -d |
| 55 | sleep 5 |
| 56 | |
| 57 | # Clone DMaaP Data Router repo |
| 58 | mkdir -p $WORKSPACE/archives/dmaapdr |
| 59 | cd $WORKSPACE/archives/dmaapdr |
| 60 | git clone --depth 1 https://gerrit.onap.org/r/dmaap/datarouter -b master |
LiamBurke | 1344ef2 | 2018-10-19 15:22:16 +0000 | [diff] [blame] | 61 | cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources |
| 62 | mkdir docker-compose |
| 63 | cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose |
| 64 | cp $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 |
| 65 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 66 | docker login -u docker -p docker nexus3.onap.org:10001 |
| 67 | docker-compose up -d |
LiamBurke | ca7df55 | 2018-10-26 13:57:21 +0000 | [diff] [blame] | 68 | echo "Disregard the message ERROR: for datarouter-node Container 1234456 is unhealthy, this is expected behaiour at this stage" |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 69 | docker kill vescollector |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 70 | docker kill cbs |
LiamBurke | 248195d | 2019-04-03 10:21:12 +0100 | [diff] [blame] | 71 | sleep 10 |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 72 | CONSUL_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' consul ) |
| 73 | sed -i -e '/CONSUL_HOST:/ s/:.*/: '$CONSUL_IP'/' docker-compose.yml |
Bartek Grzybowski | 5f7b64b | 2020-03-23 12:57:08 +0100 | [diff] [blame^] | 74 | HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $7}') |
rajendrajaiswal | c117c75 | 2020-02-26 14:57:17 +0000 | [diff] [blame] | 75 | DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) |
| 76 | sed -i -e '/DMAAPHOST:/ s/:.*/: '$DMAAP_MR_IP'/' docker-compose.yml |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 77 | MARIADB=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb ) |
LiamBurke | 1344ef2 | 2018-10-19 15:22:16 +0000 | [diff] [blame] | 78 | sed -i 's/datarouter-mariadb/'$MARIADB'/g' $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/prov_data/provserver.properties |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 79 | docker-compose up -d |
LiamBurke | 248195d | 2019-04-03 10:21:12 +0100 | [diff] [blame] | 80 | sleep 5 |
| 81 | # Get IP address of datarrouger-prov, datarouter-node, fileconsumer-node. |
| 82 | DR_PROV_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-prov) |
| 83 | DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' datarouter-node) |
| 84 | DR_SUBSCIBER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fileconsumer-node) |
| 85 | DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) |
| 86 | |
| 87 | echo DR_PROV_IP=${DR_PROV_IP} |
| 88 | echo DR_NODE_IP=${DR_NODE_IP} |
| 89 | echo DR_GATEWAY_IP=${DR_GATEWAY_IP} |
| 90 | echo DR_SUBSCIBER_IP=${DR_SUBSCIBER_IP} |
| 91 | |
| 92 | docker kill datarouter-node |
| 93 | docker kill datarouter-prov |
| 94 | sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml |
| 95 | sed -i 's/2.2.2.2/'$DR_PROV_IP'/g' docker-compose.yml |
| 96 | docker-compose up -d |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 97 | |
| 98 | # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb |
LiamBurke | f708f84 | 2018-10-10 09:26:26 +0000 | [diff] [blame] | 99 | for i in {1..10}; do |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 100 | if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \ |
| 101 | [ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \ |
| 102 | [ $(docker inspect --format '{{ .State.Running }}' mariadb) ] |
| 103 | then |
| 104 | echo "DR Service Running" |
| 105 | break |
| 106 | else |
| 107 | echo sleep $i |
| 108 | sleep $i |
| 109 | fi |
| 110 | done |
| 111 | |
| 112 | sleep 5 |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 113 | |
| 114 | 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" |
| 115 | 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" |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 116 | docker exec datarouter-node /bin/sh -c "echo '${DR_SUBSCIBER_IP}' dmaap-dr-subscriber >> /etc/hosts" |
| 117 | |
LiamBurke | 248195d | 2019-04-03 10:21:12 +0100 | [diff] [blame] | 118 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 119 | # Get IP address of DMAAP, KAFKA, Zookeeper |
| 120 | DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $DMAAP) |
| 121 | KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA) |
| 122 | ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER) |
| 123 | VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector) |
| 124 | SFTP_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sftp) |
| 125 | |
| 126 | export VESC_IP=${VESC_IP} |
| 127 | export HOST_IP=${HOST_IP} |
| 128 | export DMAAP_MR_IP=${DMAAP_MR_IP} |
| 129 | |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 130 | |
LiamBurke | f8d0c2e | 2019-03-13 12:47:16 +0000 | [diff] [blame] | 131 | # Data File Collector configuration : |
rajendrajaiswal | 44762cc | 2019-07-31 15:45:04 +0000 | [diff] [blame] | 132 | sed -i 's/5.5.5.5/'$DR_NODE_IP'/g' docker-compose.yml |
LiamBurke | f8d0c2e | 2019-03-13 12:47:16 +0000 | [diff] [blame] | 133 | cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/datafile_endpoints.json /tmp/ |
| 134 | sed -i 's/dmaapmrhost/'${DMAAP_MR_IP}'/g' /tmp/datafile_endpoints.json |
| 135 | sed -i 's/dmaapdrhost/'${DR_PROV_IP}'/g' /tmp/datafile_endpoints.json |
| 136 | echo data_endpoints.json to be copied onto the DFC containter |
| 137 | cat /tmp/datafile_endpoints.json |
| 138 | docker-compose up -d |
| 139 | sleep 2 |
| 140 | # DFC is now online |
| 141 | docker cp dfc:/opt/app/datafile/config/datafile_endpoints.json /tmp/datafile_endpoints.json.fromcontainer |
| 142 | echo data_endpoints.json from DFC containter |
| 143 | cat /tmp/datafile_endpoints.json.fromcontainer |
| 144 | docker cp /tmp/datafile_endpoints.json dfc:/opt/app/datafile/config/ |
yanhuanwang | b7d9f29 | 2019-09-10 13:38:46 +0200 | [diff] [blame] | 145 | docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/application.yaml dfc:/opt/app/datafile/config/ |
LiamBurke | f8d0c2e | 2019-03-13 12:47:16 +0000 | [diff] [blame] | 146 | #Increase Logging |
yanhuanwang | b7d9f29 | 2019-09-10 13:38:46 +0200 | [diff] [blame] | 147 | #docker 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" |
LiamBurke | f8d0c2e | 2019-03-13 12:47:16 +0000 | [diff] [blame] | 148 | docker restart dfc |
| 149 | sleep 2 |
| 150 | |
LiamBurke | 248195d | 2019-04-03 10:21:12 +0100 | [diff] [blame] | 151 | # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb, Consul, CBS |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 152 | for i in {1..10}; do |
| 153 | if [ $(docker inspect --format '{{ .State.Running }}' consul) ] && \ |
rajendrajaiswal | 44762cc | 2019-07-31 15:45:04 +0000 | [diff] [blame] | 154 | [ $(docker inspect --format '{{ .State.Running }}' cbs) ] |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 155 | then |
LiamBurke | 248195d | 2019-04-03 10:21:12 +0100 | [diff] [blame] | 156 | echo "Data Router, Consul, Config Binding Service Services Running" |
LiamBurke | 3608af7 | 2019-03-12 22:50:33 +0000 | [diff] [blame] | 157 | break |
| 158 | else |
| 159 | echo sleep $i |
| 160 | sleep $i |
| 161 | fi |
| 162 | done |
| 163 | sleep 10 |
| 164 | |
LiamBurke | cf7c8ca | 2019-03-15 15:25:23 +0000 | [diff] [blame] | 165 | pip install jsonschema uuid simplejson |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 166 | # Wait container ready |
| 167 | sleep 2 |
| 168 | |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 169 | # Update the File Ready Notification with actual sftp ip address and copy pm files to sftp server. |
rajendrajaiswal | 0d357f3 | 2018-09-28 10:18:19 +0100 | [diff] [blame] | 170 | cp $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotification.json $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 171 | sed -i 's/sftpserver/'${SFTP_IP}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json |
LiamBurke | a451619 | 2019-02-11 12:28:55 +0000 | [diff] [blame] | 172 | sed -i 's/sftpport/'${SFTP_PORT}'/g' $WORKSPACE/tests/usecases/5G-bulkpm/assets/json_events/FileExistNotificationUpdated.json |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 173 | docker cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/xNF.pm.xml.gz sftp:/home/admin/ |
LiamBurke | ab2e098 | 2019-04-11 11:43:42 +0100 | [diff] [blame] | 174 | docker cp $WORKSPACE/tests/dcaegen2-pmmapper/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz sftp:/home/admin/ |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 175 | |
| 176 | # Data Router Configuration: |
| 177 | # Create default feed and create file consumer subscriber on data router |
egernug | 6f2874b | 2019-02-06 15:16:54 +0000 | [diff] [blame] | 178 | 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 |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 179 | cp $WORKSPACE/plans/usecases/5G-bulkpm/assets/addSubscriber.json /tmp/addSubscriber.json |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 180 | sed -i 's/fileconsumer/'${DR_SUBSCIBER_IP}'/g' /tmp/addSubscriber.json |
egernug | 6f2874b | 2019-02-06 15:16:54 +0000 | [diff] [blame] | 181 | 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 |
rajendrajaiswal | b99eedc | 2018-10-02 09:42:23 +0100 | [diff] [blame] | 182 | sleep 10 |
LiamBurke | f708f84 | 2018-10-10 09:26:26 +0000 | [diff] [blame] | 183 | curl -k https://$DR_PROV_IP:8443/internal/prov |
LiamBurke | a451619 | 2019-02-11 12:28:55 +0000 | [diff] [blame] | 184 | |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 185 | # Consul Configuration for PM Mapper |
| 186 | cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cbs.json /tmp/cbs.json |
| 187 | sed -i 's/ipaddress/'${CBS_IP}'/g' /tmp/cbs.json |
| 188 | curl --request PUT --data @/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register |
rajendrajaiswal | c117c75 | 2020-02-26 14:57:17 +0000 | [diff] [blame] | 189 | curl '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/usecases/5G-bulkpm/assets/config.json |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 190 | |
| 191 | # PM Mapper startup and configuration |
| 192 | mkdir /tmp/docker-compose |
| 193 | cd /tmp/docker-compose |
tragait | cd8b66c | 2020-02-05 17:02:20 +0000 | [diff] [blame] | 194 | cp $WORKSPACE/plans/usecases/5G-bulkpm/composefile/docker-compose-pmmapper.yml /tmp/docker-compose/docker-compose.yml |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 195 | CBS_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cbs) |
| 196 | sed -i 's/CBSIP/'$CBS_IP'/g' docker-compose.yml |
| 197 | sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml |
rajendrajaiswal | 44762cc | 2019-07-31 15:45:04 +0000 | [diff] [blame] | 198 | sed -i 's/4.4.4.4/'$MARIADB'/g' docker-compose.yml |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 199 | docker-compose up -d |
| 200 | |
LiamBurke | ab2e098 | 2019-04-11 11:43:42 +0100 | [diff] [blame] | 201 | cd $WORKSPACE/archives/dmaapdr/datarouter/datarouter-docker-compose/src/main/resources/docker-compose |
| 202 | PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper) |
| 203 | docker kill datarouter-node |
| 204 | docker kill datarouter-prov |
| 205 | sed -i 's/1.1.1.1/'$DR_NODE_IP'/g' docker-compose.yml |
| 206 | sed -i 's/2.2.2.2/'$DR_PROV_IP'/g' docker-compose.yml |
| 207 | sed -i 's/3.3.3.3/'$PMMAPPER_IP'/g' docker-compose.yml |
| 208 | docker-compose up -d |
| 209 | |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 210 | # Setting up PM Mapper certs. |
rajendrajaiswal | 744ed22 | 2020-03-02 14:53:27 +0000 | [diff] [blame] | 211 | docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/cert.jks pmmapper:opt/app/pm-mapper/etc/ |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 212 | docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/jks.pass pmmapper:opt/app/pm-mapper/etc/ |
rajendrajaiswal | 744ed22 | 2020-03-02 14:53:27 +0000 | [diff] [blame] | 213 | docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.jks pmmapper:opt/app/pm-mapper/etc/ |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 214 | docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/trust.pass pmmapper:opt/app/pm-mapper/etc/ |
| 215 | docker restart pmmapper |
LiamBurke | ab2e098 | 2019-04-11 11:43:42 +0100 | [diff] [blame] | 216 | sleep 5 |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 217 | |
rajendrajaiswal | 44762cc | 2019-07-31 15:45:04 +0000 | [diff] [blame] | 218 | # Simulation setup for Message Router |
| 219 | docker cp $WORKSPACE/plans/dcaegen2-pmmapper/pmmapper/assets/mrserver.js mariadb:/ |
| 220 | docker exec mariadb /bin/bash -c "apt update" |
| 221 | sleep 2 |
| 222 | docker exec mariadb /bin/bash -c "apt install nodejs -y" |
| 223 | sleep 10 |
| 224 | docker exec mariadb /bin/bash -c "nodejs mrserver.js &" & |
| 225 | |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 226 | # Create PM Mapper feed and create PM Mapper subscriber on data router |
LiamBurke | ab2e098 | 2019-04-11 11:43:42 +0100 | [diff] [blame] | 227 | #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 |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 228 | curl -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 |
| 229 | |
| 230 | # Create PM Mapper tocic in Message Router |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 231 | PMMAPPER_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' pmmapper) |
| 232 | docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" > /tmp/pmmapper.log |
| 233 | cat /tmp/pmmapper.log |
| 234 | docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/fetchProv" |
| 235 | sleep 10 |
| 236 | curl -k https://$DR_PROV_IP:8443/internal/prov |
LiamBurke | f9d624a | 2019-04-10 10:41:26 +0100 | [diff] [blame] | 237 | |
| 238 | #Pass any variables required by Robot test suites in ROBOT_VARIABLES |
rajendrajaiswal | c117c75 | 2020-02-26 14:57:17 +0000 | [diff] [blame] | 239 | ROBOT_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}" |