blob: 47ce5f14dc7d50fd47eee992e47bf01a4120240a [file] [log] [blame]
pswang212b7d92017-09-27 12:45:03 -05001*** Settings ***
2Documentation Testing DCAE VES Listener with various event feeds from VoLTE, vDNS, vFW and cCPE use scenarios
3
4Library RequestsLibrary
5Library OperatingSystem
6Library Collections
7Library DcaeLibrary
8Resource resources/dcae_keywords.robot
9Test Setup Cleanup VES Events
10Suite Setup VES Collector Suite Setup DMaaP
11Suite 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
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
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
38*** Test Cases ***
39
40VES Collector Health Check
41 [Tags] DCAE-VESC-R1
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
48
49
50Publish Single VES VoLTE Fault Event
51 [Tags] DCAE-VESC-R1
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
62
63Publish Single VES VNF Measurement Event
64 [Tags] DCAE-VESC-R1
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
75
76Publish VES VoLTE Fault Batch Events
77 [Tags] DCAE-VESC-R1
Lusheng Jie6546d62018-03-07 23:10:13 -050078 [Documentation] Post batched events and expect 200 Response
pswang212b7d92017-09-27 12:45:03 -050079 ${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
Lusheng Jie6546d62018-03-07 23:10:13 -050083 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
84 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
pswang212b7d92017-09-27 12:45:03 -050085 Should Be Equal As Strings ${ret} true
86
87
88Publish Single VES VoLTE Fault Event With Bad Data
89 [Tags] DCAE-VESC-R1
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()}
99
100Publish VES Event With Invalid Method
101 [Tags] DCAE-VESC-R1
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
109
110
111Publish VES Event With Invalid URL Path
112 [Tags] DCAE-VESC-R1
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
120
121
Lusheng Jie6546d62018-03-07 23:10:13 -0500122#Enable VESC HTTPS And Basic Auth
123 #[Tags] DCAE-VESC-R1
124 #[Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check
125 #Enable VESC Https Auth
126 #
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
pswang212b7d92017-09-27 12:45:03 -0500132
133Publish Single VES Fault Event Over HTTPS
134 [Tags] DCAE-VESC-R1
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
146
147
148Publish Single VES Measurement Event Over HTTPS
149 [Tags] DCAE-VESC-R1
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
160
161Publish VES Fault Batch Events Over HTTPS
162 [Tags] DCAE-VESC-R1
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
Lusheng Jie6546d62018-03-07 23:10:13 -0500168 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
169 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
pswang212b7d92017-09-27 12:45:03 -0500170 Should Be Equal As Strings ${ret} true
171
172
173Publish VES Event With Invalid URL Path HTTPS
174 [Tags] DCAE-VESC-R1
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201