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 Process |
| 4 | Library resources/PrhLibrary.py |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 5 | |
| 6 | *** Variables *** |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 7 | ${DMAAP_SIM_URL} http://${DMAAP_SIMULATOR} |
| 8 | ${AAI_SIM_URL} http://${AAI_SIMULATOR} |
| 9 | ${PRH_URL} http://${PRH} |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 10 | |
| 11 | *** Test Cases *** |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 12 | Getting and Consuming Positive Scenario |
| 13 | [Documentation] Get message from new topic and consume it - positive scenarios |
| 14 | [Tags] PRH |
| 15 | [Setup] Start prh |
| 16 | [Template] Run Getting and Consuming |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 17 | {"pnfName":"NOKQTFCOC540002E","ipv4":"10.16.123.234","ipv6":"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}}} |
| 18 | {"pnfName":"NOKQTFCOC540002F","ipv4":"","ipv6":"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}}} |
| 19 | {"pnfName":"NOKQTFCOC540002G","ipv4":"10.16.123.234","ipv6":""} 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}}} |
| 20 | {"pnfName":"ERIQTFCOC5400000","ipv4":"10.16.123.23","ipv6":""} 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}}} |
| 21 | [Teardown] Stop prh |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 22 | |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 23 | Missing IPv4 and IPv6 |
| 24 | [Documentation] Test get event from DMaaP without IPv4 and IPv6 |
| 25 | [Tags] PRH no_IPv4 no_IPv6 |
| 26 | [Setup] Start prh |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 27 | 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}}} |
| 28 | [Teardown] Stop prh |
| 29 | |
| 30 | Wrong AAI record |
| 31 | [Documentation] Wrong or missing record in AAI |
| 32 | [Tags] PRH AAI |
| 33 | [Setup] Start prh |
| 34 | 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] | 35 | [Teardown] Stop prh |
| 36 | |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 37 | *** Keywords *** |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 38 | Wrong AAI record |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 39 | [Arguments] ${event_in_dmaap} |
| 40 | [Timeout] 1m |
| 41 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 42 | Set get event in DMAAP ${event_in_dmaap} ${headers} |
Mariusz Wagner | a2a6c98 | 2018-06-14 15:53:56 +0200 | [diff] [blame] | 43 | Set pnfs name in AAI wrong_aai_record |
| 44 | ${check}= check for log org.onap.dcaegen2.services.prh.exceptions.AAINotFoundException: Incorrect response code for continuation of tasks workflow |
| 45 | Should Be Equal As Strings ${check} True |
| 46 | |
| 47 | Missing IP |
| 48 | [Arguments] ${event_in_dmaap} |
| 49 | [Timeout] 1m |
| 50 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 51 | Set get event in DMAAP ${event_in_dmaap} ${headers} |
| 52 | ${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] | 53 | Should Be Equal As Strings ${check} True |
| 54 | |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 55 | Run Getting and Consuming |
| 56 | [Arguments] ${posted_event_to_dmaap} ${pnfs_name} ${event_in_dmaap} |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 57 | [Timeout] 1m |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 58 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 59 | Set pnfs name in AAI ${pnfs_name} |
| 60 | Set get event in DMAAP ${event_in_dmaap} ${headers} |
| 61 | : FOR ${Index} IN RANGE 1 30 |
| 62 | \ Create Session prh_ready ${DMAAP_SIM_URL} |
| 63 | \ ${resp}= Get Request prh_ready /events/pnfReady headers=${headers} |
| 64 | \ Exit For Loop If '${resp.text}' == '${posted_event_to_dmaap}' |
| 65 | \ Sleep 1s |
| 66 | Should Be Equal ${resp.text} ${posted_event_to_dmaap} |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 67 | |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 68 | Start prh |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 69 | [Timeout] 1m |
wejs | 060bc42 | 2018-05-25 13:58:11 +0200 | [diff] [blame] | 70 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 71 | Create Session prh_start ${PRH_URL} |
| 72 | ${resp}= Get Request prh_start /start headers=${headers} |
| 73 | Should Be Equal ${resp.text} "PRH Service has been started!" |
| 74 | |
| 75 | Stop prh |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 76 | [Timeout] 1m |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 77 | ${headers}= Create Dictionary Accept=application/json Content-Type=application/json |
| 78 | Create Session prh_stop ${PRH_URL} |
| 79 | ${resp}= Get Request prh_stop /stopPrh headers=${headers} |
| 80 | Should Be Equal ${resp.text} "PRH Service has already been stopped!" |
| 81 | |
| 82 | Set pnfs name in AAI |
| 83 | [Arguments] ${pnfs_name} |
| 84 | [Timeout] 1 minute |
| 85 | ${headers}= Create Dictionary Accept=application/json Content-Type=text/html |
| 86 | Create Session set_pnfs_in_aai ${AAI_SIM_URL} |
| 87 | ${resp}= Put Request set_pnfs_in_aai /set_pnfs headers=${headers} data=${pnfs_name} |
| 88 | Should Be Equal As Strings ${resp.status_code} 200 |
| 89 | Log To Console ${resp.text} |
| 90 | |
| 91 | Set get event in DMAAP |
| 92 | [Arguments] ${event_in_dmaap} ${headers} |
Mariusz Wagner | cfd26b9 | 2018-06-13 14:30:27 +0200 | [diff] [blame] | 93 | [Timeout] 1m |
Mariusz Wagner | 4a6ece4 | 2018-06-05 15:54:27 +0200 | [diff] [blame] | 94 | Create Session set_get_event ${DMAAP_SIM_URL} |
| 95 | ${resp}= Put Request set_get_event /set_get_event headers=${headers} data=${event_in_dmaap} |
| 96 | Should Be Equal As Strings ${resp.status_code} 200 |
| 97 | Log To Console ${resp.text} |