pswang | daef349 | 2017-09-21 22:04:20 -0500 | [diff] [blame] | 1 | *** Settings ***
|
| 2 | Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios
|
| 3 |
|
| 4 | Library RequestsLibrary
|
| 5 | Library OperatingSystem
|
| 6 | Library Collections
|
| 7 | Library DcaeLibrary
|
| 8 | Resource resources/dcae_keywords.robot
|
| 9 | Test Setup Cleanup VES Events
|
| 10 | Suite Setup VES Collector Suite Setup DMaaP
|
| 11 | Suite Teardown VES Collector Suite Shutdown DMaaP
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 | *** Variables ***
|
| 17 | ${VESC_URL_HTTPS} https://%{VESC_IP}:8443
|
| 18 | ${VESC_URL} http://%{VESC_IP}:8080
|
| 19 | ${VES_ANY_EVENT_PATH} /eventListener/v5
|
| 20 | ${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch
|
| 21 | ${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState
|
| 22 | ${HEADER_STRING} content-type=application/json
|
pswang | 47e5ebb | 2017-09-25 17:05:15 -0500 | [diff] [blame] | 23 | ${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json
|
| 24 | ${EVENT_MEASURE_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json
|
| 25 | ${EVENT_DATA_FILE_BAD} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json
|
| 26 | ${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json
|
| 27 | ${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json
|
pswang | daef349 | 2017-09-21 22:04:20 -0500 | [diff] [blame] | 28 |
|
| 29 |
|
| 30 | #DCAE Health Check
|
| 31 | ${CONFIG_BINDING_URL} http://localhost:8443
|
| 32 | ${CB_HEALTHCHECK_PATH} /healthcheck
|
| 33 | ${CB_SERVICE_COMPONENT_PATH} /service_component/
|
| 34 | ${VES_Service_Name1} dcae-controller-ves-collector
|
| 35 | ${VES_Service_Name2} ves-collector-not-exist
|
| 36 |
|
| 37 | *** Comment out from R1 release ***
|
| 38 | DCAE Health Check
|
| 39 | [Tags] DCAE-HealthCheck
|
| 40 | [Documentation] Get DCAE Overall Status
|
| 41 | ${auth}= Create List ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
|
| 42 | ${session}= Create Session dcae-health-check ${CONFIG_BINDING_URL} auth=${auth}
|
| 43 | ${resp}= Get Request dcae-health-check ${CB_HEALTHCHECK_PATH}
|
| 44 | Should Be Equal As Strings ${resp.status_code} 200
|
| 45 |
|
| 46 |
|
| 47 | Get VES Collector Service Status
|
| 48 | [Tags] DCAE-HealthCheck
|
| 49 | [Documentation] Get the status of a VES Collector Service Component based on service name
|
| 50 | ${urlpath}= Catenate SEPARATOR= ${CB_SERVICE_COMPONENT_PATH} ${VES_Service_Name1}
|
| 51 | Log Service component name for status query: ${urlpath}
|
| 52 | ${resp}= Get DCAE Service Component Status ${CONFIG_BINDING_URL} ${CB_SERVICE_COMPONENT_PATH} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
|
| 53 | Log Receive HTTP Status code ${resp.status_code}
|
| 54 | Should Be Equal As Strings ${resp.status_code} 200
|
| 55 | ${isEmpty}= Is Json Empty ${resp}
|
| 56 | Run Keyword If '${isEmpty}' == False Log ${resp.json()}
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 | #*** Comment out from R1 release ***
|
| 61 | Publish VES VoLTE Fault Provide Throttling State
|
| 62 | [Tags] DCAE-D1
|
| 63 | ${evtdata}= Get Event Data From File ${EVENT_THROTTLING_STATE_DATA_FILE}
|
| 64 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 65 | ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} ${VES_THROTTLE_STATE_EVENT_PATH} ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
|
| 66 | Should Be Equal As Strings ${resp.status_code} 204
|
| 67 |
|
| 68 | Publish VES Event With Invalid Method
|
| 69 | [Tags] DCAE-D1
|
| 70 | [Documentation] Use invalid Put instead of Post method to expect 405 response
|
| 71 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 72 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 73 | Log Send HTTP Request with invalid method Put instead of Post
|
| 74 | ${resp}= Publish Event To VES Collector With Put Method ${VES_VOLTE_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
|
| 75 | Log Receive HTTP Status code ${resp.status_code}
|
| 76 | Should Be Equal As Strings ${resp.status_code} 405
|
| 77 |
|
| 78 |
|
| 79 | Publish VES Event With Invalid URL Path
|
| 80 | [Tags] DCAE-D1
|
| 81 | [Documentation] Use invalid url path to expect 404 response
|
| 82 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 83 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 84 | Log Send HTTP Request with invalid /listener/v5/ instead of /eventlistener/v5 path
|
| 85 | ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} /listener/v5/ ${headers} ${evtdata} ${GLOBAL_DCAE_USERNAME} ${GLOBAL_DCAE_PASSWORD}
|
| 86 | Log Receive HTTP Status code ${resp.status_code}
|
| 87 | Should Be Equal As Strings ${resp.status_code} 404
|
| 88 |
|
| 89 | Publish VES Event With Invalid Login
|
| 90 | [Tags] DCAE-D1
|
| 91 | [Documentation] Use invalid user or password to expect 401 response
|
| 92 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 93 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 94 | Log Send HTTP Request with invalid User: BadUserName
|
| 95 | ${resp}= Publish Event To VES Collector ${VES_VOLTE_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} BadUserName ${GLOBAL_DCAE_PASSWORD}
|
| 96 | Log Receive HTTP Status code ${resp.status_code}
|
| 97 | Should Be Equal As Strings ${resp.status_code} 401
|
| 98 |
|
| 99 | *** Test Cases ***
|
| 100 | VES Collector Health Check
|
| 101 | [Tags] DCAE-VESC-R1
|
| 102 | [Documentation] Ves Collector Health Check
|
| 103 | ${uuid}= Generate UUID
|
| 104 | ${session}= Create Session dcae ${VESC_URL}
|
| 105 | ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
|
| 106 | ${resp}= Get Request dcae /healthcheck headers=${headers}
|
| 107 | Should Be Equal As Strings ${resp.status_code} 200
|
| 108 |
|
| 109 |
|
| 110 | Publish Single VES VoLTE Fault Event
|
| 111 | [Tags] DCAE-VESC-R1
|
| 112 | [Documentation] Post single event and expect 200 Response
|
| 113 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 114 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 115 | ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
|
| 116 | Log Receive HTTP Status code ${resp.status_code}
|
| 117 | Should Be Equal As Strings ${resp.status_code} 200
|
| 118 | ${isEmpty}= Is Json Empty ${resp}
|
| 119 | Run Keyword If '${isEmpty}' == False Log ${resp.json()}
|
| 120 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
|
| 121 | Should Be Equal As Strings ${ret} true
|
| 122 |
|
| 123 | Publish Single VES VNF Measurement Event
|
| 124 | [Tags] DCAE-VESC-R1
|
| 125 | [Documentation] Post single event and expect 200 Response
|
| 126 | ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
|
| 127 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 128 | ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
|
| 129 | Log Receive HTTP Status code ${resp.status_code}
|
| 130 | Should Be Equal As Strings ${resp.status_code} 200
|
| 131 | ${isEmpty}= Is Json Empty ${resp}
|
| 132 | Run Keyword If '${isEmpty}' == False Log ${resp.json()}
|
| 133 | ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
|
| 134 | Should Be Equal As Strings ${ret} true
|
| 135 |
|
| 136 | Publish VES VoLTE Fault Batch Events
|
| 137 | [Tags] DCAE-VESC-R1
|
| 138 | [Documentation] Post batched events and expect 202 Response
|
| 139 | ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
|
| 140 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 141 | ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata}
|
| 142 | Should Be Equal As Strings ${resp.status_code} 200
|
| 143 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
|
| 144 | Should Be Equal As Strings ${ret} true
|
| 145 |
|
| 146 |
|
| 147 | Publish Single VES VoLTE Fault Event With Bad Data
|
| 148 | [Tags] DCAE-VESC-R1
|
| 149 | [Documentation] Run with JSON Envent with missing comma to expect 400 response
|
| 150 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE_BAD}
|
| 151 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 152 | Log Send HTTP Request with invalid Json Event Data
|
| 153 | ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
|
| 154 | Log Receive HTTP Status code ${resp.status_code}
|
| 155 | Should Be Equal As Strings ${resp.status_code} 400
|
| 156 | ${isEmpty}= Is Json Empty ${resp}
|
| 157 | Run Keyword If '${isEmpty}' == False Log ${resp.json()}
|
| 158 |
|
| 159 | Publish VES Event With Invalid Method
|
| 160 | [Tags] DCAE-VESC-R1
|
| 161 | [Documentation] Use invalid Put instead of Post method to expect 405 response
|
| 162 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 163 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 164 | Log Send HTTP Request with invalid method Put instead of Post
|
| 165 | ${resp}= Publish Event To VES Collector With Put Method No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
|
| 166 | Log Receive HTTP Status code ${resp.status_code}
|
| 167 | Should Be Equal As Strings ${resp.status_code} 404
|
| 168 |
|
| 169 |
|
| 170 | Publish VES Event With Invalid URL Path
|
| 171 | [Tags] DCAE-VESC-R1
|
| 172 | [Documentation] Use invalid url path to expect 404 response
|
| 173 | ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
|
| 174 | ${headers}= Create Header From String ${HEADER_STRING}
|
| 175 | Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path
|
| 176 | ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} /listener/v5/ ${headers} ${evtdata}
|
| 177 | Log Receive HTTP Status code ${resp.status_code}
|
| 178 | Should Be Equal As Strings ${resp.status_code} 404
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
|
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|