*** 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 header AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh
-Suite Teardown Ensure Container Is Running ssl_prh
+Suite Setup Run keywords Create Headers AND Create sessions AND Set default PRH config
Test Teardown Reset Simulators
-Library resources/PrhLibrary.py
+Test Timeout 2 minutes
+
+Resource resources/prh_sessions.robot
Resource resources/prh_library.robot
-Resource ../../common.robot
+Resource resources/prh_config_library.robot
*** Variables ***
-${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP}
-${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP}
-${CONSUL_SETUP_URL} http://${CONSUL_SETUP}
-
-${VES_EVENT_PNF_REGISTRATION_SIMPLE} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/ves-event-pnf-registration-simple.json
-${AAI_PNF_REGISTRATION_SIMPLE} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/aai-pnf-registration-simple.json
-${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_all_fields.json
-${EVENT_WITH_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV4.json
-${EVENT_WITH_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV6.json
-${EVENT_WITH_MISSING_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_IPV4_and_IPV6.json
-${EVENT_WITH_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName.json
-${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV4.json
-${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV6.json
-${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_IPV4_and_IPV6.json
-${EVENT_WITH_OPTIONAL_REGISTRATION_FIELDS_ALL_FILLED} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_optional_registration_fields_all_filled.json
-${EVENT_WITH_OPTIONAL_REGISTRATION_FIELDS_EMPTY} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_optional_registration_fields_empty.json
-${EVENT_WITH_OPTIONAL_REGISTRATION_FIELDS_MISSING_ALL} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_optional_registration_fields_missing_all.json
-${EVENT_WITH_OPTIONAL_REGISTRATION_FIELDS_MISSING_PARTIAL} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_optional_registration_fields_missing_partial.json
-${EVENT_WITHOUT_IPV6_FILED} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_without_IPV6_field.json
-${Not_json_format} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/not_json_format.json
+${TEST_CASES_DIR} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets
*** Test Cases ***
-Process valid simple PNF Registration DMaaP event which can be converted to PNF_READY notification
- [Documentation] PRH get valid event from DMaaP with required fields - PRH produce PNF_READY notification
+BBS case event - attachment point
+ [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] Valid event processing
- ${VES_EVENT_PNF_REGISTRATION_SIMPLE} ${AAI_PNF_REGISTRATION_SIMPLE}
- #${VES_EVENT_PNF_REGISTRATION_SIMPLE_AND_ATTACHMENT_POINT}
+ [Template] Verify PNF ready sent
+ ${TEST_CASES_DIR}/ves-event-without-additional-fields
+ ${TEST_CASES_DIR}/ves-event-with-missing-IP-addresses
+ ${TEST_CASES_DIR}/ves-event-with-only-IP-addresses
+ ${TEST_CASES_DIR}/ves-event-with-empty-additional-fields
+ ${TEST_CASES_DIR}/ves-event-with-empty-attachment-point
+
+Should not send PNF ready when DMaaP event has missing required field
+ [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
-Invalid DMaaP event cannot be converted to PNF_READY notification
- [Documentation] PRH get invalid event from DMaaP with missing required fields - PRH does not produce PNF_READY notification
+Should not send PNF ready when DMaaP event is not JSON array
+ [Documentation] Event from DMaaP is not an array of JSON objects
[Tags] PRH Invalid event
- [Template] Invalid event processing
- ${EVENT_WITH_MISSING_SOURCENAME}
+ Verify incorrect JSON event is logged ${TEST_CASES_DIR}/ves-event-not-a-json-object
-Get valid event from DMaaP and record in AAI does not exist
- [Documentation] PRH get valid event from DMaaP with all required fields and in AAI record doesn't exist - PRH does not produce PNF_READY notification
+Should not send 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
- [Timeout] 30s
- ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
- Set PNF name in AAI wrong_aai_record
- Set event in DMaaP ${data}
- Wait Until Keyword Succeeds 100x 300ms Check PRH log |AAIProducerTask exception has been registered
- Wait Until Keyword Succeeds 100x 300ms Check PRH log |Chain of tasks have been aborted due to errors in PRH workflow
+ Verify missing AAI record is logged ${TEST_CASES_DIR}/aai-missing-entry
+
+Should not send 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
+
+Should send PNF ready when logical link exists and replace it in AAI
+ [Documentation] PRH gets event from DMaaP with an attachment point, PNF is related to a logical link in AAI
+ [Tags] PRH Attachment point
+ [Template] Verify PNF ready sent and old logical link replaced in AAI
+ ${TEST_CASES_DIR}/pnf-with-existing-logical-link
+ ${TEST_CASES_DIR}/pnf-with-different-logical-link
+
+BBS case event - Re-registration
+ [Documentation] After registered PNF, PRH reads another one PRH event with registration event
+ [Tags] PRH Valid event Re registraiton
+ [Template] Verify PNF re registration
+ ${TEST_CASES_DIR}/re-registration
-Event in DMaaP is not JSON format
- [Documentation] PRH get not JSON format event from DMaaP - PRH does not produce PNF_READY notification
- [Tags] PRH
- ${data}= Get Data From File ${Not_json_format}
- Set event in DMaaP ${data}
- #TODO to fix after CBS merge
- #Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array:
+Should send PNF ready when the associated service instance is non-Active
+ [Documentation] PNF has a non active service instance, should send PNF_READY event
+ [Tags] PRH Service instance non active
+ [Template] Verify PNF ready sent when service instance non active
+ ${TEST_CASES_DIR}/service-instance-non-active
-Get valid event from DMaaP and AAI is not responding
- [Documentation] PRH get valid event from DMaaP with all required fields and AAI is not responding - PRH does not produce PNF_READY notification
- [Tags] PRH AAI
- [Timeout] 180s
- ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
- Ensure Container Is Exited aai_simulator
- Set event in DMaaP ${data}
- #TODO fix after CBS merge
- #Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai
- Ensure Container Is Running aai_simulator
+PRH logging level change
+ [Documentation] ad-hoc PRH logging level change using rest endpoint
+ [Tags] PRH logging level
+ Verify change logging level