Fix Cert-service tests
[integration/csit.git] / tests / usecases-5G-bulkpm / 5G-bulkpm / resources / bulkpm_keywords.robot
1  *** Settings ***
2 Documentation     The main interface for interacting with VES. It handles low level stuff like managing the http request library and VES required fields
3 Library               RequestsLibrary
4 Library           ../resources/xNFLibrary.py
5 Library           ../resources/JsonValidatorLibrary.py
6 Library           OperatingSystem
7 Library           Collections
8 Library           requests
9 Library           Collections
10 Library           String
11
12 *** Variables ***
13
14 *** Keywords ***
15
16 Get Event Data From File
17     [Arguments]    ${jsonfile}
18     ${data}=    OperatingSystem.Get File    ${jsonfile}
19     #Should Not Be_Equal    ${data}    None
20     [return]    ${data}
21
22 Publish Event To VES Collector
23     [Documentation]    Send an event to VES Collector
24     [Arguments]     ${url}  ${evtpath}   ${httpheaders}    ${evtdata}
25     Log    Creating session ${url}
26     ${session}=    Create Session       dcaegen2-d1     ${url}
27     ${resp}=    Post Request    dcaegen2-d1     ${evtpath}     data=${evtdata}   headers=${httpheaders}
28     #Log    Received response from dcae ${resp.json()}
29     [return]    ${resp}
30 PostCall
31     [Arguments]    ${url}               ${data}
32     ${headers}=    Create Dictionary    Accept=application/json    Content-Type=application/json
33     ${resp}=       Evaluate    requests.post('${url}',data='${data}', headers=${headers},verify=False)    requests
34     [Return]       ${resp}
35
36 GetCall
37     [Arguments]     ${url}
38     ${resp}=            Evaluate    requests.get('${url}')    requests
39     [Return]            ${resp}