Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Integration tests for PRH. |
| 3 | ... PRH receive events from DMaaP and produce or not PNF_READY notification depends on required fields in received event. |
pkaras | c7abba8 | 2018-10-22 12:22:35 +0200 | [diff] [blame] | 4 | Suite Setup Run keywords Create header AND Create sessions AND Ensure Container Is Running prh AND Ensure Container Is Exited ssl_prh |
| 5 | Suite Teardown Ensure Container Is Running ssl_prh |
| 6 | Test Teardown Reset Simulators |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 7 | Library resources/PrhLibrary.py |
| 8 | Resource resources/prh_library.robot |
| 9 | Resource ../../common.robot |
| 10 | |
| 11 | *** Variables *** |
pkaras | c7abba8 | 2018-10-22 12:22:35 +0200 | [diff] [blame] | 12 | ${DMAAP_SIMULATOR_SETUP_URL} http://${DMAAP_SIMULATOR_SETUP} |
pkaras | 55d3686 | 2018-10-17 15:08:34 +0200 | [diff] [blame] | 13 | ${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP} |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 14 | ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_all_fields.json |
| 15 | ${EVENT_WITH_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV4.json |
| 16 | ${EVENT_WITH_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV6.json |
| 17 | ${EVENT_WITH_MISSING_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_IPV4_and_IPV6.json |
| 18 | ${EVENT_WITH_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName.json |
| 19 | ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV4.json |
| 20 | ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV6.json |
| 21 | ${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_IPV4_and_IPV6.json |
Mariusz Wagner | 1fd732a | 2018-09-28 09:03:08 +0200 | [diff] [blame] | 22 | ${EVENT_WITHOUT_IPV6_FILED} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_without_IPV6_field.json |
Gary Wu | 13111e9 | 2018-09-27 11:31:33 -0700 | [diff] [blame] | 23 | ${Not_json_format} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/not_json_format.json |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 24 | |
| 25 | *** Test Cases *** |
| 26 | Valid DMaaP event can be converted to PNF_READY notification |
| 27 | [Documentation] PRH get valid event from DMaaP with required fields - PRH produce PNF_READY notification |
| 28 | [Tags] PRH Valid event |
| 29 | [Template] Valid event processing |
| 30 | ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} |
| 31 | ${EVENT_WITH_IPV4} |
| 32 | ${EVENT_WITH_IPV6} |
Mariusz Wagner | 1fd732a | 2018-09-28 09:03:08 +0200 | [diff] [blame] | 33 | ${EVENT_WITHOUT_IPV6_FILED} |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 34 | |
| 35 | Invalid DMaaP event cannot be converted to PNF_READY notification |
| 36 | [Documentation] PRH get invalid event from DMaaP with missing required fields - PRH does not produce PNF_READY notification |
| 37 | [Tags] PRH Invalid event |
| 38 | [Template] Invalid event processing |
| 39 | ${EVENT_WITH_MISSING_IPV4_AND_IPV6} |
| 40 | ${EVENT_WITH_MISSING_SOURCENAME} |
| 41 | ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4} |
| 42 | ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6} |
| 43 | ${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6} |
| 44 | |
| 45 | Get valid event from DMaaP and record in AAI does not exist |
| 46 | [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 |
| 47 | [Tags] PRH Missing AAI record |
| 48 | [Timeout] 30s |
| 49 | ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} |
| 50 | Set PNF name in AAI wrong_aai_record |
| 51 | Set event in DMaaP ${data} |
Marcin Migdal | 326c656 | 2018-12-17 16:12:05 +0100 | [diff] [blame] | 52 | Wait Until Keyword Succeeds 100x 300ms Check PRH log org.onap.dcaegen2.services.prh.exceptions.AaiNotFoundException |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 53 | |
| 54 | Event in DMaaP is not JSON format |
| 55 | [Documentation] PRH get not JSON format event from DMaaP - PRH does not produce PNF_READY notification |
| 56 | [Tags] PRH |
| 57 | ${data}= Get Data From File ${Not_json_format} |
| 58 | Set event in DMaaP ${data} |
| 59 | Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array: |
| 60 | |
| 61 | Get valid event from DMaaP and AAI is not responding |
| 62 | [Documentation] PRH get valid event from DMaaP with all required fields and AAI is not responding - PRH does not produce PNF_READY notification |
| 63 | [Tags] PRH AAI |
| 64 | [Timeout] 180s |
| 65 | ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} |
pkaras | c7abba8 | 2018-10-22 12:22:35 +0200 | [diff] [blame] | 66 | Ensure Container Is Exited aai_simulator |
Gary Wu | 9abb61c | 2018-09-27 10:38:50 -0700 | [diff] [blame] | 67 | Set event in DMaaP ${data} |
| 68 | Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai |
pkaras | c7abba8 | 2018-10-22 12:22:35 +0200 | [diff] [blame] | 69 | Ensure Container Is Running aai_simulator |