+ export 'PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin' + RESP_CACHE=/opt/app/config/cache + RESP=/dev/null + APP_ROOT=/opt/app/dbc-client + IF_PUB_SUB_EXIST=false + CONFIGMAP_ROOT=/opt/app/config + PORT=8080 + DBC=dmaap-bc + PROTO=http + PARAM='useExisting=true' + REQUESTID=dcae-pm-mapper-dmaap-provisioning + URL=http://dmaap-bc:8080/webapi/ + CA_PEM=ca.pem + KEY_PEM=key.pem + CLIENT_PEM=client.pem + PEM_DIR=/opt/app/osaaf/local + CERT_PWD='2U[iOZzMHI:.#tdCwlBqc;}S' + BA_PWD='demo123456!' + AUTH_METHOD=basicAuth + BA_IDENTITY=dmaap-bc@dmaap-bc.onap.org + init_config + '[' '!' -d /opt/app/dbc-client -a '!' -d /opt/app/config ] + cd /opt/app/osaaf/local + '[' basicAuth '=' basicAuth ] + echo '-u dmaap-bc@dmaap-bc.onap.org:demo123456!' + CURL_CRED='-K /opt/app/osaaf/local/curl.cred' + init_dbc_provisioning + cd /opt/app/config + '[' -d dmaap ] + '[' -d dcaeLocations ] + '[' -d mr_clusters ] + '[' -d topics ] + '[' -d mr_clients ] + '[' -d dr_nodes ] + '[' -d feeds ] + ls feeds/feedConfig-0.json + do_http_post feeds/feedConfig-0.json feeds + RETRY_TIME=60 + '[' -n /opt/app/config/cache ] + echo feedConfig-0.json + cut -d . -f1 + RESP=/opt/app/config/cache/feedConfig-0-resp.json + true + '[' feeds '!=' feeds -a feeds '!=' topics ] + xcurl -o /opt/app/config/cache/feedConfig-0-resp.json -d @feeds/feedConfig-0.json 'http://dmaap-bc:8080/webapi/feeds/?useExisting=true' + curl -X POST -s '-K /opt/app/osaaf/local/curl.cred' -w '%{http_code}' -H 'X-ECOMP-RequestID: dcae-pm-mapper-dmaap-provisioning' -H 'Content-Type: application/json' -o /opt/app/config/cache/feedConfig-0-resp.json -d @feeds/feedConfig-0.json 'http://dmaap-bc:8080/webapi/feeds/?useExisting=true' + rc=200 + '[' 200 '=' 200 -o 200 '=' 201 -o 200 '=' 409 ] + echo 'Http Post request for feed creation is successful with response code=200' + break + '[' -d dr_pubs ] + '[' -d dr_subs ] Http Post request for feed creation is successful with response code=200 + ls dr_subs/drsubConfig-0.json + do_http_post dr_subs/drsubConfig-0.json dr_subs + RETRY_TIME=60 + '[' -n /opt/app/config/cache ] + echo drsubConfig-0.json + cut -d . -f1 + RESP=/opt/app/config/cache/drsubConfig-0-resp.json + true + '[' dr_subs '!=' feeds -a dr_subs '!=' topics ] + cat dr_subs/drsubConfig-0.json + envsubst + req_body='{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' + '[' -n /opt/app/config/cache ] + '[' dr_subs '=' dr_pubs -o dr_subs '=' dr_subs ] + IF_PUB_SUB_EXIST=false + check_pub_sub dr_subs '{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' /opt/app/config/cache/drsubConfig-0-resp.json + echo 0 + feed_config_resp=/opt/app/config/cache/feedConfig-0-resp.json + '[' -f /opt/app/config/cache/feedConfig-0-resp.json ] + echo 'Checking if pub or sub exist..' + val=subs Checking if pub or sub exist.. + echo '{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' + jq -r .username + dr_usr=username + jq -r .userpwd + echo '{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' + dr_pwd=password + jq '.subs | length' /opt/app/config/cache/feedConfig-0-resp.json + pub_sub_cnt=0 + local 'i=0' + '[' 0 -lt 0 ] + '[' false '=' true ] + xcurl -o /opt/app/config/cache/drsubConfig-0-resp.json -d '{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' http://dmaap-bc:8080/webapi/dr_subs + curl -X POST -s '-K /opt/app/osaaf/local/curl.cred' -w '%{http_code}' -H 'X-ECOMP-RequestID: dcae-pm-mapper-dmaap-provisioning' -H 'Content-Type: application/json' -o /opt/app/config/cache/drsubConfig-0-resp.json -d '{"dcaeLocationName":"loc00","decompress":true,"deliveryURL":"http://dcae-pm-mapper:8081/delivery","feedName":"bulk_pm_feed","privilegedSubscriber":true,"username":"username","userpwd":"password"}' http://dmaap-bc:8080/webapi/dr_subs + rc=201 + '[' 201 '=' 200 -o 201 '=' 201 -o 201 '=' 409 ] + echo 'Http Post request is successful with response code=201' + break Http Post request is successful with response code=201