diff options
author | TamasBakai <tamas.bakai@est.tech> | 2019-08-15 08:25:27 +0000 |
---|---|---|
committer | Daniel Rose <dr695h@att.com> | 2019-08-15 14:14:18 +0000 |
commit | fa357dfc37bb5a71689a8390a287f7ec74a3fdd9 (patch) | |
tree | 3e0694bd1f0ba05a291ff9a537d3e73161b95552 /test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh | |
parent | 1160da46b6fd3a98608e59ca82c14529af94edbd (diff) |
Simulator integration for CSIT of generalized DfC
Issue-ID: DCAEGEN2-1719
Change-Id: I963cfaef30bc4e85d76fecddd310f091e8c00bd0
Signed-off-by: TamasBakai <tamas.bakai@est.tech>
Diffstat (limited to 'test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh')
-rwxr-xr-x | test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh | 19 |
1 files changed, 5 insertions, 14 deletions
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 |