aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dcaegen2')
-rw-r--r--tests/dcaegen2/prh-testcases/prh_tests.robot85
-rw-r--r--tests/dcaegen2/prh-testcases/prh_tests2.robot53
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library.robot155
-rw-r--r--tests/dcaegen2/prh-testcases/resources/prh_library2.robot121
-rw-r--r--tests/dcaegen2/prh-testcases/ssl_prh_tests.robot17
5 files changed, 130 insertions, 301 deletions
diff --git a/tests/dcaegen2/prh-testcases/prh_tests.robot b/tests/dcaegen2/prh-testcases/prh_tests.robot
index aa6fc052..b4666d10 100644
--- a/tests/dcaegen2/prh-testcases/prh_tests.robot
+++ b/tests/dcaegen2/prh-testcases/prh_tests.robot
@@ -1,73 +1,54 @@
*** 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 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_library.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}
-${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 ***
-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
+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] 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-empty-additional-fields
+ ${TEST_CASES_DIR}/ves-event-with-empty-attachment-point
-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 sent PNF ready when DMaaP event is invalid
+ [Documentation] PRH get from DMaaP event with missing required field
[Tags] PRH Invalid event
- [Template] Invalid event processing
- ${EVENT_WITH_MISSING_SOURCENAME}
+ [Template] Verify event with missing required field is logged
+ ${TEST_CASES_DIR}/ves-event-missing-field
-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
- [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
+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
-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 hangs up build
- #Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON 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
-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}
- Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai
- Ensure Container Is Running aai_simulator
+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/prh_tests2.robot b/tests/dcaegen2/prh-testcases/prh_tests2.robot
deleted file mode 100644
index 7f0531b8..00000000
--- a/tests/dcaegen2/prh-testcases/prh_tests2.robot
+++ /dev/null
@@ -1,53 +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
-
-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/prh_library.robot b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
index 36b1a1c5..0353e119 100644
--- a/tests/dcaegen2/prh-testcases/resources/prh_library.robot
+++ b/tests/dcaegen2/prh-testcases/resources/prh_library.robot
@@ -1,82 +1,113 @@
*** Settings ***
Library RequestsLibrary
-Library Collections
Library PrhLibrary.py
Resource ../../../common.robot
*** Keywords ***
-Create header
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- Set Suite Variable ${suite_headers} ${headers}
+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
+ 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 30x 3000ms Check recorded PNF_READY notification ${expected_pnf_ready_event}
-Create sessions
- Create Session dmaap_setup_session ${DMAAP_SIMULATOR_SETUP_URL}
- Set Suite Variable ${dmaap_setup_session} dmaap_setup_session
- Create Session aai_setup_session ${AAI_SIMULATOR_SETUP_URL}
- 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 10s
+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}
-Reset Simulators
- Reset AAI simulator
- Reset DMaaP simulator
+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}
-Valid event processing
- [Arguments] ${input_valid__ves_event_in_dmaap} ${input_aai}
- [Timeout] 150s
- Wait Until Keyword Succeeds 10x 3000ms Check CBS ready
- ${data}= Get Data From File ${input_valid__ves_event_in_dmaap}
- ${aai_entry_to_be_set}= Get Data From File ${input_aai}
- Set event in DMaaP ${data}
- ${pnf_name}= Create PNF name ${data}
- 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 30x 3000ms Check PNF_READY notification ${expected_event_pnf_ready_in_dpaap}
-
-Invalid event processing
- [Arguments] ${input_invalid_event_in_dmaap}
- [Timeout] 150s
- ${data}= Get Data From File ${input_invalid_event_in_dmaap}
- Set event in DMaaP ${data}
- ${invalid_notification}= Create invalid notification ${data}
- ${notification}= Catenate SEPARATOR= \\n |Incorrect json, consumerDmaapModel can not be created: ${invalid_notification}
- Wait Until Keyword Succeeds 100x 100ms Check PRH log ${notification}
+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:
-Check PRH log
- [Arguments] ${searched_log}
- ${status}= Find log entry ${searched_log}
- Should Be Equal As Strings ${status} True
+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
+ Log CBS ${resp.content}
-Check PNF_READY notification
+Check recorded PNF_READY notification
[Arguments] ${expected_event_pnf_ready_in_dpaap}
${resp}= Get Request ${dmaap_setup_session} /setup/pnf_ready headers=${suite_headers}
- Should Be Equal ${resp.text} ${expected_event_pnf_ready_in_dpaap}
+ Should Be Equal As Strings ${resp.status_code} 200
+ Should Be Equal As JSON ${resp.content} ${expected_event_pnf_ready_in_dpaap}
-Set PNF name in AAI
- [Arguments] ${pnf_name}
- ${headers}= Create Dictionary Accept=application/json Content-Type=text/html
- Log AAI url ${AAI_SIMULATOR_SETUP_URL}
- Log Http headers ${headers}
- Log PNF name ${pnf_name}
- ${resp}= Put Request ${aai_setup_session} /set_pnf headers=${headers} data=${pnf_name}
+Check recorded Logical Link
+ [Arguments] ${expected_logical_link_in_aai}
+ ${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}
-Set PNF content in AAI
- [Arguments] ${aai_pnf_content}
- ${headers}= Create Dictionary Accept=application/json Content-Type=text/html
+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
Log AAI url ${AAI_SIMULATOR_SETUP_URL}
- Log Http headers ${headers}
- Log PNF AAI content ${aai_pnf_content}
- ${resp}= Put Request ${aai_setup_session} /setup/add_pnf_entry headers=${headers} data=${aai_pnf_content}
+ ${resp}= Put Request ${aai_setup_session} /setup/add_pnf_entry headers=${suite_headers} data=${pnf_entry}
Should Be Equal As Strings ${resp.status_code} 200
-Set event in DMaaP
- [Arguments] ${event_in_dmaap}
- ${resp}= Put Request ${dmaap_setup_session} /setup/ves_event headers=${suite_headers} data=${event_in_dmaap}
+Set VES event in DMaaP
+ [Arguments] ${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
+ [Arguments] ${given} ${expected}
+ Should Be True ${given}==${expected}
+
+Create sessions
+ Create Session dmaap_setup_session ${DMAAP_SIMULATOR_SETUP_URL}
+ Set Suite Variable ${dmaap_setup_session} dmaap_setup_session
+ Create Session aai_setup_session ${AAI_SIMULATOR_SETUP_URL}
+ 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
+
+Reset Simulators
+ Reset AAI simulator
+ Reset DMaaP simulator
+
Reset AAI simulator
${resp}= Post Request ${aai_setup_session} /reset
Should Be Equal As Strings ${resp.status_code} 200
@@ -85,8 +116,6 @@ Reset DMaaP simulator
${resp}= Post Request ${dmaap_setup_session} /reset
Should Be Equal As Strings ${resp.status_code} 200
-
-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}
+Create headers
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
+ Set Suite Variable ${suite_headers} ${headers}
diff --git a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot b/tests/dcaegen2/prh-testcases/resources/prh_library2.robot
deleted file mode 100644
index ecc92f25..00000000
--- a/tests/dcaegen2/prh-testcases/resources/prh_library2.robot
+++ /dev/null
@@ -1,121 +0,0 @@
-*** Settings ***
-Library RequestsLibrary
-Library PrhLibrary.py
-Resource ../../../common.robot
-
-*** Keywords ***
-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
- 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
- Log CBS ${resp.content}
-
-Check recorded PNF_READY notification
- [Arguments] ${expected_event_pnf_ready_in_dpaap}
- ${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/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
- Log AAI url ${AAI_SIMULATOR_SETUP_URL}
- ${resp}= Put Request ${aai_setup_session} /setup/add_pnf_entry headers=${suite_headers} data=${pnf_entry}
- Should Be Equal As Strings ${resp.status_code} 200
-
-Set VES event in DMaaP
- [Arguments] ${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
- [Arguments] ${given} ${expected}
- Should Be True ${given}==${expected}
-
-Create sessions
- Create Session dmaap_setup_session ${DMAAP_SIMULATOR_SETUP_URL}
- Set Suite Variable ${dmaap_setup_session} dmaap_setup_session
- Create Session aai_setup_session ${AAI_SIMULATOR_SETUP_URL}
- 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
-
-Reset Simulators
- Reset AAI simulator
- Reset DMaaP simulator
-
-Reset AAI simulator
- ${resp}= Post Request ${aai_setup_session} /reset
- Should Be Equal As Strings ${resp.status_code} 200
-
-Reset DMaaP simulator
- ${resp}= Post Request ${dmaap_setup_session} /reset
- Should Be Equal As Strings ${resp.status_code} 200
-
-Create headers
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
- Set Suite Variable ${suite_headers} ${headers}
diff --git a/tests/dcaegen2/prh-testcases/ssl_prh_tests.robot b/tests/dcaegen2/prh-testcases/ssl_prh_tests.robot
index 3e227e7c..6e350cef 100644
--- a/tests/dcaegen2/prh-testcases/ssl_prh_tests.robot
+++ b/tests/dcaegen2/prh-testcases/ssl_prh_tests.robot
@@ -1,7 +1,7 @@
*** 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. PRH comunicates with AAI and DMaaP through SSL
-Suite Setup Run keywords Create header AND Create sessions AND Ensure Container Is Running ssl_prh AND Ensure Container Is Exited prh
+Suite Setup Run keywords Create headers AND Create sessions AND Ensure Container Is Running ssl_prh AND Ensure Container Is Exited prh
Suite Teardown Ensure Container Is Running prh
Test Teardown Reset Simulators
Library resources/PrhLibrary.py
@@ -9,20 +9,13 @@ Resource resources/prh_library.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}
-${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_WITHOUT_IPV6_FILED} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_without_IPV6_field.json
-
*** Test Cases ***
Valid DMaaP event can be converted to PNF_READY notification with ssl connection to AAI
- [Documentation] PRH get valid event from DMaaP with required fields - PRH produce PNF_READY notification
- [Tags] PRH Valid event
- [Template] Valid event processing
- ${VES_EVENT_PNF_REGISTRATION_SIMPLE} ${AAI_PNF_REGISTRATION_SIMPLE}
+ [Template] Verify PNF ready sent
+ ${TEST_CASES_DIR}/ves-event-without-additional-fields \ No newline at end of file