diff options
author | mprzybys <marcin.przybysz@nokia.com> | 2020-10-13 13:50:13 +0200 |
---|---|---|
committer | Bartek Grzybowski <b.grzybowski@partner.samsung.com> | 2020-10-15 08:44:46 +0000 |
commit | e3024beed447e25c419c9725ee7b8f925705b961 (patch) | |
tree | a5acb109f8f851dbe7c7989e6d0e20880be3e490 | |
parent | 82223efa960d3d11e25af5776467cadbaca3fdca (diff) |
Add E2E integration tests to cover new stndDefined VES events
Issue-ID: INT-1258
Signed-off-by: Marcin Przybysz <marcin.przybysz@nokia.com>
Change-Id: I1d20d7bcf40bec1c498e8cee743cedeb7f25acea
-rw-r--r-- | .coafile | 5 | ||||
-rw-r--r-- | robot/assets/dcae/ves7_batch_valid.json | 67 | ||||
-rw-r--r-- | robot/assets/dcae/ves7_valid.json | 34 | ||||
-rw-r--r-- | robot/assets/dcae/ves_stdnDefined_3GPP-FaultSupervision.json | 54 | ||||
-rw-r--r-- | robot/assets/dcae/ves_stdnDefined_3GPP-Heartbeat.json | 54 | ||||
-rw-r--r-- | robot/assets/dcae/ves_stdnDefined_3GPP-PerformanceAssurance.json | 54 | ||||
-rw-r--r-- | robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json | 54 | ||||
-rw-r--r-- | robot/resources/dcae/ves_interface.robot | 41 | ||||
-rw-r--r-- | robot/testsuites/ves.robot | 79 |
9 files changed, 441 insertions, 1 deletions
@@ -9,4 +9,7 @@ bears = JSONFormatBear json_sort = False indent_size = 2 ignore = - .tox/** + .tox/**, + robot/assets/dcae/ves*.json + + diff --git a/robot/assets/dcae/ves7_batch_valid.json b/robot/assets/dcae/ves7_batch_valid.json new file mode 100644 index 00000000..1db81eed --- /dev/null +++ b/robot/assets/dcae/ves7_batch_valid.json @@ -0,0 +1,67 @@ + +{ + "eventList": [ + { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "fault0000250", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam0011234", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + }, + { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": " Fault_Vscf:Acs-Ericcson_RecordingServerUnreachable", + "eventId": "fault0000251", + "sequence": 0, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam0011234", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000010, + "lastEpochMicrosec": 1413378172000010, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "RecordingServerUnreachable", + "eventSourceType": "other", + "specificProblem": "Recording server unreachable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active" + } + } + ] +} + diff --git a/robot/assets/dcae/ves7_valid.json b/robot/assets/dcae/ves7_valid.json new file mode 100644 index 00000000..aabefd5c --- /dev/null +++ b/robot/assets/dcae/ves7_valid.json @@ -0,0 +1,34 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "vesEventListenerVersion": "7.0.1", + "domain": "fault", + "eventName": "Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion", + "eventId": "ab305d54-85b4-a31b-7db2-fb6b9e546015", + "sequence": 1, + "priority": "High", + "reportingEntityId": "cc305d54-75b4-431b-adb2-eb6b9e541234", + "reportingEntityName": "ibcx0001vm002oam001", + "sourceId": "de305d54-75b4-431b-adb2-eb6b9e546014", + "sourceName": "scfx0001vm002cap001", + "nfVendorName": "Ericsson", + "nfNamingCode": "scfx", + "nfcNamingCode": "ssc", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "timeZoneOffset": "UTC-05:30" + }, + "faultFields": { + "faultFieldsVersion": "4.0", + "alarmCondition": "PilotNumberPoolExhaustion", + "eventSourceType": "other", + "specificProblem": "Calls cannot complete - pilot numbers are unavailable", + "eventSeverity": "CRITICAL", + "vfStatus": "Active", + "alarmAdditionalInformation": { + "PilotNumberPoolSize": "1000" + } + } + } +} diff --git a/robot/assets/dcae/ves_stdnDefined_3GPP-FaultSupervision.json b/robot/assets/dcae/ves_stdnDefined_3GPP-FaultSupervision.json new file mode 100644 index 00000000..aa1e7125 --- /dev/null +++ b/robot/assets/dcae/ves_stdnDefined_3GPP-FaultSupervision.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "ves_stdnDefined_3GPP-FaultSupervision", + "stndDefinedNamespace": "3GPP-FaultSupervision", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/robot/assets/dcae/ves_stdnDefined_3GPP-Heartbeat.json b/robot/assets/dcae/ves_stdnDefined_3GPP-Heartbeat.json new file mode 100644 index 00000000..7a83d339 --- /dev/null +++ b/robot/assets/dcae/ves_stdnDefined_3GPP-Heartbeat.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "ves_stdnDefined_3GPP-Heartbeat", + "stndDefinedNamespace": "3GPP-Heartbeat", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/robot/assets/dcae/ves_stdnDefined_3GPP-PerformanceAssurance.json b/robot/assets/dcae/ves_stdnDefined_3GPP-PerformanceAssurance.json new file mode 100644 index 00000000..6ffdf14f --- /dev/null +++ b/robot/assets/dcae/ves_stdnDefined_3GPP-PerformanceAssurance.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "ves_stdnDefined_3GPP-PerformanceAssurance", + "stndDefinedNamespace": "3GPP-PerformanceAssurance", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json b/robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json new file mode 100644 index 00000000..a1eea0f4 --- /dev/null +++ b/robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json @@ -0,0 +1,54 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.1", + "vesEventListenerVersion": "7.2", + "domain": "stndDefined", + "eventId": "stndDefined-gNB_Nokia000001", + "eventName": "ves_stdnDefined_3GPP-Provisioning", + "stndDefinedNamespace": "3GPP-Provisioning", + "startEpochMicrosec": 1413378172000000, + "lastEpochMicrosec": 1413378172000000, + "reportingEntityName": "ibcx0001vm002oam001", + "sourceName": "scfx0001vm002cap001", + "sequence": 1, + "priority": "High" + }, + "stndDefinedFields": { + "schemaReference": "https://forge.3gpp.org/rep/sa5/data-models/tree/SA88-Rel16/OpenAPI/faultMnS.yaml#components/schemas/NotifyNewAlarm", + "data": { + "href": 1, + "uri": "1", + "notificationId": 1, + "notificationType": "notifyNewAlarm", + "eventTime": "xyz", + "systemDN": "xyz", + "probableCause": 1, + "perceivedSeverity": "INDETERMINATE", + "rootCauseIndicator": false, + "specificProblem": "xyz", + "correlatedNotifications": [], + "backedUpStatus": true, + "backUpObject": "xyz", + "trendIndication": "MORE_SEVERE", + "thresholdInfo": { + "observedMeasurement": "new", + "observedValue": 123 + }, + "stateChangeDefinition": { + }, + "monitoredAttributes": { + "newAtt": "new" + }, + "proposedRepairActions": "xyz", + "additionalText": "xyz", + "additionalInformation": { + "addInfo": "new" + }, + "alarmId": "1", + "alarmType": "COMMUNICATIONS_ALARM" + }, + "stndDefinedFieldsVersion": "1.0" + } + } +} diff --git a/robot/resources/dcae/ves_interface.robot b/robot/resources/dcae/ves_interface.robot new file mode 100644 index 00000000..4201a4d2 --- /dev/null +++ b/robot/resources/dcae/ves_interface.robot @@ -0,0 +1,41 @@ +Documentation The main interface for interacting with VES Collector +Library RequestsLibrary +Library OperatingSystem +Library String + +*** Variables *** +${INVENTORY_SERVER} ${GLOBAL_INVENTORY_SERVER_PROTOCOL}://${GLOBAL_INVENTORY_SERVER_NAME}:${GLOBAL_INVENTORY_SERVER_PORT} +${DEPLOYMENT_SERVER} ${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PROTOCOL}://${GLOBAL_DEPLOYMENT_HANDLER_SERVER_NAME}:${GLOBAL_DEPLOYMENT_HANDLER_SERVER_PORT} +${DR_ENDPOINT} ${GLOBAL_DMAAP_DR_PROV_SERVER_PROTOCOL}://${GLOBAL_INJECTED_DMAAP_DR_PROV_IP_ADDR}:${GLOBAL_DMAAP_DR_PROV_SERVER_PORT} +${DMAAP_BC_SERVER} ${GLOBAL_BC_SERVER_PROTOCOL}://${GLOBAL_INJECTED_BC_IP_ADDR}:${GLOBAL_BC_HTTPS_SERVER_PORT} +${VES_HEALTH_CHECK_PATH} ${GLOBAL_DCAE_VES_HTTPS_PROTOCOL}://${GLOBAL_INJECTED_DCAE_VES_HOST}:${GLOBAL_DCAE_VES_HTTPS_SERVER_PORT} +${MR_PUBLISH_TEMPLATE} mr/mr_publish.jinja + +*** Keywords *** + + +Send Event to VES Collector + [Documentation] keyword wich is used to send events through VES Collector Event Listener path + [Arguments] ${event} + ${headers}= Create Dictionary content-type=application/json + ${event_from_file}= OperatingSystem.Get File ${event} + ${auth}= Create List ${GLOBAL_DCAE_VES_USERNAME} ${GLOBAL_DCAE_VES_PASSWORD} + ${session}= Create Session ves ${VES_HEALTH_CHECK_PATH} auth=${auth} + ${resp}= Post Request ves ${VES_LISTENER_PATH} data=${event_from_file} headers=${headers} + Should Be Equal As Strings ${resp.status_code} 202 + +Topic Validate + [Documentation] Keyword checks content of DMAAP topic and evaluate it's content with desired value + [Arguments] ${topic_name} ${expected_text} + ${timestamp}= Get Current Date + ${dict}= Create Dictionary timestamp=${timestamp} + Templating.Create Environment mr ${GLOBAL_TEMPLATE_FOLDER} + ${data}= Templating.Apply Template mr ${MR_PUBLISH_TEMPLATE} ${dict} + ${resp}= Run MR Auth Get Request ${topic_name} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD} + Should Contain ${resp.text} ${expected_text} + +Send Event to VES & Validate Topic + [Documentation] Keyword is a test template which alows to send event through VES Collector and check if ivent is routed to proper DMAAP topic + [Arguments] ${event} ${topic_name} ${expected_text} + Send Event to VES Collector ${event} + Wait Until Keyword Succeeds 10x 5s Topic Validate ${topic_name} ${expected_text} diff --git a/robot/testsuites/ves.robot b/robot/testsuites/ves.robot new file mode 100644 index 00000000..42f55b9b --- /dev/null +++ b/robot/testsuites/ves.robot @@ -0,0 +1,79 @@ +*** Settings *** +Documentation Suite for checking handling events by VES Collector + +Library RequestsLibrary +Library OperatingSystem +Library Collections +Library String +Library DateTime +Library SSHLibrary +Library JSONLibrary +Library Process +Library ONAPLibrary.JSON +Library ONAPLibrary.Utilities +Resource ../../resources/dcae/ves_interface.robot +Resource ../../resources/mr_interface.robot +Resource ../../resources/dr_interface.robot + +*** Variables *** +${MR_TOPIC_CHECK_PATH} /topics +${DR_SUB_CHECK_PATH} /internal/prov +${MR_TOPIC_URL_PATH} /events/unauthenticated.SEC_FAULT_OUTPUT/CG1/C1 +${MR_FAULTSUPERVISION_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT/CG1/C1 +${MR_HEARTBEAT_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT/CG1/C1 +${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT/CG1/C1 +${MR_PROVISIONING_TOPIC_URL_PATH} /events/unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT/CG1/C1 +${DMAAP_BC_MR_CLIENT_PATH} /webapi/mr_clients +${DMAAP_BC_MR_CLUSTER_PATH} /webapi/mr_clusters +${VES_LISTENER_PATH} /eventListener/v7 +${ves7_valid_json} ${EXECDIR}/robot/assets/dcae/ves7_valid.json +${FaultSupervision_json} ${EXECDIR}/robot/assets/dcae/ves_stdnDefined_3GPP-FaultSupervision.json +${Heartbeat_json} ${EXECDIR}/robot/assets/dcae/ves_stdnDefined_3GPP-Heartbeat.json +${PerformanceAssurance_json} ${EXECDIR}/robot/assets/dcae/ves_stdnDefined_3GPP-PerformanceAssurance.json +${Provisioning_json} ${EXECDIR}/robot/assets/dcae/ves_stdnDefined_3GPP-Provisioning.json + +*** Test Cases *** + +Send standard event to VES and check if is routed to proper topic + [Documentation] + ... This test case checks wheather fault event is send to proper DMAAP topic. + ... Fault event should be routed by VES Collector to unauthenticated.SEC_FAULT_OUTPUT topic on DMAAP MR . + [Tags] vescollector ete + ${expected_fault_on_mr} Set Variable Fault_Vscf:Acs-Ericcson_PilotNumberPoolExhaustion + Send Event to VES & Validate Topic ${ves7_valid_json} ${MR_TOPIC_URL_PATH} ${expected_fault_on_mr} + +Send 3GPP Fault Supervision event to VES and check if is routed to proper topic + [Documentation] + ... This test case checks wheather fault event is send to proper DMAAP topic. + ... Fault Supervision event should be routed by domain = "stndDefined" and stndDefinedNamespace = "3GPP-FaultSupervision" . + ... Fault should be routed to mr topic unauthenticated.SEC_3GPP_FAULTSUPERVISION_OUTPUT + [Tags] vescollector ete + ${expected_fault_on_mr} Set Variable ves_stdnDefined_3GPP-FaultSupervision + Send Event to VES & Validate Topic ${FaultSupervision_json} ${MR_FAULTSUPERVISION_TOPIC_URL_PATH} ${expected_fault_on_mr} + +Send 3GPP Heartbeat event to VES and check if is routed to proper topic + [Documentation] + ... This test case checks wheather fault event is send to proper DMAAP topic. + ... Fault Supervision event should be routed by domain = "stndDefined" and stndDefinedNamespace = "3GPP-Heartbeat" . + ... Fault should be routed to mr topic unauthenticated.SEC_3GPP_HEARTBEAT_OUTPUT + [Tags] vescollector ete + ${expected_fault_on_mr} Set Variable ves_stdnDefined_3GPP-Heartbeat + Send Event to VES & Validate Topic ${Heartbeat_json} ${MR_HEARTBEAT_TOPIC_URL_PATH} ${expected_fault_on_mr} + +Send 3GPP Performance Assurance event to VES and check if is routed to proper topic + [Documentation] + ... This test case checks wheather fault event is send to proper DMAAP topic. + ... Fault Supervision event should be routed by domain = "stndDefined" and stndDefinedNamespace = "3GPP-PerformanceAssurance" . + ... Fault should be routed to mr topic unauthenticated.SEC_3GPP_PERFORMANCEASSURANCE_OUTPUT + [Tags] vescollector ete + ${expected_fault_on_mr} Set Variable ves_stdnDefined_3GPP-PerformanceAssurance + Send Event to VES & Validate Topic ${PerformanceAssurance_json} ${MR_PERFORMANCEASSURANCE_TOPIC_URL_PATH} ${expected_fault_on_mr} + +Send 3GPP Provisioning event to VES and check if is routed to proper topic + [Documentation] + ... This test case checks wheather fault event is send to proper DMAAP topic. + ... Fault Supervision event should be routed by domain = "stndDefined" and stndDefinedNamespace = "3GPP-Provisioning" . + ... Fault should be routed to mr topic unauthenticated.SEC_3GPP_PROVISIONING_OUTPUT + [Tags] vescollector ete + ${expected_fault_on_mr} Set Variable ves_stdnDefined_3GPP-Provisioning + Send Event to VES & Validate Topic ${Provisioning_json} ${MR_PROVISIONING_TOPIC_URL_PATH} ${expected_fault_on_mr}
\ No newline at end of file |