aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/datafilecollector-testharness
diff options
context:
space:
mode:
authorecaiyanlinux <martin.c.yan@est.tech>2019-08-21 12:10:33 +0000
committerDaniel Rose <dr695h@att.com>2019-08-29 17:35:36 +0000
commit796e8fe4255036b5785a2071ddd6a0240464556a (patch)
treeb5d9ee29c9c07d91ea4848dafb12c5ae9cd7336d /test/mocks/datafilecollector-testharness
parent190a2f42b5c0af56b8c8da7e05a90ad3999598d3 (diff)
Add tls-init-container to simulator
1.replace dr-sim/dr-redir-sim cert/key 2.update mr-sim, make it support https 3.update ftpes cert/key Change-Id: I7bbde98f352d1e7d7c8775acf3d8af89a6ef7bdc Issue-ID: DCAEGEN2-1702 Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Diffstat (limited to 'test/mocks/datafilecollector-testharness')
-rwxr-xr-xtest/mocks/datafilecollector-testharness/auto-test/FTC1.sh14
-rwxr-xr-xtest/mocks/datafilecollector-testharness/auto-test/FTC2.sh14
-rwxr-xr-xtest/mocks/datafilecollector-testharness/auto-test/FTC3.sh14
-rw-r--r--test/mocks/datafilecollector-testharness/common/test_env.sh3
-rwxr-xr-xtest/mocks/datafilecollector-testharness/common/testcase_common.sh52
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/Dockerfile1
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/cert/certificate.crt21
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/cert/mydomain.csr18
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/cert/private.key28
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js6
-rw-r--r--test/mocks/datafilecollector-testharness/dr-sim/dmaapDR_redir.js12
-rw-r--r--test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps13
-rw-r--r--test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf6
-rwxr-xr-xtest/mocks/datafilecollector-testharness/mr-sim/Dockerfile3
-rw-r--r--test/mocks/datafilecollector-testharness/mr-sim/docker-compose.yml1
-rw-r--r--test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py30
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM.json4
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM_feed2_CTR.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR_feed3_LOG_TEMP.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM.json12
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_secureMR.json32
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed3_PM_CTR.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c13_feed2_CTR.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c14_feed3_LOG.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c15_feed1_PM_feed4_TEST.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/consul/c16_feed4_TEST_feed5_TEMP.json8
-rw-r--r--test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml46
-rwxr-xr-xtest/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh15
29 files changed, 236 insertions, 173 deletions
diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh
index fe6d45349..88f63c378 100755
--- a/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh
+++ b/test/mocks/datafilecollector-testharness/auto-test/FTC1.sh
@@ -29,13 +29,13 @@ log_sim_settings
start_simulators
-consul_config_app 0 "../simulator-group/consul/c12_feed2_PM.json"
+consul_config_app 0 "../simulator-group/consul/c12_feed2_PM_secureMR.json"
consul_config_dmaap 0 "../simulator-group/consul/dmaap_feed2.json"
-mr_equal ctr_requests 0 60
+mr_secure_equal ctr_requests 0 60
dr_equal ctr_published_files 0 60
-mr_print tc_info
+mr_secure_print tc_info
dr_print tc_info
drr_print tc_info
@@ -47,11 +47,11 @@ sleep_wait 30
dr_equal ctr_published_files 1
-mr_greater ctr_requests 1
+mr_secure_greater ctr_requests 1
-mr_equal ctr_events 1
-mr_equal ctr_unique_files 1
-mr_equal ctr_unique_PNFs 1
+mr_secure_equal ctr_events 1
+mr_secure_equal ctr_unique_files 1
+mr_secure_equal ctr_unique_PNFs 1
dr_equal ctr_publish_query 1
dr_equal ctr_publish_query_bad_file_prefix 0
diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh
index e46c0f287..6311bcf12 100755
--- a/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh
+++ b/test/mocks/datafilecollector-testharness/auto-test/FTC2.sh
@@ -29,13 +29,13 @@ log_sim_settings
start_simulators
-consul_config_app 0 "../simulator-group/consul/c12_feed2_PM.json"
+consul_config_app 0 "../simulator-group/consul/c12_feed2_PM_secureMR.json"
consul_config_dmaap 0 "../simulator-group/consul/dmaap_feed2.json"
-mr_equal ctr_requests 0 60
+mr_secure_equal ctr_requests 0 60
dr_equal ctr_published_files 0 60
-mr_print tc_info
+mr_secure_print tc_info
dr_print tc_info
drr_print tc_info
@@ -47,11 +47,11 @@ sleep_wait 30
dr_equal ctr_published_files 1
-mr_greater ctr_requests 1
+mr_secure_greater ctr_requests 1
-mr_equal ctr_events 1
-mr_equal ctr_unique_files 1
-mr_equal ctr_unique_PNFs 1
+mr_secure_equal ctr_events 1
+mr_secure_equal ctr_unique_files 1
+mr_secure_equal ctr_unique_PNFs 1
dr_equal ctr_publish_query 1
dr_equal ctr_publish_query_bad_file_prefix 0
diff --git a/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh b/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh
index 06baaefe4..1f7a8e9a1 100755
--- a/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh
+++ b/test/mocks/datafilecollector-testharness/auto-test/FTC3.sh
@@ -29,13 +29,13 @@ log_sim_settings
start_simulators
-consul_config_app 0 "../simulator-group/consul/c12_feed2_PM.json"
+consul_config_app 0 "../simulator-group/consul/c12_feed2_PM_secureMR.json"
consul_config_dmaap 0 "../simulator-group/consul/dmaap_feed2.json"
-mr_equal ctr_requests 0 60
+mr_secure_equal ctr_requests 0 60
dr_equal ctr_published_files 0 60
-mr_print tc_info
+mr_secure_print tc_info
dr_print tc_info
drr_print tc_info
@@ -47,11 +47,11 @@ sleep_wait 30
dr_equal ctr_published_files 1
-mr_greater ctr_requests 1
+mr_secure_greater ctr_requests 1
-mr_equal ctr_events 1
-mr_equal ctr_unique_files 1
-mr_equal ctr_unique_PNFs 1
+mr_secure_equal ctr_events 1
+mr_secure_equal ctr_unique_files 1
+mr_secure_equal ctr_unique_PNFs 1
dr_equal ctr_publish_query 1
dr_equal ctr_publish_query_bad_file_prefix 0
diff --git a/test/mocks/datafilecollector-testharness/common/test_env.sh b/test/mocks/datafilecollector-testharness/common/test_env.sh
index f4d443bff..7ba35ef27 100644
--- a/test/mocks/datafilecollector-testharness/common/test_env.sh
+++ b/test/mocks/datafilecollector-testharness/common/test_env.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# This env variable is only needed if the auto test scripts tests are executed in a different folder than 'auto-test' in the integration repo
+# This env variable is only needed if the auto test scripts tests are executed in a different folder than 'auto-test' in the integration repo
# Change '<local-path>' to your path to the integration repo. In addition to the auto-test, the 'common' dir is needed if not executed in the
# integration repo.
#
@@ -26,6 +26,7 @@ CONSUL_HOST="consul-server"
CONSUL_PORT=8500
CONFIG_BINDING_SERVICE="config-binding-service"
MR_PORT=2222
+MR_PORT_SECURE=2223
DR_PORT=3906
DR_PORT_SECURE=3907
DRR_PORT=3908
diff --git a/test/mocks/datafilecollector-testharness/common/testcase_common.sh b/test/mocks/datafilecollector-testharness/common/testcase_common.sh
index b0a14aa35..02aae7195 100755
--- a/test/mocks/datafilecollector-testharness/common/testcase_common.sh
+++ b/test/mocks/datafilecollector-testharness/common/testcase_common.sh
@@ -70,7 +70,7 @@ fi
TESTLOGS=$PWD/logs
# Create a log dir for the test case
-mkdir -p $TESTLOGS/$ATC
+mkdir -p $TESTLOGS/$ATC
# Clear the log dir for the test case
rm $TESTLOGS/$ATC/*.log &> /dev/null
@@ -99,7 +99,7 @@ if [ -z "$SIM_GROUP" ]; then
echo "Trying to set env var SIM_GROUP to dir 'simulator-group' in the integration repo, but failed."
echo "Please set the SIM_GROUP manually in the test_env.sh"
exit 1
- else
+ else
echo "SIM_GROUP auto set to: " $SIM_GROUP
fi
elif [ $SIM_GROUP = *simulator_group ]; then
@@ -198,7 +198,7 @@ __print_err() {
#<flag-to-strip-new-line> may contain any string, it is just a flag
# Returns the variable value (if success) and return code 0 or an error message and return code 1
__do_curl() {
- res=$(curl -sw "%{http_code}" $1)
+ res=$(curl -skw "%{http_code}" $1)
http_code="${res:${#res}-3}"
if [ ${#res} -eq 3 ]; then
echo "<no-response-from-server>"
@@ -543,7 +543,7 @@ start_dfc() {
if [ $1 -lt 0 ] || [ $1 -gt $DFC_MAX_IDX ]; then
__print_err "arg should be 0.."$DFC_MAX_IDX
exit 1
- fi
+ fi
appname=$DFC_APP_BASE$1
STARTED_DFCS=$STARTED_DFCS"_"$appname"_"
@@ -781,6 +781,15 @@ mr_print() {
echo -e "---- MR sim, \033[1m $1 \033[0m: $(__do_curl http://127.0.0.1:$MR_PORT/$1)"
}
+# Print a variable value from the MR https simulator. Arg: <variable-name>
+mr_secure_print() {
+ if [ $# != 1 ]; then
+ __print_err "need one arg, <sim-param>"
+ exit 1
+ fi
+ echo -e "---- MR sim, \033[1m $1 \033[0m: $(__do_curl https://127.0.0.1:$MR_PORT_SECURE/$1)"
+}
+
# Print a variable value from the DR simulator. Arg: <variable-name>
dr_print() {
if [ $# != 1 ]; then
@@ -818,6 +827,11 @@ mr_read() {
echo "$(__do_curl http://127.0.0.1:$MR_PORT/$1)"
}
+# Read a variable value from MR https sim and send to stdout. Arg: <variable-name>
+mr_secure_read() {
+ echo "$(__do_curl https://127.0.0.1:$MR_PORT_SECURE/$1)"
+}
+
# Read a variable value from DR sim and send to stdout. Arg: <variable-name>
dr_read() {
echo "$(__do_curl http://127.0.0.1:$DR_PORT/$1)"
@@ -894,6 +908,14 @@ mr_equal() {
fi
}
+mr_secure_equal() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "=" $2 $3
+ else
+ __print_err "Wrong args to mr_secure_equal, needs two or three args: <sim-param> <target-value> [ timeout ]"
+ fi
+}
+
# Tests if a variable value in the MR simulator is greater than a target value and and optional timeout.
# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
# greater than the target or not.
@@ -908,6 +930,14 @@ mr_greater() {
fi
}
+mr_secure_greater() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 ">" $2 $3
+ else
+ __print_err "Wrong args to mr_secure_greater, needs two or three args: <sim-param> <target-value> [ timeout ]"
+ fi
+}
+
# Tests if a variable value in the MR simulator is less than a target value and and optional timeout.
# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
# less than the target or not.
@@ -921,6 +951,13 @@ mr_less() {
__print_err "Wrong args to mr_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
fi
}
+mr_secure_less() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "<" $2 $3
+ else
+ __print_err "Wrong args to mr_secure_less, needs two or three args: <sim-param> <target-value> [ timeout ]"
+ fi
+}
# Tests if a variable value in the MR simulator contains the target string and and optional timeout.
# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable contains
@@ -935,6 +972,13 @@ mr_contain_str() {
__print_err "Wrong args to mr_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
fi
}
+mr_secure_contain_str() {
+ if [ $# -eq 2 ] || [ $# -eq 3 ]; then
+ __var_test "MR" "https://127.0.0.1:$MR_PORT_SECURE/" $1 "contain_str" $2 $3
+ else
+ __print_err "Wrong args to mr_secure_contain_str, needs two or three args: <sim-param> <target-value> [ timeout ]"
+ fi
+}
# Tests if a variable value in the DR simulator is equal to a target value and and optional timeout.
# Arg: <variable-name> <target-value> - This test set pass or fail depending on if the variable is
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/Dockerfile b/test/mocks/datafilecollector-testharness/dr-sim/Dockerfile
index da05eed58..cbe30366c 100644
--- a/test/mocks/datafilecollector-testharness/dr-sim/Dockerfile
+++ b/test/mocks/datafilecollector-testharness/dr-sim/Dockerfile
@@ -7,7 +7,6 @@ WORKDIR /app
COPY dmaapDR.js ./
COPY dmaapDR_redir.js ./
COPY package*.json ./
-COPY cert/ cert/
RUN npm install express
RUN npm install argparse
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/cert/certificate.crt b/test/mocks/datafilecollector-testharness/dr-sim/cert/certificate.crt
deleted file mode 100644
index df5a9acdb..000000000
--- a/test/mocks/datafilecollector-testharness/dr-sim/cert/certificate.crt
+++ /dev/null
@@ -1,21 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDijCCAnICCQDwhiz1dOajRzANBgkqhkiG9w0BAQUFADCBhjELMAkGA1UEBhMC
-U0UxEjAQBgNVBAgMCXN0b2NraG9sbTESMBAGA1UEBwwJc3RvY2tob2xtMQwwCgYD
-VQQKDANlc3QxCzAJBgNVBAsMAnJkMQswCQYDVQQDDAJyZDEnMCUGCSqGSIb3DQEJ
-ARYYbWFydGluLnlhbi5zZXVAZ21haWwuY29tMB4XDTE4MDkyNjA5MjQyOVoXDTE4
-MTAyNjA5MjQyOVowgYYxCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlzdG9ja2hvbG0x
-EjAQBgNVBAcMCXN0b2NraG9sbTEMMAoGA1UECgwDZXN0MQswCQYDVQQLDAJyZDEL
-MAkGA1UEAwwCcmQxJzAlBgkqhkiG9w0BCQEWGG1hcnRpbi55YW4uc2V1QGdtYWls
-LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANk/J7FGpQw/NCXx
-ZTqCstNOZrpA4jvHPHFpxzsWRPVdugEaZpshmQB0Riwk0uSWCW0XnNWu1sYnMnhp
-OeF2Npk/uTwndm5kMWxTul6h0bklw5k9Icbf4mFJssLouyeTWQxgFjpn6vSD4INC
-c8/vJKEmoFQHbuV4Ei4dUmhITKdXg6hWqD7jQCF2tHNQK0wceCahzvdYOBq5S9LF
-wLlf1FSmlTDdJjQptp18ZxBqRByePcbPk/6QW+su9tRQKXBAYxs33yUhlDDcU7hn
-BqIVH/u2CEcSyhs8IJ872HrMonOHhJq9cMfr3Knc2tsESSJykBqSF4blkQq1xIkN
-cjcQaDMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAQjoyXaSmu+eWC+AhPz63Ikwn
-QsOEET602iwO6zERe3O1cr2ZtxSzWO5LOmHCEQTZvDc3K+rtbqzruzdSE47l6vWb
-E6h1R2+SORs9fUuRN+HYTonpxSnNLcz2p1+874BKrnBofJBK+EUFbhV589Iar0Lz
-bkFDzmfWEgrr+Io7gW9bLW5q3yX7dAU7W7Dd4sYe+Afu1LlQPg3fLZO6lA09r5kc
-nu+Nu4qFhgY5pOUvtO8Yu3B+MnNk8m8xbba5oADgKtGCH0wZlM9P4Gb50v+L7Je1
-zFqVtvBTHoKXjrEQynyZXJVxtkr7eX/sZRoCVSuhiouL5MGyn6RTrDbBwzulpw==
------END CERTIFICATE-----
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/cert/mydomain.csr b/test/mocks/datafilecollector-testharness/dr-sim/cert/mydomain.csr
deleted file mode 100644
index da609a6f3..000000000
--- a/test/mocks/datafilecollector-testharness/dr-sim/cert/mydomain.csr
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE REQUEST-----
-MIIC4zCCAcsCAQAwgYYxCzAJBgNVBAYTAlNFMRIwEAYDVQQIDAlzdG9ja2hvbG0x
-EjAQBgNVBAcMCXN0b2NraG9sbTEMMAoGA1UECgwDZXN0MQswCQYDVQQLDAJyZDEL
-MAkGA1UEAwwCcmQxJzAlBgkqhkiG9w0BCQEWGG1hcnRpbi55YW4uc2V1QGdtYWls
-LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANk/J7FGpQw/NCXx
-ZTqCstNOZrpA4jvHPHFpxzsWRPVdugEaZpshmQB0Riwk0uSWCW0XnNWu1sYnMnhp
-OeF2Npk/uTwndm5kMWxTul6h0bklw5k9Icbf4mFJssLouyeTWQxgFjpn6vSD4INC
-c8/vJKEmoFQHbuV4Ei4dUmhITKdXg6hWqD7jQCF2tHNQK0wceCahzvdYOBq5S9LF
-wLlf1FSmlTDdJjQptp18ZxBqRByePcbPk/6QW+su9tRQKXBAYxs33yUhlDDcU7hn
-BqIVH/u2CEcSyhs8IJ872HrMonOHhJq9cMfr3Knc2tsESSJykBqSF4blkQq1xIkN
-cjcQaDMCAwEAAaAXMBUGCSqGSIb3DQEJBzEIDAZzZWNyZXQwDQYJKoZIhvcNAQEL
-BQADggEBAHFdQI+uj5nPOLVtzpedYuPMe/z6xwKTFNBGtaBO45aQvIaBvBkSAe55
-AoNjHcuNIPpTWWk7VSz3P03gVIW8RQNkuqJ+G5XyxJPtZRyjZxF5tFXM9Qnia+oI
-MnPqpXLw4A5h5oR2MePAj8GaQxanD8KhoaRvPvcP4pR0uk8UpfTn8mTF2WNkErBb
-yDdfC5+Dm5S6NpPZFWcIAqQ73dtYN4BkSvfSrkTRAhIU0gFHeOJfp0Y25qHWfgZc
-wsU3OpbqzVHqjbsEWo4AC06U8H8kSjf4Z0e8ry6mabgEF/ukODcbZQpG77pbwgZ3
-tKkgxuGf8ylgr672GliitonkTusB2QY=
------END CERTIFICATE REQUEST-----
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/cert/private.key b/test/mocks/datafilecollector-testharness/dr-sim/cert/private.key
deleted file mode 100644
index c9fc39e06..000000000
--- a/test/mocks/datafilecollector-testharness/dr-sim/cert/private.key
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDZPyexRqUMPzQl
-8WU6grLTTma6QOI7xzxxacc7FkT1XboBGmabIZkAdEYsJNLklgltF5zVrtbGJzJ4
-aTnhdjaZP7k8J3ZuZDFsU7peodG5JcOZPSHG3+JhSbLC6Lsnk1kMYBY6Z+r0g+CD
-QnPP7yShJqBUB27leBIuHVJoSEynV4OoVqg+40AhdrRzUCtMHHgmoc73WDgauUvS
-xcC5X9RUppUw3SY0KbadfGcQakQcnj3Gz5P+kFvrLvbUUClwQGMbN98lIZQw3FO4
-ZwaiFR/7tghHEsobPCCfO9h6zKJzh4SavXDH69yp3NrbBEkicpAakheG5ZEKtcSJ
-DXI3EGgzAgMBAAECggEBAKmojan/XrPyxBoBrCmGmns1FjrMoyFGFikID8RQPuhU
-Gwfzg0ARe/iD1a1x0JUdqxzcPOoP0cEMKXkpzD8MX9VMk6+rrezGKGbN+JUg0LVE
-Db4lpLQ4cgXCVW2r7UUZ6IgmnhVcxHvSZcp8Yg94VmXX0YvuBigEnkYPNiUkmWBx
-IhO3dBUOpraOcUK1ChaEseL8I7rWWBxp8g71TS4Q+KqK9bELiSltwWpuKOpWPZL3
-496mVX57a/tMdsY2rzNp+aeC2T6nBcTOdQ9yodh9HWvc79QIw47vCGYqiHgXg706
-Qe4412kmcc2joB7bncOrOvDNERm3dsZHGwWHFn0qEMECgYEA+Gl+nN2wDKdQJ/89
-SnTEiBnRpv9qs/90dfZkPzOKSqchKTHPXB2TRft+gDZNrrVhzczZlXbC5FZ3pWI1
-U3zM6DtziikQH9udNf9E7ou9A+d8+KEw7EmuBim6L6mzwpCCmGURWPj5BmeK2vVV
-j+jOQGgBXnduadYXzI+dVyJPLZMCgYEA3+H08PE8GwRccIb9QFQuULKQgkl/aRKc
-Qq6Fpg87/0YdW2j99mZc2CkHbv66viRwYKNVLxHE6+98z6JYbnjaztfC7XvVkfHg
-6CTN/xUYCpZt7qp3TdEP3B6wieWuDP6srJVp9dX4zzS+PbANzkL0kCQq3ZcNjS9G
-kyD3j5upfuECgYBhRAVUbKUrPzPuhU09Yx004U8q4WWpVwQF0FUOPiMO+gPM+njj
-65yn0UKF9z1RhCnoiCZGFLtY5tZwRlT0/K/K2sRxu4RZxQb4hpw5/zMiXTicrZjX
-XD4soZgKY5tEOos4GpLBULNJI6/F7jvzXkesBk1K7N6pyC+HZFBKNt/jywKBgQC2
-J5gs+XmX2cKEY7BlyJguXDqrZrVdfiDZODnRVI/SMO/t0czfz4U28przuhmiXu94
-ESxbsa9w71ezcDlXGMmehXo50wl/RzdgaaGZK0Z2RtKG3vdWvwSSaf3lFJS6SfOg
-L6kYtdFMdXNbqYRyD5QAOw0NYbtK5e4cAzSpCVOswQKBgQCkVFcuk58MwtJDhlJz
-xQFOqFb8uDB4ab2O+eJuW2CnKuX34uS0oSUgkIDUsX8riCptZeQLWFrz1d9j7GRy
-I4JdvvTA4rWx7wPGRlOuC0W7EXolGgOEu2L0uvbO8wpTfS6lM3Bv0K0RdR3ORQjR
-MtevE5IzvzTMrVcv7kPsl9mNVw==
------END PRIVATE KEY-----
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js b/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js
index e307cf66f..7acf51034 100644
--- a/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js
+++ b/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR.js
@@ -8,8 +8,8 @@ var fs = require('fs');
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
-var privateKey = fs.readFileSync('cert/private.key', 'utf8');
-var certificate = fs.readFileSync('cert/certificate.crt', 'utf8');
+var privateKey = fs.readFileSync('cert/key.pem', 'utf8');
+var certificate = fs.readFileSync('cert/cert.pem', 'utf8');
var credentials = {key: privateKey, cert: certificate};
var feeds="1:A"; //Comma separated list of feedId:filePrefix. Default is feedId=1 and file prefix 'A'
@@ -87,7 +87,7 @@ if (args.tc==tc_normal) {
} else if (args.tc==tc_all_delay_1s) {
console.log("TC: " + args.tc)
-
+
} else if (args.tc==tc_all_delay_10s) {
console.log("TC: " + args.tc)
diff --git a/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR_redir.js b/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR_redir.js
index a5f1beb56..9e3454fef 100644
--- a/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR_redir.js
+++ b/test/mocks/datafilecollector-testharness/dr-sim/dmaapDR_redir.js
@@ -10,8 +10,8 @@ const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
var ArgumentParser = require('argparse').ArgumentParser;
-var privateKey = fs.readFileSync('cert/private.key', 'utf8');
-var certificate = fs.readFileSync('cert/certificate.crt', 'utf8');
+var privateKey = fs.readFileSync('cert/key.pem', 'utf8');
+var certificate = fs.readFileSync('cert/cert.pem', 'utf8');
var credentials = {key: privateKey, cert: certificate};
var total_first_publish=0;
@@ -68,7 +68,7 @@ if (args.tc==tc_normal) {
} else if (args.tc==tc_no_publish) {
console.log("TC: " + args.tc)
-
+
} else if (args.tc==tc_10p_no_response) {
console.log("TC: " + args.tc)
@@ -80,13 +80,13 @@ if (args.tc==tc_normal) {
} else if (args.tc==tc_all_delay_1s) {
console.log("TC: " + args.tc)
-
+
} else if (args.tc==tc_all_delay_10s) {
console.log("TC: " + args.tc)
} else if (args.tc==tc_10p_delay_10s) {
console.log("TC: " + args.tc)
-
+
} else if (args.tc==tc_10p_error_response) {
console.log("TC: " + args.tc)
@@ -327,7 +327,7 @@ app.put('/publish/:feedId/:filename', function (req, res) {
console.log(filename);
//Create filename (appending file size and feedid to name) to store
- var storedFilename = path.resolve(__dirname, filename+"-"+feedId+"-"+req.body.length);
+ var storedFilename = path.resolve(__dirname, filename+"-"+feedId+"-"+req.body.length);
fs.writeFile(storedFilename, "", function (error) { //Store file with zero size
if (error) { console.error(error); }
});
diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps b/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps
index 736314cef..a0d6cfafc 100644
--- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps
+++ b/test/mocks/datafilecollector-testharness/ftps-sftp-server/Dockerfile-ftps
@@ -1,18 +1,5 @@
FROM docker.io/panubo/vsftpd
-
-COPY tls/ftp.crt /etc/ssl/private/ftp.crt
-RUN chmod 644 /etc/ssl/private/ftp.crt
-RUN chown root:root /etc/ssl/private/ftp.crt
-
-COPY tls/ftp.key /etc/ssl/private/ftp.key
-RUN chmod 644 /etc/ssl/private/ftp.key
-RUN chown root:root /etc/ssl/private/ftp.key
-
-COPY tls/dfc.crt /etc/ssl/private/dfc.crt
-RUN chmod 644 /etc/ssl/private/dfc.crt
-RUN chown root:root /etc/ssl/private/dfc.crt
-
COPY configuration/vsftpd_ssl.conf /etc/vsftpd_ssl.conf
RUN chmod 644 /etc/vsftpd_ssl.conf
RUN chown root:root /etc/vsftpd_ssl.conf \ No newline at end of file
diff --git a/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf b/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf
index 6946bffe2..0a24e38a8 100644
--- a/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf
+++ b/test/mocks/datafilecollector-testharness/ftps-sftp-server/configuration/vsftpd_ssl.conf
@@ -48,10 +48,10 @@ allow_anon_ssl=NO
ssl_tlsv1=YES
ssl_sslv2=YES
ssl_sslv3=YES
-rsa_cert_file=/etc/ssl/private/ftp.crt
-rsa_private_key_file=/etc/ssl/private/ftp.key
+rsa_cert_file=/etc/ssl/private/cert.pem
+rsa_private_key_file=/etc/ssl/private/key.pem
require_cert=YES
ssl_request_cert=YES
-ca_certs_file=/etc/ssl/private/dfc.crt
+ca_certs_file=/etc/ssl/private/cacert.pem
diff --git a/test/mocks/datafilecollector-testharness/mr-sim/Dockerfile b/test/mocks/datafilecollector-testharness/mr-sim/Dockerfile
index 5341bb074..c54713e7f 100755
--- a/test/mocks/datafilecollector-testharness/mr-sim/Dockerfile
+++ b/test/mocks/datafilecollector-testharness/mr-sim/Dockerfile
@@ -6,5 +6,4 @@ WORKDIR /app
RUN pip install -r requirements.txt
-EXPOSE 2222
-
+EXPOSE 2222 2223
diff --git a/test/mocks/datafilecollector-testharness/mr-sim/docker-compose.yml b/test/mocks/datafilecollector-testharness/mr-sim/docker-compose.yml
index 7315e4be3..a02e6a423 100644
--- a/test/mocks/datafilecollector-testharness/mr-sim/docker-compose.yml
+++ b/test/mocks/datafilecollector-testharness/mr-sim/docker-compose.yml
@@ -5,6 +5,7 @@ services:
image: mrsim:latest
ports:
- "2222:2222"
+ - "2223:2223"
container_name: mrsim
command: python mr-sim.py --tc100
# Change -tc100 to other tc number for desired behavior. \ No newline at end of file
diff --git a/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py b/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py
index 51e0badef..6345ab69f 100644
--- a/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py
+++ b/test/mocks/datafilecollector-testharness/mr-sim/mr-sim.py
@@ -1,18 +1,19 @@
import argparse
+import json
import os
-from werkzeug import secure_filename
-from flask import Flask, render_template, request
-from time import sleep
-import time
import sys
-import json
-from flask import Flask
+import time
+from time import sleep
+
+from flask import Flask, render_template, request
+from werkzeug import secure_filename
app = Flask(__name__)
#Server info
HOST_IP = "0.0.0.0"
HOST_PORT = 2222
+HOST_PORT_TLS = 2223
sftp_hosts=[]
sftp_ports=[]
@@ -1144,7 +1145,7 @@ def getEventHead(groupIndex, changeId, nodename):
"changeType": "FileReady",
"changeIdentifier": \"""" + changeId + """",
"arrayOfNamedHashMap": [
- """
+ """
return headStr
# Function to build the variable part of an event
@@ -1300,7 +1301,7 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser()
-#SFTP TCs with single ME
+#SFTP TCs with single ME
parser.add_argument(
'--tc100',
action='store_true',
@@ -1717,5 +1718,16 @@ if __name__ == "__main__":
print("Using up to " + str(num_ftp_servers) + " ftp servers, for each protocol for PNFs.")
- app.run(port=HOST_PORT, host=HOST_IP)
+ def https_app(**kwargs):
+ import ssl
+ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
+ context.load_cert_chain('cert/cert.pem', 'cert/key.pem')
+ app.run(ssl_context=context, **kwargs)
+
+ from multiprocessing import Process
+
+ kwargs = dict(host=HOST_IP)
+ Process(target=https_app, kwargs=dict(kwargs, port=HOST_PORT_TLS),
+ daemon=True).start()
+ app.run(port=HOST_PORT, host=HOST_IP) \ No newline at end of file
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM.json
index 29acb16ce..ff3783d40 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM.json
@@ -1,8 +1,8 @@
{
"dmaap.ftpesConfig.keyCert":"config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword":"secret",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
"dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword":"secret",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath":"change it",
"dmaap.security.trustStorePasswordPath":"trustStorePasswordPath",
"dmaap.security.keyStorePath":"keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM_feed2_CTR.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM_feed2_CTR.json
index a37c3be4d..d26dd8d76 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM_feed2_CTR.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed1_PM_feed2_CTR.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR.json
index 31d3a4b67..96521498d 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR_feed3_LOG_TEMP.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR_feed3_LOG_TEMP.json
index b7b63cc27..6508749be 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR_feed3_LOG_TEMP.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_CTR_feed3_LOG_TEMP.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
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 8b87a5c3a..2ccfb1829 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
@@ -1,12 +1,12 @@
{
"dmaap.ftpesConfig.keyCert":"config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword":"secret",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
"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.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
+ "dmaap.security.trustStorePath":"config/ftp.jks",
+ "dmaap.security.trustStorePasswordPath":"config/ftp.pass",
+ "dmaap.security.keyStorePath":"config/dfc.jks",
+ "dmaap.security.keyStorePasswordPath":"config/dfc.pass",
"dmaap.security.enableDmaapCertAuth":"false",
"streams_publishes":{
"PM_MEAS_FILES":{
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_secureMR.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_secureMR.json
new file mode 100644
index 000000000..b11339a82
--- /dev/null
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed2_PM_secureMR.json
@@ -0,0 +1,32 @@
+{
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
+ "dmaap.security.trustStorePath":"config/ftp.jks",
+ "dmaap.security.trustStorePasswordPath":"config/ftp.pass",
+ "dmaap.security.keyStorePath":"config/dfc.jks",
+ "dmaap.security.keyStorePasswordPath":"config/dfc.pass",
+ "dmaap.security.enableDmaapCertAuth":"true",
+ "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":"https://dradmin:dradmin@mrsim:2223/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12"
+ },
+ "type":"message_router"
+ }
+ }
+}
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed3_PM_CTR.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed3_PM_CTR.json
index 617126863..b7063feee 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed3_PM_CTR.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c12_feed3_PM_CTR.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c13_feed2_CTR.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c13_feed2_CTR.json
index ade30aa89..6e8925f3f 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c13_feed2_CTR.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c13_feed2_CTR.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c14_feed3_LOG.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c14_feed3_LOG.json
index b98a46f73..2212765ab 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c14_feed3_LOG.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c14_feed3_LOG.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c15_feed1_PM_feed4_TEST.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c15_feed1_PM_feed4_TEST.json
index 7ee78f5cd..178552c46 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c15_feed1_PM_feed4_TEST.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c15_feed1_PM_feed4_TEST.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/consul/c16_feed4_TEST_feed5_TEMP.json b/test/mocks/datafilecollector-testharness/simulator-group/consul/c16_feed4_TEST_feed5_TEMP.json
index 7c68d7ac6..42fddd0b9 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/consul/c16_feed4_TEST_feed5_TEMP.json
+++ b/test/mocks/datafilecollector-testharness/simulator-group/consul/c16_feed4_TEST_feed5_TEMP.json
@@ -1,8 +1,8 @@
{
- "dmaap.ftpesConfig.keyCert": "config/dfc.jks",
- "dmaap.ftpesConfig.keyPassword": "secret",
- "dmaap.ftpesConfig.trustedCa": "config/ftp.jks",
- "dmaap.ftpesConfig.trustedCaPassword": "secret",
+ "dmaap.ftpesConfig.keyCert":"config/dfc.jks",
+ "dmaap.ftpesConfig.keyPassword":"hD:!w:CxF]lGvM6Mz9l^j[7U",
+ "dmaap.ftpesConfig.trustedCa":"config/ftp.jks",
+ "dmaap.ftpesConfig.trustedCaPassword":"ee%v.7Y3nf*We2T2Z$}}c%S?",
"dmaap.security.trustStorePath": "change it",
"dmaap.security.trustStorePasswordPath": "trustStorePasswordPath",
"dmaap.security.keyStorePath": "keyStorePath",
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml
index f078d36e3..78fa7cb1b 100644
--- a/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml
+++ b/test/mocks/datafilecollector-testharness/simulator-group/docker-compose-template.yml
@@ -29,6 +29,14 @@ services:
depends_on:
- consul-server
+ tls-init-container:
+ container_name: dfc_tls-init-container
+ image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.deployments.tls-init-container
+ networks:
+ - dfcnet
+ volumes:
+ - ./tls:/opt/tls/shared:rw
+
drsim:
networks:
- dfcnet
@@ -41,11 +49,15 @@ services:
- "3907:3907"
container_name: dfc_dr-sim
command: node dmaapDR.js ${DR_TC}
+ volumes:
+ - ./tls:/app/cert/:rw
+ depends_on:
+ - tls-init-container
drsim_redir:
networks:
- dfcnet
- environment:
+ environment:
DR_SIM_IP: drsim
DR_REDIR_FEEDS: ${DR_REDIR_FEEDS}
image: drsim_common:latest
@@ -54,6 +66,10 @@ services:
- "3909:3909"
container_name: dfc_dr-redir-sim
command: node dmaapDR_redir.js ${DR_REDIR_TC}
+ volumes:
+ - ./tls:/app/cert/:rw
+ depends_on:
+ - tls-init-container
mrsim:
networks:
@@ -66,9 +82,14 @@ services:
MR_FILE_PREFIX_MAPPING: ${MR_FILE_PREFIX_MAPPING}
image: mrsim:latest
ports:
- - "2222:2222"
+ - "2222:2222"
+ - "2223:2223"
container_name: dfc_mr-sim
command: python mr-sim.py ${MR_TC}
+ volumes:
+ - ./tls:/app/cert/:rw
+ depends_on:
+ - tls-init-container
sftp-server0:
networks:
@@ -132,6 +153,10 @@ services:
FTP_PASSWORD: pano
restart: on-failure
command: vsftpd /etc/vsftpd_ssl.conf
+ volumes:
+ - ./tls:/etc/ssl/private/:rw
+ depends_on:
+ - tls-init-container
ftpes-server-vsftpd1:
networks:
@@ -145,6 +170,10 @@ services:
FTP_PASSWORD: pano
restart: on-failure
command: vsftpd /etc/vsftpd_ssl.conf
+ volumes:
+ - ./tls:/etc/ssl/private/:rw
+ depends_on:
+ - tls-init-container
ftpes-server-vsftpd2:
networks:
@@ -158,6 +187,10 @@ services:
FTP_PASSWORD: pano
restart: on-failure
command: vsftpd /etc/vsftpd_ssl.conf
+ volumes:
+ - ./tls:/etc/ssl/private/:rw
+ depends_on:
+ - tls-init-container
ftpes-server-vsftpd3:
networks:
@@ -171,6 +204,10 @@ services:
FTP_PASSWORD: pano
restart: on-failure
command: vsftpd /etc/vsftpd_ssl.conf
+ volumes:
+ - ./tls:/etc/ssl/private/:rw
+ depends_on:
+ - tls-init-container
ftpes-server-vsftpd4:
networks:
@@ -184,4 +221,7 @@ services:
FTP_PASSWORD: pano
restart: on-failure
command: vsftpd /etc/vsftpd_ssl.conf
-
+ volumes:
+ - ./tls:/etc/ssl/private/:rw
+ depends_on:
+ - tls-init-container
diff --git a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
index 9370f99a6..5463da8bd 100755
--- a/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
+++ b/test/mocks/datafilecollector-testharness/simulator-group/simulators-start.sh
@@ -12,6 +12,18 @@ server_check() {
echo "Simulator " $1 " on localhost:$2$3 - no response"
}
+server_check_https() {
+ for i in {1..10}; do
+ res=$(curl -k -s -o /dev/null -w "%{http_code}" https://localhost:$2$3)
+ if [ $res -gt 199 ] && [ $res -lt 300 ]; then
+ echo "Simulator " $1 " on https://localhost:$2$3 responded ok"
+ return
+ fi
+ sleep 1
+ done
+ echo "Simulator " $1 " on https://localhost:$2$3 - no response"
+}
+
ftps_server_check() {
for i in {1..10}; do
res=$(curl --silent --max-time 3 localhost:$2 2>&1 | grep vsFTPd)
@@ -97,6 +109,9 @@ server_check "consul " 8500 "/v1/catalog/service/agent"
server_check "DR sim " 3906 "/"
server_check "DR redir sim " 3908 "/"
server_check "MR sim " 2222 "/"
+server_check_https "DR sim https " 3907 "/"
+server_check_https "DR redir sim https" 3909 "/"
+server_check_https "MR sim https " 2223 "/"
ftps_server_check "FTPS server 0" 1032
ftps_server_check "FTPS server 1" 1033
ftps_server_check "FTPS server 2" 1034