Add test for csar validation get result using execution id.
[integration/csit.git] / tests / vnfsdk-refrepo / resources / vnfsdk_keywords.robot
1 *** Settings ***
2 Resource          ./vnfsdk_properties.robot
3
4 Library           OperatingSystem
5 Library           Process
6 Library           String
7 Library           Collections
8 Library           RequestsLibrary
9 Library           json
10
11 *** Keywords ***
12
13 Validate CSAR usign Post request
14     [Documentation]    Perform POST Request to vnfsdk marketplace with CSAR and execution options, in order to perfvorm CSAR validation
15     [Arguments]    ${csar_name}  ${execution_json}
16     ${response}=   Run   curl -s --location --request POST '${base_url}/vtp/executions' --header 'Content-Type: multipart/form-data' --header 'Accept: application/json' --form 'file=@${csarpath}/${csar_name}' --form 'executions=${execution_json}'
17     ${response}=    String.Replace String    ${response}    \\n   ${SPACE}
18     [Return]     ${response}
19
20 Get validation result using GET request
21     [Documentation]    Perform GET request to vnfsdk marketplace with request id or execution id, in order to get that request/execution result
22     [Arguments]    ${requestId}
23     ${response}=   Run   curl -s --location --request GET '${base_url}/vtp/executions?requestId=${requestId}' --header 'Accept: application/json'
24     ${response}=    String.Replace String    ${response}    \\n   ${SPACE}
25     [Return]     ${response}