From fa357dfc37bb5a71689a8390a287f7ec74a3fdd9 Mon Sep 17 00:00:00 2001 From: TamasBakai Date: Thu, 15 Aug 2019 08:25:27 +0000 Subject: Simulator integration for CSIT of generalized DfC Issue-ID: DCAEGEN2-1719 Change-Id: I963cfaef30bc4e85d76fecddd310f091e8c00bd0 Signed-off-by: TamasBakai --- .../simulator-group/consul/c12_feed2_PM.json | 2 +- .../simulator-group/consul/c12_feed2_PM_MEAS.json | 32 ++++++++++++++++++++++ .../simulator-group/consul/consul_config.json | 0 .../simulator-group/consul_config.sh | 19 ++++--------- .../simulator-group/simulators-start.sh | 2 +- 5 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_MEAS.json create mode 100644 test/mocks/datafilecollector-testharness/simulator-group/consul/consul_config.json (limited to 'test/mocks/datafilecollector-testharness/simulator-group') diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json index 9974c187f..8b87a5c3a 100644 --- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json +++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json @@ -24,7 +24,7 @@ "streams_subscribes":{ "dmaap_subscriber":{ "dmaap_info":{ - "topic_url":"http://dradmin:dradmin@mrsim:2222/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12" + "topic_url":"http://dradmin:dradmin@dfc_mr-sim:2222/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12" }, "type":"message_router" } diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_MEAS.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_MEAS.json new file mode 100644 index 000000000..9974c187f --- /dev/null +++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_MEAS.json @@ -0,0 +1,32 @@ +{ + "dmaap.ftpesConfig.keyCert":"config/dfc.jks", + "dmaap.ftpesConfig.keyPassword":"secret", + "dmaap.ftpesConfig.trustedCa":"config/ftp.jks", + "dmaap.ftpesConfig.trustedCaPassword":"secret", + "dmaap.security.trustStorePath":"change it", + "dmaap.security.trustStorePasswordPath":"trustStorePasswordPath", + "dmaap.security.keyStorePath":"keyStorePath", + "dmaap.security.keyStorePasswordPath":"change it", + "dmaap.security.enableDmaapCertAuth":"false", + "streams_publishes":{ + "PM_MEAS_FILES":{ + "type":"data_router", + "dmaap_info":{ + "username": "user", + "log_url": "https://drsim:3907/feedlog/2", + "publish_url": "https://drsim:3907/publish/2", + "location": "loc00", + "password": "password", + "publisher_id": "972.360gm" + } + } + }, + "streams_subscribes":{ + "dmaap_subscriber":{ + "dmaap_info":{ + "topic_url":"http://dradmin:dradmin@mrsim:2222/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12" + }, + "type":"message_router" + } + } +} diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/consul_config.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/consul_config.json new file mode 100644 index 000000000..e69de29bb diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh b/test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh index a3492b93d..5e8f7e2d4 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh @@ -1,4 +1,5 @@ #!/bin/bash +bash -x # Script to configure consul with json configuration files with 'localhost' urls. This # is needed when running the simulator as as a stand-alone app or via a dfc container in 'host' network mode. @@ -24,20 +25,10 @@ if ! [ -f $3 ]; then exit 1 fi -if [ $1 == "app" ]; then - appname=$DFC_APP_BASE$2 - echo "Replacing 'mrsim' with 'localhost' in json app config for consul" - sed 's/mrsim/localhost/g' $3 > .tmp_file.json -elif [ $1 == "dmaap" ]; then - appname=$DFC_APP_BASE$2":dmaap" - echo "Replacing 'drsim' with 'localhost' in json dmaap config for consul" - sed 's/drsim/localhost/g' $3 > .tmp_file.json -else - __print_err "config type should be 'app' or 'dmaap'" - exit 1 -fi - echo "Configuring consul for " $appname " from " $3 -curl -s http://127.0.0.1:${CONSUL_PORT}/v1/kv/${appname}?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary "@"$tmp_file.json >/dev/null +curl -s http://127.0.0.1:${CONSUL_PORT}/v1/kv/${appname}?dc=dc1 -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary "@"$3 + +echo "Reading back from consul:" +curl "http://127.0.0.1:${CONSUL_PORT}/v1/kv/${appname}?dc=dc1&raw=0" echo "done" \ No newline at end of file diff --git a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh index 82ad6aa1e..9370f99a6 100755 --- a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh +++ b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -x server_check() { for i in {1..10}; do res=$(curl -s -o /dev/null -w "%{http_code}" localhost:$2$3) -- cgit 1.2.3-korg