blob: d81efe6ec2dac5a5ae61c35ccfaf8b74ce38f289 [file] [log] [blame]
Gary Wu9abb61c2018-09-27 10:38:50 -07001*** Settings ***
2Documentation Integration tests for PRH.
3... PRH receive events from DMaaP and produce or not PNF_READY notification depends on required fields in received event.
4Suite Setup Run keywords Create header Create sessions
pkaras55d36862018-10-17 15:08:34 +02005Test Setup Run keywords Reset Simulators
Gary Wu9abb61c2018-09-27 10:38:50 -07006Library resources/PrhLibrary.py
7Resource resources/prh_library.robot
8Resource ../../common.robot
9
10*** Variables ***
11${DMAAP_SIMULATOR_URL} http://${DMAAP_SIMULATOR}
pkaras55d36862018-10-17 15:08:34 +020012${AAI_SIMULATOR_SETUP_URL} http://${AAI_SIMULATOR_SETUP}
Gary Wu13111e92018-09-27 11:31:33 -070013${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_all_fields.json
14${EVENT_WITH_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV4.json
15${EVENT_WITH_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_IPV6.json
16${EVENT_WITH_MISSING_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_IPV4_and_IPV6.json
17${EVENT_WITH_MISSING_SOURCENAME} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName.json
18${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV4.json
19${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_and_IPV6.json
20${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_with_missing_sourceName_IPV4_and_IPV6.json
Mariusz Wagner1fd732a2018-09-28 09:03:08 +020021${EVENT_WITHOUT_IPV6_FILED} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/event_without_IPV6_field.json
Gary Wu13111e92018-09-27 11:31:33 -070022${Not_json_format} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/not_json_format.json
Gary Wu9abb61c2018-09-27 10:38:50 -070023
24*** Test Cases ***
25Valid DMaaP event can be converted to PNF_READY notification
26 [Documentation] PRH get valid event from DMaaP with required fields - PRH produce PNF_READY notification
27 [Tags] PRH Valid event
28 [Template] Valid event processing
29 ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
30 ${EVENT_WITH_IPV4}
31 ${EVENT_WITH_IPV6}
Mariusz Wagner1fd732a2018-09-28 09:03:08 +020032 ${EVENT_WITHOUT_IPV6_FILED}
Gary Wu9abb61c2018-09-27 10:38:50 -070033
34Invalid DMaaP event cannot be converted to PNF_READY notification
35 [Documentation] PRH get invalid event from DMaaP with missing required fields - PRH does not produce PNF_READY notification
36 [Tags] PRH Invalid event
37 [Template] Invalid event processing
38 ${EVENT_WITH_MISSING_IPV4_AND_IPV6}
39 ${EVENT_WITH_MISSING_SOURCENAME}
40 ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4}
41 ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6}
42 ${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6}
43
44Get valid event from DMaaP and record in AAI does not exist
45 [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
46 [Tags] PRH Missing AAI record
47 [Timeout] 30s
48 ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
49 Set PNF name in AAI wrong_aai_record
50 Set event in DMaaP ${data}
51 Wait Until Keyword Succeeds 100x 300ms Check PRH log java.io.IOException: Connection closed prematurely
52
53Event in DMaaP is not JSON format
54 [Documentation] PRH get not JSON format event from DMaaP - PRH does not produce PNF_READY notification
55 [Tags] PRH
56 ${data}= Get Data From File ${Not_json_format}
57 Set event in DMaaP ${data}
58 Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array:
59
60Get valid event from DMaaP and AAI is not responding
61 [Documentation] PRH get valid event from DMaaP with all required fields and AAI is not responding - PRH does not produce PNF_READY notification
62 [Tags] PRH AAI
63 [Timeout] 180s
64 ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
65 Stop AAI
66 Set event in DMaaP ${data}
67 Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai