diff options
Diffstat (limited to 'test/csit/plans/dcae-bulkpm')
4 files changed, 59 insertions, 21 deletions
diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json new file mode 100644 index 000000000..612c4626a --- /dev/null +++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/addSubscriber.json @@ -0,0 +1,18 @@ +{ + "delivery":{ + "url":"http://fileconsumer:7070", + "user":"LOGIN", + "password":"PASSWORD", + "use100":true + }, + "follow_redirect":false, + "metadataOnly":false, + "suspend":false, + "groupid":0, + "links":{ + "self": "https://dmaap-dr-prov/subscribe/1", + "log": "https://dmaap-dr-prov/feedlog/1", + "feed": "https://dmaap-dr-prov/feed/1" + }, + "subscriber":"admin" + }
\ No newline at end of file diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json new file mode 100644 index 000000000..fdcc7eef6 --- /dev/null +++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json @@ -0,0 +1,18 @@ +{ + "name": "DefaultFeed", + "version": "m1.0", + "description": "Default feed", + "business_description": "Default Feed", + "suspend": false, + "deleted": false, + "changeowner": true, + "authorization": { + "classification": "unclassified", + "endpoint_addrs": [], + "endpoint_ids": [ + { + "password": "dradmin", + "id": "dradmin" + }] + } + }
\ No newline at end of file diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh b/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh index c9f5318dd..24027e911 100644 --- a/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh +++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/setup.sh @@ -63,7 +63,8 @@ docker-compose up -d docker kill datarouter-prov docker kill datarouter-node docker kill vescollector -sed -i -e '/DMAAPHOST:/ s/:.*/: '$DMAAP_MR_IP'/' docker-compose.yml +HOST_IP=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}') +sed -i -e '/DMAAPHOST:/ s/:.*/: '$HOST_IP'/' docker-compose.yml MARIADB=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mariadb ) sed -i 's/172.100.0.2/'$MARIADB'/g' $WORKSPACE/archives/dmaapdr/datarouter/docker-compose/prov_data/provserver.properties docker-compose up -d @@ -90,10 +91,6 @@ DR_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress} DR_SUBSCIBER_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' subscriber-node) DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) -#Add the DR_NODE_IP to /etc/hosts -echo "${DR_NODE_IP} dmaap-dr-node" >> /etc/hosts -echo "${DR_PROV_IP} dmaap-dr-prov" >> /etc/hosts - echo DR_PROV_IP=${DR_PROV_IP} echo DR_NODE_IP=${DR_NODE_IP} echo DR_GATEWAY_IP=${DR_GATEWAY_IP} @@ -110,16 +107,23 @@ DMAAP_MR_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPA KAFKA_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $KAFKA) ZOOKEEPER_IP=$(docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $ZOOKEEPER) VESC_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' vescollector) +SFTP_IP=$(docker inspect '--format={{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sftp) export VESC_IP=${VESC_IP} export HOST_IP=${HOST_IP} export DMAAP_MR_IP=${DMAAP_MR_IP} -echo "${DMAAP_MR_IP} dmaap-mr" >> /etc/hosts - #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 VESC_IP:${VESC_IP}" +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 DR_SUBSCIBER_IP:${DR_SUBSCIBER_IP}" pip install jsonschema uuid # Wait container ready -sleep 2
\ No newline at end of file +sleep 2 +# Update the File Ready Notification with actual sftp ip address +sed -i 's/sftpserver/'${SFTP_IP}'/g' $WORKSPACE/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json +#Create default feed in 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/test/csit/plans/dcae-bulkpm/bulkpm-suite/assets/createFeed.json --post301 --location-trusted -k https://${DR_PROV_IP}:8443 +#create file consumer subscriber on data router. +cp $WORKSPACE/test/csit/plans/dcae-bulkpm/bulkpm-suite/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 diff --git a/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh b/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh index e3035f0c1..e11616ed3 100644 --- a/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh +++ b/test/csit/plans/dcae-bulkpm/bulkpm-suite/teardown.sh @@ -1,14 +1,12 @@ #!/bin/bash echo "Starting teardown script" -cd $WORKSPACE/test/csit/scripts -./kill-instance.sh $DMAAP -./kill-instance.sh $KAFKA -./kill-instance.sh $ZOOKEEPER -./kill-instance.sh vescollector -./kill-instance.sh datarouter-node -./kill-instance.sh datarouter-prov -./kill-instance.sh subscriber-node -./kill-instance.sh mariadb -./kill-instance.sh dfc -./kill-instance.sh sftp -sudo sed -i '/dmaap/d' /etc/hosts
\ No newline at end of file +kill-instance.sh $DMAAP +kill-instance.sh $KAFKA +kill-instance.sh $ZOOKEEPER +kill-instance.sh vescollector +kill-instance.sh datarouter-node +kill-instance.sh datarouter-prov +kill-instance.sh subscriber-node +kill-instance.sh mariadb +kill-instance.sh dfc +kill-instance.sh sftp
\ No newline at end of file |