From 1a2435d72a46d8daec2a0259275fee4842da5a9a Mon Sep 17 00:00:00 2001 From: Pawel Date: Fri, 18 Jun 2021 15:26:31 +0200 Subject: CSIT tests update for Synchronous VES collector -When evens belonging to different domains are reported in eventBatch -When different stndDefinedNamespace is used if domain==stndDefined -Error codes resulting from DMaaP-MR errors, mapped to HTTP/503 Issue-ID: DCAEGEN2-1483 Signed-off-by: Pawel Change-Id: I4c993e4c7bfd22981030c69e126e90bbf7e48d4a --- .../collector_backwards_compatibility.properties | 83 ++++++++++++++++++++++ .../resources/collector_basic_auth.properties | 7 +- .../resources/collector_stnd_defined.properties | 7 +- ...ollector_stnd_defined_new_schema_map.properties | 7 +- .../testcases/resources/dcae_properties.robot | 5 ++ .../resources/robot_library/DmaapLibrary.py | 5 ++ .../robot_library/dmaap_simulator/DMaaPHandler.py | 6 +- .../robot_library/dmaap_simulator/DMaaPServer.py | 6 ++ 8 files changed, 121 insertions(+), 5 deletions(-) create mode 100755 tests/dcaegen2/testcases/resources/collector_backwards_compatibility.properties (limited to 'tests/dcaegen2/testcases/resources') diff --git a/tests/dcaegen2/testcases/resources/collector_backwards_compatibility.properties b/tests/dcaegen2/testcases/resources/collector_backwards_compatibility.properties new file mode 100755 index 00000000..e62c14c7 --- /dev/null +++ b/tests/dcaegen2/testcases/resources/collector_backwards_compatibility.properties @@ -0,0 +1,83 @@ +############################################################################### +## +## Collector Server config +## +## - Default values are shown as commented settings. +## +############################################################################### +## +## HTTP(S) service +## +## Normally: +## +## - 8080 is http service +## - https is disabled by default +## +## - At this time, the server always binds to 0.0.0.0 +## +## +collector.service.port=8080 + +## Authentication is only supported via secure port +## When enabled - require valid keystore defined +collector.service.secure.port=8443 + +# auth.method flags: +# +# noAuth - default option - no security (http) +# certBasicAuth - auth by certificate and basic auth username / password (https) +auth.method=noAuth + +## Combination of userid,hashPassword encoded pwd list to be supported +## userid and pwd comma separated; pipe delimitation between each pair +## Password is generated by crypt-password library using BCrypt algorithm stored in dcaegen2/sdk package +## or https://nexus.onap.org/#nexus-search;quick~crypt-password +header.authlist=sample1,$2a$10$0buh.2WeYwN868YMwnNNEuNEAMNYVU9.FSMJGyIKV3dGET/7oGOi6 + +## The keystore must be setup per installation when secure port is configured +collector.keystore.file.location=etc/keystore +collector.keystore.passwordfile=etc/passwordfile + +collector.cert.subject.matcher=etc/certSubjectMatcher.properties + +## The truststore must be setup per installation when mutual tls support is configured +collector.truststore.file.location=etc/truststore +collector.truststore.passwordfile=etc/trustpasswordfile + +## Schema Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schemafile location must be specified +collector.schema.checkflag=1 +collector.schema.file={\"v1\":\"./etc/CommonEventFormat_27.2.json\",\"v2\":\"./etc/CommonEventFormat_27.2.json\",\"v3\":\"./etc/CommonEventFormat_27.2.json\",\"v4\":\"./etc/CommonEventFormat_27.2.json\",\"v5\":\"./etc/CommonEventFormat_28.4.1.json\",\"v7\":\"./etc/CommonEventFormat_30.2.1_ONAP.json\"} + +## Schema StndDefinedFields Validation checkflag +## default no validation checkflag (-1) +## If enabled (1) - schema files locations must be specified, mapping file path must be specified, schema reference path +## in event json must be specified, path to stndDefined data field in event json must be specified +collector.externalSchema.checkflag=1 +collector.externalSchema.schemasLocation=./etc/externalRepo/ +collector.externalSchema.mappingFileLocation=./etc/externalRepo/schema-map.json +event.externalSchema.schemaRefPath=$.event.stndDefinedFields.schemaReference +event.externalSchema.stndDefinedDataPath=$.event.stndDefinedFields.data + + +## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile +collector.dmaap.streamid=fault=ves-fault,ves-other|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance +collector.dmaapfile=./etc/ves-dmaap-config.json + +## Path to the file containing description of api versions +collector.description.api.version.location=etc/api_version_description.json + +## Event transformation Flag - when set expects configurable transformation +## defined under ./etc/eventTransform.json +## Enabled by default; to disable set to 0 +event.transform.flag=1 + +# Describes at what frequency (measured in minutes) should application try to fetch config from CBS +collector.dynamic.config.update.frequency=5 + +# Response compatibility (set to None to turn off ves 7.2 compatibility) +# v7.2 response codes: 202, 500 +# None response code: 200, 413, 503 +collector.response.compatibility=None + diff --git a/tests/dcaegen2/testcases/resources/collector_basic_auth.properties b/tests/dcaegen2/testcases/resources/collector_basic_auth.properties index cd417635..aff4b1bb 100755 --- a/tests/dcaegen2/testcases/resources/collector_basic_auth.properties +++ b/tests/dcaegen2/testcases/resources/collector_basic_auth.properties @@ -62,7 +62,7 @@ event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data ## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance -collector.dmaapfile=./etc/DmaapConfig.json +collector.dmaapfile=./etc/ves-dmaap-config.json ## Event transformation Flag - when set expects configurable transformation ## defined under ./etc/eventTransform.json @@ -71,3 +71,8 @@ event.transform.flag=1 # Describes at what frequency (measured in minutes) should application try to fetch config from CBS collector.dynamic.config.update.frequency=5 + +# Response compatibility (set to None to turn off ves 7.2 compatibility) +# v7.2 response codes: 202, 500 +# None response code: 200, 413, 503 +collector.response.compatibility=v7.2 diff --git a/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties b/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties index 9712dff5..a5ae2b3a 100644 --- a/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties +++ b/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties @@ -62,7 +62,7 @@ event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data ## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance -collector.dmaapfile=./etc/DmaapConfig.json +collector.dmaapfile=./etc/ves-dmaap-config.json ## Event transformation Flag - when set expects configurable transformation ## defined under ./etc/eventTransform.json @@ -71,3 +71,8 @@ event.transform.flag=1 # Describes at what frequency (measured in minutes) should application try to fetch config from CBS collector.dynamic.config.update.frequency=5 + +# Response compatibility (set to None to turn off ves 7.2 compatibility) +# v7.2 response codes: 202, 500 +# None response code: 200, 413, 503 +collector.response.compatibility=v7.2 diff --git a/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties b/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties index cd417635..aff4b1bb 100644 --- a/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties +++ b/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties @@ -62,7 +62,7 @@ event.externalSchema.stndDefinedDataPath=/event/stndDefinedFields/data ## List all streamid per domain to be supported. The streamid should match to channel name on dmaapfile collector.dmaap.streamid=fault=ves-fault|syslog=ves-syslog|heartbeat=ves-heartbeat|measurementsForVfScaling=ves-measurement|mobileFlow=ves-mobileflow|other=ves-other|stateChange=ves-statechange|thresholdCrossingAlert=ves-thresholdCrossingAlert|voiceQuality=ves-voicequality|sipSignaling=ves-sipsignaling|notification=ves-notification|pnfRegistration=ves-pnfRegistration|3GPP-FaultSupervision=ves-3gpp-fault-supervision|3GPP-Heartbeat=ves-3gpp-heartbeat|3GPP-Provisioning=ves-3gpp-provisioning|3GPP-PerformanceAssurance=ves-3gpp-performance-assurance -collector.dmaapfile=./etc/DmaapConfig.json +collector.dmaapfile=./etc/ves-dmaap-config.json ## Event transformation Flag - when set expects configurable transformation ## defined under ./etc/eventTransform.json @@ -71,3 +71,8 @@ event.transform.flag=1 # Describes at what frequency (measured in minutes) should application try to fetch config from CBS collector.dynamic.config.update.frequency=5 + +# Response compatibility (set to None to turn off ves 7.2 compatibility) +# v7.2 response codes: 202, 500 +# None response code: 200, 413, 503 +collector.response.compatibility=v7.2 diff --git a/tests/dcaegen2/testcases/resources/dcae_properties.robot b/tests/dcaegen2/testcases/resources/dcae_properties.robot index 2ae46f92..9bb16bd6 100644 --- a/tests/dcaegen2/testcases/resources/dcae_properties.robot +++ b/tests/dcaegen2/testcases/resources/dcae_properties.robot @@ -60,10 +60,15 @@ ${VES_STND_DEFINED_NO_VALUE} %{WORKSPACE}/tests/dcaegen2/testcases/a ${VES_STND_DEFINED_INVALID_TYPE_DATA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves_stdnDefined_invalid_type_data_field.json ${VES_CERT_BASIC_AUTH_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_basic_auth.properties ${VES_DISABLED_STNDDEFINED_COLLECTOR_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_stnd_defined.properties +${VES_BACKWARDS_COMPATIBILITY_PROPERTIES} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_backwards_compatibility.properties ${VES_ADD_REFERENCE_TO_OTHER_SCHEMAS} %{WORKSPACE}/tests/dcaegen2/testcases/resources/collector_stnd_defined_new_schema_map.properties ${VES_VALID_JSON_WITH_RFERENCE_TO_VALID_SCHEMA} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_with_valid_schema_ref.json ${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_FILE_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_file_ref.json ${VES_VALID_JSON_V7_STND_DEF_FIELDS_WRONG_SCHEMA_INTERNAL_REF} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_valid_eventWithStndDefinedFields_to_schema_with_wrong_internal_ref.json +${VES_BATCH_TWO_DIFFERENT_DOMAIN} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_batch_with_different_domain.json +${VES_BATCH_STND_DEFINED_TWO_DIFFERENT_STND_NAMESPACE} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_batch_stdnDefined_withDifferentStndDefinedNamespace.json +${VES_BATCH_STND_DEFINED_VALID} %{WORKSPACE}/tests/dcaegen2/testcases/assets/json_events/ves7_batch_stdnDefined_valid.json +${ERROR_MESSAGE_CODE} The following service error occurred: %1. Error code is %2 #DCAE Health Check ${CONFIG_BINDING_URL} http://localhost:8443 diff --git a/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py b/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py index c9a0ff7b..f79ba04e 100644 --- a/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py +++ b/tests/dcaegen2/testcases/resources/robot_library/DmaapLibrary.py @@ -49,6 +49,7 @@ class DmaapLibrary(object): @staticmethod def cleanup_ves_events(): + DmaapLibrary.dmaap_server.reset_dmaap_succesfull_code() if DmaapLibrary.server_thread is not None: DmaapLibrary.dmaap_queue.clean_up_event() logger.console("DMaaP event queue is cleaned up") @@ -77,3 +78,7 @@ class DmaapLibrary(object): return 'true' evt_str = DmaapLibrary.dmaap_queue.deque_event() return 'false' + + @staticmethod + def set_successfull_dmaap_code(code): + DmaapLibrary.dmaap_server.set_dmaap_successfull_code(int(code)) \ No newline at end of file diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py index f1c46e19..cc73c36a 100644 --- a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPHandler.py @@ -19,9 +19,11 @@ try: except ImportError: from StringIO import StringIO - class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): + DEFAULT_SUCCES_RESPONSE_CODE=200 + succes_response_code=DEFAULT_SUCCES_RESPONSE_CODE + def __init__(self, dmaap_simulator, *args): self.dmaap_simulator = dmaap_simulator BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args) @@ -66,7 +68,7 @@ class DMaaPHandler(BaseHTTPServer.BaseHTTPRequestHandler): if 'clientThrottlingState' in self.requestline: self.send_response(204) else: - self.send_response(200) + self.send_response(self.succes_response_code) self.send_header('Content-Type', 'application/json') self.end_headers() self.wfile.write("{'count': 1, 'serverTimeMs': 3}") diff --git a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py index 37499be8..8b66fd4d 100644 --- a/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py +++ b/tests/dcaegen2/testcases/resources/robot_library/dmaap_simulator/DMaaPServer.py @@ -14,6 +14,12 @@ class DMaaPServer(BaseHTTPServer.HTTPServer): serer_address = self.socket.getsockname() print "Serving HTTP on", serer_address[0], "port", serer_address[1], "..." + def set_dmaap_successfull_code(self,code_number): + DMaaPHandler.DMaaPHandler.succes_response_code=code_number + + def reset_dmaap_succesfull_code(self): + DMaaPHandler.DMaaPHandler.succes_response_code=DMaaPHandler.DMaaPHandler.DEFAULT_SUCCES_RESPONSE_CODE + def create_dmaap_server(dmaap_simulator, protocol="HTTP/1.0", port=3904): server_address = ('', port) -- cgit 1.2.3-korg