Test basic registration scenario when AAI and dmaap is configured _NOT_ to use cert auth
Change-Id: I92d6670344a65eed4289c5f72bdd5206f2b329f9
Issue-ID: INT-1076
Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
diff --git a/tests/dcaegen2/prh-testcases/prh_tests.robot b/tests/dcaegen2/prh-testcases/prh_tests.robot
index c8297ec..5988434 100644
--- a/tests/dcaegen2/prh-testcases/prh_tests.robot
+++ b/tests/dcaegen2/prh-testcases/prh_tests.robot
@@ -1,13 +1,13 @@
*** Settings ***
Documentation Integration tests for PRH.
... PRH receive events from DMaaP and produce or not PNF_READY notification depends on required fields in received event.
-Suite Setup Run keywords Create Headers AND Create sessions
+Suite Setup Run keywords Create Headers AND Create sessions AND Set default PRH CBS config
Test Teardown Reset Simulators
Test Timeout 2 minutes
-Library resources/PrhLibrary.py
Resource resources/prh_sessions.robot
Resource resources/prh_library.robot
+Resource resources/prh_config_library.robot
*** Variables ***
${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets
diff --git a/tests/dcaegen2/prh-testcases/prh_tests_with_no_auth.robot b/tests/dcaegen2/prh-testcases/prh_tests_with_no_auth.robot
new file mode 100644
index 0000000..afcd0f8
--- /dev/null
+++ b/tests/dcaegen2/prh-testcases/prh_tests_with_no_auth.robot
@@ -0,0 +1,20 @@
+*** Settings ***
+Documentation Integration tests for PRH when cert auth for dmaap and aai is disabled.
+Suite Setup Run keywords Create Headers AND Create sessions AND
+... Set PRH CBS config from file ${CONFIGS_DIR}/prh-no-auth-config.json
+Test Teardown Reset Simulators
+Test Timeout 2 minutes
+
+Resource resources/prh_sessions.robot
+Resource resources/prh_library.robot
+Resource resources/prh_config_library.robot
+
+*** Variables ***
+${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets
+
+*** Test Cases ***
+Simple registration event
+ [Documentation] simple registration scenario when AAI and dmaap cert atuh is disabled
+ [Tags] PRH Valid event
+ [Template] Verify PNF ready sent
+ ${TEST_CASES_DIR}/ves-event-without-additional-fields
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_configs/prh-no-auth-config.json b/tests/dcaegen2/prh-testcases/resources/prh_configs/prh-no-auth-config.json
new file mode 100644
index 0000000..a4f87e0
--- /dev/null
+++ b/tests/dcaegen2/prh-testcases/resources/prh_configs/prh-no-auth-config.json
@@ -0,0 +1,58 @@
+{
+ "cbs.updates-interval": 0,
+ "logging.level.org.onap.dcaegen2.services.prh": "debug",
+ "logging.level.org.onap.dcaegen2.services.sdk": "debug",
+ "logging.level.org.onap.dcaegen2.services.prh.controllers.AppInfoController": "off",
+ "dmaap.dmaapConsumerConfiguration.dmaapUserName": "admin",
+ "dmaap.dmaapConsumerConfiguration.dmaapUserPassword": "admin",
+ "dmaap.dmaapConsumerConfiguration.dmaapContentType": "application/json",
+ "dmaap.dmaapConsumerConfiguration.consumerId": "c12",
+ "dmaap.dmaapConsumerConfiguration.consumerGroup": "OpenDCAE-c12",
+ "dmaap.dmaapConsumerConfiguration.timeoutMs": -1,
+ "dmaap.dmaapProducerConfiguration.dmaapUserName": "admin",
+ "dmaap.dmaapProducerConfiguration.dmaapUserPassword": "admin",
+ "dmaap.dmaapProducerConfiguration.dmaapContentType": "application/json",
+ "dmaap.dmaapUpdateProducerConfiguration.dmaapUserName": "admin",
+ "dmaap.dmaapUpdateProducerConfiguration.dmaapUserPassword": "admin",
+ "dmaap.dmaapUpdateProducerConfiguration.dmaapContentType": "application/json",
+ "aai.aaiClientConfiguration.pnfUrl": "http://aai:3333/aai/v12/network/pnfs/pnf",
+ "aai.aaiClientConfiguration.aaiUserName": "DCAE",
+ "aai.aaiClientConfiguration.aaiUserPassword": "DCAE",
+ "aai.aaiClientConfiguration.aaiIgnoreSslCertificateErrors": true,
+ "aai.aaiClientConfiguration.aaiServiceInstancePath": "/business/customers/customer/${customer}/service-subscriptions/service-subscription/${serviceType}/service-instances/service-instance/${serviceInstanceId}",
+ "aai.aaiClientConfiguration.aaiHeaders": {
+ "X-FromAppId": "prh",
+ "X-TransactionId": "9999",
+ "Accept": "application/json",
+ "Real-Time": "true",
+ "Authorization": "Basic QUFJOkFBSQ=="
+ },
+ "security.trustStorePath": "",
+ "security.trustStorePasswordPath": "",
+ "security.keyStorePath": "",
+ "security.keyStorePasswordPath": "",
+ "security.enableAaiCertAuth": false,
+ "security.enableDmaapCertAuth": false,
+ "streams_publishes": {
+ "pnf-update": {
+ "type": "message_router",
+ "dmaap_info": {
+ "topic_url": "http://dmaap-mr:2222/events/unauthenticated.PNF_UPDATE"
+ }
+ },
+ "pnf-ready": {
+ "type": "message_router",
+ "dmaap_info": {
+ "topic_url": "http://dmaap-mr:2222/events/unauthenticated.PNF_READY"
+ }
+ }
+ },
+ "streams_subscribes": {
+ "ves-reg-output": {
+ "type": "message_router",
+ "dmaap_info": {
+ "topic_url": "http://dmaap-mr:2222/events/unauthenticated.VES_PNFREG_OUTPUT"
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
index e5f0b10..fbfc5af 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py
@@ -196,6 +196,7 @@
def _main_(handler_class=AAIHandler, protocol="HTTP/1.0"):
handler_class.protocol_version = protocol
+ httpServerLib.start_http_endpoint(3333, AAIHandler)
httpServerLib.start_https_endpoint(3334, AAIHandler, keyfile="certs/aai.key", certfile="certs/aai.crt", ca_certs="certs/root.crt")
httpServerLib.start_http_endpoint(3335, AAISetup)
while 1:
diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
index 5ec601f..5d7bd70 100644
--- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
+++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py
@@ -125,6 +125,7 @@
def _main_(handler_class=DMaaPHandler, protocol="HTTP/1.0"):
handler_class.protocol_version = protocol
+ httpServerLib.start_http_endpoint(2222, DMaaPHandler)
httpServerLib.start_https_endpoint(2223, DMaaPHandler, keyfile="certs/dmaap-mr.key", certfile="certs/dmaap-mr.crt", ca_certs="certs/root.crt")
httpServerLib.start_http_endpoint(2224, DmaapSetup)
while 1: