diff options
author | 2018-09-07 15:23:18 +0100 | |
---|---|---|
committer | 2018-09-12 11:27:20 +0100 | |
commit | 6823ae7e627761d0a3eb1a0c4dde30043d25c865 (patch) | |
tree | 370d613765bbc0ede9d6c523a0aa8a4bb1948aae /test/csit/tests/dcae-bulkpm/testcases/resources | |
parent | dc0afcbbd39a144f0d7c57760b219576049fc67c (diff) |
Integration Test Cases for 5G Bulk PM
Change-Id: Ibec3e9726354b8f3818084b03f61c0e9aed09df2
Issue-ID: INT-649
Signed-off-by: Rajendra Jaiswal <rajendra.jaiswal@ericsson.com>
Diffstat (limited to 'test/csit/tests/dcae-bulkpm/testcases/resources')
-rw-r--r-- | test/csit/tests/dcae-bulkpm/testcases/resources/VesLibrary.py | 25 | ||||
-rw-r--r-- | test/csit/tests/dcae-bulkpm/testcases/resources/ves_keywords.robot | 39 |
2 files changed, 64 insertions, 0 deletions
diff --git a/test/csit/tests/dcae-bulkpm/testcases/resources/VesLibrary.py b/test/csit/tests/dcae-bulkpm/testcases/resources/VesLibrary.py new file mode 100644 index 000000000..d1ec9811d --- /dev/null +++ b/test/csit/tests/dcae-bulkpm/testcases/resources/VesLibrary.py @@ -0,0 +1,25 @@ +''' +Created on Aug 18, 2017 + +@author: sw6830 +''' +from robot.api import logger +from Queue import Queue +import uuid, time, json, threading,os, platform, subprocess,paramiko + +class VesLibrary(object): + + def __init__(self): + pass + + def create_header_from_string(self, dictStr): + logger.info("Enter create_header_from_string: dictStr") + return dict(u.split("=") for u in dictStr.split(",")) + + def Generate_UUID(self): + """generate a uuid""" + return uuid.uuid4() + +if __name__ == '__main__': + lib = VesLibrary() + time.sleep(100000)
\ No newline at end of file diff --git a/test/csit/tests/dcae-bulkpm/testcases/resources/ves_keywords.robot b/test/csit/tests/dcae-bulkpm/testcases/resources/ves_keywords.robot new file mode 100644 index 000000000..76bc33f47 --- /dev/null +++ b/test/csit/tests/dcae-bulkpm/testcases/resources/ves_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/VesLibrary.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} +
\ No newline at end of file |