summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoanna Jeremicz <joanna.jeremicz@nokia.com>2022-01-31 13:03:27 +0100
committerJoanna Jeremicz <joanna.jeremicz@nokia.com>2022-02-11 08:57:40 +0100
commit4ec32437bf1a19bcd55e0dc24c97614a764c8aae (patch)
tree3eb530ed8b6cfc2dc4c23cebdc52197397396134
parent25f7419b16e1fc090d65465f2fa1c72662c872bf (diff)
Remove Consul from CSITs
Issue-ID: DCAEGEN2-2964 Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com> Change-Id: I0f21178e938b4e6ad13b9601fdd9cca93e06621c
-rw-r--r--csit/plans/filesprocessingconfigpmmapper/assets/cbs.json7
-rw-r--r--csit/plans/filesprocessingconfigpmmapper/assets/config.json35
-rw-r--r--csit/plans/filesprocessingconfigpmmapper/assets/config.yaml29
-rw-r--r--csit/plans/filesprocessingconfigpmmapper/docker-compose.yml20
-rw-r--r--csit/plans/filesprocessingconfigpmmapper/setup.sh20
-rw-r--r--csit/plans/pmmapper/assets/cbs.json7
-rw-r--r--csit/plans/pmmapper/assets/config.json35
-rw-r--r--csit/plans/pmmapper/assets/config.yaml29
-rw-r--r--csit/plans/pmmapper/docker-compose.yml20
-rw-r--r--csit/plans/pmmapper/setup.sh22
-rw-r--r--csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot18
-rw-r--r--csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py5
-rw-r--r--csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py23
-rw-r--r--csit/tests/pmmapper/assets/pm_filter_config.yaml36
-rw-r--r--csit/tests/pmmapper/assets/pm_filter_regex_config.yaml34
-rw-r--r--csit/tests/pmmapper/assets/vendor_filter_config.yaml33
-rw-r--r--csit/tests/pmmapper/pmmapper.robot7
17 files changed, 217 insertions, 163 deletions
diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json b/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json
deleted file mode 100644
index a29956f..0000000
--- a/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "ID": "cbs",
- "Name": "config_binding_service",
- "Tags": ["cbs"],
- "Address": "ipaddress",
- "Port": 10000
-} \ No newline at end of file
diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/config.json b/csit/plans/filesprocessingconfigpmmapper/assets/config.json
deleted file mode 100644
index 3f1009d..0000000
--- a/csit/plans/filesprocessingconfigpmmapper/assets/config.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "pm-mapper-filter": { "filters":[]},
- "key_store_path": "/opt/app/pm-mapper/etc/certs/cert.jks",
- "key_store_pass_path": "/opt/app/pm-mapper/etc/certs/jks.pass",
- "trust_store_path": "/opt/app/pm-mapper/etc/certs/trust.jks",
- "trust_store_pass_path": "/opt/app/pm-mapper/etc/certs/trust.pass",
- "dmaap_dr_delete_endpoint": "https://dmaap-dr-node:8443/delete",
- "dmaap_dr_feed_name": "1",
- "aaf_identity": "aaf_admin@people.osaaf.org",
- "aaf_password": "demo123456!",
- "enable_http": true,
- "streams_publishes": {
- "dmaap_publisher": {
- "type": "message_router",
- "dmaap_info": {
- "topic_url": "http://message-router:3904/events/org.onap.dmaap.mr.VES_PM",
- "client_role": "org.onap.dcae.pmPublisher",
- "location": "csit-pmmapper",
- "client_id": "1562763644939"
- }
- }
- },
- "streams_subscribes": {
- "dmaap_subscriber": {
- "type": "data_router",
- "dmaap_info": {
- "username": "username",
- "password": "password",
- "location": "csit-pmmapper",
- "delivery_url": "http://dcae-pm-mapper:8081/delivery",
- "subscriber_id": 1
- }
- }
- }
-} \ No newline at end of file
diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/config.yaml b/csit/plans/filesprocessingconfigpmmapper/assets/config.yaml
new file mode 100644
index 0000000..6f438f7
--- /dev/null
+++ b/csit/plans/filesprocessingconfigpmmapper/assets/config.yaml
@@ -0,0 +1,29 @@
+---
+pm-mapper-filter:
+ filters: []
+key_store_path: "/opt/app/pm-mapper/etc/certs/cert.jks"
+key_store_pass_path: "/opt/app/pm-mapper/etc/certs/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/certs/trust.jks"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/certs/trust.pass"
+dmaap_dr_delete_endpoint: "https://dmaap-dr-node:8443/delete"
+dmaap_dr_feed_name: "1"
+aaf_identity: "aaf_admin@people.osaaf.org"
+aaf_password: "demo123456!"
+enable_http: true
+streams_publishes:
+ dmaap_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url: "http://message-router:3904/events/org.onap.dmaap.mr.VES_PM"
+ client_role: "org.onap.dcae.pmPublisher"
+ location: "csit-pmmapper"
+ client_id: "1562763644939"
+streams_subscribes:
+ dmaap_subscriber:
+ type: "data_router"
+ dmaap_info:
+ username: "username"
+ password: "password"
+ location: "csit-pmmapper"
+ delivery_url: "http://dcae-pm-mapper:8081/delivery"
+ subscriber_id: 1
diff --git a/csit/plans/filesprocessingconfigpmmapper/docker-compose.yml b/csit/plans/filesprocessingconfigpmmapper/docker-compose.yml
index 62d1cd3..ac56e5a 100644
--- a/csit/plans/filesprocessingconfigpmmapper/docker-compose.yml
+++ b/csit/plans/filesprocessingconfigpmmapper/docker-compose.yml
@@ -73,22 +73,6 @@ services:
pmmapper-network:
ipv4_address: $MARIADB_IP
- consul:
- container_name: consul
- image: nexus3.onap.org:10001/consul:latest
- networks:
- pmmapper-network:
- ipv4_address: $CONSUL_IP
-
- cbs:
- container_name: cbs
- image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:2.3.0
- environment:
- CONSUL_HOST: $CONSUL_IP
- networks:
- pmmapper-network:
- ipv4_address: $CBS_IP
-
pmmapper:
container_name: pmmapper
image: onap/org.onap.dcaegen2.services.pm-mapper:latest
@@ -96,13 +80,13 @@ services:
- "8081:8081"
volumes:
- /var/tmp/:/opt/app/pm-mapper/etc/certs/
+ - /var/tmp/config.yaml:/app-config-input/application_config.yaml
depends_on:
- datarouter-prov
environment:
CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
CONFIG_BINDING_SERVICE: $CBS_IP
- CONSUL_HOST: $CBS_IP
- HOSTNAME: pmmapper
+ CBS_CLIENT_CONFIG_PATH: /app-config-input/application_config.yaml
networks:
pmmapper-network:
ipv4_address: $PMMAPPER_IP
diff --git a/csit/plans/filesprocessingconfigpmmapper/setup.sh b/csit/plans/filesprocessingconfigpmmapper/setup.sh
index 0a86c0a..ee6d111 100644
--- a/csit/plans/filesprocessingconfigpmmapper/setup.sh
+++ b/csit/plans/filesprocessingconfigpmmapper/setup.sh
@@ -9,18 +9,16 @@ TEST_PLANS_DIR=$WORKSPACE/plans/filesprocessingconfigpmmapper
export GATEWAY_IP=172.18.0.1
export DR_NODE_IP=172.18.0.2
export DR_PROV_IP=172.18.0.3
-export CONSUL_IP=172.18.0.4
+export PMMAPPER_IP=172.18.0.4
export CBS_IP=172.18.0.5
export MARIADB_IP=172.18.0.6
export NODE_IP=172.18.0.7
-export PMMAPPER_IP=172.18.0.8
-for asset in provserver.properties node.properties cbs.json mrserver.js cert.jks jks.pass trust.jks trust.pass; do
+for asset in provserver.properties node.properties mrserver.js cert.jks jks.pass trust.jks trust.pass config.yaml; do
cp $TEST_PLANS_DIR/assets/${asset} /var/tmp/
done
sed -i 's/datarouter-mariadb/'$MARIADB_IP'/g' /var/tmp/provserver.properties
-sed -i 's/ipaddress//g' /var/tmp/cbs.json
# ------------------------------------
#Prepare enviroment for client
@@ -30,7 +28,7 @@ pip uninstall -y docker-py
pip uninstall -y docker
pip install -U docker==2.7.0
-docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d mariadb consul cbs node
+docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d mariadb node
echo "Waiting for MariaDB to come up healthy..."
for i in {1..30}; do
@@ -48,25 +46,17 @@ docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d datarouter-node datar
unset http_proxy
unset https_proxy
-curl --request PUT --data @/var/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register
-curl 'http://'$CONSUL_IP':8500/v1/kv/pmmapper?dc=dc1' -X PUT \
- -H 'Accept: application/json' \
- -H 'Content-Type: application/json' \
- -H 'X-Requested-With: XMLHttpRequest' \
- --data @$TEST_PLANS_DIR/assets/config.json
docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d pmmapper
sleep 2
-# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb, Consul, CBS
+# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb
containers_ok=false
for i in {1..5}; do
if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \
[ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \
[ $(docker inspect --format '{{ .State.Running }}' mariadb) ] && \
[ $(docker inspect --format '{{ .State.Running }}' mr-simulator) ] && \
- [ $(docker inspect --format '{{ .State.Running }}' consul) ] && \
- [ $(docker inspect --format '{{ .State.Running }}' cbs) ] && \
[ $(docker inspect --format '{{ .State.Running }}' pmmapper) ]
then
echo "All required docker containers are up."
@@ -110,4 +100,4 @@ docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/f
curl -k https://$DR_PROV_IP:8443/internal/prov
#Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v CONSUL_IP:${CONSUL_IP} -v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP} -v NODE_IP:${NODE_IP}"
+ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP} -v NODE_IP:${NODE_IP}"
diff --git a/csit/plans/pmmapper/assets/cbs.json b/csit/plans/pmmapper/assets/cbs.json
deleted file mode 100644
index a29956f..0000000
--- a/csit/plans/pmmapper/assets/cbs.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "ID": "cbs",
- "Name": "config_binding_service",
- "Tags": ["cbs"],
- "Address": "ipaddress",
- "Port": 10000
-} \ No newline at end of file
diff --git a/csit/plans/pmmapper/assets/config.json b/csit/plans/pmmapper/assets/config.json
deleted file mode 100644
index 3f1009d..0000000
--- a/csit/plans/pmmapper/assets/config.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "pm-mapper-filter": { "filters":[]},
- "key_store_path": "/opt/app/pm-mapper/etc/certs/cert.jks",
- "key_store_pass_path": "/opt/app/pm-mapper/etc/certs/jks.pass",
- "trust_store_path": "/opt/app/pm-mapper/etc/certs/trust.jks",
- "trust_store_pass_path": "/opt/app/pm-mapper/etc/certs/trust.pass",
- "dmaap_dr_delete_endpoint": "https://dmaap-dr-node:8443/delete",
- "dmaap_dr_feed_name": "1",
- "aaf_identity": "aaf_admin@people.osaaf.org",
- "aaf_password": "demo123456!",
- "enable_http": true,
- "streams_publishes": {
- "dmaap_publisher": {
- "type": "message_router",
- "dmaap_info": {
- "topic_url": "http://message-router:3904/events/org.onap.dmaap.mr.VES_PM",
- "client_role": "org.onap.dcae.pmPublisher",
- "location": "csit-pmmapper",
- "client_id": "1562763644939"
- }
- }
- },
- "streams_subscribes": {
- "dmaap_subscriber": {
- "type": "data_router",
- "dmaap_info": {
- "username": "username",
- "password": "password",
- "location": "csit-pmmapper",
- "delivery_url": "http://dcae-pm-mapper:8081/delivery",
- "subscriber_id": 1
- }
- }
- }
-} \ No newline at end of file
diff --git a/csit/plans/pmmapper/assets/config.yaml b/csit/plans/pmmapper/assets/config.yaml
new file mode 100644
index 0000000..c535113
--- /dev/null
+++ b/csit/plans/pmmapper/assets/config.yaml
@@ -0,0 +1,29 @@
+---
+pm-mapper-filter:
+ filters: []
+key_store_path: "/opt/app/pm-mapper/etc/certs/cert.jks"
+key_store_pass_path: "/opt/app/pm-mapper/etc/certs/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/certs/trust.jks"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/certs/trust.pass"
+dmaap_dr_delete_endpoint: https://dmaap-dr-node:8443/delete
+dmaap_dr_feed_name: '1'
+aaf_identity: aaf_admin@people.osaaf.org
+aaf_password: demo123456!
+enable_http: true
+streams_publishes:
+ dmaap_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url: http://message-router:3904/events/org.onap.dmaap.mr.VES_PM
+ client_role: org.onap.dcae.pmPublisher
+ location: csit-pmmapper
+ client_id: '1562763644939'
+streams_subscribes:
+ dmaap_subscriber:
+ type: data_router
+ dmaap_info:
+ username: username
+ password: password
+ location: csit-pmmapper
+ delivery_url: http://dcae-pm-mapper:8081/delivery
+ subscriber_id: 1
diff --git a/csit/plans/pmmapper/docker-compose.yml b/csit/plans/pmmapper/docker-compose.yml
index 87a56b3..d8f07a0 100644
--- a/csit/plans/pmmapper/docker-compose.yml
+++ b/csit/plans/pmmapper/docker-compose.yml
@@ -75,22 +75,6 @@ services:
pmmapper-network:
ipv4_address: $MARIADB_IP
- consul:
- container_name: consul
- image: nexus3.onap.org:10001/consul:latest
- networks:
- pmmapper-network:
- ipv4_address: $CONSUL_IP
-
- cbs:
- container_name: cbs
- image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.configbinding.app-app:2.3.0
- environment:
- CONSUL_HOST: $CONSUL_IP
- networks:
- pmmapper-network:
- ipv4_address: $CBS_IP
-
pmmapper:
container_name: pmmapper
image: onap/org.onap.dcaegen2.services.pm-mapper:latest
@@ -98,13 +82,13 @@ services:
- "8081:8081"
volumes:
- /var/tmp/:/opt/app/pm-mapper/etc/certs/
+ - /var/tmp/config.yaml:/app-config-input/application_config.yaml
depends_on:
- datarouter-prov
environment:
CONFIG_BINDING_SERVICE_SERVICE_PORT: 10000
CONFIG_BINDING_SERVICE: $CBS_IP
- CONSUL_HOST: $CBS_IP
- HOSTNAME: pmmapper
+ CBS_CLIENT_CONFIG_PATH: /app-config-input/application_config.yaml
networks:
pmmapper-network:
ipv4_address: $PMMAPPER_IP
diff --git a/csit/plans/pmmapper/setup.sh b/csit/plans/pmmapper/setup.sh
index 258b99e..a0e823b 100644
--- a/csit/plans/pmmapper/setup.sh
+++ b/csit/plans/pmmapper/setup.sh
@@ -9,23 +9,20 @@ TEST_PLANS_DIR=$WORKSPACE/plans/pmmapper
export GATEWAY_IP=172.18.0.1
export DR_NODE_IP=172.18.0.2
export DR_PROV_IP=172.18.0.3
-export CONSUL_IP=172.18.0.4
+export PMMAPPER_IP=172.18.0.4
export CBS_IP=172.18.0.5
export MARIADB_IP=172.18.0.6
export NODE_IP=172.18.0.7
-export PMMAPPER_IP=172.18.0.8
-for asset in provserver.properties addSubscriber.txt addFeed3.txt node.properties cbs.json mrserver.js cert.jks jks.pass trust.jks trust.pass; do
+for asset in provserver.properties addSubscriber.txt addFeed3.txt node.properties mrserver.js cert.jks jks.pass trust.jks trust.pass config.yaml; do
cp $TEST_PLANS_DIR/assets/${asset} /var/tmp/
done
sed -i 's/datarouter-mariadb/'$MARIADB_IP'/g' /var/tmp/provserver.properties
#sed -i 's/<kafka-ip>/'$KAFKA_IP'/g' /var/tmp/addSubscriber.txt
#sed -i 's/<kafka-ip>/'$KAFKA_IP'/g' /var/tmp/addFeed3.txt
-#sed -i 's/ipaddress/'$CBS_IP'/g' /var/tmp/cbs.json
-sed -i 's/ipaddress//g' /var/tmp/cbs.json
-docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d mariadb consul cbs node
+docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d mariadb node
echo "Waiting for MariaDB to come up healthy..."
for i in {1..30}; do
@@ -41,25 +38,16 @@ done
docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d datarouter-node datarouter-prov
-curl --request PUT --data @/var/tmp/cbs.json http://$CONSUL_IP:8500/v1/agent/service/register
-curl 'http://'$CONSUL_IP':8500/v1/kv/pmmapper?dc=dc1' -X PUT \
- -H 'Accept: application/json' \
- -H 'Content-Type: application/json' \
- -H 'X-Requested-With: XMLHttpRequest' \
- --data @$TEST_PLANS_DIR/assets/config.json
-
docker-compose -f $TEST_PLANS_DIR/docker-compose.yml up -d pmmapper
sleep 2
-# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb, Consul, CBS
+# Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb
containers_ok=false
for i in {1..5}; do
if [ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ] && \
[ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ] && \
[ $(docker inspect --format '{{ .State.Running }}' mariadb) ] && \
[ $(docker inspect --format '{{ .State.Running }}' mr-simulator) ] && \
- [ $(docker inspect --format '{{ .State.Running }}' consul) ] && \
- [ $(docker inspect --format '{{ .State.Running }}' cbs) ] && \
[ $(docker inspect --format '{{ .State.Running }}' pmmapper) ]
then
echo "All required docker containers are up."
@@ -102,4 +90,4 @@ docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/f
curl -k https://$DR_PROV_IP:8443/internal/prov
#Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v CONSUL_IP:${CONSUL_IP} -v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP}"
+ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DMAAP_MR_IP:${DMAAP_MR_IP} -v CBS_IP:${CBS_IP} -v PMMAPPER_IP:${PMMAPPER_IP} -v DR_NODE_IP:${DR_NODE_IP}"
diff --git a/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot b/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot
index 5f026d1..11b19b7 100644
--- a/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot
+++ b/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot
@@ -38,11 +38,14 @@ Verify that PM Mapper rejects 6-9 messages when limitRate is 1 and threads count
${alllogs}= GetLogsOutput
${filtered_logs}= GetFilteredLogs ${alllogs} ${testname}
${dropped_nr}= GetDroppedNumber ${filtered_logs}
+ ${received_nr}= GetReceivedNumber ${filtered_logs}
Sleep 40s
${isCorrectDroppedCount}= Evaluate ${5} < ${dropped_nr} < ${10}
+ ${isCorrectReceivedCount}= Evaluate ${0} < ${received_nr} < ${5}
SavePmMapperLogsAndDroppedCount config_1_1 ${dropped_nr}
Should Be True ${isCorrectDroppedCount} Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 6-9
+ Should Be True ${isCorrectReceivedCount} Pm-mapper received ${received_nr} messages. Expected received count: 1-4
ClearLogs
Verify that PM Mapper rejects 0 messages when limitRate is 10 and threads count is 1
@@ -58,10 +61,12 @@ Verify that PM Mapper rejects 0 messages when limitRate is 10 and threads count
${alllogs}= GetLogsOutput
${filtered_logs}= GetFilteredLogs ${alllogs} ${testname}
${dropped_nr}= GetDroppedNumber ${filtered_logs}
+ ${received_nr}= GetReceivedNumber ${filtered_logs}
Sleep 15s
SavePmMapperLogsAndDroppedCount config_10_1 ${dropped_nr}
Should Be Equal As Numbers ${dropped_nr} 0 Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 0
+ Should Be Equal As Numbers ${received_nr} 10 Pm-mapper received ${received_nr} messages. Expected received count: 10
ClearLogs
Verify that PM Mapper rejects 0 messages when limitRate is 1 and threads count is 10
@@ -77,10 +82,12 @@ Verify that PM Mapper rejects 0 messages when limitRate is 1 and threads count i
${alllogs}= GetLogsOutput
${filtered_logs}= GetFilteredLogs ${alllogs} ${testname}
${dropped_nr}= GetDroppedNumber ${filtered_logs}
+ ${received_nr}= GetReceivedNumber ${filtered_logs}
Sleep 15s
SavePmMapperLogsAndDroppedCount config_1_10 ${dropped_nr}
Should Be Equal As Numbers ${dropped_nr} 0 Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 0
+ Should Be Equal As Numbers ${received_nr} 10 Pm-mapper received ${received_nr} messages. Expected received count: 10
ClearLogs
*** Keywords ***
@@ -133,7 +140,12 @@ GetFilteredLogs
GetDroppedNumber
[Arguments] ${logs_output}
- ${number}= Get Number Of Dropped Messages ${logs_output}
+ ${number}= Get Number Of Element Occurrences In Logs ${logs_output} |429|
+ [Return] ${number}
+
+GetReceivedNumber
+ [Arguments] ${logs_output}
+ ${number}= Get Number Of Element Occurrences In Logs ${logs_output} |200|
[Return] ${number}
RestartPmmapper
@@ -145,6 +157,6 @@ RestartPmmapper
SavePmMapperLogsAndDroppedCount
[Arguments] ${test_name} ${dropped_count}
- Run Process echo "Dropped: ${dropped_count}" > %{WORKSPACE}/archives/${test_name}_dropped_count.log shell=yes
- Run Process docker logs ${CLIENT_CONTAINER_NAME} > %{WORKSPACE}/archives/${test_name}_pm_mapper_container_logs.log shell=yes
+ Run Process echo "Dropped: ${dropped_count}" > %{WORKSPACE}/archives/${test_name}_dropped_count.log shell=yes
+ Run Process docker logs ${CLIENT_CONTAINER_NAME} > %{WORKSPACE}/archives/${test_name}_pm_mapper_container_logs.log shell=yes
diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py b/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py
index 036a8a1..e3186ca 100644
--- a/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py
+++ b/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py
@@ -28,8 +28,7 @@ class DockerContainerManager:
environment = EnvsReader().read_env_list_from_file(path_to_env)
environment.append("CONFIG_BINDING_SERVICE_SERVICE_PORT=10000")
environment.append("CONFIG_BINDING_SERVICE=172.18.0.5")
- environment.append("CONSUL_HOST=172.18.0.5")
- environment.append("HOSTNAME=pmmapper")
+ environment.append("CBS_CLIENT_CONFIG_PATH=/app-config-input/application_config.yaml")
client.containers.run(
image=client_image,
name=container_name,
@@ -38,7 +37,7 @@ class DockerContainerManager:
network='filesprocessingconfigpmmapper_pmmapper-network',
extra_hosts={'dmaap-dr-node': dr_node_ip, 'message-router': mr_ip},
user='root',
- mounts=[Mount(target='/opt/app/pm-mapper/etc/certs/', source='/var/tmp/', type='bind')],
+ mounts=[Mount(target='/opt/app/pm-mapper/etc/certs/', source='/var/tmp/', type='bind'), Mount(target='/app-config-input/application_config.yaml', source='/var/tmp/config.yaml', type='bind')],
detach=True
)
diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py
index 01718e3..cc4bf22 100644
--- a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py
+++ b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py
@@ -1,3 +1,22 @@
+# ============LICENSE_START=======================================================
+# org.onap.dcae
+# ================================================================================
+# Copyright (c) 2021-2022 Nokia. All rights reserved.
+# ================================================================================
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+#
+
import re
class LogReader:
@@ -14,8 +33,8 @@ class LogReader:
nrs_set.add(filename[0])
return ret_logs
- def get_number_of_dropped_messages(self, logs_output):
- return len(list(filter(lambda line: "|429|" in line, logs_output)))
+ def get_number_of_element_occurrences_in_logs(self, logs_output, element):
+ return len(list(filter(lambda line: element in line, logs_output)))
def get_log_files_list(self, fileNames):
files = fileNames.split()
diff --git a/csit/tests/pmmapper/assets/pm_filter_config.yaml b/csit/tests/pmmapper/assets/pm_filter_config.yaml
new file mode 100644
index 0000000..aa7f6c4
--- /dev/null
+++ b/csit/tests/pmmapper/assets/pm_filter_config.yaml
@@ -0,0 +1,36 @@
+---
+pm-mapper-filter:
+ filters:
+ - pmDefVsn: '1.0'
+ nfType: gnb
+ vendor: Ericsson
+ measTypes:
+ - attTCHSeizures
+ - succTCHSeizures2
+ - succImmediateAssignProcs8
+key_store_path: "/opt/app/pm-mapper/etc/cert.jks"
+key_store_pass_path: "/opt/app/pm-mapper/etc/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/trust.jks"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/trust.pass"
+dmaap_dr_delete_endpoint: https://dmaap-dr-node:8443/delete
+dmaap_dr_feed_name: '1'
+aaf_identity: aaf_admin@people.osaaf.org
+aaf_password: demo123456!
+enable_http: true
+streams_publishes:
+ dmaap_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url: http://message-router:3904/events/org.onap.dmaap.mr.VES_PM
+ client_role: org.onap.dcae.pmPublisher
+ location: csit-pmmapper
+ client_id: '1562763644939'
+streams_subscribes:
+ dmaap_subscriber:
+ type: data_router
+ dmaap_info:
+ username: username
+ password: password
+ location: csit-pmmapper
+ delivery_url: http://dcae-pm-mapper:8081/delivery
+ subscriber_id: 1
diff --git a/csit/tests/pmmapper/assets/pm_filter_regex_config.yaml b/csit/tests/pmmapper/assets/pm_filter_regex_config.yaml
new file mode 100644
index 0000000..5cb564a
--- /dev/null
+++ b/csit/tests/pmmapper/assets/pm_filter_regex_config.yaml
@@ -0,0 +1,34 @@
+---
+pm-mapper-filter:
+ filters:
+ - pmDefVsn: '1.0'
+ nfType: gnb
+ vendor: Ericsson
+ measTypes:
+ - att.*
+key_store_path: "/opt/app/pm-mapper/etc/cert.jks.b64"
+key_store_pass_path: "/opt/app/pm-mapper/etc/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/trust.jks.b64"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/trust.pass"
+dmaap_dr_delete_endpoint: https://dmaap-dr-node:8443/delete
+dmaap_dr_feed_name: '1'
+aaf_identity: aaf_admin@people.osaaf.org
+aaf_password: demo123456!
+enable_http: true
+streams_publishes:
+ dmaap_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url: http://message-router:3904/events/org.onap.dmaap.mr.VES_PM
+ client_role: org.onap.dcae.pmPublisher
+ location: csit-pmmapper
+ client_id: '1562763644939'
+streams_subscribes:
+ dmaap_subscriber:
+ type: data_router
+ dmaap_info:
+ username: username
+ password: password
+ location: csit-pmmapper
+ delivery_url: http://dcae-pm-mapper:8081/delivery
+ subscriber_id: 1
diff --git a/csit/tests/pmmapper/assets/vendor_filter_config.yaml b/csit/tests/pmmapper/assets/vendor_filter_config.yaml
new file mode 100644
index 0000000..9a622ab
--- /dev/null
+++ b/csit/tests/pmmapper/assets/vendor_filter_config.yaml
@@ -0,0 +1,33 @@
+---
+pm-mapper-filter:
+ filters:
+ - pmDefVsn: '1.0'
+ nfType: gnb
+ vendor: Ericsson
+ measTypes: []
+key_store_path: "/opt/app/pm-mapper/etc/cert.jks"
+key_store_pass_path: "/opt/app/pm-mapper/etc/jks.pass"
+trust_store_path: "/opt/app/pm-mapper/etc/trust.jks"
+trust_store_pass_path: "/opt/app/pm-mapper/etc/trust.pass"
+dmaap_dr_delete_endpoint: https://dmaap-dr-node:8443/delete
+dmaap_dr_feed_name: '1'
+aaf_identity: aaf_admin@people.osaaf.org
+aaf_password: demo123456!
+enable_http: true
+streams_publishes:
+ dmaap_publisher:
+ type: message_router
+ dmaap_info:
+ topic_url: http://message-router:3904/events/org.onap.dmaap.mr.VES_PM
+ client_role: org.onap.dcae.pmPublisher
+ location: csit-pmmapper
+ client_id: '1562763644939'
+streams_subscribes:
+ dmaap_subscriber:
+ type: data_router
+ dmaap_info:
+ username: username
+ password: password
+ location: csit-pmmapper
+ delivery_url: http://dcae-pm-mapper:8081/delivery
+ subscriber_id: 1
diff --git a/csit/tests/pmmapper/pmmapper.robot b/csit/tests/pmmapper/pmmapper.robot
index 72801d0..b7131a3 100644
--- a/csit/tests/pmmapper/pmmapper.robot
+++ b/csit/tests/pmmapper/pmmapper.robot
@@ -31,9 +31,10 @@ ${TYPE-C_PM_DATA_FILE_PATH} ${ASSETS_PATH}/C20190328.0000-0015.xml
${NR-TYPE-A_PM_DATA_FILE_PATH} ${ASSETS_PATH}/new_radio/A20181004.0000-1000-0015-1000_5G.xml
${NR-TYPE-C_PM_DATA_FILE_PATH} ${ASSETS_PATH}/new_radio/C20190329.0000-0015.xml
${NR-TYPE-PM_DATA_FILE_PATH} ${ASSETS_PATH}/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml
-${CLI_EXEC_VENDOR_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @${ASSETS_PATH}/vendor_filter_config.json
-${CLI_EXEC_PM_FILTER} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @${ASSETS_PATH}/pm_filter_config.json
-${CLI_EXEC_PM_FILTER_regex} curl 'http://${CONSUL_IP}:8500/v1/kv/pmmapper?dc=dc1' -X PUT -H 'Accept: application/^Con' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data @${ASSETS_PATH}/pm_filter_regex_config.json
+${CLI_EXEC_VENDOR_FILTER} cp ${ASSETS_PATH}/vendor_filter_config.yaml /var/tmp/config.yaml
+${CLI_EXEC_PM_FILTER} cp ${ASSETS_PATH}/pm_filter_config.yaml /var/tmp/config.yaml
+${CLI_EXEC_PM_FILTER_regex} cp ${ASSETS_PATH}/pm_filter_regex_config.yaml /var/tmp/config.yaml
+
${CLI_MESSAGE_ROUTER_TOPIC} curl http://${DMAAP_MR_IP}:3904/events/PM_MAPPER/CG1/C1?timeout=1000 > /tmp/mr.log
${CLI_MR_LOG} cat /tmp/mr.log