pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 3 | Library RequestsLibrary |
| 4 | Library OperatingSystem |
| 5 | Library Collections |
| 6 | Library DcaeLibrary |
| 7 | Resource resources/dcae_keywords.robot |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 8 | Resource ../../common.robot |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 9 | Test Setup Cleanup VES Events |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 10 | Suite Setup Run keywords VES Collector Suite Setup DMaaP Create sessions Create header |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 11 | Suite Teardown VES Collector Suite Shutdown DMaaP |
| 12 | |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 13 | *** Variables *** |
| 14 | ${VESC_URL_HTTPS} https://%{VESC_IP}:8443 |
| 15 | ${VESC_URL} http://%{VESC_IP}:8080 |
| 16 | ${VES_ANY_EVENT_PATH} /eventListener/v5 |
| 17 | ${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch |
| 18 | ${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 19 | ${EVENT_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event.json |
| 20 | ${EVENT_MEASURE_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_vfirewall_measurement.json |
| 21 | ${EVENT_DATA_FILE_BAD} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_single_fault_event_bad.json |
| 22 | ${EVENT_BATCH_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_eventlist_batch.json |
| 23 | ${EVENT_THROTTLING_STATE_DATA_FILE} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_volte_fault_provide_throttle_state.json |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 24 | ${EVENT_PNF_REGISTRATION} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 25 | |
| 26 | #DCAE Health Check |
| 27 | ${CONFIG_BINDING_URL} http://localhost:8443 |
| 28 | ${CB_HEALTHCHECK_PATH} /healthcheck |
| 29 | ${CB_SERVICE_COMPONENT_PATH} /service_component/ |
| 30 | ${VES_Service_Name1} dcae-controller-ves-collector |
| 31 | ${VES_Service_Name2} ves-collector-not-exist |
| 32 | |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 33 | *** Test Cases *** |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 34 | VES Collector Health Check |
| 35 | [Tags] DCAE-VESC-R1 |
| 36 | [Documentation] Ves Collector Health Check |
| 37 | ${uuid}= Generate UUID |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 38 | ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 39 | ${resp}= Get Request ${suite_dcae_vesc_url_session} /healthcheck headers=${headers} |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 40 | Should Be Equal As Strings ${resp.status_code} 200 |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 41 | |
| 42 | Publish Single VES VoLTE Fault Event |
| 43 | [Tags] DCAE-VESC-R1 |
| 44 | [Documentation] Post single event and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 45 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE} |
| 46 | ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 47 | Log Receive HTTP Status code ${resp.status_code} |
| 48 | Should Be Equal As Strings ${resp.status_code} 200 |
| 49 | ${isEmpty}= Is Json Empty ${resp} |
| 50 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 51 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 |
| 52 | Should Be Equal As Strings ${ret} true |
| 53 | |
| 54 | Publish Single VES VNF Measurement Event |
| 55 | [Tags] DCAE-VESC-R1 |
| 56 | [Documentation] Post single event and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 57 | ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE} |
| 58 | ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 59 | Log Receive HTTP Status code ${resp.status_code} |
| 60 | Should Be Equal As Strings ${resp.status_code} 200 |
| 61 | ${isEmpty}= Is Json Empty ${resp} |
| 62 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 63 | ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 |
| 64 | Should Be Equal As Strings ${ret} true |
| 65 | |
| 66 | Publish VES VoLTE Fault Batch Events |
| 67 | [Tags] DCAE-VESC-R1 |
Lusheng Ji | e6546d6 | 2018-03-07 23:10:13 -0500 | [diff] [blame] | 68 | [Documentation] Post batched events and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 69 | ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE} |
| 70 | ${resp}= Publish Event To VES Collector No Auth ${VES_BATCH_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 71 | Should Be Equal As Strings ${resp.status_code} 200 |
Lusheng Ji | e6546d6 | 2018-03-07 23:10:13 -0500 | [diff] [blame] | 72 | #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 |
| 73 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025 |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 74 | Should Be Equal As Strings ${ret} true |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 75 | |
| 76 | Publish Single VES VoLTE Fault Event With Bad Data |
| 77 | [Tags] DCAE-VESC-R1 |
| 78 | [Documentation] Run with JSON Envent with missing comma to expect 400 response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 79 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE_BAD} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 80 | Log Send HTTP Request with invalid Json Event Data |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 81 | ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 82 | Log Receive HTTP Status code ${resp.status_code} |
| 83 | Should Be Equal As Strings ${resp.status_code} 400 |
| 84 | ${isEmpty}= Is Json Empty ${resp} |
| 85 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 86 | |
| 87 | Publish VES Event With Invalid Method |
| 88 | [Tags] DCAE-VESC-R1 |
| 89 | [Documentation] Use invalid Put instead of Post method to expect 405 response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 90 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 91 | Log Send HTTP Request with invalid method Put instead of Post |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 92 | ${resp}= Publish Event To VES Collector With Put Method No Auth ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 93 | Log Receive HTTP Status code ${resp.status_code} |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 94 | Should Be Equal As Strings ${resp.status_code} 404 |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 95 | |
| 96 | Publish VES Event With Invalid URL Path |
| 97 | [Tags] DCAE-VESC-R1 |
| 98 | [Documentation] Use invalid url path to expect 404 response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 99 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 100 | Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 101 | ${resp}= Publish Event To VES Collector No Auth /listener/v5/ ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 102 | Log Receive HTTP Status code ${resp.status_code} |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 103 | Should Be Equal As Strings ${resp.status_code} 404 |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 104 | |
Lusheng Ji | e6546d6 | 2018-03-07 23:10:13 -0500 | [diff] [blame] | 105 | #Enable VESC HTTPS And Basic Auth |
| 106 | #[Tags] DCAE-VESC-R1 |
| 107 | #[Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check |
| 108 | #Enable VESC Https Auth |
| 109 | # |
| 110 | #${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD} |
| 111 | #${session}= Create Session dcaegen2-r1 ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1 |
| 112 | #${headers}= Create Dictionary Accept=*/* X-FromAppId=${GLOBAL_APPLICATION_ID} |
| 113 | #${resp}= Get Request dcaegen2-r1 /healthcheck headers=${headers} |
| 114 | #Should Be Equal As Strings ${resp.status_code} 200 |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 115 | |
| 116 | Publish Single VES Fault Event Over HTTPS |
| 117 | [Tags] DCAE-VESC-R1 |
| 118 | [Documentation] Post single event and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 119 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 120 | Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD} |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 121 | ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 122 | Log Receive HTTP Status code ${resp.status_code} |
| 123 | Should Be Equal As Strings ${resp.status_code} 200 |
| 124 | ${isEmpty}= Is Json Empty ${resp} |
| 125 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 126 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015 |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 127 | Should Be Equal As Strings ${ret} true |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 128 | |
| 129 | Publish Single VES Measurement Event Over HTTPS |
| 130 | [Tags] DCAE-VESC-R1 |
| 131 | [Documentation] Post single event and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 132 | ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE} |
| 133 | ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 134 | Log Receive HTTP Status code ${resp.status_code} |
| 135 | Should Be Equal As Strings ${resp.status_code} 200 |
| 136 | ${isEmpty}= Is Json Empty ${resp} |
| 137 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 138 | ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6 |
| 139 | Should Be Equal As Strings ${ret} true |
| 140 | |
| 141 | Publish VES Fault Batch Events Over HTTPS |
| 142 | [Tags] DCAE-VESC-R1 |
| 143 | [Documentation] Post batched events and expect 202 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 144 | ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE} |
| 145 | ${resp}= Publish Event To VES Collector ${VES_BATCH_EVENT_PATH} ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 146 | Should Be Equal As Strings ${resp.status_code} 200 |
Lusheng Ji | e6546d6 | 2018-03-07 23:10:13 -0500 | [diff] [blame] | 147 | #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016 |
| 148 | ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025 |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 149 | Should Be Equal As Strings ${ret} true |
| 150 | |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 151 | Publish VES Event With Invalid URL Path HTTPS |
| 152 | [Tags] DCAE-VESC-R1 |
| 153 | [Documentation] Use invalid url path to expect 404 response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 154 | ${evtdata}= Get Data From File ${EVENT_DATA_FILE} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 155 | Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 156 | ${resp}= Publish Event To VES Collector /eventlistener/v5 ${evtdata} |
pswang | 212b7d9 | 2017-09-27 12:45:03 -0500 | [diff] [blame] | 157 | Log Receive HTTP Status code ${resp.status_code} |
| 158 | Should Be Equal As Strings ${resp.status_code} 404 |
| 159 | |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 160 | Publish PNF Registration Event |
| 161 | [Tags] DCAE-VESC-R1 |
| 162 | [Documentation] Post PNF registration event and expect 200 Response |
Mariusz Wagner | 831baff | 2018-09-14 14:24:02 +0200 | [diff] [blame^] | 163 | ${evtdata}= Get Data From File ${EVENT_PNF_REGISTRATION} |
| 164 | ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata} |
Mariusz Wagner | 006629d | 2018-04-26 14:01:28 +0200 | [diff] [blame] | 165 | Log Receive HTTP Status code ${resp.status_code} |
| 166 | Should Be Equal As Strings ${resp.status_code} 200 |
| 167 | ${isEmpty}= Is Json Empty ${resp} |
| 168 | Run Keyword If '${isEmpty}' == False Log ${resp.json()} |
| 169 | ${ret}= DMaaP Message Receive QTFCOC540002E-reg |
| 170 | Should Be Equal As Strings ${ret} true |
| 171 | |