blob: 1cfc2da71b2d85b125e22cba924ecd29b4c94410 [file] [log] [blame]
wejs060bc422018-05-25 13:58:11 +02001*** Settings ***
wejs060bc422018-05-25 13:58:11 +02002Library RequestsLibrary
Mariusz Wagnercfd26b92018-06-13 14:30:27 +02003Library resources/PrhLibrary.py
wejs060bc422018-05-25 13:58:11 +02004
5*** Variables ***
Mariusz Wagner4a6ece42018-06-05 15:54:27 +02006${DMAAP_SIM_URL} http://${DMAAP_SIMULATOR}
7${AAI_SIM_URL} http://${AAI_SIMULATOR}
8${PRH_URL} http://${PRH}
wejs060bc422018-05-25 13:58:11 +02009
10*** Test Cases ***
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020011Getting and Consuming Positive Scenario
12 [Documentation] Get message from new topic and consume it - positive scenarios
13 [Tags] PRH
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020014 [Template] Run Getting and Consuming
Mariusz Wagner60be36d2018-07-05 11:32:51 +020015 {"pnf-name":"NOKQTFCOC540002E","ipaddress-v4-oam":"10.16.123.234","ipaddress-v6-oam":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002E {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}}
16 {"pnf-name":"NOKQTFCOC540002F","ipaddress-v4-oam":"","ipaddress-v6-oam":"2001:0db8:85a3:0000:0000:8a2e:0370:7334"} NOKQTFCOC540002F {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002F", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002F-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002F", "pnfManufactureDate":1516406400}}}
17 {"pnf-name":"NOKQTFCOC540002G","ipaddress-v4-oam":"10.16.123.234","ipaddress-v6-oam":""} NOKQTFCOC540002G {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002G", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002G-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002G", "pnfManufactureDate":1516406400}}}
18 {"pnf-name":"ERIQTFCOC5400000","ipaddress-v4-oam":"10.16.123.23","ipaddress-v6-oam":""} ERIQTFCOC5400000 {"event": {"commonEventHeader": {"sourceId":"QTFCOC5400000", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC5400000-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Ericsson", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.23", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC5400000", "pnfManufactureDate":1516406400}}}
wejs060bc422018-05-25 13:58:11 +020019
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020020Missing IPv4 and IPv6
21 [Documentation] Test get event from DMaaP without IPv4 and IPv6
22 [Tags] PRH no_IPv4 no_IPv6
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020023 Missing IP {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}}
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020024
25Wrong AAI record
26 [Documentation] Wrong or missing record in AAI
27 [Tags] PRH AAI
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020028 Wrong AAI record {"event": {"commonEventHeader": {"sourceId":"QTFCOC540002E", "startEpochMicrosec":1519837825682, "eventId":"QTFCOC540002E-reg", "nfcNamingCode":"5DU", "internalHeaderFields":{"collectorTimeStamp":"Fri, 04 27 2018 09:01:10 GMT"}, "eventType":"pnfRegistration", "priority":"Normal", "version":3, "reportingEntityName":"5GRAN_DU", "sequence":0, "domain":"other", "lastEpochMicrosec":1519837825682, "eventName":"pnfRegistration_5GDU", "sourceName":"5GRAN_DU", "nfNamingCode":"5GRAN"}, "otherFields": {"pnfLastServiceDate":1517206400, "pnfOamIpv6Address":"2001:0db8:85a3:0000:0000:8a2e:0370:7334", "pnfVendorName":"Nokia", "pnfModelNumber":"AJ02", "pnfFamily":"BBU", "pnfType":"AirScale", "otherFieldsVersion":1, "pnfOamIpv4Address":"10.16.123.234", "pnfSoftwareVersion":"v4.5.0.1", "pnfSerialNumber":"QTFCOC540002E", "pnfManufactureDate":1516406400}}}
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020029
wejs060bc422018-05-25 13:58:11 +020030*** Keywords ***
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020031Wrong AAI record
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020032 [Arguments] ${event_in_dmaap}
Mariusz Wagner60be36d2018-07-05 11:32:51 +020033 [Timeout] 30s
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020034 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
35 Set get event in DMAAP ${event_in_dmaap} ${headers}
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020036 Set pnfs name in AAI wrong_aai_record
37 ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException: Incorrect response code for continuation of tasks workflow
38 Should Be Equal As Strings ${check} True
39
40Missing IP
41 [Arguments] ${event_in_dmaap}
Mariusz Wagner60be36d2018-07-05 11:32:51 +020042 [Timeout] 30s
Mariusz Wagnera2a6c982018-06-14 15:53:56 +020043 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
44 Set get event in DMAAP ${event_in_dmaap} ${headers}
45 ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.DmaapNotFoundException: IPV4 and IPV6 are empty
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020046 Should Be Equal As Strings ${check} True
47
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020048Run Getting and Consuming
49 [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap}
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020050 [Timeout] 1m
wejs060bc422018-05-25 13:58:11 +020051 ${headers}= Create Dictionary Accept=application/json Content-Type=application/json
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020052 Set pnfs name in AAI ${pnfs_name}
53 Set get event in DMAAP ${event_in_dmaap} ${headers}
54 : FOR ${Index} IN RANGE 1 30
55 \ Create Session prh_ready ${DMAAP_SIM_URL}
56 \ ${resp}= Get Request prh_ready /events/pnfReady headers=${headers}
57 \ Exit For Loop If '${resp.text}' == '${posted_event_to_dmaap}'
58 \ Sleep 1s
59 Should Be Equal ${resp.text} ${posted_event_to_dmaap}
wejs060bc422018-05-25 13:58:11 +020060
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020061Set pnfs name in AAI
62 [Arguments] ${pnfs_name}
Mariusz Wagner60be36d2018-07-05 11:32:51 +020063 [Timeout] 1m
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020064 ${headers}= Create Dictionary Accept=application/json Content-Type=text/html
65 Create Session set_pnfs_in_aai ${AAI_SIM_URL}
66 ${resp}= Put Request set_pnfs_in_aai /set_pnfs headers=${headers} data=${pnfs_name}
67 Should Be Equal As Strings ${resp.status_code} 200
68 Log To Console ${resp.text}
69
70Set get event in DMAAP
71 [Arguments] ${event_in_dmaap} ${headers}
Mariusz Wagnercfd26b92018-06-13 14:30:27 +020072 [Timeout] 1m
Mariusz Wagner4a6ece42018-06-05 15:54:27 +020073 Create Session set_get_event ${DMAAP_SIM_URL}
74 ${resp}= Put Request set_get_event /set_get_event headers=${headers} data=${event_in_dmaap}
75 Should Be Equal As Strings ${resp.status_code} 200
76 Log To Console ${resp.text}