From 125390ba301915c0829ad4c0b7eff0c935b6956c Mon Sep 17 00:00:00 2001 From: efiacor Date: Wed, 6 May 2020 01:14:00 +0100 Subject: Seperating usecase test suite dependencies # Refactoring BulkPM Dataplane test suite Signed-off-by: efiacor Change-Id: I4b2ad0dc5147e10ffc55f4ec210a29f073cd865b Issue-ID: INT-832 Signed-off-by: efiacor --- .../5G-bulkpm/resources/bulkpm_keywords.robot | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot (limited to 'tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot') diff --git a/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot new file mode 100644 index 00000000..9ef56c83 --- /dev/null +++ b/tests/usecases-5G-bulkpm/5G-bulkpm/resources/bulkpm_keywords.robot @@ -0,0 +1,39 @@ + *** Settings *** +Documentation The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields +Library RequestsLibrary +Library ../resources/xNFLibrary.py +Library ../resources/JsonValidatorLibrary.py +Library OperatingSystem +Library Collections +Library requests +Library Collections +Library String + +*** Variables *** + +*** Keywords *** + +Get Event Data From File + [Arguments] ${jsonfile} + ${data}= OperatingSystem.Get File ${jsonfile} + #Should Not Be_Equal ${data} None + [return] ${data} + +Publish Event To VES Collector + [Documentation] Send an event to VES Collector + [Arguments] ${url} ${evtpath} ${httpheaders} ${evtdata} + Log Creating session ${url} + ${session}= Create Session dcaegen2-d1 ${url} + ${resp}= Post Request dcaegen2-d1 ${evtpath} data=${evtdata} headers=${httpheaders} + #Log Received response from dcae ${resp.json()} + [return] ${resp} +PostCall + [Arguments] ${url} ${data} + ${headers}= Create Dictionary Accept=application/json Content-Type=application/json + ${resp}= Evaluate requests.post('${url}',data='${data}', headers=${headers},verify=False) requests + [Return] ${resp} + +GetCall + [Arguments] ${url} + ${resp}= Evaluate requests.get('${url}') requests + [Return] ${resp} -- cgit 1.2.3-korg