Simulator integration for CSIT of generalized DfC 08/93608/2
authorTamasBakai <tamas.bakai@est.tech>
Thu, 15 Aug 2019 08:25:27 +0000 (08:25 +0000)
committerDaniel Rose <dr695h@att.com>
Thu, 15 Aug 2019 14:14:18 +0000 (14:14 +0000)
Issue-ID: DCAEGEN2-1719
Change-Id: I963cfaef30bc4e85d76fecddd310f091e8c00bd0
Signed-off-by: TamasBakai <tamas.bakai@est.tech>
test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js
test/mocks/datafilecollector-testharness/dr-sim/docker-compose.yml
test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py
test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json
test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_MEAS.json [new file with mode: 0644]
test/mocks/datafilecollector-testharness/simulator-group/consul/consul_config.json [new file with mode: 0644]
test/mocks/datafilecollector-testharness/simulator-group/consul_config.sh
test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh

index f94600a..e307cf6 100644 (file)
@@ -35,7 +35,7 @@ const tc_10p_error_response = "10p_error_response";
 const tc_10first_error_response = "10first_error_response";
 const tc_100first_error_response = "100first_error_response";
 
-var drr_sim_ip = '127.0.0.1'; //IP for redirect to DR redir sim. Can be changed by env DRR_SIM_IP
+var drr_sim_ip = 'drsim_redir'; //IP for redirect to DR redir sim. Can be changed by env DRR_SIM_IP
 
 //Counters
 var ctr_publish_query = [];
index 1ad4788..4d98c70 100644 (file)
@@ -14,4 +14,4 @@ services:
      - "3908:3908"
      - "3909:3909"
     container_name: drsim_redir
-    command: node dmaapDR_redir.js    
\ No newline at end of file
+    command: node dmaapDR_redir.js
\ No newline at end of file
index eefc61e..51e0bad 100644 (file)
@@ -18,7 +18,7 @@ sftp_hosts=[]
 sftp_ports=[]
 ftps_hosts=[]
 ftps_ports=[]
-num_ftp_servers=0
+num_ftp_servers=1
 
 def sumList(ctrArray):
     tmp=0
@@ -1218,6 +1218,7 @@ if __name__ == "__main__":
         ftps_ports.append(hp[1])
 
     groups = os.environ.get('MR_GROUPS', 'OpenDcae-c12:PM_MEAS_FILES')
+    print("Groups detected: " + groups )
     configuredPrefixes = os.environ.get('MR_FILE_PREFIX_MAPPING', 'PM_MEAS_FILES:A')
 
     if (len(groups) == 0 ):
index 9974c18..8b87a5c 100644 (file)
@@ -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 (file)
index 0000000..9974c18
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
index a3492b9..5e8f7e2 100755 (executable)
@@ -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
index 82ad6aa..9370f99 100755 (executable)
@@ -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)