blob: daed35fa82da1179da814217e88dc578de59669a [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
Mariusz Wagner831baff2018-09-14 14:24:02 +02008Resource ../../common.robot
pswang212b7d92017-09-27 12:45:03 -05009Test Setup Cleanup VES Events
Mariusz Wagner831baff2018-09-14 14:24:02 +020010Suite Setup Run keywords VES Collector Suite Setup DMaaP Create sessions Create header
pswang212b7d92017-09-27 12:45:03 -050011Suite Teardown VES Collector Suite Shutdown DMaaP
12
pswang212b7d92017-09-27 12:45:03 -050013*** 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
pswang212b7d92017-09-27 12:45:03 -050019${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 Wagner831baff2018-09-14 14:24:02 +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
Mariusz Wagner831baff2018-09-14 14:24:02 +020033*** 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
pswang212b7d92017-09-27 12:45:03 -050038 ${headers}= Create Dictionary Accept=*/* X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID}
Mariusz Wagner831baff2018-09-14 14:24:02 +020039 ${resp}= Get Request ${suite_dcae_vesc_url_session} /healthcheck headers=${headers}
Mariusz Wagner006629d2018-04-26 14:01:28 +020040 Should Be Equal As Strings ${resp.status_code} 200
pswang212b7d92017-09-27 12:45:03 -050041
42Publish Single VES VoLTE Fault Event
43 [Tags] DCAE-VESC-R1
44 [Documentation] Post single event and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +020045 ${evtdata}= Get Data From File ${EVENT_DATA_FILE}
46 ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -050047 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
54Publish Single VES VNF Measurement Event
55 [Tags] DCAE-VESC-R1
56 [Documentation] Post single event and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +020057 ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE}
58 ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -050059 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
66Publish VES VoLTE Fault Batch Events
67 [Tags] DCAE-VESC-R1
Lusheng Jie6546d62018-03-07 23:10:13 -050068 [Documentation] Post batched events and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +020069 ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE}
70 ${resp}= Publish Event To VES Collector No Auth ${VES_BATCH_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -050071 Should Be Equal As Strings ${resp.status_code} 200
Lusheng Jie6546d62018-03-07 23:10:13 -050072 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
73 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
Mariusz Wagner006629d2018-04-26 14:01:28 +020074 Should Be Equal As Strings ${ret} true
pswang212b7d92017-09-27 12:45:03 -050075
76Publish 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 Wagner831baff2018-09-14 14:24:02 +020079 ${evtdata}= Get Data From File ${EVENT_DATA_FILE_BAD}
pswang212b7d92017-09-27 12:45:03 -050080 Log Send HTTP Request with invalid Json Event Data
Mariusz Wagner831baff2018-09-14 14:24:02 +020081 ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -050082 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
87Publish VES Event With Invalid Method
88 [Tags] DCAE-VESC-R1
89 [Documentation] Use invalid Put instead of Post method to expect 405 response
Mariusz Wagner831baff2018-09-14 14:24:02 +020090 ${evtdata}= Get Data From File ${EVENT_DATA_FILE}
pswang212b7d92017-09-27 12:45:03 -050091 Log Send HTTP Request with invalid method Put instead of Post
Mariusz Wagner831baff2018-09-14 14:24:02 +020092 ${resp}= Publish Event To VES Collector With Put Method No Auth ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -050093 Log Receive HTTP Status code ${resp.status_code}
Mariusz Wagner006629d2018-04-26 14:01:28 +020094 Should Be Equal As Strings ${resp.status_code} 404
pswang212b7d92017-09-27 12:45:03 -050095
96Publish VES Event With Invalid URL Path
97 [Tags] DCAE-VESC-R1
98 [Documentation] Use invalid url path to expect 404 response
Mariusz Wagner831baff2018-09-14 14:24:02 +020099 ${evtdata}= Get Data From File ${EVENT_DATA_FILE}
pswang212b7d92017-09-27 12:45:03 -0500100 Log Send HTTP Request with invalid /listener/v5/ instead of /eventListener/v5 path
Mariusz Wagner831baff2018-09-14 14:24:02 +0200101 ${resp}= Publish Event To VES Collector No Auth /listener/v5/ ${evtdata}
pswang212b7d92017-09-27 12:45:03 -0500102 Log Receive HTTP Status code ${resp.status_code}
Mariusz Wagner006629d2018-04-26 14:01:28 +0200103 Should Be Equal As Strings ${resp.status_code} 404
pswang212b7d92017-09-27 12:45:03 -0500104
Lusheng Jie6546d62018-03-07 23:10:13 -0500105#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
pswang212b7d92017-09-27 12:45:03 -0500115
116Publish Single VES Fault Event Over HTTPS
117 [Tags] DCAE-VESC-R1
118 [Documentation] Post single event and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +0200119 ${evtdata}= Get Data From File ${EVENT_DATA_FILE}
pswang212b7d92017-09-27 12:45:03 -0500120 Log Login User=${VESC_HTTPS_USER}, Pd=${VESC_HTTPS_PD}
Mariusz Wagner831baff2018-09-14 14:24:02 +0200121 ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -0500122 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 Wagner006629d2018-04-26 14:01:28 +0200127 Should Be Equal As Strings ${ret} true
pswang212b7d92017-09-27 12:45:03 -0500128
129Publish Single VES Measurement Event Over HTTPS
130 [Tags] DCAE-VESC-R1
131 [Documentation] Post single event and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +0200132 ${evtdata}= Get Data From File ${EVENT_MEASURE_FILE}
133 ${resp}= Publish Event To VES Collector ${VES_ANY_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -0500134 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
141Publish VES Fault Batch Events Over HTTPS
142 [Tags] DCAE-VESC-R1
143 [Documentation] Post batched events and expect 202 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +0200144 ${evtdata}= Get Data From File ${EVENT_BATCH_DATA_FILE}
145 ${resp}= Publish Event To VES Collector ${VES_BATCH_EVENT_PATH} ${evtdata}
pswang212b7d92017-09-27 12:45:03 -0500146 Should Be Equal As Strings ${resp.status_code} 200
Lusheng Jie6546d62018-03-07 23:10:13 -0500147 #${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546016
148 ${ret}= DMaaP Message Receive ab305d54-85b4-a31b-7db2-fb6b9e546025
pswang212b7d92017-09-27 12:45:03 -0500149 Should Be Equal As Strings ${ret} true
150
pswang212b7d92017-09-27 12:45:03 -0500151Publish VES Event With Invalid URL Path HTTPS
152 [Tags] DCAE-VESC-R1
153 [Documentation] Use invalid url path to expect 404 response
Mariusz Wagner831baff2018-09-14 14:24:02 +0200154 ${evtdata}= Get Data From File ${EVENT_DATA_FILE}
pswang212b7d92017-09-27 12:45:03 -0500155 Log Send HTTP Request with invalid /eventlistener/v5/ instead of /eventListener/v5 path
Mariusz Wagner831baff2018-09-14 14:24:02 +0200156 ${resp}= Publish Event To VES Collector /eventlistener/v5 ${evtdata}
pswang212b7d92017-09-27 12:45:03 -0500157 Log Receive HTTP Status code ${resp.status_code}
158 Should Be Equal As Strings ${resp.status_code} 404
159
Mariusz Wagner006629d2018-04-26 14:01:28 +0200160Publish PNF Registration Event
161 [Tags] DCAE-VESC-R1
162 [Documentation] Post PNF registration event and expect 200 Response
Mariusz Wagner831baff2018-09-14 14:24:02 +0200163 ${evtdata}= Get Data From File ${EVENT_PNF_REGISTRATION}
164 ${resp}= Publish Event To VES Collector No Auth ${VES_ANY_EVENT_PATH} ${evtdata}
Mariusz Wagner006629d2018-04-26 14:01:28 +0200165 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