rajendrajaiswal | 6823ae7 | 2018-09-07 15:23:18 +0100 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing E2E VES,Dmaap,DFC,DR with File Ready event feed from xNF |
| 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library Collections |
| 6 | Resource resources/ves_keywords.robot |
| 7 | |
| 8 | |
| 9 | *** Variables *** |
| 10 | ${VESC_URL} http://%{VESC_IP}:8080 |
| 11 | ${GLOBAL_APPLICATION_ID} robot-ves |
| 12 | ${VES_ANY_EVENT_PATH} /eventListener/v7 |
| 13 | ${HEADER_STRING} content-type=application/json |
| 14 | ${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcae-bulkpm/testcases/assets/json_events/FileExistNotification.json |
| 15 | |
| 16 | ${TARGETURL_TOPICS} http://${DMAAP_MR_IP}:3904/topics |
| 17 | ${TARGETURL_SUBSCR} http://${DMAAP_MR_IP}:3904/events/unauthenticated.VES_NOTIFICATION_OUTPUT/OpenDcae-c12/C12?timeout=1000 |
| 18 | *** Test Cases *** |
| 19 | |
| 20 | Send VES File Ready Event to VES Collector |
| 21 | [Tags] DCAE-VESC-R1 |
| 22 | [Documentation] Post single event and expect 200 Response |
| 23 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE} |
| 24 | ${headers}= Create Header From String ${HEADER_STRING} |
| 25 | ${resp}= Publish Event To VES Collector ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} |
| 26 | Log Receive HTTP Status code ${resp.status_code} |
| 27 | Should Be Equal As Strings ${resp.status_code} 202 |
| 28 | |
| 29 | Check VES Notification Topic is existing in Message Router |
| 30 | [Documentation] Get the count of the Topics |
| 31 | [Timeout] 1 minute |
| 32 | Sleep 10s |
| 33 | ${resp}= GetCall ${TARGETURL_TOPICS} |
| 34 | log ${TARGETURL_TOPICS} |
| 35 | log 'JSON Response Code :'${resp} |
| 36 | ${topics}= Evaluate $resp.json().get('topics') |
| 37 | log ${topics} |
| 38 | ${ListLength}= Get Length ${topics} |
| 39 | log ${ListLength} |
| 40 | List Should Contain Value ${topics} unauthenticated.VES_NOTIFICATION_OUTPUT |