diff options
author | kurczews <krzysztof.kurczewski@nokia.com> | 2019-04-18 14:56:41 +0200 |
---|---|---|
committer | kurczews <krzysztof.kurczewski@nokia.com> | 2019-04-26 13:49:12 +0200 |
commit | cd057060c750914f9a1ca3578edc9f0223c73bd9 (patch) | |
tree | 6f266528ec132cf5406fb3fe6a3610759d600a22 /tests/dcaegen2/prh-testcases | |
parent | 5f6b56855f325efb70212b3949d844f3a5c2856b (diff) |
PRH BBS tests - part 2
Issue-ID: INT-989
Change-Id: Ifa55723579d763e4bede7dbc373c7605dccb9b0e
Signed-off-by: kurczews <krzysztof.kurczewski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases')
25 files changed, 452 insertions, 51 deletions
diff --git a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json new file mode 100644 index 00000000..d0db0a11 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/incorrect-aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "wrong-record", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +} diff --git a/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-missing-entry/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/aai-not-responding/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json new file mode 100644 index 00000000..52024d69 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-missing-field/invalid-ves-event.json @@ -0,0 +1,16 @@ +{ + "event": { + "commonEventHeader": { + "sourceName": "" + }, + "pnfRegistrationFields": { + "oamV4IpAddress": "10.18.123.236", + "oamV6IpAddress": "2001:0db8:85a3:0000:0000:8a2a:0370:7334", + "serialNumber": "", + "vendorName": "", + "modelNumber": "", + "unitType": "", + "additionalFields": {} + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json new file mode 100644 index 00000000..f6afb1d3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-not-array/invalid-ves-event.json @@ -0,0 +1,15 @@ +{ + "event": { + "commonEventHeader": { + "sourceName":"NOK6061ZW1" + }, + "pnfRegistrationFields": { + "oamV4IpAddress":"10.16.123.234", + "oamV6IpAddress":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", + "serialNumber":"NOkkaaa123", + "vendorName":"equipVendor", + "modelNumber":"equipModel", + "unitType":"equipType", + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/aai-entry.json index 8787dc1b..8787dc1b 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/aai-entry.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/aai-entry.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-logical-link.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json index c48c841c..c48c841c 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-logical-link.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-logical-link.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-pnf-ready-event.json index 9da0201c..9da0201c 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/expected-pnf-ready-event.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/expected-pnf-ready-event.json diff --git a/tests/dcaegen2/prh-testcases/assets/bbs_registration/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json index c67d863e..c67d863e 100644 --- a/tests/dcaegen2/prh-testcases/assets/bbs_registration/ves-event.json +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-attachment-point/ves-event.json diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json new file mode 100644 index 00000000..6c92285c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/expected-pnf-ready-event.json @@ -0,0 +1,3 @@ +{ + "correlationId": "NOK6061ZW8" +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json new file mode 100644 index 00000000..8fbfff32 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-additional-fields/ves-event.json @@ -0,0 +1,39 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7", + "additionalFields": { + } + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json new file mode 100644 index 00000000..75cb4a2e --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/expected-pnf-ready-event.json @@ -0,0 +1,6 @@ +{ + "additionalFields": { + "attachmentPoint": "" + }, + "correlationId": "NOK6061ZW8" +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json new file mode 100644 index 00000000..d90869e3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-with-empty-attachment-point/ves-event.json @@ -0,0 +1,40 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7", + "additionalFields": { + "attachmentPoint": "" + } + } + } +} diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json new file mode 100644 index 00000000..1378f58f --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/aai-entry.json @@ -0,0 +1,23 @@ +{ + "pnf-name": "NOK6061ZW8", + "pnf-name2": "example-pnf-name2-val-58071", + "pnf-name2-source": "example-pnf-name2-source-val-22408", + "pnf-id": "example-pnf-id-val-55834", + "equip-type": "example-equip-type-val-5497", + "equip-vendor": "example-equip-vendor-val-85730", + "equip-model": "example-equip-model-val-38526", + "management-option": "example-management-option-val-15776", + "ipaddress-v4-oam": "example-ipaddress-v4-oam-val-33556", + "sw-version": "example-sw-version-val-64239", + "in-maint": true, + "frame-id": "example-frame-id-val-76733", + "serial-number": "example-serial-number-val-79366", + "ipaddress-v4-loopback-0": "example-ipaddress-v4-loopback0-val-34781", + "ipaddress-v6-loopback-0": "example-ipaddress-v6-loopback0-val-29979", + "ipaddress-v4-aim": "example-ipaddress-v4-aim-val-53703", + "ipaddress-v6-aim": "example-ipaddress-v6-aim-val-93386", + "ipaddress-v6-oam": "example-ipaddress-v6-oam-val-92665", + "inv-status": "example-inv-status-val-8477", + "prov-status": "example-prov-status-val-68268", + "nf-role": "example-nf-role-val-68489" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json new file mode 100644 index 00000000..4ac7f6e3 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/expected-pnf-ready-event.json @@ -0,0 +1,3 @@ +{ + "correlationId": "NOK6061ZW8" +}
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json new file mode 100644 index 00000000..d8f3c90c --- /dev/null +++ b/tests/dcaegen2/prh-testcases/assets/ves-event-without-additional-fields/ves-event.json @@ -0,0 +1,37 @@ +{ + "event": { + "commonEventHeader": { + "startEpochMicrosec": 1540212137393, + "sourceId": "val13", + "eventId": "registration_40212137", + "nfcNamingCode": "oam", + "internalHeaderFields": { + "collectorTimeStamp": "Mon, 10 22 2018 12:42:18 UTC" + }, + "eventType": "pnfRegistration", + "priority": "Normal", + "version": "4.0.1", + "reportingEntityName": "NOK6061ZW8", + "sequence": 0, + "domain": "pnfRegistration", + "lastEpochMicrosec": 1540212137393, + "eventName": "pnfRegistration_Nokia_5gDu", + "vesEventListenerVersion": "7.0.1", + "sourceName": "NOK6061ZW8", + "nfNamingCode": "gNB" + }, + "pnfRegistrationFields": { + "unitType": "val8", + "serialNumber": "6061ZW9", + "pnfRegistrationFieldsVersion": "2.0", + "manufactureDate": "1540212137393", + "modelNumber": "val6", + "lastServiceDate": "1540212137393", + "unitFamily": "BBU", + "vendorName": "Nokia", + "oamV4IpAddress": "val3", + "oamV6IpAddress": "val4", + "softwareVersion": "val7" + } + } +} diff --git a/tests/dcaegen2/prh-testcases/bbs_tests.robot b/tests/dcaegen2/prh-testcases/bbs_tests.robot deleted file mode 100644 index e9bc999a..00000000 --- a/tests/dcaegen2/prh-testcases/bbs_tests.robot +++ /dev/null @@ -1,27 +0,0 @@ -*** 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 AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh -Suite Teardown Ensure Container Is Running ssl_prh -Test Teardown Reset Simulators - -#Suite Setup Run keywords Create headers AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh -#Suite Teardown Run keywords Ensure Container Is Running ssl_prh AND Ensure Container Is Exited prh AND Reset Simulators -#Test Teardown Reset Simulators -Library resources/PrhLibrary.py -Resource resources/prh_library2.robot -Resource ../../common.robot - -*** Variables *** -${TEST_CASE_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets - -${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP} -${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} -${CONSUL_SETUP_URL} http://${CONSUL_SETUP} - -*** Test Cases *** - -Correct VES event with additional fields - [Tags] PRH - [Template] VES event with additional fields - ${TEST_CASE_DIR}/bbs_registration
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/prh_tests2.robot b/tests/dcaegen2/prh-testcases/prh_tests2.robot new file mode 100644 index 00000000..7f0531b8 --- /dev/null +++ b/tests/dcaegen2/prh-testcases/prh_tests2.robot @@ -0,0 +1,53 @@ +*** 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 AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh +Suite Teardown Ensure Container Is Running ssl_prh +Test Teardown Reset Simulators + +Library resources/PrhLibrary.py +Resource resources/prh_library2.robot +Resource ../../common.robot + +*** Variables *** +${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets + +${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP} +${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} +${CONSUL_SETUP_URL} http://${CONSUL_SETUP} + +*** Test Cases *** +Simple BBS case event + [Documentation] PRH get from DMaaP valid event with valid attachment point + [Tags] PRH Valid event Attachment point + [Template] Verify PNF ready sent and logical link created + ${TEST_CASES_DIR}/ves-event-with-attachment-point + +Simple registration event + [Documentation] PRH get from DMaaP valid event without valid attachment point + [Tags] PRH Valid event + [Template] Verify PNF ready sent + ${TEST_CASES_DIR}/ves-event-without-additional-fields + ${TEST_CASES_DIR}/ves-event-with-empty-additional-fields + ${TEST_CASES_DIR}/ves-event-with-empty-attachment-point + +Should not sent PNF ready when DMaaP event is invalid + [Documentation] PRH get from DMaaP event with missing required field + [Tags] PRH Invalid event + [Template] Verify event with missing required field is logged + ${TEST_CASES_DIR}/ves-event-missing-field + +Should not sent PNF ready when DMaaP event is not JSON array + [Documentation] Event from DMaaP is not JSON array + [Tags] PRH Invalid event + Verify incorrect JSON event is logged ${TEST_CASES_DIR}/ves-event-not-array + +Should not sent PNF ready when AAI record doesn't exist + [Documentation] PRH get from DMaaP valid event but given PNF doesn't exists in AAI + [Tags] PRH Missing AAI record + Verify missing AAI record is logged ${TEST_CASES_DIR}/aai-missing-entry + +Should not sent PNF ready when AAI is not responding + [Documentation] PRH get from DMaaP valid event but AAI is not responding + [Tags] PRH AAI not responding + Verify AAI not responding is logged ${TEST_CASES_DIR}/aai-not-responding diff --git a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py index 597f8647..f6439be3 100644 --- a/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py +++ b/tests/dcaegen2/prh-testcases/resources/PrhLibrary.py @@ -10,7 +10,8 @@ class PrhLibrary(object): pass @staticmethod - def check_for_log(search_for): + def find_log_entry(search_for): + print (type(search_for)) client = docker.from_env() container = client.containers.get('prh') print ("Check for log searches for pattern: ", search_for ) @@ -126,4 +127,4 @@ class PrhLibrary(object): @staticmethod def is_in_status(client, name, status): - return len(client.containers.list(all=True, filters={"name": "^/"+name+"$", "status": status})) == 1 + return len(client.containers.list(all=True, filters={"name": "^/"+name+"$", "status": status})) == 1
\ No newline at end of file diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot index cfe1d993..36b1a1c5 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot @@ -16,7 +16,7 @@ Create sessions Set Suite Variable ${aai_setup_session} aai_setup_session Create Session consul_setup_session ${CONSUL_SETUP_URL} Set Suite Variable ${consul_setup_session} consul_setup_session - Sleep 60s + Sleep 10s Reset Simulators Reset AAI simulator @@ -33,7 +33,7 @@ Valid event processing Set PNF name in AAI ${pnf_name} Set PNF content in AAI ${aai_entry_to_be_set} ${expected_event_pnf_ready_in_dpaap}= create pnf ready_notification as pnf ready ${data} - Wait Until Keyword Succeeds 10x 3000ms Check PNF_READY notification ${expected_event_pnf_ready_in_dpaap} + Wait Until Keyword Succeeds 30x 3000ms Check PNF_READY notification ${expected_event_pnf_ready_in_dpaap} Invalid event processing [Arguments] ${input_invalid_event_in_dmaap} @@ -46,12 +46,12 @@ Invalid event processing Check PRH log [Arguments] ${searched_log} - ${status}= Check for log ${searched_log} + ${status}= Find log entry ${searched_log} Should Be Equal As Strings ${status} True Check PNF_READY notification [Arguments] ${expected_event_pnf_ready_in_dpaap} - ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers} + ${resp}= Get Request ${dmaap_setup_session} /setup/pnf_ready headers=${suite_headers} Should Be Equal ${resp.text} ${expected_event_pnf_ready_in_dpaap} Set PNF name in AAI @@ -74,7 +74,7 @@ Set PNF content in AAI Set event in DMaaP [Arguments] ${event_in_dmaap} - ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${event_in_dmaap} + ${resp}= Put Request ${dmaap_setup_session} /setup/ves_event headers=${suite_headers} data=${event_in_dmaap} Should Be Equal As Strings ${resp.status_code} 200 Reset AAI simulator @@ -89,4 +89,4 @@ Reset DMaaP simulator Check CBS ready ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs Should Be Equal As Strings ${resp.status_code} 200 - Log CBS ${resp.content}
\ No newline at end of file + Log CBS ${resp.content} diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot index 99939a06..ecc92f25 100644 --- a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot +++ b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot @@ -1,21 +1,57 @@ *** Settings *** Library RequestsLibrary -Library Collections +Library PrhLibrary.py Resource ../../../common.robot *** Keywords *** -VES event with additional fields +Verify PNF ready sent [Arguments] ${test_case_directory} ${pnf_entry}= Get Data From File ${test_case_directory}/aai-entry.json ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json ${expected_pnf_ready_event}= Get Data From File ${test_case_directory}/expected-pnf-ready-event.json - ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json Add PNF entry in AAI ${pnf_entry} Set VES event in DMaaP ${ves_event} Wait Until Keyword Succeeds 10x 3000ms Check CBS ready Wait Until Keyword Succeeds 10x 3000ms Check recorded PNF_READY notification ${expected_pnf_ready_event} + +Verify PNF ready sent and logical link created + [Arguments] ${test_case_directory} + ${expected_logical_link}= Get Data From File ${test_case_directory}/expected-logical-link.json + Verify PNF ready sent ${test_case_directory} Check recorded Logical Link ${expected_logical_link} +Verify event with missing required field is logged + [Arguments] ${test_case_directory} + ${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json + Set VES event in DMaaP ${invalid_ves_event} + ${error_msg}= Create event parsing error ${invalid_ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log ${error_msg} + +Verify incorrect JSON event is logged + [Timeout] 60s + [Arguments] ${test_case_directory} + ${invalid_ves_event}= Get Data From File ${test_case_directory}/invalid-ves-event.json + Set VES event in DMaaP ${invalid_ves_event} + # TODO hangs build + #Wait Until Keyword Succeeds 10x 3000ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array: + +Verify missing AAI record is logged + [Arguments] ${test_case_directory} + ${incorrect_aai_entry}= Get Data From File ${test_case_directory}/incorrect-aai-entry.json + ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json + Add PNF entry in AAI ${incorrect_aai_entry} + Set VES event in DMaaP ${ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log |AAIProducerTask exception has been registered + Wait Until Keyword Succeeds 10x 3000ms Check PRH log |Chain of tasks have been aborted due to errors in PRH workflow + +Verify AAI not responding is logged + [Arguments] ${test_case_directory} + ${ves_event}= Get Data From File ${test_case_directory}/ves-event.json + Ensure Container Is Exited aai_simulator + Set VES event in DMaaP ${ves_event} + Wait Until Keyword Succeeds 10x 3000ms Check PRH log java.net.UnknownHostException: aai + Ensure Container Is Running aai_simulator + Check CBS ready ${resp}= Get Request ${consul_setup_session} /v1/catalog/service/cbs Should Be Equal As Strings ${resp.status_code} 200 @@ -23,16 +59,27 @@ Check CBS ready Check recorded PNF_READY notification [Arguments] ${expected_event_pnf_ready_in_dpaap} - ${resp}= Get Request ${dmaap_setup_session} /setup/get_pnf_ready headers=${suite_headers} + ${resp}= Get Request ${dmaap_setup_session} /setup/pnf_ready headers=${suite_headers} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON ${resp.content} ${expected_event_pnf_ready_in_dpaap} Check recorded Logical Link [Arguments] ${expected_logical_link_in_aai} - ${resp}= Get Request ${aai_setup_session} /setup/get_created_logical_link headers=${suite_headers} + ${resp}= Get Request ${aai_setup_session} /setup/created_logical_link headers=${suite_headers} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON ${resp.content} ${expected_logical_link_in_aai} +Check PRH log + [Arguments] ${log_entry} + ${found}= Find log entry ${log_entry} + Should Be True ${found} + +Create event parsing error + [Arguments] ${ves_event} + ${notification}= Create invalid notification ${ves_event} + ${error_msg}= Catenate SEPARATOR= \\n |Incorrect json, consumerDmaapModel can not be created: ${notification} + [Return] ${error_msg} + Add PNF entry in AAI [Arguments] ${pnf_entry} ${headers}= Create Dictionary Accept=application/json Content-Type=application/json @@ -42,7 +89,7 @@ Add PNF entry in AAI Set VES event in DMaaP [Arguments] ${ves_event} - ${resp}= Put Request ${dmaap_setup_session} /setup/set_ves_event headers=${suite_headers} data=${ves_event} + ${resp}= Put Request ${dmaap_setup_session} /setup/ves_event headers=${suite_headers} data=${ves_event} Should Be Equal As Strings ${resp.status_code} 200 Should Be Equal As JSON @@ -71,4 +118,4 @@ Reset DMaaP simulator Create headers ${headers}= Create Dictionary Accept=application/json Content-Type=application/json - Set Suite Variable ${suite_headers} ${headers}
\ No newline at end of file + Set Suite Variable ${suite_headers} ${headers} diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py index 55b2d1f6..4457ef15 100644 --- a/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py +++ b/tests/dcaegen2/prh-testcases/resources/simulator/AAI.py @@ -27,12 +27,12 @@ class AAISetup(BaseHTTPRequestHandler): def do_GET(self): try: - if re.search('/setup/get_patched_pnf', self.path): + if re.search('/setup/patched_pnf', self.path): httpServerLib.set_response_200_ok(self, payload = patched_pnf) - logger.debug('AAISetup GET /setup/get_patched_pnf -> 200 OK') - elif re.search('/setup/get_created_logical_link', self.path): + logger.debug('AAISetup GET /setup/patched_pnf -> 200 OK') + elif re.search('/setup/created_logical_link', self.path): httpServerLib.set_response_200_ok(self, payload = created_logical_link) - logger.debug('AAISetup GET /setup/get_created_logical_link -> 200 OK') + logger.debug('AAISetup GET /setup/created_logical_link -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('AAISetup GET ' + self.path + ' -> 404 Not found') @@ -129,7 +129,9 @@ class AAIHandler(BaseHTTPRequestHandler): created_logical_link = httpServerLib.get_payload(self) httpServerLib.set_response_200_ok(self) - logger.debug('AAIHandler PUT /aai/v12/network/logical-links/logical-link/' + created_logical_link + ' -> 200 OK') + + logical_link_name = basename(self.path) + logger.debug('AAIHandler PUT /aai/v12/network/logical-links/logical-link/' + logical_link_name + ' -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('AAIHandler PUT ' + self.path + ' -> 404 Not found') diff --git a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py index b2716968..92985cb6 100644 --- a/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py +++ b/tests/dcaegen2/prh-testcases/resources/simulator/DMaaP.py @@ -24,10 +24,10 @@ class DmaapSetup(BaseHTTPRequestHandler): def do_GET(self): try: - if re.search('/setup/get_pnf_ready', self.path): + if re.search('/setup/pnf_ready', self.path): global captured_prh_event httpServerLib.set_response_200_ok(self, payload = captured_prh_event) - logger.debug('DmaapSetup GET /setup/get_pnf_ready -> 200 OK') + logger.debug('DmaapSetup GET /setup/pnf_ready -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('DmaapSetup GET ' + self.path + ' -> 404 Not found') @@ -37,11 +37,11 @@ class DmaapSetup(BaseHTTPRequestHandler): def do_PUT(self): try: - if re.search('/setup/set_ves_event', self.path): + if re.search('/setup/ves_event', self.path): global ves_event ves_event = httpServerLib.get_payload(self) httpServerLib.set_response_200_ok(self) - logger.debug('DmaapSetup PUT /setup/set_ves_event -> 200 OK') + logger.debug('DmaapSetup PUT /setup/ves_event -> 200 OK') else: httpServerLib.set_response_404_not_found(self) logger.info('DmaapSetup PUT ' + self.path + ' -> 404 Not found') |