From 40c1ddcef93d169922cdb2b95a817e2ff50a25ce Mon Sep 17 00:00:00 2001 From: Stavros Kanarakis Date: Wed, 27 Mar 2019 19:11:43 +0200 Subject: CSIT tests for bbs-event-processor Change-Id: Iaf4d5f47754489b111a0af90bf3cdf819d4e62f7 Issue-ID: DCAEGEN2-1355 Signed-off-by: Stavros Kanarakis --- .../assets/aai_records/aai_pnf_not_found.json | 17 ++++++++ .../bbs-testcases/assets/aai_records/aai_pnfs.json | 46 ++++++++++++++++++++++ .../assets/aai_records/aai_services.json | 46 ++++++++++++++++++++++ .../json_events/auth_event_with_all_fields.json | 30 ++++++++++++++ .../auth_event_with_missing_new_old_state.json | 29 ++++++++++++++ .../json_events/auth_event_with_missing_rgmac.json | 30 ++++++++++++++ .../auth_event_with_missing_sourceName.json | 30 ++++++++++++++ .../auth_event_with_wrong_sourceName.json | 30 ++++++++++++++ .../json_events/auth_event_without_swversion.json | 16 ++++++++ .../assets/json_events/auth_not_json_format.json | 30 ++++++++++++++ .../json_events/auth_policy_with_all_fields.json | 23 +++++++++++ .../json_events/update_event_with_all_fields.json | 16 ++++++++ .../update_event_with_missing_attachment.json | 15 +++++++ .../update_event_with_missing_correlation.json | 15 +++++++ .../update_event_with_wrong_correlation.json | 15 +++++++ .../assets/json_events/update_not_json_format.json | 15 +++++++ .../json_events/update_policy_with_all_fields.json | 24 +++++++++++ 17 files changed, 427 insertions(+) create mode 100644 tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnf_not_found.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnfs.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/aai_records/aai_services.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_all_fields.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_without_swversion.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_not_json_format.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_all_fields.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_not_json_format.json create mode 100644 tests/dcaegen2/bbs-testcases/assets/json_events/update_policy_with_all_fields.json (limited to 'tests/dcaegen2/bbs-testcases/assets') diff --git a/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnf_not_found.json b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnf_not_found.json new file mode 100644 index 00000000..23c169fd --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnf_not_found.json @@ -0,0 +1,17 @@ +[ +{ + "requestError": { + "serviceException": { + "messageId": "SVC3001", + "text": "Resource not found for %1 using id %2 (msg=%3) (ec=%4)", + "variables": [ + "GET", + "nodes/pnfs/pnf/Wrong-PNF-Name", + "Node Not Found:No Node of type pnf found at: nodes/pnfs/pnf/Wrong-PNF-Name", + "ERR.5.4.6114" + ] + } + } +} + +] diff --git a/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnfs.json b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnfs.json new file mode 100644 index 00000000..4ea7827f --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_pnfs.json @@ -0,0 +1,46 @@ +[ +{ + "pnf-name": "NVendor-Equip_Model-SN1234", + "in-maint": true, + "resource-version": "1551889263181", + "relationship-list": { + "relationship": [ + { + "related-to": "service-instance", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v14/business/customers/customer/766162a3-53a9-42b8-8fe2-ebaa2213a6dd/service-subscriptions/service-subscription/BBS-CFS11/service-instances/service-instance/1923eaa8-8ab7-49ef-b4c2-e185efbbe832", + "relationship-data": [ + { + "relationship-key": "customer.global-customer-id", + "relationship-value": "766162a3-53a9-42b8-8fe2-ebaa2213a6dd" + }, + { + "relationship-key": "service-subscription.service-type", + "relationship-value": "BBS-CFS11" + }, + { + "relationship-key": "service-instance.service-instance-id", + "relationship-value": "1923eaa8-8ab7-49ef-b4c2-e185efbbe832" + } + ], + "related-to-property": [ + { + "property-key": "service-instance.service-instance-name" + } + ] + }, + { + "related-to": "logical-link", + "relationship-label": "org.onap.relationships.inventory.BridgedTo", + "related-link": "/aai/v14/network/logical-links/logical-link/olt11-11-11", + "relationship-data": [ + { + "relationship-key": "logical-link.link-name", + "relationship-value": "olt11-11-11" + } + ] + } + ] + } +} +] diff --git a/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_services.json b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_services.json new file mode 100644 index 00000000..351cc780 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/aai_records/aai_services.json @@ -0,0 +1,46 @@ +[ +{ + "service-instance-id": "1923eaa8-8ab7-49ef-b4c2-e185efbbe832", + "resource-version": "1551889260591", + "orchestration-status": "assigned", + "relationship-list": { + "relationship": [ + { + "related-to": "pnf", + "relationship-label": "org.onap.relationships.inventory.ComposedOf", + "related-link": "/aai/v14/network/pnfs/pnf/NVendor-Equip_Model-SN1234", + "relationship-data": [ + { + "relationship-key": "pnf.pnf-name", + "relationship-value": "NVendor-Equip_Model-SN1234" + } + ] + } + ] + }, + "metadata": { + "metadatum": [ + { + "metaname": "cvlan", + "metaval": "1005", + "resource-version": "1551889260599" + }, + { + "metaname": "svlan", + "metaval": "100", + "resource-version": "1551889260608" + }, + { + "metaname": "oltName", + "metaval": "olt1", + "resource-version": "1551889260616" + }, + { + "metaname": "rgw-mac-address", + "metaval": "01:02:03:04:05:06", + "resource-version": "1551889260624" + } + ] + } +} +] diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_all_fields.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_all_fields.json new file mode 100644 index 00000000..3ad1fec0 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_all_fields.json @@ -0,0 +1,30 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "NVendor-Equip_Model-SN1234", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "outOfService", + "newState": "inService", + "stateInterface": "", + "additionalFields": { + "macAddress": "01:02:03:04:05:06", + "swVersion": "1.2.3" + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json new file mode 100644 index 00000000..2c14d468 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_new_old_state.json @@ -0,0 +1,29 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "NVendor-Equip_Model-SN1234", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "", + "newState": "", + "stateInterface": "", + "additionalFields": { + "macAddress": "01:02:03:04:05:06" + } + } + } +} \ No newline at end of file diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json new file mode 100644 index 00000000..21d97259 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_rgmac.json @@ -0,0 +1,30 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "NVendor-Equip_Model-SN1234", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "outOfService", + "newState": "inService", + "stateInterface": "", + "additionalFields": { + "macAddress": "", + "swVersion": "1.2.3" + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json new file mode 100644 index 00000000..538a56c6 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_missing_sourceName.json @@ -0,0 +1,30 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "outOfService", + "newState": "inService", + "stateInterface": "", + "additionalFields": { + "macAddress": "01:02:03:04:05:06", + "swVersion": "1.2.3" + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json new file mode 100644 index 00000000..39a9e4ae --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_with_wrong_sourceName.json @@ -0,0 +1,30 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "Wrong-PNF-Name", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "outOfService", + "newState": "inService", + "stateInterface": "", + "additionalFields": { + "macAddress": "01:02:03:04:05:06", + "swVersion": "1.2.3" + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_without_swversion.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_without_swversion.json new file mode 100644 index 00000000..fcacf1ce --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_event_without_swversion.json @@ -0,0 +1,16 @@ +{ + "event": { + "commonEventHeader": { + "sourceName":"NVendor-Equip_Model-SN1234" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "newState": "inService", + "oldState": "outOfService", + "stateInterface": "", + "additionalFields": { + "macAddress": "00:11:22:33:44:55" + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_not_json_format.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_not_json_format.json new file mode 100644 index 00000000..7801ad69 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_not_json_format.json @@ -0,0 +1,30 @@ +{ + "event": { + "commonEventHeader": { + "version": "4.0.1", + "eventName": "StateChange_cpe_authentication", + "domain": "stateChange", + "eventId": "ab305d54-85b4-a31b-7db2fb6b9e546015", + "eventType": "applicationNf", + "sourceId": "", + "sourceName": "NVendor-Equip_Model-SN1234pnf-11", + "reportingEntityId": "", + "reportingEntityName": "thirdparty-sdnc-idfromesrrequest", + "priority": "Normal", + "startEpochMicrosec": 1.413378172e+15, + "lastEpochMicrosec": 1.413378172e+15, + "sequence": 0, + "vesEventListenerVersion": "7.1" + }, + "stateChangeFields": { + "stateChangeFieldsVersion": 1, + "oldState": "outOfService", + "newState": "inService", + "stateInterface": "", + "additionalFields": { + "macAddress": "01:02:03:04:05:06", + "swVersion": "1.2.3", + } + } + } +} diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json new file mode 100644 index 00000000..05b15fbf --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/auth_policy_with_all_fields.json @@ -0,0 +1,23 @@ +[ + { + "closedLoopEventClient": "DCAE.BBS_event_processor_mSInstance", + "policyVersion": "1.0.0.5", + "policyName": "CPE_Authentication", + "policyScope": "policyScopeCpeAuth", + "target_type": "VM", + "AAI": + { + "cpe.old-authentication-state": "outOfService", + "cpe.new-authentication-state": "inService", + "cpe.swVersion": "1.2.3", + "service-information.hsia-cfs-service-instance-id": "1923eaa8-8ab7-49ef-b4c2-e185efbbe832" + }, + "closedLoopAlarmStart": 1552997462, + "closedLoopEventStatus": "ONSET", + "closedLoopControlName": "clControlNameCpeAuth", + "version": "1.0.2", + "target": "vserver.vserver-name", + "requestID": "d76541f3-7f55-4c80-b0a0-ec5dee2a56cb", + "from": "DCAE" + } +] diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_all_fields.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_all_fields.json new file mode 100644 index 00000000..6fe23199 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_all_fields.json @@ -0,0 +1,16 @@ +{ + "nf-role":"role", + "equip-type":"Equipment-Type-1", + "equip-vendor":"NVendor", + "equip-model":"Equip_Model", + "serial-number":"SN1234", + "sw-version":"SW-version-1", + "correlationId":"NVendor-Equip_Model-SN1234", + "additionalFields": { + "attachment-point": "olt1-1-1", + "cvlan": "1005", + "svlan": "100", + "remote-id": "some-remote-id" + } + } + \ No newline at end of file diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json new file mode 100644 index 00000000..43d1b212 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_attachment.json @@ -0,0 +1,15 @@ +{ + "nf-role":"role", + "equip-type":"Equipment-Type-1", + "equip-vendor":"NVendor", + "equip-model":"Equip_Model", + "serial-number":"SN1234", + "sw-version":"SW-version-1", + "correlationId":"NVendor-Equip_Model-SN1234", + "additionalFields": { + "attachment-point": "", + "cvlan": "1005", + "svlan": "100", + "remote-id": "some-remote-id" + } + } diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json new file mode 100644 index 00000000..a1aaee30 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_missing_correlation.json @@ -0,0 +1,15 @@ +{ + "nf-role":"role", + "equip-type":"Equipment-Type-1", + "equip-vendor":"Vendor", + "equip-model":"Equip_Model", + "serial-number":"SN1234", + "sw-version":"SW-version-1", + "correlationId":"", + "additionalFields": { + "attachment-point": "olt1-1-1", + "cvlan": "1005", + "svlan": "100", + "remote-id": "some-remote-id" + } + } diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json new file mode 100644 index 00000000..f1dca037 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_event_with_wrong_correlation.json @@ -0,0 +1,15 @@ +{ + "nf-role":"role", + "equip-type":"Equipment-Type-1", + "equip-vendor":"NVendor", + "equip-model":"Equip_Model", + "serial-number":"SN1234", + "sw-version":"SW-version-1", + "correlationId":"Wrong-Correlation-Id", + "additionalFields": { + "attachment-point": "olt1-1-1", + "cvlan": "1005", + "svlan": "100", + "remote-id": "some-remote-id" + } + } diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_not_json_format.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_not_json_format.json new file mode 100644 index 00000000..ab5b214a --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_not_json_format.json @@ -0,0 +1,15 @@ +{ + "nf-role":"role", + "equip-type":"Equipment-Type-1", + "equip-vendor":"NVendor", + "equip-model":"Equip_Model", + "serial-number":"SN1234", + "sw-version":"SW-version-1", + "correlationId":"NVendor-Equip_Model-SN1234", + "additionalFields": { + "attachment-point": "olt1-1-1", + "cvlan": "1005", + "svlan": "100", + "remote-id": "some-remote-id", + } + } diff --git a/tests/dcaegen2/bbs-testcases/assets/json_events/update_policy_with_all_fields.json b/tests/dcaegen2/bbs-testcases/assets/json_events/update_policy_with_all_fields.json new file mode 100644 index 00000000..49402657 --- /dev/null +++ b/tests/dcaegen2/bbs-testcases/assets/json_events/update_policy_with_all_fields.json @@ -0,0 +1,24 @@ +[ + { + "closedLoopEventClient": "DCAE.BBS_event_processor_mSInstance", + "policyVersion": "1.0.0.5", + "policyName": "Nomadic_ONT", + "policyScope": "reRegPolicyScope", + "target_type": "VM", + "AAI":{ + "attachmentPoint": "olt11-1-1", + "service-information.hsia-cfs-service-instance-id": "1923eaa8-8ab7-49ef-b4c2-e185efbbe832", + "cvlan": "1005", + "svlan": "100", + "remoteId": "some-remote-id" + }, + "closedLoopAlarmStart": 1553067455, + "closedLoopEventStatus": "ONSET", + "closedLoopControlName": "reRegControlName", + "version": "1.0.2", + "target": "vserver.vserver-name", + "requestID": + "407a6515-4b10-46ad-a249-efe529a36c69", + "from": "DCAE" + } +] -- cgit 1.2.3-korg