From a3f68d14609fc94ec89e3eb724664a62bc2b0210 Mon Sep 17 00:00:00 2001 From: Lasse Kaihlavirta Date: Fri, 21 May 2021 12:59:08 +0300 Subject: [PATCH] Move PM-Mapper CSIT to project repo Issue-ID: DCAEGEN2-2746 Signed-off-by: Lasse Kaihlavirta Change-Id: Ib96f8453fd7fecbaddaada1b11d3b8551bb7f8fa --- csit/.gitignore | 2 + csit/README.md | 38 +++ .../assets/addSubscriber.json | 20 ++ .../filesprocessingconfigpmmapper/assets/cbs.json | 7 + .../filesprocessingconfigpmmapper/assets/cert.jks | Bin 0 -> 4654 bytes .../assets/config.json | 35 +++ .../assets/createFeed.json | 18 ++ .../filesprocessingconfigpmmapper/assets/jks.pass | 1 + .../assets/mrserver.js | 28 +++ .../assets/node.properties | 89 +++++++ .../assets/provserver.properties | 62 +++++ .../filesprocessingconfigpmmapper/assets/trust.jks | Bin 0 -> 1413 bytes .../assets/trust.pass | 1 + .../docker-compose.yml | 119 ++++++++++ csit/plans/filesprocessingconfigpmmapper/setup.sh | 101 ++++++++ .../filesprocessingconfigpmmapper/teardown.sh | 8 + .../filesprocessingconfigpmmapper/testplan.txt | 3 + csit/plans/pmmapper/assets/addFeed3.txt | 44 ++++ csit/plans/pmmapper/assets/addSubscriber.json | 20 ++ csit/plans/pmmapper/assets/addSubscriber.txt | 35 +++ csit/plans/pmmapper/assets/cbs.json | 7 + csit/plans/pmmapper/assets/cert.jks | Bin 0 -> 4654 bytes csit/plans/pmmapper/assets/config.json | 35 +++ csit/plans/pmmapper/assets/createFeed.json | 18 ++ csit/plans/pmmapper/assets/jks.pass | 1 + csit/plans/pmmapper/assets/mrserver.js | 25 ++ csit/plans/pmmapper/assets/node.properties | 87 +++++++ csit/plans/pmmapper/assets/provserver.properties | 60 +++++ csit/plans/pmmapper/assets/trust.jks | Bin 0 -> 1413 bytes csit/plans/pmmapper/assets/trust.pass | 1 + csit/plans/pmmapper/docker-compose.yml | 121 ++++++++++ csit/plans/pmmapper/setup.sh | 94 ++++++++ csit/plans/pmmapper/teardown.sh | 7 + csit/plans/pmmapper/testplan.txt | 3 + csit/prepare-csit.sh | 49 ++++ csit/run-csit.sh | 191 +++++++++++++++ csit/run-project-csit.sh | 33 +++ csit/scripts/common_functions.sh | 263 +++++++++++++++++++++ csit/scripts/kill-instance.sh | 31 +++ .../filesprocessingconfigpmmapper/__init__.robot | 2 + .../assets/.gitattributes | 1 + .../assets/ABigFile.xml | 163 +++++++++++++ .../assets/config_10_1.env | 3 + .../assets/config_1_1.env | 3 + .../assets/config_1_10.env | 3 + .../assets/valid_metadata.json | 12 + .../filesprocessingconfigpmmapper.robot | 149 ++++++++++++ .../libraries/DockerContainerManager.py | 29 +++ .../libraries/DockerContainerManager.pyc | Bin 0 -> 1989 bytes .../libraries/EnvsReader.py | 11 + .../libraries/EnvsReader.pyc | Bin 0 -> 824 bytes .../libraries/LogReader.py | 22 ++ .../libraries/LogReader.pyc | Bin 0 -> 1953 bytes csit/tests/pmmapper/__init__.robot | 2 + csit/tests/pmmapper/assets/.gitattributes | 1 + .../assets/A20181002.0000-1000-0015-1000_5G.xml | 88 +++++++ .../assets/A20181002.0000-1000-0015-1000_5G.xml.gz | Bin 0 -> 959 bytes .../tests/pmmapper/assets/A_no_managed_element.xml | 27 +++ csit/tests/pmmapper/assets/A_no_measdata.xml | 11 + csit/tests/pmmapper/assets/C20190328.0000-0015.xml | 49 ++++ .../pmmapper/assets/diff_vendor_metadata.json | 12 + .../new_radio/A20181004.0000-1000-0015-1000_5G.xml | 88 +++++++ .../assets/new_radio/C20190329.0000-0015.xml | 49 ++++ ...01+020024C202007171207+0200-1215+0200_45678.xml | 88 +++++++ .../pmmapper/assets/new_radio/valid_metadata.json | 12 + csit/tests/pmmapper/assets/pm_filter_config.json | 42 ++++ .../pmmapper/assets/pm_filter_regex_config.json | 42 ++++ csit/tests/pmmapper/assets/valid_metadata.json | 12 + .../pmmapper/assets/vendor_filter_config.json | 42 ++++ csit/tests/pmmapper/pmmapper.robot | 201 ++++++++++++++++ 70 files changed, 2821 insertions(+) create mode 100644 csit/.gitignore create mode 100644 csit/README.md create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/addSubscriber.json create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/cbs.json create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/cert.jks create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/config.json create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/createFeed.json create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/jks.pass create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/mrserver.js create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/node.properties create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/provserver.properties create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/trust.jks create mode 100644 csit/plans/filesprocessingconfigpmmapper/assets/trust.pass create mode 100644 csit/plans/filesprocessingconfigpmmapper/docker-compose.yml create mode 100644 csit/plans/filesprocessingconfigpmmapper/setup.sh create mode 100644 csit/plans/filesprocessingconfigpmmapper/teardown.sh create mode 100644 csit/plans/filesprocessingconfigpmmapper/testplan.txt create mode 100644 csit/plans/pmmapper/assets/addFeed3.txt create mode 100644 csit/plans/pmmapper/assets/addSubscriber.json create mode 100644 csit/plans/pmmapper/assets/addSubscriber.txt create mode 100644 csit/plans/pmmapper/assets/cbs.json create mode 100644 csit/plans/pmmapper/assets/cert.jks create mode 100644 csit/plans/pmmapper/assets/config.json create mode 100644 csit/plans/pmmapper/assets/createFeed.json create mode 100644 csit/plans/pmmapper/assets/jks.pass create mode 100644 csit/plans/pmmapper/assets/mrserver.js create mode 100644 csit/plans/pmmapper/assets/node.properties create mode 100644 csit/plans/pmmapper/assets/provserver.properties create mode 100644 csit/plans/pmmapper/assets/trust.jks create mode 100644 csit/plans/pmmapper/assets/trust.pass create mode 100644 csit/plans/pmmapper/docker-compose.yml create mode 100644 csit/plans/pmmapper/setup.sh create mode 100644 csit/plans/pmmapper/teardown.sh create mode 100644 csit/plans/pmmapper/testplan.txt create mode 100755 csit/prepare-csit.sh create mode 100755 csit/run-csit.sh create mode 100755 csit/run-project-csit.sh create mode 100755 csit/scripts/common_functions.sh create mode 100755 csit/scripts/kill-instance.sh create mode 100644 csit/tests/filesprocessingconfigpmmapper/__init__.robot create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/.gitattributes create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/ABigFile.xml create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/config_10_1.env create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/config_1_1.env create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/config_1_10.env create mode 100644 csit/tests/filesprocessingconfigpmmapper/assets/valid_metadata.json create mode 100644 csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.pyc create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/EnvsReader.py create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/EnvsReader.pyc create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py create mode 100644 csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.pyc create mode 100644 csit/tests/pmmapper/__init__.robot create mode 100644 csit/tests/pmmapper/assets/.gitattributes create mode 100644 csit/tests/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml create mode 100644 csit/tests/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz create mode 100644 csit/tests/pmmapper/assets/A_no_managed_element.xml create mode 100644 csit/tests/pmmapper/assets/A_no_measdata.xml create mode 100644 csit/tests/pmmapper/assets/C20190328.0000-0015.xml create mode 100644 csit/tests/pmmapper/assets/diff_vendor_metadata.json create mode 100644 csit/tests/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml create mode 100644 csit/tests/pmmapper/assets/new_radio/C20190329.0000-0015.xml create mode 100644 csit/tests/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml create mode 100644 csit/tests/pmmapper/assets/new_radio/valid_metadata.json create mode 100644 csit/tests/pmmapper/assets/pm_filter_config.json create mode 100644 csit/tests/pmmapper/assets/pm_filter_regex_config.json create mode 100644 csit/tests/pmmapper/assets/valid_metadata.json create mode 100644 csit/tests/pmmapper/assets/vendor_filter_config.json create mode 100644 csit/tests/pmmapper/pmmapper.robot diff --git a/csit/.gitignore b/csit/.gitignore new file mode 100644 index 0000000..c8865c2 --- /dev/null +++ b/csit/.gitignore @@ -0,0 +1,2 @@ +env.properties +archives/ diff --git a/csit/README.md b/csit/README.md new file mode 100644 index 0000000..88d0411 --- /dev/null +++ b/csit/README.md @@ -0,0 +1,38 @@ +## Continuous System and Integration Testing (CSIT) for DCAEGEN2 PM-Mapper + +The directory structure: + +- **plans/** contains testing plans, each sub-folder represents a separate test plan with contents processed subsequently: + _startup.sh_ (serves docker containers startup), _testplan.txt_ (lists test suites), _teardown.sh_ (serves docker containers stopping and images removal) +- **scripts/** contains shell scripts used on tests executions +- **tests/** contains test suites that are processed by folder name (relative to _tests_ folder) taken from _testplan.txt_ + +Test suites are executed using Robot framework. + +### Running on local environment + +Prerequisites: +- maven +- docker +- docker-compose +- settings.xml corresponding to the one under oparent repository + +```bash + +Navigate to project directory +```bash +cd ~//pm-mapper +``` + +Build a docker image from your pm-mapper directory: + +```bash +mvn clean install docker:build +``` + +Execute tests from pm-mapper/csit folder: +```bash +cd csit +./run-project-csit.sh +``` + diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/addSubscriber.json b/csit/plans/filesprocessingconfigpmmapper/assets/addSubscriber.json new file mode 100644 index 0000000..0666a7d --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/addSubscriber.json @@ -0,0 +1,20 @@ +{ + "delivery":{ + "url":"http://dcae-pm-mapper:8081/delivery", + "user":"username", + "password":"password", + "use100":true + }, + "follow_redirect":false, + "metadataOnly":false, + "suspend":false, + "groupid":0, + "links":{ + "self": "https://dmaap-dr-prov/subscribe/1", + "log": "https://dmaap-dr-prov/feedlog/1", + "feed": "https://dmaap-dr-prov/feed/1" + }, + "subscriber":"pmmapper", + "decompress":true, + "privilegedSubscriber": true + } \ No newline at end of file diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json b/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json new file mode 100644 index 0000000..a29956f --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/cbs.json @@ -0,0 +1,7 @@ +{ + "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/cert.jks b/csit/plans/filesprocessingconfigpmmapper/assets/cert.jks new file mode 100644 index 0000000000000000000000000000000000000000..33dc9a31aa5574aa13620ca9b45b2fd583fef227 GIT binary patch literal 4654 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 literal 0 HcmV?d00001 diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/config.json b/csit/plans/filesprocessingconfigpmmapper/assets/config.json new file mode 100644 index 0000000..3f1009d --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/config.json @@ -0,0 +1,35 @@ +{ + "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/createFeed.json b/csit/plans/filesprocessingconfigpmmapper/assets/createFeed.json new file mode 100644 index 0000000..f93633d --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/createFeed.json @@ -0,0 +1,18 @@ +{ + "name": "PM Mapper Feed", + "version": "m1.0", + "description": "PM Mapper Feed", + "business_description": "PM Mapper", + "suspend": false, + "deleted": false, + "changeowner": true, + "authorization": { + "classification": "unclassified", + "endpoint_addrs": [], + "endpoint_ids": [ + { + "password": "pmmapper", + "id": "pmmapper" + }] + } + } \ No newline at end of file diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/jks.pass b/csit/plans/filesprocessingconfigpmmapper/assets/jks.pass new file mode 100644 index 0000000..ae8f7e7 --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/jks.pass @@ -0,0 +1 @@ +Er1tmip;T4w[%1}YE?x{fN9v \ No newline at end of file diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/mrserver.js b/csit/plans/filesprocessingconfigpmmapper/assets/mrserver.js new file mode 100644 index 0000000..cc84571 --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/mrserver.js @@ -0,0 +1,28 @@ +var httpServer = function () { + var http = require('http'), + url = require('url'), + fs = require('fs'), + + start = function (port) { + var server = http.createServer(function (req, res) { + processHttpRequest(res); + }); + server.listen(port, function () { + console.log('Listening on ' + port + '...'); + }); + }, + + processHttpRequest = function (res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + console.log('received message'); + setTimeout(() => { + res.end('Published Successfully.\n'); + }, 100); + }; + + return { + start: start + } +}(); + +httpServer.start(3904); diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/node.properties b/csit/plans/filesprocessingconfigpmmapper/assets/node.properties new file mode 100644 index 0000000..7abaf60 --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/node.properties @@ -0,0 +1,89 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * =========================================================================== +# * Modifications Copyright (C) 2021 Nokia Intellectual Property +# * =========================================================================== +# * 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- +# +# Configuration parameters set at startup for the DataRouter node +# +# URL to retrieve dynamic configuration +ProvisioningURL = https://dmaap-dr-prov:8443/internal/prov +# +# URL to upload PUB/DEL/EXP logs +LogUploadURL = https://dmaap-dr-prov:8443/internal/logs +# +# The port number for http as seen within the server +IntHttpPort = 8080 +# +# The port number for https as seen within the server +IntHttpsPort = 8443 +# +# The external port number for https taking port mapping into account +ExtHttpsPort = 443 +# +# The minimum interval between fetches of the dynamic configuration from the provisioning server +MinProvFetchInterval = 10000 +# +# The minimum interval between saves of the redirection data file +MinRedirSaveInterval = 10000 +# +# The path to the directory where log files are stored +LogDir = /opt/app/datartr/logs +# +# The retention interval (in days) for log files +LogRetention = 30 +# +# The path to the directories where data and meta data files are stored +SpoolDir = /opt/app/datartr/spool +# +# The path to the redirection data file +RedirectionFile = etc/redirections.dat +# +# The type of keystore for https +KeyStoreType = PKCS12 +# +# The type of truststore for https +TrustStoreType = jks +# +# The path to the file used to trigger an orderly shutdown +QuiesceFile = etc/SHUTDOWN +# +# The key used to generate passwords for node to node transfers +NodeAuthKey = Node123! +# +# DR_NODE DEFAULT ENABLED TLS PROTOCOLS +NodeHttpsProtocols = TLSv1.1|TLSv1.2 +# +# AAF type to generate permission string +AAFType = org.onap.dmaap-dr.feed +# +# AAF default instance to generate permission string - default should be legacy +AAFInstance = legacy +# +# AAF action to generate permission string - default should be publish +AAFAction = publish +# +# AAF CADI enabled flag +CadiEnabled = false +# +# AAF Props file path +AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/provserver.properties b/csit/plans/filesprocessingconfigpmmapper/assets/provserver.properties new file mode 100644 index 0000000..cd333ef --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/assets/provserver.properties @@ -0,0 +1,62 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# * =========================================================================== +# * Modifications Copyright (C) 2021 Nokia Intellectual Property +# * =========================================================================== +# * 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- + +#Jetty Server properties +org.onap.dmaap.datarouter.provserver.http.port = 8080 +org.onap.dmaap.datarouter.provserver.https.port = 8443 +org.onap.dmaap.datarouter.provserver.https.relaxation = true + +org.onap.dmaap.datarouter.provserver.aafprops.path = /opt/app/osaaf/local/org.onap.dmaap-dr.props + +org.onap.dmaap.datarouter.provserver.accesslog.dir = /opt/app/datartr/logs +org.onap.dmaap.datarouter.provserver.spooldir = /opt/app/datartr/spool +org.onap.dmaap.datarouter.provserver.dbscripts = /opt/app/datartr/etc/misc +org.onap.dmaap.datarouter.provserver.logretention = 30 + +#DMAAP-597 (Tech Dept) REST request source IP auth +# relaxation to accommodate OOM kubernetes deploy +org.onap.dmaap.datarouter.provserver.isaddressauthenabled = false + +#Localhost address config +org.onap.dmaap.datarouter.provserver.localhost = 127.0.0.1 + +# Database access +org.onap.dmaap.datarouter.db.driver = org.mariadb.jdbc.Driver +org.onap.dmaap.datarouter.db.url = jdbc:mariadb://datarouter-mariadb:3306/datarouter +org.onap.dmaap.datarouter.db.login = datarouter +org.onap.dmaap.datarouter.db.password = datarouter + +# PROV - DEFAULT ENABLED TLS PROTOCOLS +org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2 + +# AAF config +org.onap.dmaap.datarouter.provserver.cadi.enabled = false + +org.onap.dmaap.datarouter.provserver.passwordencryption = PasswordEncryptionKey#@$%^&1234# +org.onap.dmaap.datarouter.provserver.aaf.feed.type = org.onap.dmaap-dr.feed +org.onap.dmaap.datarouter.provserver.aaf.sub.type = org.onap.dmaap-dr.sub +org.onap.dmaap.datarouter.provserver.aaf.instance = legacy +org.onap.dmaap.datarouter.provserver.aaf.action.publish = publish +org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe diff --git a/csit/plans/filesprocessingconfigpmmapper/assets/trust.jks b/csit/plans/filesprocessingconfigpmmapper/assets/trust.jks new file mode 100644 index 0000000000000000000000000000000000000000..679c95a5c2c82666c1b78ff3786b5b12fe809d7e GIT binary patch literal 1413 zcmb7DYdF&j9NtyOZA)s_5Tc#skpHaJ6m3@IxP&wlidC2rsU!CXJGKzHNp-a=}&;N(<@> zIg83Y2{`{XBkqF8o-1r>Vg{>?x!MoJ8Msfz5P#NrPJOPxDh=tH{PuRgR=qJyaeF#M z>^10niFzK_-;mRKt8>ODRc1)d_sKGHlP3RhXzXfUU*~E?0NKbXF=HccJ@r0Z) zMdVRtLP&}Cdgg2@ti?|^d9*YuKazOdYpJVGMXM5bUMNC!wK*rxr@7OVpetRu2yc)Q*-9)89BkeeH*cq#5DLo24>V z-WQCMI6y%<4$0Y>H1=t*XRs%S$d8^>r+-1@O9@rc%J&g;1BPlxm0@K~&`6!_0Lc^9 zit0@!hoBfLm8!q-vnXi)7>m(GEZr@*V7w@$wcgrY1CV5vtRChY_So5PTR-O~35{UV zWCD}tQ&~2&!oFyW3$^i&O7({?83AHX!HeF+zqXXk$fbhg&|Ff@RQ{ci(u%b*ShZ@}OHbQ1u?mVn$6V4DTu{20T{ zR&2%)3?l1vGpoZ29csuJKZd!`_;h#Iw##zs8sbDkpgzGwvYI;t%?(w!x~`@~Mr3Ff z#l_fld5JSH^rS1f{7g3WfJb)Q!nz!**Q^`JY+WGdJ6(G*WV&+wV|7RId>_|N?3?rH zF_4xQ-oJ}<)Ixye&&LV83xnQ6q;H6_%|?UWG-@T}5-SyT(IS5&3;%DMh46M%nLE){-aKos`qXVW2wbt&J3UISZ{Pn_VplZcmVLUIJ9lavr2VLP>85wX44TQ(8XP`CU*uAP z^FE)6mQG!NQtsesAWhucd~XeTzl%3Du9ZD!`crxxHQ $WORKSPACE/archives/filesprocessingconfigpmmapper-docker-compose.log +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml down -v diff --git a/csit/plans/filesprocessingconfigpmmapper/testplan.txt b/csit/plans/filesprocessingconfigpmmapper/testplan.txt new file mode 100644 index 0000000..902faca --- /dev/null +++ b/csit/plans/filesprocessingconfigpmmapper/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [dcaegen2/services/pm-mapper.git]/csit/tests/. +# Place the suites in run order. +filesprocessingconfigpmmapper diff --git a/csit/plans/pmmapper/assets/addFeed3.txt b/csit/plans/pmmapper/assets/addFeed3.txt new file mode 100644 index 0000000..60544d9 --- /dev/null +++ b/csit/plans/pmmapper/assets/addFeed3.txt @@ -0,0 +1,44 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright © 2017 AT&T Intellectual Property. 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- +{ + "name": "Jettydemo", + "version": "m1.0", + "description": "Jettydemo", + "business_description": "Jettydemo", + "suspend": false, + "deleted": false, + "changeowner": true, + "authorization": { + "classification": "unclassified", + "endpoint_addrs": [ + "", + ], + "endpoint_ids": [ + { + "password": "rs873m", + "id": "rs873m" + } + ] + }, +} + diff --git a/csit/plans/pmmapper/assets/addSubscriber.json b/csit/plans/pmmapper/assets/addSubscriber.json new file mode 100644 index 0000000..0666a7d --- /dev/null +++ b/csit/plans/pmmapper/assets/addSubscriber.json @@ -0,0 +1,20 @@ +{ + "delivery":{ + "url":"http://dcae-pm-mapper:8081/delivery", + "user":"username", + "password":"password", + "use100":true + }, + "follow_redirect":false, + "metadataOnly":false, + "suspend":false, + "groupid":0, + "links":{ + "self": "https://dmaap-dr-prov/subscribe/1", + "log": "https://dmaap-dr-prov/feedlog/1", + "feed": "https://dmaap-dr-prov/feed/1" + }, + "subscriber":"pmmapper", + "decompress":true, + "privilegedSubscriber": true + } \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/addSubscriber.txt b/csit/plans/pmmapper/assets/addSubscriber.txt new file mode 100644 index 0000000..95cc2af --- /dev/null +++ b/csit/plans/pmmapper/assets/addSubscriber.txt @@ -0,0 +1,35 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright © 2017 AT&T Intellectual Property. 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- +{ +"delivery" : + { + "url" : "http://:7070/", + "user" : "datarouter", + "password" : "datarouter", + "use100" : true + }, +"metadataOnly" : false, +"suspend" : false, +"groupid" : 29, +"subscriber" : "sg481n" +} diff --git a/csit/plans/pmmapper/assets/cbs.json b/csit/plans/pmmapper/assets/cbs.json new file mode 100644 index 0000000..a29956f --- /dev/null +++ b/csit/plans/pmmapper/assets/cbs.json @@ -0,0 +1,7 @@ +{ + "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/cert.jks b/csit/plans/pmmapper/assets/cert.jks new file mode 100644 index 0000000000000000000000000000000000000000..33dc9a31aa5574aa13620ca9b45b2fd583fef227 GIT binary patch literal 4654 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 literal 0 HcmV?d00001 diff --git a/csit/plans/pmmapper/assets/config.json b/csit/plans/pmmapper/assets/config.json new file mode 100644 index 0000000..3f1009d --- /dev/null +++ b/csit/plans/pmmapper/assets/config.json @@ -0,0 +1,35 @@ +{ + "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/createFeed.json b/csit/plans/pmmapper/assets/createFeed.json new file mode 100644 index 0000000..f93633d --- /dev/null +++ b/csit/plans/pmmapper/assets/createFeed.json @@ -0,0 +1,18 @@ +{ + "name": "PM Mapper Feed", + "version": "m1.0", + "description": "PM Mapper Feed", + "business_description": "PM Mapper", + "suspend": false, + "deleted": false, + "changeowner": true, + "authorization": { + "classification": "unclassified", + "endpoint_addrs": [], + "endpoint_ids": [ + { + "password": "pmmapper", + "id": "pmmapper" + }] + } + } \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/jks.pass b/csit/plans/pmmapper/assets/jks.pass new file mode 100644 index 0000000..ae8f7e7 --- /dev/null +++ b/csit/plans/pmmapper/assets/jks.pass @@ -0,0 +1 @@ +Er1tmip;T4w[%1}YE?x{fN9v \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/mrserver.js b/csit/plans/pmmapper/assets/mrserver.js new file mode 100644 index 0000000..a6a6130 --- /dev/null +++ b/csit/plans/pmmapper/assets/mrserver.js @@ -0,0 +1,25 @@ +var httpServer = function() { +var http = require('http'), +url = require('url'), +fs = require('fs'), + +start = function(port) { + var server = http.createServer(function(req, res) { + processHttpRequest(res); + }); + server.listen(port, function() { + console.log('Listening on ' + port + '...'); + }); +}, + +processHttpRequest = function(res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('Published Successfully.\n'); +}; + +return { + start: start +} +}(); + +httpServer.start(3904); \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/node.properties b/csit/plans/pmmapper/assets/node.properties new file mode 100644 index 0000000..ddd4ebc --- /dev/null +++ b/csit/plans/pmmapper/assets/node.properties @@ -0,0 +1,87 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright � 2017 AT&T Intellectual Property. 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- +# +# Configuration parameters set at startup for the DataRouter node +# +# URL to retrieve dynamic configuration +ProvisioningURL = https://dmaap-dr-prov:8443/internal/prov +# +# URL to upload PUB/DEL/EXP logs +LogUploadURL = https://dmaap-dr-prov:8443/internal/logs +# +# The port number for http as seen within the server +IntHttpPort = 8080 +# +# The port number for https as seen within the server +IntHttpsPort = 8443 +# +# The external port number for https taking port mapping into account +ExtHttpsPort = 443 +# +# The minimum interval between fetches of the dynamic configuration from the provisioning server +MinProvFetchInterval = 10000 +# +# The minimum interval between saves of the redirection data file +MinRedirSaveInterval = 10000 +# +# The path to the directory where log files are stored +LogDir = /opt/app/datartr/logs +# +# The retention interval (in days) for log files +LogRetention = 30 +# +# The path to the directories where data and meta data files are stored +SpoolDir = /opt/app/datartr/spool +# +# The path to the redirection data file +RedirectionFile = etc/redirections.dat +# +# The type of keystore for https +KeyStoreType = PKCS12 +# +# The type of truststore for https +TrustStoreType = jks +# +# The path to the file used to trigger an orderly shutdown +QuiesceFile = etc/SHUTDOWN +# +# The key used to generate passwords for node to node transfers +NodeAuthKey = Node123! +# +# DR_NODE DEFAULT ENABLED TLS PROTOCOLS +NodeHttpsProtocols = TLSv1.1|TLSv1.2 +# +# AAF type to generate permission string +AAFType = org.onap.dmaap-dr.feed +# +# AAF default instance to generate permission string - default should be legacy +AAFInstance = legacy +# +# AAF action to generate permission string - default should be publish +AAFAction = publish +# +# AAF CADI enabled flag +CadiEnabled = false +# +# AAF Props file path +AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/provserver.properties b/csit/plans/pmmapper/assets/provserver.properties new file mode 100644 index 0000000..20b5cb9 --- /dev/null +++ b/csit/plans/pmmapper/assets/provserver.properties @@ -0,0 +1,60 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START================================================== +# * org.onap.dmaap +# * =========================================================================== +# * Copyright � 2017 AT&T Intellectual Property. 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==================================================== +# * +# * ECOMP is a trademark and service mark of AT&T Intellectual Property. +# * +#------------------------------------------------------------------------------- + +#Jetty Server properties +org.onap.dmaap.datarouter.provserver.http.port = 8080 +org.onap.dmaap.datarouter.provserver.https.port = 8443 +org.onap.dmaap.datarouter.provserver.https.relaxation = true + +org.onap.dmaap.datarouter.provserver.aafprops.path = /opt/app/osaaf/local/org.onap.dmaap-dr.props + +org.onap.dmaap.datarouter.provserver.accesslog.dir = /opt/app/datartr/logs +org.onap.dmaap.datarouter.provserver.spooldir = /opt/app/datartr/spool +org.onap.dmaap.datarouter.provserver.dbscripts = /opt/app/datartr/etc/misc +org.onap.dmaap.datarouter.provserver.logretention = 30 + +#DMAAP-597 (Tech Dept) REST request source IP auth +# relaxation to accommodate OOM kubernetes deploy +org.onap.dmaap.datarouter.provserver.isaddressauthenabled = false + +#Localhost address config +org.onap.dmaap.datarouter.provserver.localhost = 127.0.0.1 + +# Database access +org.onap.dmaap.datarouter.db.driver = org.mariadb.jdbc.Driver +org.onap.dmaap.datarouter.db.url = jdbc:mariadb://datarouter-mariadb:3306/datarouter +org.onap.dmaap.datarouter.db.login = datarouter +org.onap.dmaap.datarouter.db.password = datarouter + +# PROV - DEFAULT ENABLED TLS PROTOCOLS +org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2 + +# AAF config +org.onap.dmaap.datarouter.provserver.cadi.enabled = false + +org.onap.dmaap.datarouter.provserver.passwordencryption = PasswordEncryptionKey#@$%^&1234# +org.onap.dmaap.datarouter.provserver.aaf.feed.type = org.onap.dmaap-dr.feed +org.onap.dmaap.datarouter.provserver.aaf.sub.type = org.onap.dmaap-dr.sub +org.onap.dmaap.datarouter.provserver.aaf.instance = legacy +org.onap.dmaap.datarouter.provserver.aaf.action.publish = publish +org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe \ No newline at end of file diff --git a/csit/plans/pmmapper/assets/trust.jks b/csit/plans/pmmapper/assets/trust.jks new file mode 100644 index 0000000000000000000000000000000000000000..679c95a5c2c82666c1b78ff3786b5b12fe809d7e GIT binary patch literal 1413 zcmb7DYdF&j9NtyOZA)s_5Tc#skpHaJ6m3@IxP&wlidC2rsU!CXJGKzHNp-a=}&;N(<@> zIg83Y2{`{XBkqF8o-1r>Vg{>?x!MoJ8Msfz5P#NrPJOPxDh=tH{PuRgR=qJyaeF#M z>^10niFzK_-;mRKt8>ODRc1)d_sKGHlP3RhXzXfUU*~E?0NKbXF=HccJ@r0Z) zMdVRtLP&}Cdgg2@ti?|^d9*YuKazOdYpJVGMXM5bUMNC!wK*rxr@7OVpetRu2yc)Q*-9)89BkeeH*cq#5DLo24>V z-WQCMI6y%<4$0Y>H1=t*XRs%S$d8^>r+-1@O9@rc%J&g;1BPlxm0@K~&`6!_0Lc^9 zit0@!hoBfLm8!q-vnXi)7>m(GEZr@*V7w@$wcgrY1CV5vtRChY_So5PTR-O~35{UV zWCD}tQ&~2&!oFyW3$^i&O7({?83AHX!HeF+zqXXk$fbhg&|Ff@RQ{ci(u%b*ShZ@}OHbQ1u?mVn$6V4DTu{20T{ zR&2%)3?l1vGpoZ29csuJKZd!`_;h#Iw##zs8sbDkpgzGwvYI;t%?(w!x~`@~Mr3Ff z#l_fld5JSH^rS1f{7g3WfJb)Q!nz!**Q^`JY+WGdJ6(G*WV&+wV|7RId>_|N?3?rH zF_4xQ-oJ}<)Ixye&&LV83xnQ6q;H6_%|?UWG-@T}5-SyT(IS5&3;%DMh46M%nLE){-aKos`qXVW2wbt&J3UISZ{Pn_VplZcmVLUIJ9lavr2VLP>85wX44TQ(8XP`CU*uAP z^FE)6mQG!NQtsesAWhucd~XeTzl%3Du9ZD!`crxxHQ/'$KAFKA_IP'/g' /var/tmp/addSubscriber.txt +#sed -i 's//'$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 + +echo "Waiting for MariaDB to come up healthy..." +for i in {1..30}; do + mariadb_state=$(docker inspect --format='{{json .State.Health.Status}}' mariadb) + if [ $mariadb_state = '"healthy"' ] + then + break + else + sleep 2 + fi +done +[ "$mariadb_state" != '"healthy"' ] && echo "Error: MariaDB container state not healthy" && exit 1 + +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 +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." + containers_ok=true + break + else + sleep $i + fi +done +[ "$containers_ok" = "false" ] && echo "Error: required container not running." && exit 1 + +# Data Router Configuration. +docker exec -i datarouter-prov sh -c \ + "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$GATEWAY_IP" +docker exec -i datarouter-prov sh -c \ + "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$GATEWAY_IP" + +# Create PM Mapper feed and create PM Mapper subscriber on data router +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.feed" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ + --data-ascii @$TEST_PLANS_DIR/assets/createFeed.json \ + --post301 --location-trusted -k https://${DR_PROV_IP}:8443 +curl -v -X POST -H "Content-Type:application/vnd.dmaap-dr.subscription" -H "X-DMAAP-DR-ON-BEHALF-OF:pmmapper" \ + --data-ascii @$TEST_PLANS_DIR/assets/addSubscriber.json \ + --post301 --location-trusted -k https://${DR_PROV_IP}:8443/subscribe/1 + +docker cp pmmapper:/var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log /tmp/pmmapper.log +sleep 10 +docker exec -it datarouter-prov sh -c "curl http://dmaap-dr-node:8080/internal/fetchProv" +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}" diff --git a/csit/plans/pmmapper/teardown.sh b/csit/plans/pmmapper/teardown.sh new file mode 100644 index 0000000..8ca608d --- /dev/null +++ b/csit/plans/pmmapper/teardown.sh @@ -0,0 +1,7 @@ +#!/bin/bash +echo "Starting teardown script" +TEST_PLANS_DIR=$WORKSPACE/plans/pmmapper +mkdir -p $WORKSPACE/archives +docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml logs > $WORKSPACE/archives/pmmapper-docker-compose.log +docker-compose -f $TEST_PLANS_DIR/docker-compose.yml down -v diff --git a/csit/plans/pmmapper/testplan.txt b/csit/plans/pmmapper/testplan.txt new file mode 100644 index 0000000..a2cc01b --- /dev/null +++ b/csit/plans/pmmapper/testplan.txt @@ -0,0 +1,3 @@ +# Test suites are relative paths under [dcaegen2/services/pm-mapper.git]/csit/tests/. +# Place the suites in run order. +pmmapper diff --git a/csit/prepare-csit.sh b/csit/prepare-csit.sh new file mode 100755 index 0000000..3cc143d --- /dev/null +++ b/csit/prepare-csit.sh @@ -0,0 +1,49 @@ +#!/bin/bash -x +# +# Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# +# 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. +# +# This script installs common libraries required by CSIT tests +# + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=`git rev-parse --show-toplevel` +fi + +TESTPLANDIR=${WORKSPACE}/${TESTPLAN} + +# Assume that if ROBOT_VENV is set and virtualenv with system site packages can be activated, +# ci-management/jjb/integration/include-raw-integration-install-robotframework.sh has already +# been executed + +if [ -f ${WORKSPACE}/env.properties ]; then + source ${WORKSPACE}/env.properties +fi +if [ -f ${ROBOT_VENV}/bin/activate ]; then + source ${ROBOT_VENV}/bin/activate +else + rm -rf /tmp/ci-management + rm -f ${WORKSPACE}/env.properties + cd /tmp + git clone "https://gerrit.onap.org/r/ci-management" + source /tmp/ci-management/jjb/integration/include-raw-integration-install-robotframework.sh +fi + +# install eteutils +mkdir -p ${ROBOT_VENV}/src/onap +rm -rf ${ROBOT_VENV}/src/onap/testsuite +pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre + +pip freeze + diff --git a/csit/run-csit.sh b/csit/run-csit.sh new file mode 100755 index 0000000..fcbcbe1 --- /dev/null +++ b/csit/run-csit.sh @@ -0,0 +1,191 @@ +#!/bin/bash -x +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# Modification Copyright 2019-2021 © Samsung Electronics Co., Ltd. +# +# 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. +# +# $1 project/functionality +# $2 robot options +# + +function on_exit(){ + rc=$? + if [[ ${WORKSPACE} ]]; then + if [[ ${WORKDIR} ]]; then + rsync -av "$WORKDIR/" "$WORKSPACE/archives/$TESTPLAN" + fi + # Record list of active docker containers + docker ps --format "{{.Image}}" > "$WORKSPACE/archives/$TESTPLAN/_docker-images.log" + + # show memory consumption after all docker instances initialized + docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-2-after-robot.txt" + fi + # Run teardown script plan if it exists + cd "${TESTPLANDIR}" + TEARDOWN="${TESTPLANDIR}/teardown.sh" + if [ -f "${TEARDOWN}" ]; then + echo "Running teardown script ${TEARDOWN}" + source_safely "${TEARDOWN}" + fi + exit $rc +} +# ensure that teardown and other finalizing steps are always executed +trap on_exit EXIT + +function docker_stats(){ + #General memory details + echo "> top -bn1 | head -3" + top -bn1 | head -3 + echo + + echo "> free -h" + free -h + echo + + #Memory details per Docker + echo "> docker ps" + docker ps + echo + + echo "> docker stats --no-stream" + docker stats --no-stream + echo +} + +# save current set options +function save_set() { + RUN_CSIT_SAVE_SET="$-" + RUN_CSIT_SHELLOPTS="$SHELLOPTS" +} + +# load the saved set options +function load_set() { + _setopts="$-" + + # bash shellopts + for i in $(echo "$SHELLOPTS" | tr ':' ' ') ; do + set +o ${i} + done + for i in $(echo "$RUN_CSIT_SHELLOPTS" | tr ':' ' ') ; do + set -o ${i} + done + + # other options + for i in $(echo "$_setopts" | sed 's/./& /g') ; do + set +${i} + done + set -${RUN_CSIT_SAVE_SET} +} + +# set options for quick bailout when error +function harden_set() { + set -xeo pipefail + set +u # enabled it would probably fail too many often +} + +# relax set options so the sourced file will not fail +# the responsibility is shifted to the sourced file... +function relax_set() { + set +e + set +o pipefail +} + +# wrapper for sourcing a file +function source_safely() { + [ -z "$1" ] && return 1 + relax_set + . "$1" + load_set +} + +# +# main +# + +# set and save options for quick failure +harden_set && save_set + +if [ $# -eq 0 ] +then + echo + echo "Usage: $0 plans// []" + echo + echo " , , : " + echo " The same values as for the '{project}-csit-{functionality}' JJB job template." + echo + exit 1 +fi + +if [ -z "$WORKSPACE" ]; then + export WORKSPACE=$(git rev-parse --show-toplevel) +fi + +if [ -f "${WORKSPACE}/${1}/testplan.txt" ]; then + export TESTPLAN="${1}" +else + echo "testplan not found: ${WORKSPACE}/${TESTPLAN}/testplan.txt" + exit 2 +fi + +export TESTOPTIONS="${2}" + +rm -rf "$WORKSPACE/archives/$TESTPLAN" +mkdir -p "$WORKSPACE/archives/$TESTPLAN" + +TESTPLANDIR="${WORKSPACE}/${TESTPLAN}" + +# Run installation of prerequired libraries +source_safely "${WORKSPACE}/prepare-csit.sh" + +# Activate the virtualenv containing all the required libraries installed by prepare-csit.sh +source_safely "${ROBOT_VENV}/bin/activate" + +WORKDIR=$(mktemp -d --suffix=-robot-workdir) +cd "${WORKDIR}" + +# Add csit scripts to PATH +export PATH="${PATH}:${WORKSPACE}/docker/scripts:${WORKSPACE}/scripts:${ROBOT_VENV}/bin" +export SCRIPTS="${WORKSPACE}/scripts" +export ROBOT_VARIABLES= + +# Sign in to nexus3 docker repo +docker login -u docker -p docker nexus3.onap.org:10001 + +# Run setup script plan if it exists +cd "${TESTPLANDIR}" +SETUP="${TESTPLANDIR}/setup.sh" +if [ -f "${SETUP}" ]; then + echo "Running setup script ${SETUP}" + source_safely "${SETUP}" +fi + +# show memory consumption after all docker instances initialized +docker_stats | tee "$WORKSPACE/archives/$TESTPLAN/_sysinfo-1-after-setup.txt" + +# Run test plan +cd "$WORKDIR" +echo "Reading the testplan:" +cat "${TESTPLANDIR}/testplan.txt" | egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' | sed "s|^|${WORKSPACE}/tests/|" > testplan.txt +cat testplan.txt +SUITES=$( xargs -a testplan.txt ) + +echo ROBOT_VARIABLES="${ROBOT_VARIABLES}" +echo "Starting Robot test suites ${SUITES} ..." +relax_set +python -m robot.run -N ${TESTPLAN} -v WORKSPACE:/tmp ${ROBOT_VARIABLES} ${TESTOPTIONS} ${SUITES} +RESULT=$? +load_set +echo "RESULT: $RESULT" +# Note that the final steps are done in on_exit function after this exit! +exit $RESULT diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh new file mode 100755 index 0000000..12eb349 --- /dev/null +++ b/csit/run-project-csit.sh @@ -0,0 +1,33 @@ +#!/bin/bash -x +# +# Copyright 2020-2021 © Samsung Electronics Co., Ltd. +# +# 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. +# + +# $1 test options (passed on to run-csit.sh as such) +# + +export TESTOPTIONS=${1} +export WORKSPACE=$(git rev-parse --show-toplevel)/csit + +rm -rf ${WORKSPACE}/archives +mkdir -p ${WORKSPACE}/archives +cd ${WORKSPACE} + +# Execute all testsuites defined under plans subdirectory +for dir in plans/*/ +do + dir=${dir%*/} # remove the trailing / + ./run-csit.sh ${dir} ${TESTOPTIONS} +done diff --git a/csit/scripts/common_functions.sh b/csit/scripts/common_functions.sh new file mode 100755 index 0000000..684c418 --- /dev/null +++ b/csit/scripts/common_functions.sh @@ -0,0 +1,263 @@ +#!/bin/bash + +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. + +function memory_details(){ + #General memory details + echo "> top -bn1 | head -3" + top -bn1 | head -3 + echo + + echo "> free -h" + free -h + echo + + #Memory details per Docker + echo "> docker ps" + docker ps + echo + + echo "> docker stats --no-stream" + docker stats --no-stream + echo +} +function fibonacci_number(){ + set +x + if [ $1 -le 1 ] + then + echo "1" + elif [ $1 -le 10 ] + then + Num=$1 + f1=0 + f2=1 + fn=-1 + for i in `eval echo {1..$Num}`;do + fn=$((f1+f2)) + f1=$f2 + f2=$fn + done + echo $fn + else + echo "30" + fi +} +function wait_curl_driver(){ + #Parameters: + #CURL_COMMAND - the URL on which the curl command will be executed + #GREP_STRING - Desired string to be found inside the body response of the + # previous curl command + #EXCLUDE_STRING - If the filtered string (GREP_STRING) must not exist in + # the body response of the curl + #WAIT_MESSAGE - the message to be displayed for logging purpose. (optional) + #REPEAT_NUMBER - the maximum number of tries before abandoning the curl + # command (optional, by default = 15) + #MAX_TIME - Maximum time allowed for the transfer (in seconds) + #STATUS_CODE - A HTTP status code desired to be found by getting the link + # /!\ IMPORTANT NOTICE: the usage of STATUS_CODE option turn GREP_STRING/ + # /!\ EXCLUDE_STRING/and the MAX_TIME options becomes obsolete with no + # /!\ execution impact + #MEMORY_USAGE - If Parameters exists shows the memory usage after curl + # execution(s) + + repeat_max=15 + parameters="$@" + + #WAIT_MESSAGE + if [[ $parameters == *"WAIT_MESSAGE"* ]] + then + wait_message=`echo $parameters | sed -e "s/.*WAIT_MESSAGE=//g"` + wait_message=`echo $wait_message | sed -e "s/ .*//g"` + else + wait_message="wait ..." + fi + + #REPEAT_NUMBER + if [[ $parameters == *"REPEAT_NUMBER"* ]] + then + repeat_max=`echo $parameters | sed -e "s/.*REPEAT_NUMBER=//g"` + repeat_max=`echo $repeat_max | sed -e "s/ .*//g"` + fi + + #CURL_COMMAND + if [[ $parameters == *"CURL_COMMAND"* ]] + then + curl_command=`echo $parameters | sed -e 's/.*CURL_COMMAND=//g'` + curl_command=`echo $curl_command | sed -e 's/ .*//g'` + else + echo "-Curl is empty-" # Or no parameterseter passed. + return 0 + fi + + #MAX_TIME + if [[ $parameters == *"MAX_TIME"* ]] + then + max_time=`echo $parameters | sed -e 's/.*MAX_TIME=//g'` + max_time=`echo $max_time | sed -e 's/ .*//g'` + else + max_time="5" + fi + + exclude_string="" + #EXCLUDE_STRING + if [[ $parameters == *"EXCLUDE_STRING"* ]] + then + exclude_string="-v" + fi + + status_code="" + #STATUS_CODE + if [[ $parameters == *"STATUS_CODE"* ]] + then + status_code=`echo $parameters | sed -e 's/.*STATUS_CODE=//g'` + status_code=`echo $status_code | sed -e 's/ .*//g'` + fi + + for i in `eval echo {1..$repeat_max}`; do + response_code=`curl -o /dev/null --silent --head --write-out '%{http_code}' $curl_command` + echo "..." + if [[ ! -z $status_code ]] ; then + if [ "$status_code" -eq "$response_code" ] + then + echo "SUCCESS:Actual Status code <$response_code> match the expected code <$status_code>" + return 0 + else + echo "WARNING:Expected <$status_code> but Actual <$response_code>" + fi + else + #GREP_STRING + if [[ $parameters == *"GREP_STRING"* ]] + then + grep_command=`echo $parameters | sed -e 's/.*GREP_STRING=//g'` + grep_command=`echo $grep_command | sed -e 's/ REPEAT_NUMBER=.*//g' | sed -e 's/ CURL_COMMAND=.*//g' | sed -e 's/ WAIT_MESSAGE=.*//g' | sed -e 's/ MAX_TIME=.*//g' | sed -e 's/ EXCLUDE_STRING.*//g'` + else + echo "-Grep_command is empty-" # Or no parameters passed. + return 0 + fi + + str=`curl -sS -m$max_time $curl_command | grep "$grep_command"` + echo "BODY::$str" + if [[ ! -z $exclude_string ]] + then + if [[ -z $str ]] + then + echo "SUCCESS: body response does not contains '$grep_command'"; + break; + else + echo "Fall_Short: Body response still contains '$grep_command'" + fi + else + if [[ ! -z $str ]] + then + echo "SUCCESS: body response contains '$grep_command'"; + break; + else + echo "Fall_Short: Element '$grep_command' not found yet # "$i"" + fi + fi + + if [ "$?" = "7" ]; then + echo 'Connection refused or can not connect to server/proxy'; + str='' + fi + fi + seconds2sleep=`fibonacci_number $i` + echo $wait_message + echo "Iteration::$i out of $repeat_max " + echo "Quiet time for $seconds2sleep seconds ..." + sleep $seconds2sleep + + # if waiting for a long time, log system load + if [ $i -gt 45 ] + then + memory_details + fi + done + #MEMORY_USAGE + if [[ $parameters == *"MEMORY_USAGE"* ]] + then + echo "==========================MEMORY USAGE==================================" + memory_details + echo "========================================================================" + fi + return 0 +} + +function run_simulator () +{ + run_robottestlib + run_simulator_docker $1 +} + +function run_robottestlib () +{ + #Start the robottest REST library if not started + if ! pgrep -f robottest > /dev/null + then + #Download the latest robottest jar + wget -q -O ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar "https://nexus.open-o.org/service/local/artifact/maven/redirect?r=snapshots&g=org.openo.integration&a=org.openo.robottest&e=jar&v=LATEST" + chmod +x ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar + eval `java -cp ${SCRIPTS}/integration/mockserver/org.openo.robottest.jar org.openo.robot.test.robottest.MyRemoteLibrary` & + fi +} + +function run_simulator_docker () +{ + #Start the simulator docker if not started + SIMULATOR_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' simulator` + if [[ -z $SIMULATOR_IP ]] + then + echo "Starting simulator docker..." + SIMULATOR_JSON=$1 + if [[ -z $SIMULATOR_JSON ]] + then + SIMULATOR_JSON=main.json + fi + docker run -d -i -t --name simulator -e SIMULATOR_JSON=$SIMULATOR_JSON -p 18009:18009 -p 18008:18008 openoint/simulate-test-docker + SIMULATOR_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' simulator` + fi + + #Set the simulator IP in robot variables + ROBOT_VARIABLES=${ROBOT_VARIABLES}" -v SIMULATOR_IP:${SIMULATOR_IP} -v SCRIPTS:${SCRIPTS}" + echo ${ROBOT_VARIABLES} +} + +function get_docker_compose_service () +{ + local service=$1 + local compose_file=${2:-docker-compose.yml} + + echo $(docker-compose --file ./${compose_file} ps | grep $service | cut -d " " -f1 ) +} + +function bypass_ip_adress () +{ + local ip_address=$1 + + if [[ $no_proxy && $no_proxy != *$ip_address* ]]; then + export no_proxy=$no_proxy,$ip_address + fi +} + +function wait_for_service_init () +{ + local service_url=$1 + + for delay in {1..50}; do + curl -sS ${service_url} && break + echo "$delay - Waiting for $service_url..." + sleep $delay + done +} diff --git a/csit/scripts/kill-instance.sh b/csit/scripts/kill-instance.sh new file mode 100755 index 0000000..5997098 --- /dev/null +++ b/csit/scripts/kill-instance.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# 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. +# +# $1 nickname for the instance + +mkdir -p $WORKSPACE/archives + +running_containers=$(docker ps --filter name=$1 -q) +if [ -z "$running_containers" ] +then + echo "$1 already terminated" +else + echo "Stopping and removing containers" + docker logs $running_containers >> $WORKSPACE/archives/$1.log + docker stop $running_containers + docker rm $running_containers +fi + diff --git a/csit/tests/filesprocessingconfigpmmapper/__init__.robot b/csit/tests/filesprocessingconfigpmmapper/__init__.robot new file mode 100644 index 0000000..9eda6de --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Documentation Files Processing Config PM Mapper Testcases diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/.gitattributes b/csit/tests/filesprocessingconfigpmmapper/assets/.gitattributes new file mode 100644 index 0000000..57cdc50 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/.gitattributes @@ -0,0 +1 @@ +*.gz binary diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/ABigFile.xml b/csit/tests/filesprocessingconfigpmmapper/assets/ABigFile.xml new file mode 100644 index 0000000..8a3bcf4 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/ABigFile.xml @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/config_10_1.env b/csit/tests/filesprocessingconfigpmmapper/assets/config_10_1.env new file mode 100644 index 0000000..050d2f2 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/config_10_1.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=10 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=1 diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/config_1_1.env b/csit/tests/filesprocessingconfigpmmapper/assets/config_1_1.env new file mode 100644 index 0000000..c138912 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/config_1_1.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=1 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=1 diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/config_1_10.env b/csit/tests/filesprocessingconfigpmmapper/assets/config_1_10.env new file mode 100644 index 0000000..b4c290e --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/config_1_10.env @@ -0,0 +1,3 @@ +PROCESSING_LIMIT_RATE=1 +THREADS_MULTIPLIER=1 +PROCESSING_THREADS_COUNT=10 diff --git a/csit/tests/filesprocessingconfigpmmapper/assets/valid_metadata.json b/csit/tests/filesprocessingconfigpmmapper/assets/valid_metadata.json new file mode 100644 index 0000000..da809d7 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/assets/valid_metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "gnb", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.32.435#measCollec", + "fileFormatVersion": "V9" + } \ No newline at end of file diff --git a/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot b/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot new file mode 100644 index 0000000..9648ef8 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/filesprocessingconfigpmmapper.robot @@ -0,0 +1,149 @@ +*** Settings *** +Documentation Testing PM Mapper functionality +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library Process +Library String +Library libraries/DockerContainerManager.py +Library libraries/LogReader.py + +*** Variables *** + +${ASSETS_PATH} %{WORKSPACE}/tests/filesprocessingconfigpmmapper/assets +${NR_VALID_METADATA_PATH} ${ASSETS_PATH}/valid_metadata.json +${CLI_EXEC_CLI_PM_LOG_CLEAR} docker exec pmmapper /bin/sh -c "echo -n "" > /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${PUBLISH_NODE_URL} https://${DR_NODE_IP}:8443/publish/1 +${CLI_EXEC_LOGS_LIST} docker exec datarouter-node /bin/sh -c "ls /opt/app/datartr/logs" +${DOCKER_CLIENT_IMAGE} nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pm-mapper:latest +${CLIENT_CONTAINER_NAME} pmmapper +${FILE_PATH} ${ASSETS_PATH}/ABigFile.xml +${CONFIG_ENVS_1_1} ${ASSETS_PATH}/config_1_1.env +${CONFIG_ENVS_4_1} ${ASSETS_PATH}/config_4_1.env +${CONFIG_ENVS_10_1} ${ASSETS_PATH}/config_10_1.env +${CONFIG_ENVS_1_10} ${ASSETS_PATH}/config_1_10.env + +*** Test Cases *** + +Verify that PM Mapper rejects 6-9 messages when limitRate is 1 and threads count is 1 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_1 + [Documentation] Verify that PM Mapper rejects 6-9/10 messages. Configuration: limitRate=1, threadsCount=1 + [Timeout] 15 minute + + RestartPmmapper ${CONFIG_ENVS_1_1} + + ${testname}= Set Variable Afirst- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${filtered_logs} + + Sleep 40s + ${isCorrectDroppedCount}= Evaluate ${5} < ${dropped_nr} < ${10} + SavePmMapperLogsAndDroppedCount config_1_1 ${dropped_nr} + Should Be True ${isCorrectDroppedCount} Pm-mapper drop: ${dropped_nr} messages. Expected drop count: 6-9 + ClearLogs + +Verify that PM Mapper rejects 0 messages when limitRate is 10 and threads count is 1 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_2 + [Documentation] Verify that PM Mapper rejects 0/10 messages. Configuration: limitRate=10, threadsCount=1 + [Timeout] 25 minute + + RestartPmmapper ${CONFIG_ENVS_10_1} + + ${testname}= Set Variable Athird- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${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 + ClearLogs + +Verify that PM Mapper rejects 0 messages when limitRate is 1 and threads count is 10 + [Tags] FILES_PROCESSING_CONFIG_PM_MAPPER_3 + [Documentation] Verify that PM Mapper rejects 0/10 messages. Configuration: limitRate=1, threadsCount=10 + [Timeout] 25 minute + + RestartPmmapper ${CONFIG_ENVS_1_10} + + ${testname}= Set Variable Afourth- + + SendFilesToDatarouter ${testname} + ${alllogs}= GetLogsOutput + ${filtered_logs}= GetFilteredLogs ${alllogs} ${testname} + ${dropped_nr}= GetDroppedNumber ${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 + ClearLogs + +*** Keywords *** + +SendFilesToDatarouter + [Arguments] ${testnr} + FOR ${i} IN RANGE 10 + SendToDatarouter ${FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=${i} ${testnr} ${i} + END + Sleep 20s + +SendToDatarouter + [Arguments] ${filepath} ${metadatapath} ${request_id} ${testnr} ${i} + ${pmdata}= Get File ${filepath} + ${metatdata} Get File ${metadatapath} + ${newFilename} Catenate SEPARATOR= ${testnr} ${i} .xml + ${resp}= PutCall ${PUBLISH_NODE_URL}/${newFilename} ${request_id} ${pmdata} ${metatdata.replace("\n","")} pmmapper + VerifyResponse ${resp.status_code} 204 + +PutCall + [Arguments] ${url} ${request_id} ${data} ${meta} ${user} + ${headers}= Create Dictionary X-ONAP-RequestID=${request_id} X-DMAAP-DR-META=${meta} Content-Type=application/octet-stream X-DMAAP-DR-ON-BEHALF-OF=${user} Authorization=Basic cG1tYXBwZXI6cG1tYXBwZXI= + ${resp}= Evaluate requests.put('${url}', data="""${data}""", headers=${headers}, verify=False, allow_redirects=False) requests + [Return] ${resp} + +VerifyResponse + [Arguments] ${actual_response_value} ${expected_response_value} + Should Be Equal As Strings ${actual_response_value} ${expected_response_value} + +ClearLogs + Run Process ${CLI_EXEC_CLI_PM_LOG_CLEAR} shell=yes + +GetLogsOutput + ${filesString}= Run Process ${CLI_EXEC_LOGS_LIST} shell=yes + ${filesList}= Get Log Files List ${filesString.stdout} + ${output}= Set Variable ${EMPTY} + FOR ${file} IN @{filesList} + ${file_path}= Catenate SEPARATOR= "cat /opt/app/datartr/logs/ ${file} " + ${exec}= Catenate docker exec datarouter-node /bin/sh -c ${file_path} + ${single_file}= Run Process ${exec} shell=yes + ${output}= Catenate SEPARATOR=\n ${output} ${single_file.stdout} + END + [Return] ${output} + +GetFilteredLogs + [Arguments] ${all_logs} ${testname} + ${filtered_logs}= Filter Unique ${all_logs} ${testname} + [Return] ${filtered_logs} + +GetDroppedNumber + [Arguments] ${logs_output} + ${number}= Get Number Of Dropped Messages ${logs_output} + [Return] ${number} + +RestartPmmapper + [Arguments] ${envs} + Remove Container ${CLIENT_CONTAINER_NAME} + Sleep 5s + Run Pmmapper Container ${DOCKER_CLIENT_IMAGE} ${CLIENT_CONTAINER_NAME} ${envs} ${DR_NODE_IP} ${NODE_IP} + Sleep 15s + +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 + diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py b/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py new file mode 100644 index 0000000..3e3ae58 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.py @@ -0,0 +1,29 @@ +import docker +from EnvsReader import EnvsReader +from docker.types import Mount + +class DockerContainerManager: + + def run_pmmapper_container(self, client_image, container_name, path_to_env, dr_node_ip, mr_ip): + client = docker.from_env() + environment = EnvsReader().read_env_list_from_file(path_to_env) + environment.append("CONFIG_BINDING_SERVICE_SERVICE_HOST=172.18.0.5") + environment.append("CONFIG_BINDING_SERVICE_SERVICE_PORT=10000") + environment.append("HOSTNAME=pmmapper") + client.containers.run( + image=client_image, + name=container_name, + environment=environment, + ports={'8081': 8081}, + 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')], + detach=True + ) + + def remove_container(self, container_name): + client = docker.from_env() + container = client.containers.get(container_name) + container.stop() + container.remove() diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.pyc b/csit/tests/filesprocessingconfigpmmapper/libraries/DockerContainerManager.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2bf62c34a1d0f01bb5f841e7541f4c387a9af188 GIT binary patch literal 1989 zcmc&!&2k$>5bn`h@=v7TI3eMu2)R(T9Hh0W!uUWah+~WomZ?>WDs&k(J7as5-JPwO zks(#eDZBu$z=3z*xp)Bhde)XWP{q+JO>fU^cTe}%Kha-2IT_$jCBC&K${EO!W^ z@E24POe8=7Z;5`KVlQYCuftC9H=c1U!1^ta zqx#CFI#b%VXI-3~ntAR0LvYVc{z}_JQ~Ru_wLQ)1>_Xe6hiv5;miqui!#BZx;?`-0 zZ)7H-bP{*)Iq!jNU_HX(h}@qbo@gf6$u~Xn9cE?`Eh2g==*>DU)@c@e$5vc#Ahg;9 zL9yu3tV=V5yhaPS(4__L@3FdCrvfJ%q&8_^ZIQY|s!v6S7O*>@{Y975U3__m)HbPm zOQFlq~0av{$&06ZUwk&&I~eVbK6jt~zsmP#DO7gxxOcfjcSs<5W6G}6Z+jj`SpzkLjxS?*x>U=IO8LHnPLeHFYvFG}qiYjW*e zQD5YyJ})kAE|NFQ@LHw4<`-`>d1;(?ZUA$t%Ccst?65XUySq54U<}?3t(kkc%a_mH zHDitOo{OR4GIN3TnMEw_Bb+9t@d=_#nrhfan`oaWIka68gq@jNc)Q8MSD8(G)g<8x z|GH@bd0Esdh$`)~{4!?Ib|2~)X(T$grjh_G1y7!f(xMIcM3#l~GJI!nf+E8Xo7^!# zsO<*lBi5SNY3L>n@`au2n5_qYoG#COpH<2NDUof)7@wsLxy)UY`Ag{yI}ol>Rx+Hj zXhJG0%N)bj8cR99F;+`l4KBGfl}^gcIi1WK=Mhl#FBo%I_{3{uEeS~}aO zcTyHFZDtGYlK&n7qvmxO5Qu(RBXSuP*O+_E&WXO*5rgpSi(dE*Kp$W|7CFxahK=80 zB(n;Ex21E1QBXlhH{cJ6p)ma zQS(wunLdGV`U%J?n!w#c)ufzju3g8__d1(9txtT^CJqdRu2G>`N8Hsev{=x+{SX4w TU$)?W#bxKXp!#B4Y5UrkB7crVd5Q5+>m$_^Patt8^Kk(*Z1;vHXjx#-L>wL6bttjlC)?ebm zKbSw@t6tH6kPKaKYUC zMDvvHf6y$U{XgGnKA_ovu0Vr`KBR0z-gQcThh`~VC6cjFq;7Ty>lCr2)}tV8y#-Ko zzh=@p$Q->hT@W!Gymes+uW*P}nFM1Bo2HJAE5c>`zm9ocH#+>BzOOxsAQ>g|~+D z_YME%9)g?^%2wKRcTtP3ecx)SC!_I40I5%Es5aEP`mDCpa_&`xweE`6XdTZ{>$b0M s8+?vGfP0_hUyd^twQ@CBV3-^&WysM*>i?(;tLXo8xjnx`815<23x6iV9{>OV literal 0 HcmV?d00001 diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py new file mode 100644 index 0000000..01718e3 --- /dev/null +++ b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.py @@ -0,0 +1,22 @@ +import re + +class LogReader: + + def filter_unique(self, merged_logs_output, testname): + logs = merged_logs_output.splitlines() + del_logs = list(filter(lambda line: "|DEL|" in line, logs)) + nrs_set = set() + ret_logs = set() + for log in del_logs: + filename = re.findall(testname + "\d", log) + if len(filename) > 0 and filename[0] not in nrs_set: + ret_logs.add(log) + 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_log_files_list(self, fileNames): + files = fileNames.split() + return files diff --git a/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.pyc b/csit/tests/filesprocessingconfigpmmapper/libraries/LogReader.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d8e936cbdc784820c9c1fb47f0baecb56d870e49 GIT binary patch literal 1953 zcmc&#OK;Oa5T4CDC6xdHEdp_XOD@F{;)2vx2#UB=IXDMI1u|~DF>d{;cO!x1oXRgj zh(E{=fbUzU4~|@dlbOtpXJ_Z}&8GcpbL0ElpPy#3dfNDX2{KQ>B7BvkB1aHf5_KeM z%Qum8k@rW6@22A}?2_MjCUyw%u!wyfM!LH6sGxlXavn8&VWZH?5j-j1GA%eGi0_QFBkmh+aJD_M5LLKazeFNB_aiKXty!N)+BeX$)m z=}L{AE!nF3+_xNv?MXeL1LSwwk!p`i$oK26oc7(iCntU31| zqBOSBVdjuDqE^tY@{c#+xUpHalfi%(O8{9`DSGe4fNRWwx?SljAC^5^cQ8 zZapo(+5t}4O~dRs3itbvEl3Ol{SYOT$F#6a#FS}b8KhZ-Yb;7Af}^dj&;pofi~fjI z+S1uP$)hk$-K$jR?l+90F?;NM7@f}TZLBg~#X1VoA~r#>u;s$K$e3FmX1X~LFP%2h zsk3xv + + + + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + diff --git a/csit/tests/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz b/csit/tests/pmmapper/assets/A20181002.0000-1000-0015-1000_5G.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..32865fc16376cad6e412630f42c7067228fd7963 GIT binary patch literal 959 zcmV;w13>&AiwFqAxvg9T06{V^F*q?WFfuMMFfcGJF)%PNEif=KH7zkPFfd;=M=p46 zYyiDiZFAB<5dLg`MJ9eUkav=F2#%s?X9{)-I(~DGWC_u{P3}^tzuwIy7$7OF7G)@N zw|o2Cvv1jS_<9>h!X4x^OcPgB`-&();-!9=1g`jbG3nXj>(K>2)}!n`0=foZ0=v(^ z6&Y-qyrq#StaDho;uHvdM;IBWQ3M`C$UbU0K#ZzNJP9KZ5H6vvxMnQ7l;zE4)7OJ6 z>!*1juUID23_L26+*^ltAnV#U3V8?=SA9b_Up8Rk1xLEv((nLnqjM}xQB?Ws^m^{C zAtt>rp^PLRh!=SNl5*j7>XDM^8OR9FMi56AFNP}&&_^IX{fx zZvse|tCp8nx6ct4Z;voE(L20z&tRMu3Cj^ln!-3u$_j9&@5j9l%b=%9Q<9JX{Pz*W zCFJd_R$x(8q6M!Tl#4RIZ7+CB2*P9$mabshl%AsZ6m_8*mx_YlSBi$e+-fK{5h}NF zU3C@U0fV!;P+-=s$r2*&fUrQ9Fq(HEvfuOODp{qt!QJjYW6xBu;ex#;T23*LHfjA zLwU#Pc@*tqingP)DLRVUridkVOp$wdZi>z^MZ+8%Q{(|_Qyf@!XA~PDEy_nD8?n5A zpxi;wy^g(>PGGVcH=&i(`~6X#eZn_NP}umvU|8y z^(Wb%XjN-aDK(Z}KlLnGyNe=#+lCDeIDJva8 zl?U{71e|XD?_yq&h&I)HcyO<*8%0yxk4_Q&|JLoJQ^fqUF*5kOIb!|gAhG}5B(b|D ziP1Gl^sZ;1b?(P>$0V`4CW+ZKNm|2>dw6b&9h1c9nj}uwB+$z?X00141&)Wb1 literal 0 HcmV?d00001 diff --git a/csit/tests/pmmapper/assets/A_no_managed_element.xml b/csit/tests/pmmapper/assets/A_no_managed_element.xml new file mode 100644 index 0000000..23e5c21 --- /dev/null +++ b/csit/tests/pmmapper/assets/A_no_managed_element.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + a + b + c + + 86 + 67 + 14 + false + + + + + + + \ No newline at end of file diff --git a/csit/tests/pmmapper/assets/A_no_measdata.xml b/csit/tests/pmmapper/assets/A_no_measdata.xml new file mode 100644 index 0000000..855b2e9 --- /dev/null +++ b/csit/tests/pmmapper/assets/A_no_measdata.xml @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/csit/tests/pmmapper/assets/C20190328.0000-0015.xml b/csit/tests/pmmapper/assets/C20190328.0000-0015.xml new file mode 100644 index 0000000..b6a3b43 --- /dev/null +++ b/csit/tests/pmmapper/assets/C20190328.0000-0015.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + z1 a1 zz1 b1 + + 1 11 111 1111 + false + + + + + + + + + + z2 a2 zz2 b2 + + 2 22 222 2222 + false + + + + + + + + + + z3 a3 zz3 b3 + + 3 33 333 3333 + false + + + + + + + diff --git a/csit/tests/pmmapper/assets/diff_vendor_metadata.json b/csit/tests/pmmapper/assets/diff_vendor_metadata.json new file mode 100644 index 0000000..0abf8e3 --- /dev/null +++ b/csit/tests/pmmapper/assets/diff_vendor_metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "gnb", + "vendorName": "Anon", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.32.435#measCollec", + "fileFormatVersion": "V9" + } \ No newline at end of file diff --git a/csit/tests/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml b/csit/tests/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml new file mode 100644 index 0000000..8d42d62 --- /dev/null +++ b/csit/tests/pmmapper/assets/new_radio/A20181004.0000-1000-0015-1000_5G.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + diff --git a/csit/tests/pmmapper/assets/new_radio/C20190329.0000-0015.xml b/csit/tests/pmmapper/assets/new_radio/C20190329.0000-0015.xml new file mode 100644 index 0000000..9c1b985 --- /dev/null +++ b/csit/tests/pmmapper/assets/new_radio/C20190329.0000-0015.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + z1 a1 zz1 b1 + + 1 11 111 1111 + false + + + + + + + + + + attTCHSeizures succTCHSeizures2 zz2 b2 + + 2 22 222 2222 + false + + + + + + + + + + z3 a3 zz3 succImmediateAssignProcs8 + + 3 33 333 3333 + false + + + + + + + diff --git a/csit/tests/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml b/csit/tests/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml new file mode 100644 index 0000000..8d42d62 --- /dev/null +++ b/csit/tests/pmmapper/assets/new_radio/PM202007171301+020024C202007171207+0200-1215+0200_45678.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + attTCHSeizures + succTCHSeizures + attImmediateAssignProcs + succImmediateAssignProcs + + 234 + 345 + 567 + 789 + + + 890 + 901 + 123 + 234 + + + 456 + 567 + 678 + 789 + true + + + + + + + attTCHSeizures1 + succTCHSeizures2 + attImmediateAssignProcs3 + succImmediateAssignProcs4 + + 4 + 86,87,2,6,77,96,75,33,24 + 40 + 90 + false + + + + + + + attTCHSeizures5 + succTCHSeizures6 + attImmediateAssignProcs7 + succImmediateAssignProcs8 + + 238 + 344 + 563 + 787 + + + 898 + 905 + 127 + 238 + + + 454 + 569 + 672 + 785 + true + + + + + + + diff --git a/csit/tests/pmmapper/assets/new_radio/valid_metadata.json b/csit/tests/pmmapper/assets/new_radio/valid_metadata.json new file mode 100644 index 0000000..f75adb8 --- /dev/null +++ b/csit/tests/pmmapper/assets/new_radio/valid_metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "gnb", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.28.532#measData", + "fileFormatVersion": "V9" +} diff --git a/csit/tests/pmmapper/assets/pm_filter_config.json b/csit/tests/pmmapper/assets/pm_filter_config.json new file mode 100644 index 0000000..79e3f98 --- /dev/null +++ b/csit/tests/pmmapper/assets/pm_filter_config.json @@ -0,0 +1,42 @@ +{ + "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 + } + } + } +} \ No newline at end of file diff --git a/csit/tests/pmmapper/assets/pm_filter_regex_config.json b/csit/tests/pmmapper/assets/pm_filter_regex_config.json new file mode 100644 index 0000000..5cd7146 --- /dev/null +++ b/csit/tests/pmmapper/assets/pm_filter_regex_config.json @@ -0,0 +1,42 @@ +{ + "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 + } + } + } +} \ No newline at end of file diff --git a/csit/tests/pmmapper/assets/valid_metadata.json b/csit/tests/pmmapper/assets/valid_metadata.json new file mode 100644 index 0000000..da809d7 --- /dev/null +++ b/csit/tests/pmmapper/assets/valid_metadata.json @@ -0,0 +1,12 @@ +{ + "productName": "gnb", + "vendorName": "Ericsson", + "lastEpochMicrosec": "1538478000000", + "sourceName": "oteNB5309", + "startEpochMicrosec": "1538478900000", + "timeZoneOffset": "UTC+05.00", + "location": "ftpes://192.168.0.101:22/ftp/rop/A20161224.1045-1100.bin.gz", + "compression": "gzip", + "fileFormatType": "org.3GPP.32.435#measCollec", + "fileFormatVersion": "V9" + } \ No newline at end of file diff --git a/csit/tests/pmmapper/assets/vendor_filter_config.json b/csit/tests/pmmapper/assets/vendor_filter_config.json new file mode 100644 index 0000000..94d0911 --- /dev/null +++ b/csit/tests/pmmapper/assets/vendor_filter_config.json @@ -0,0 +1,42 @@ +{ + "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 + } + } + } +} \ No newline at end of file diff --git a/csit/tests/pmmapper/pmmapper.robot b/csit/tests/pmmapper/pmmapper.robot new file mode 100644 index 0000000..f23d33c --- /dev/null +++ b/csit/tests/pmmapper/pmmapper.robot @@ -0,0 +1,201 @@ +*** Settings *** +Documentation Testing PM Mapper functionality +Library Collections +Library OperatingSystem +Library RequestsLibrary +Library Process +Library String + +Test Setup Create Session mapper_session ${PMMAPPER_BASE_URL} +Test Teardown CleanSessionsAndLogs + +*** Variables *** +${CLI_EXEC_CLI_CONFIG} { head -n 100 | tail -50;} < /tmp/pmmapper.log +${CLI_EXEC_CLI_SUBS} curl -k https://${DR_PROV_IP}:8443/internal/prov +${PMMAPPER_BASE_URL} http://${PMMAPPER_IP}:8081 +${DELIVERY_ENDPOINT} /delivery +${HEALTHCHECK_ENDPOINT} /healthcheck +${RECONFIGURE_ENDPOINT} /reconfigure +${ASSETS_PATH} %{WORKSPACE}/tests/pmmapper/assets +${NO_MANAGED_ELEMENT_PATH} ${ASSETS_PATH}/A_no_managed_element.xml +${NO_MEASDATA_PATH} ${ASSETS_PATH}/A_no_measdata.xml +${VALID_METADATA_PATH} ${ASSETS_PATH}/valid_metadata.json +${NR_VALID_METADATA_PATH} ${ASSETS_PATH}/new_radio/valid_metadata.json +${DIFF_VENDOR_METADATA} ${ASSETS_PATH}/diff_vendor_metadata.json +${NON_XML_FILE} ${ASSETS_PATH}/diff_vendor_metadata.json +${CLI_EXEC_CLI_PM_LOG} docker exec pmmapper /bin/sh -c "cat /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${CLI_EXEC_CLI_PM_LOG_CLEAR} docker exec pmmapper /bin/sh -c "echo -n "" > /var/log/ONAP/dcaegen2/services/pm-mapper/pm-mapper_output.log" +${PUBLISH_NODE_URL} https://${DR_NODE_IP}:8443/publish/1 +${TYPE-A_PM_DATA_FILE_PATH} ${ASSETS_PATH}/A20181002.0000-1000-0015-1000_5G.xml +${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_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 + + +*** Test Cases *** +Verify PM Mapper Receive Configuraton From Config Binding Service + [Tags] PM_MAPPER_01 + [Documentation] Verify 3gpp pm mapper successfully receive config data from CBS + CheckLog ${CLI_EXEC_CLI_CONFIG} Received pm-mapper configuration from ConfigBinding Service + +Verify Health Check returns 200 when a REST GET request to healthcheck url + [Tags] PM_MAPPER_02 + [Documentation] Verify Health Check returns 200 when a REST GET request to healthcheck url + [Timeout] 1 minute + ${resp}= Get Request mapper_session ${HEALTHCHECK_ENDPOINT} + VerifyResponse ${resp.status_code} 200 + +Verify 3GPP PM Mapper responds appropriately when no metadata is provided + [Tags] PM_MAPPER_03 + [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Missing Metadata." when no metadata is provided + [Timeout] 1 minute + ${headers}= Create Dictionary X-ONAP-RequestID=3 Content-Type=application/xml + ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers} + VerifyResponse ${resp.status_code} 400 + VerifyResponse ${resp.content} Missing Metadata. + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=3 + +Verify 3GPP PM Mapper responds appropriately when invalid metadata is provided + [Tags] PM_MAPPER_04 + [Documentation] Verify 3GPP PM Mapper responds 400 with the message "Malformed Metadata." when invalid metadata is provided + [Timeout] 1 minute + ${headers}= Create Dictionary X-ONAP-RequestID=4 X-DMAAP-DR-META='not metadata' Content-Type=application/xml + ${resp}= Put Request mapper_session ${DELIVERY_ENDPOINT}/filename data='${EMPTY}' headers=${headers} + VerifyResponse ${resp.status_code} 400 + VerifyResponse ${resp.content} Malformed Metadata. + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=4 + +Verify that PM Mapper logs successful when a file that contains no measdata is provided + [Tags] PM_MAPPER_05 + [Documentation] Verify that PM Mapper logs successful when a file that contains no measdata is provided + [Timeout] 1 minute + SendToDatarouter ${NO_MEASDATA_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=5 + CheckLog ${CLI_EXEC_CLI_PM_LOG} MeasData is empty + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=5 + +Verify that PM Mapper throws Event failed validation against schema error when no managed element content is provided + [Tags] PM_MAPPER_06 + [Documentation] Verify 3gpp pm mapper responds with an error when no managed element content is provided + [Timeout] 1 minute + SendToDatarouter ${NO_MANAGED_ELEMENT_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=6 + CheckLog ${CLI_EXEC_CLI_PM_LOG} XML validation failed + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=6 + +Verify that PM Mapper maps Type-C xml file and publish 3gpp perf VES evnets to message router + [Tags] PM_MAPPER_07 + [Documentation] Verify that PM Mapper maps Type-C xml file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + SendToDatarouter ${TYPE-C_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=7 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify 3GPP PM Mapper maps Type-A file based on counter filtering and publish 3gpp perf VES evnets to message router + [Tags] PM_MAPPER_08 + [Documentation] Verify 3GPP PM Mapper maps Type-A file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER} shell=yes + ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} + Sleep 5s + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=8 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify that PM Mapper correctly identifies a file that should not be mapped based on metadata filtering. + [Tags] PM_MAPPER_09 + [Documentation] Verify that PM Mapper correctly identifies a file that should not be mapped based on metadata filtering. + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_EXEC_VENDOR_FILTER} shell=yes + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} + Sleep 5s + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${DIFF_VENDOR_METADATA} X-ONAP-RequestID=9 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=9 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Metadata does not match any filters + +Verify that PM Mapper correctly identifies a non-xml file. + [Tags] PM_MAPPER_10 + [Documentation] Verify that PM Mapper correctly identifies a non-xml file. + [Timeout] 1 minute + SendToDatarouter ${NON_XML_FILE} ${VALID_METADATA_PATH} X-ONAP-RequestID=10 + CheckLog ${CLI_EXEC_CLI_PM_LOG} PM measurement file must have an extension of .xml + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=10 + +Verify that PM Mapper correctly maps an NR Type-A file based on counter filtering and publish 3gpp perf VES events to message router. + [Tags] PM_MAPPER_11 + [Documentation] Verify 3GPP PM Mapper maps an NR Type-A file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER} shell=yes + ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} + Sleep 5s + SendToDatarouter ${NR-TYPE-A_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=11 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify that PM Mapper correctly maps an NR Type-C file based on counter filtering and publish 3gpp perf VES events to message router. + [Tags] PM_MAPPER_12 + [Documentation] Verify that PM Mapper maps an NR Type-C xml file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + SendToDatarouter ${NR-TYPE-C_PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=12 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify 3GPP PM Mapper maps Type-A file based on counter filtering with regexp + [Tags] PM_MAPPER_13 + [Documentation] Verify 3GPP PM Mapper maps Type-A file based on counter filtering with wildcards/regexp and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + ${cli_cmd_output}= Run Process ${CLI_EXEC_PM_FILTER_regex} shell=yes + ${resp}= Get Request mapper_session ${RECONFIGURE_ENDPOINT} + Sleep 5s + SendToDatarouter ${TYPE-A_PM_DATA_FILE_PATH} ${VALID_METADATA_PATH} X-ONAP-RequestID=13 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +Verify that password receive from CBS are successfully encrypted + [Tags] PM_MAPPER_14 + [Documentation] Verify that password receive from CBS are successfully encrypted. + CheckLog ${CLI_EXEC_CLI_CONFIG} "aaf_password": ***** + CheckLog ${CLI_EXEC_CLI_CONFIG} "password": ***** + +Verify that PM Mapper correctly maps an NR Type-PM file based on counter filtering and publish 3gpp perf VES events to message router. + [Tags] PM_MAPPER_15 + [Documentation] Verify that PM Mapper maps an NR Type-PM xml file and publish 3gpp perf VES evnets to message router. + [Timeout] 1 minute + SendToDatarouter ${NR-TYPE-PM_DATA_FILE_PATH} ${NR_VALID_METADATA_PATH} X-ONAP-RequestID=15 + CheckLog ${CLI_EXEC_CLI_PM_LOG} RequestID=15 + CheckLog ${CLI_EXEC_CLI_PM_LOG} Successfully published VES events to messagerouter + +*** Keywords *** + +SendToDatarouter + [Arguments] ${filepath} ${metadatapath} ${request_id} + ${pmdata}= Get File ${filepath} + ${metatdata} Get File ${metadatapath} + ${filename} Fetch From Right ${filepath} / + ${resp}= PutCall ${PUBLISH_NODE_URL}/${filename} ${request_id} ${pmdata} ${metatdata.replace("\n","")} pmmapper + VerifyResponse ${resp.status_code} 204 + Sleep 10s + +PutCall + [Arguments] ${url} ${request_id} ${data} ${meta} ${user} + ${headers}= Create Dictionary X-ONAP-RequestID=${request_id} X-DMAAP-DR-META=${meta} Content-Type=application/octet-stream X-DMAAP-DR-ON-BEHALF-OF=${user} Authorization=Basic cG1tYXBwZXI6cG1tYXBwZXI= + ${resp}= Evaluate requests.put('${url}', data="""${data}""", headers=${headers}, verify=False, allow_redirects=False) requests + [Return] ${resp} + +CheckLog + [Arguments] ${cli_exec_log_Path} ${string_to_check_in_log} + ${cli_cmd_output}= Run Process ${cli_exec_log_Path} shell=yes + Log ${cli_cmd_output.stdout} + Should Be Equal As Strings ${cli_cmd_output.rc} 0 + Should Contain ${cli_cmd_output.stdout} ${string_to_check_in_log} + +VerifyResponse + [Arguments] ${actual_response_value} ${expected_response_value} + Should Be Equal As Strings ${actual_response_value} ${expected_response_value} + +ClearLogs + Run Process ${CLI_EXEC_CLI_PM_LOG_CLEAR} shell=yes + +CleanSessionsAndLogs + Delete All Sessions + ClearLogs -- 2.16.6