2 Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios
4 Library RequestsLibrary
5 Library OperatingSystem
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
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
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
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
40 VES Collector Health Check
42 [Documentation] Ves Collector Health Check
43 ${uuid}= Generate UUID
44 ${session}= Create Session dcae ${VESC_URL}
45 ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
46 ${resp}= Get Request dcae /healthcheck headers=${headers}
47 Should Be Equal As Strings ${resp.status_code} 200
50 Publish Single VES VoLTE Fault Event
52 [Documentation] Post single event and expect 200 Response
53 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
54 ${headers}= Create Header From String ${HEADER_STRING}
55 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
56 Log Receive HTTP Status code ${resp.status_code}
57 Should Be Equal As Strings ${resp.status_code} 200
58 ${isEmpty}= Is Json Empty ${resp}
59 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
60 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
61 Should Be Equal As Strings ${ret} true
63 Publish Single VES VNF Measurement Event
65 [Documentation] Post single event and expect 200 Response
66 ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
67 ${headers}= Create Header From String ${HEADER_STRING}
68 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
69 Log Receive HTTP Status code ${resp.status_code}
70 Should Be Equal As Strings ${resp.status_code} 200
71 ${isEmpty}= Is Json Empty ${resp}
72 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
73 ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
74 Should Be Equal As Strings ${ret} true
76 Publish VES VoLTE Fault Batch Events
78 [Documentation] Post batched events and expect 200 Response
79 ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
80 ${headers}= Create Header From String ${HEADER_STRING}
81 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata}
82 Should Be Equal As Strings ${resp.status_code} 200
83 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
84 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
85 Should Be Equal As Strings ${ret} true
88 Publish Single VES VoLTE Fault Event With Bad Data
90 [Documentation] Run with JSON Envent with missing comma to expect 400 response
91 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE_BAD}
92 ${headers}= Create Header From String ${HEADER_STRING}
93 Log Send HTTP Request with invalid Json Event Data
94 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
95 Log Receive HTTP Status code ${resp.status_code}
96 Should Be Equal As Strings ${resp.status_code} 400
97 ${isEmpty}= Is Json Empty ${resp}
98 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
100 Publish VES Event With Invalid Method
102 [Documentation] Use invalid Put instead of Post method to expect 405 response
103 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
104 ${headers}= Create Header From String ${HEADER_STRING}
105 Log Send HTTP Request with invalid method Put instead of Post
106 ${resp}= Publish Event To VES Collector With Put Method No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
107 Log Receive HTTP Status code ${resp.status_code}
108 Should Be Equal As Strings ${resp.status_code} 404
111 Publish VES Event With Invalid URL Path
113 [Documentation] Use invalid url path to expect 404 response
114 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
115 ${headers}= Create Header From String ${HEADER_STRING}
116 Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path
117 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} /listener/v5/ ${headers} ${evtdata}
118 Log Receive HTTP Status code ${resp.status_code}
119 Should Be Equal As Strings ${resp.status_code} 404
122 #Enable VESC HTTPS And Basic Auth
124 #[Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check
125 #Enable VESC Https Auth
127 #${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
128 #${session}= Create Session dcaegen2-r1 ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1
129 #${headers}= Create Dictionary Accept=*/* X-FromAppId=${GLOBAL_APPLICATION_ID}
130 #${resp}= Get Request dcaegen2-r1 /healthcheck headers=${headers}
131 #Should Be Equal As Strings ${resp.status_code} 200
133 Publish Single VES Fault Event Over HTTPS
135 [Documentation] Post single event and expect 200 Response
136 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
137 ${headers}= Create Header From String ${HEADER_STRING}
138 Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD}
139 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} sample1 sample1
140 Log Receive HTTP Status code ${resp.status_code}
141 Should Be Equal As Strings ${resp.status_code} 200
142 ${isEmpty}= Is Json Empty ${resp}
143 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
144 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
145 Should Be Equal As Strings ${ret} true
148 Publish Single VES Measurement Event Over HTTPS
150 [Documentation] Post single event and expect 200 Response
151 ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
152 ${headers}= Create Header From String ${HEADER_STRING}
153 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
154 Log Receive HTTP Status code ${resp.status_code}
155 Should Be Equal As Strings ${resp.status_code} 200
156 ${isEmpty}= Is Json Empty ${resp}
157 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
158 ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
159 Should Be Equal As Strings ${ret} true
161 Publish VES Fault Batch Events Over HTTPS
163 [Documentation] Post batched events and expect 202 Response
164 ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
165 ${headers}= Create Header From String ${HEADER_STRING}
166 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
167 Should Be Equal As Strings ${resp.status_code} 200
168 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
169 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
170 Should Be Equal As Strings ${ret} true
173 Publish VES Event With Invalid URL Path HTTPS
175 [Documentation] Use invalid url path to expect 404 response
176 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
177 ${headers}= Create Header From String ${HEADER_STRING}
178 Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path
179 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} /eventlistener/v5 ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
180 Log Receive HTTP Status code ${resp.status_code}
181 Should Be Equal As Strings ${resp.status_code} 404