aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vnfsdk-refrepo/resources/vnfsdk_keywords.robot
blob: 11bb6015eb04d6a489a359497a6f3900cdccf28b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
*** Settings ***
Resource          ./vnfsdk_properties.robot

Library           OperatingSystem
Library           Process
Library           String
Library           Collections
Library           RequestsLibrary
Library           json

*** Keywords ***

Validate CSAR usign Post request
    [Documentation]    Perform POST Request to vnfsdk marketplace with CSAR and execution options, in order to perfvorm CSAR validation
    [Arguments]    ${csar_name}  ${execution_json}
    ${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}'
    ${response}=    String.Replace String    ${response}    \\n   ${SPACE}
    [Return]     ${response}

Get validation result using GET request
    [Documentation]    Perform GET request to vnfsdk marketplace with request id or execution id, in order to get that request/execution result
    [Arguments]    ${requestId}
    ${response}=   Run   curl -s --location --request GET '${base_url}/vtp/executions?requestId=${requestId}' --header 'Accept: application/json'
    ${response}=    String.Replace String    ${response}    \\n   ${SPACE}
    [Return]     ${response}