wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 1 | *** Settings *** |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 2 | Library RequestsLibrary |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 3 | Library resources/PrhLibrary.py |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 4 | |
| 5 | *** Variables *** |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 6 | ${DMAAP_SIM_URL} http://${DMAAP_SIMULATOR} |
| 7 | ${AAI_SIM_URL} http://${AAI_SIMULATOR} |
| 8 | ${PRH_URL} http://${PRH} |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 9 | |
| 10 | *** Test Cases *** |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 11 | Getting and Consuming Positive Scenario |
| 12 | [Documentation] Get message from new topic and consume it - positive scenarios |
| 13 | [Tags] PRH |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 14 | [Template] Run Getting and Consuming |
Mariusz Wagner | 60be36d | 2018-07-05 11:32:51 +0200 | [diff] [blame] | 15 | {"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}}} |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 19 | |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 20 | Missing IPv4 and IPv6 |
| 21 | [Documentation] Test get event from DMaaP without IPv4 and IPv6 |
| 22 | [Tags] PRH no_IPv4 no_IPv6 |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 23 | 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 Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 24 | |
| 25 | Wrong AAI record |
| 26 | [Documentation] Wrong or missing record in AAI |
| 27 | [Tags] PRH AAI |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 28 | 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 Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 29 | |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 30 | *** Keywords *** |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 31 | Wrong AAI record |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 32 | [Arguments] ${event_in_dmaap} |
Mariusz Wagner | 60be36d | 2018-07-05 11:32:51 +0200 | [diff] [blame] | 33 | [Timeout] 30s |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 34 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 35 | Set get event in DMAAP ${event_in_dmaap} ${headers} |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 36 | 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 | |
| 40 | Missing IP |
| 41 | [Arguments] ${event_in_dmaap} |
Mariusz Wagner | 60be36d | 2018-07-05 11:32:51 +0200 | [diff] [blame] | 42 | [Timeout] 30s |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 43 | ${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 Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 46 | Should Be Equal As Strings ${check} True |
| 47 | |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 48 | Run Getting and Consuming |
| 49 | [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap} |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 50 | [Timeout] 1m |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 51 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 52 | 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} |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 60 | |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 61 | Set pnfs name in AAI |
| 62 | [Arguments] ${pnfs_name} |
Mariusz Wagner | 60be36d | 2018-07-05 11:32:51 +0200 | [diff] [blame] | 63 | [Timeout] 1m |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 64 | ${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 | |
| 70 | Set get event in DMAAP |
| 71 | [Arguments] ${event_in_dmaap} ${headers} |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 72 | [Timeout] 1m |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 73 | 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} |