blob: 393359f541bb9ec91933263bdc3920a7a43ffbd3 [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
pswang212b7d92017-09-27 12:45:03 -05003Library RequestsLibrary
4Library OperatingSystem
5Library Collections
6Library DcaeLibrary
7Resource resources/dcae_keywords.robot
8Test Setup Cleanup VES Events
9Suite Setup VES Collector Suite Setup DMaaP
10Suite Teardown VES Collector Suite Shutdown DMaaP
11
pswang212b7d92017-09-27 12:45:03 -050012*** Variables ***
13${VESC_URL_HTTPS} https://%{VESC_IP}:8443
14${VESC_URL} http://%{VESC_IP}:8080
15${VES_ANY_EVENT_PATH} /eventListener/v5
16${VES_BATCH_EVENT_PATH} /eventListener/v5/eventBatch
17${VES_THROTTLE_STATE_EVENT_PATH} /eventListener/v5/clientThrottlingState
18${HEADER_STRING} content-type=application/json
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 Wagner006629d2018-04-26 14:01:28 +020024${EVENT_PNF_REGISTRATION} %{WORKSPACE}/test/csit/tests/dcaegen2/testcases/assets/json_events/ves_pnf_registration_event.json
pswang212b7d92017-09-27 12:45:03 -050025
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
pswang212b7d92017-09-27 12:45:03 -050033*** Test Cases ***
pswang212b7d92017-09-27 12:45:03 -050034VES Collector Health Check
35 [Tags] DCAE-VESC-R1
36 [Documentation] Ves Collector Health Check
37 ${uuid}= Generate UUID
38 ${session}= Create Session dcae ${VESC_URL}
39 ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
40 ${resp}= Get Request dcae /healthcheck headers=${headers}
Mariusz Wagner006629d2018-04-26 14:01:28 +020041 Should Be Equal As Strings ${resp.status_code} 200
pswang212b7d92017-09-27 12:45:03 -050042
43Publish Single VES VoLTE Fault Event
44 [Tags] DCAE-VESC-R1
45 [Documentation] Post single event and expect 200 Response
46 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
47 ${headers}= Create Header From String ${HEADER_STRING}
48 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
49 Log Receive HTTP Status code ${resp.status_code}
50 Should Be Equal As Strings ${resp.status_code} 200
51 ${isEmpty}= Is Json Empty ${resp}
52 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
53 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
54 Should Be Equal As Strings ${ret} true
55
56Publish Single VES VNF Measurement Event
57 [Tags] DCAE-VESC-R1
58 [Documentation] Post single event and expect 200 Response
59 ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
60 ${headers}= Create Header From String ${HEADER_STRING}
61 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
62 Log Receive HTTP Status code ${resp.status_code}
63 Should Be Equal As Strings ${resp.status_code} 200
64 ${isEmpty}= Is Json Empty ${resp}
65 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
66 ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
67 Should Be Equal As Strings ${ret} true
68
69Publish VES VoLTE Fault Batch Events
70 [Tags] DCAE-VESC-R1
Lusheng Jie6546d62018-03-07 23:10:13 -050071 [Documentation] Post batched events and expect 200 Response
pswang212b7d92017-09-27 12:45:03 -050072 ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
73 ${headers}= Create Header From String ${HEADER_STRING}
74 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata}
75 Should Be Equal As Strings ${resp.status_code} 200
Lusheng Jie6546d62018-03-07 23:10:13 -050076 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
77 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
Mariusz Wagner006629d2018-04-26 14:01:28 +020078 Should Be Equal As Strings ${ret} true
pswang212b7d92017-09-27 12:45:03 -050079
80Publish Single VES VoLTE Fault Event With Bad Data
81 [Tags] DCAE-VESC-R1
82 [Documentation] Run with JSON Envent with missing comma to expect 400 response
83 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE_BAD}
84 ${headers}= Create Header From String ${HEADER_STRING}
85 Log Send HTTP Request with invalid Json Event Data
86 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
87 Log Receive HTTP Status code ${resp.status_code}
88 Should Be Equal As Strings ${resp.status_code} 400
89 ${isEmpty}= Is Json Empty ${resp}
90 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
91
92Publish VES Event With Invalid Method
93 [Tags] DCAE-VESC-R1
94 [Documentation] Use invalid Put instead of Post method to expect 405 response
95 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
96 ${headers}= Create Header From String ${HEADER_STRING}
97 Log Send HTTP Request with invalid method Put instead of Post
98 ${resp}= Publish Event To VES Collector With Put Method No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
99 Log Receive HTTP Status code ${resp.status_code}
Mariusz Wagner006629d2018-04-26 14:01:28 +0200100 Should Be Equal As Strings ${resp.status_code} 404
pswang212b7d92017-09-27 12:45:03 -0500101
102Publish VES Event With Invalid URL Path
103 [Tags] DCAE-VESC-R1
104 [Documentation] Use invalid url path to expect 404 response
105 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
106 ${headers}= Create Header From String ${HEADER_STRING}
107 Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path
108 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} /listener/v5/ ${headers} ${evtdata}
109 Log Receive HTTP Status code ${resp.status_code}
Mariusz Wagner006629d2018-04-26 14:01:28 +0200110 Should Be Equal As Strings ${resp.status_code} 404
pswang212b7d92017-09-27 12:45:03 -0500111
Lusheng Jie6546d62018-03-07 23:10:13 -0500112#Enable VESC HTTPS And Basic Auth
113 #[Tags] DCAE-VESC-R1
114 #[Documentation] Enable VESC Https and Authentication, Disable Http and Run Health Check
115 #Enable VESC Https Auth
116 #
117 #${auth}= Create List ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
118 #${session}= Create Session dcaegen2-r1 ${VESC_URL_HTTPS} auth=${auth} disable_warnings=1
119 #${headers}= Create Dictionary Accept=*/* X-FromAppId=${GLOBAL_APPLICATION_ID}
120 #${resp}= Get Request dcaegen2-r1 /healthcheck headers=${headers}
121 #Should Be Equal As Strings ${resp.status_code} 200
pswang212b7d92017-09-27 12:45:03 -0500122
123Publish Single VES Fault Event Over HTTPS
124 [Tags] DCAE-VESC-R1
125 [Documentation] Post single event and expect 200 Response
126 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
127 ${headers}= Create Header From String ${HEADER_STRING}
128 Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD}
129 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} sample1 sample1
130 Log Receive HTTP Status code ${resp.status_code}
131 Should Be Equal As Strings ${resp.status_code} 200
132 ${isEmpty}= Is Json Empty ${resp}
133 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
134 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546015
Mariusz Wagner006629d2018-04-26 14:01:28 +0200135 Should Be Equal As Strings ${ret} true
pswang212b7d92017-09-27 12:45:03 -0500136
137Publish Single VES Measurement Event Over HTTPS
138 [Tags] DCAE-VESC-R1
139 [Documentation] Post single event and expect 200 Response
140 ${evtdata}= Get Event Data From File ${EVENT_MEASURE_FILE}
141 ${headers}= Create Header From String ${HEADER_STRING}
142 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
143 Log Receive HTTP Status code ${resp.status_code}
144 Should Be Equal As Strings ${resp.status_code} 200
145 ${isEmpty}= Is Json Empty ${resp}
146 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
147 ${ret}= DMaaP Message Receive 0b2b5790-3673-480a-a4bd-5a00b88e5af6
148 Should Be Equal As Strings ${ret} true
149
150Publish VES Fault Batch Events Over HTTPS
151 [Tags] DCAE-VESC-R1
152 [Documentation] Post batched events and expect 202 Response
153 ${evtdata}= Get Event Data From File ${EVENT_BATCH_DATA_FILE}
154 ${headers}= Create Header From String ${HEADER_STRING}
155 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} ${VES_BATCH_EVENT_PATH} ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
156 Should Be Equal As Strings ${resp.status_code} 200
Lusheng Jie6546d62018-03-07 23:10:13 -0500157 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
158 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
pswang212b7d92017-09-27 12:45:03 -0500159 Should Be Equal As Strings ${ret} true
160
pswang212b7d92017-09-27 12:45:03 -0500161Publish VES Event With Invalid URL Path HTTPS
162 [Tags] DCAE-VESC-R1
163 [Documentation] Use invalid url path to expect 404 response
164 ${evtdata}= Get Event Data From File ${EVENT_DATA_FILE}
165 ${headers}= Create Header From String ${HEADER_STRING}
166 Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path
167 ${resp}= Publish Event To VES Collector ${VESC_URL_HTTPS} /eventlistener/v5 ${headers} ${evtdata} ${VESC_HTTPS_USER} ${VESC_HTTPS_PD}
168 Log Receive HTTP Status code ${resp.status_code}
169 Should Be Equal As Strings ${resp.status_code} 404
170
Mariusz Wagner006629d2018-04-26 14:01:28 +0200171Publish PNF Registration Event
172 [Tags] DCAE-VESC-R1
173 [Documentation] Post PNF registration event and expect 200 Response
174 ${evtdata}= Get Event Data From File ${EVENT_PNF_REGISTRATION}
175 ${headers}= Create Header From String ${HEADER_STRING}
176 ${resp}= Publish Event To VES Collector No Auth ${VESC_URL} ${VES_ANY_EVENT_PATH} ${headers} ${evtdata}
177 Log Receive HTTP Status code ${resp.status_code}
178 Should Be Equal As Strings ${resp.status_code} 200
179 ${isEmpty}= Is Json Empty ${resp}
180 Run Keyword If '${isEmpty}' == False Log ${resp.json()}
181 ${ret}= DMaaP Message Receive QTFCOC540002E-reg
182 Should Be Equal As Strings ${ret} true
183