blob: 55f484fa64532b48ad53ad4f376cd8c1da8da950 [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
5Library resources/PrhLibrary.py
6Resource resources/prh_library.robot
7Resource ../../common.robot
8
9*** Variables ***
10${DMAAP_SIMULATOR_URL} http://${DMAAP_SIMULATOR}
11${AAI_SIMULATOR_URL} http://${AAI_SIMULATOR}
12${PRH_URL} http://${PRH}
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
21${Not_json_format} %{WORKSPACE}/tests/dcaegen2/prh-testcases/assets/json_events/not_json_format.json
Gary Wu9abb61c2018-09-27 10:38:50 -070022
23*** Test Cases ***
24Valid DMaaP event can be converted to PNF_READY notification
25 [Documentation] PRH get valid event from DMaaP with required fields - PRH produce PNF_READY notification
26 [Tags] PRH Valid event
27 [Template] Valid event processing
28 ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
29 ${EVENT_WITH_IPV4}
30 ${EVENT_WITH_IPV6}
31
32Invalid DMaaP event cannot be converted to PNF_READY notification
33 [Documentation] PRH get invalid event from DMaaP with missing required fields - PRH does not produce PNF_READY notification
34 [Tags] PRH Invalid event
35 [Template] Invalid event processing
36 ${EVENT_WITH_MISSING_IPV4_AND_IPV6}
37 ${EVENT_WITH_MISSING_SOURCENAME}
38 ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV4}
39 ${EVENT_WITH_MISSING_SOURCENAME_AND_IPV6}
40 ${EVENT_WITH_MISSING_SOURCENAME_IPV4_AND_IPV6}
41
42Get valid event from DMaaP and record in AAI does not exist
43 [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
44 [Tags] PRH Missing AAI record
45 [Timeout] 30s
46 ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
47 Set PNF name in AAI wrong_aai_record
48 Set event in DMaaP ${data}
49 Wait Until Keyword Succeeds 100x 300ms Check PRH log java.io.IOException: Connection closed prematurely
50
51Event in DMaaP is not JSON format
52 [Documentation] PRH get not JSON format event from DMaaP - PRH does not produce PNF_READY notification
53 [Tags] PRH
54 ${data}= Get Data From File ${Not_json_format}
55 Set event in DMaaP ${data}
56 Wait Until Keyword Succeeds 100x 300ms Check PRH log |java.lang.IllegalStateException: Not a JSON Array:
57
58Get valid event from DMaaP and AAI is not responding
59 [Documentation] PRH get valid event from DMaaP with all required fields and AAI is not responding - PRH does not produce PNF_READY notification
60 [Tags] PRH AAI
61 [Timeout] 180s
62 ${data}= Get Data From File ${EVENT_WITH_ALL_VALID_REQUIRED_FIELDS}
63 Stop AAI
64 Set event in DMaaP ${data}
65 Wait Until Keyword Succeeds 100x 300ms Check PRH log java.net.UnknownHostException: aai