Publish Single VES VNF Measurement Event with Standard Defined Fields API V7
[Tags] DCAE-VESC-R1
[Documentation] Post single event with valid data with Standard Defined Fields to /eventListener/v7 endpoint and expect 202 Response Status Code
- Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost
+ Send Request And Validate Response Publish Event To VES Collector ${http_session} ${VES_EVENTLISTENER_V7} ${VES_VALID_JSON_V7_STND_DEF_FIELDS} 202 stndDefined-gNB-Nokia-PowerLost unauthenticated.SEC_OTHER_OUTPUT
Publish Single VES VNF Measurement Event with wrong JSON
[Tags] DCAE-VESC-R1
'''
if resp_code == 0:
+ topic = self.extract_topic_from_path()
content_len = int(self.headers.getheader('content-length', 0))
post_body = self.rfile.read(content_len)
indx = post_body.index("{")
if indx != 0:
post_body = post_body[indx:]
-
- if not enque_event(post_body):
+
+ event = "\""+topic+"\":" + post_body
+ if not enque_event(event):
print "enque event fails"
global EvtSchema
'''
return
+ def extract_topic_from_path(self):
+ return self.path["/events/".__len__():]
+
def do_GET(self):
"""Serve a GET request."""
f = self.send_head()
time.sleep(5)
return
+ @staticmethod
+ def dmaap_message_receive_on_topic(evtobj, topic):
+
+ evt_str = DMaaP.deque_event()
+ while evt_str != None:
+ if evtobj in evt_str and topic in evt_str:
+ logger.info("DMaaP Receive Expected Publish Event:\n" + evt_str)
+ logger.info("On Expected Topic:\n" + topic)
+ return 'true'
+ evt_str = DMaaP.deque_event()
+ return 'false'
+
@staticmethod
def dmaap_message_receive(evtobj, action='contain'):
Send Request And Validate Response
[Documentation] Post singel event to passed url with passed data and validate received response
- [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None
+ [Arguments] ${keyword} ${session} ${evtpath} ${evtjson} ${resp_code} ${msg_code}=None ${topic}=None
${evtdata}= Get Data From File ${evtjson}
${resp}= Run Keyword ${keyword} ${session} ${evtpath} ${evtdata}
Log Receive HTTPS Status code ${resp.status_code}
Should Be Equal As Strings ${resp.status_code} ${resp_code}
${isEmpty}= Is Json Empty ${resp}
Run Keyword If '${isEmpty}' == False Log ${resp.json()}
- Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code}
+ Run Keyword If '${msg_code}' != 'None' Check Whether Message Received ${msg_code} ${topic}
Check Whether Message Received
[Documentation] Validare if message has been received
- [Arguments] ${msg_code}
- ${ret}= DMaaP Message Receive ${msg_code}
+ [Arguments] ${msg_code} ${topic}
+ ${ret}= Run Keyword If '${topic}' != 'None' DMaaP Message Receive On Topic ${msg_code} ${topic}
+ ... ELSE DMaaP Message Receive ${msg_code}
Should Be Equal As Strings ${ret} true
Send Request And Expect Error