aboutsummaryrefslogtreecommitdiffstats
path: root/test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot
blob: b06d5b544d2fd000e7ed7de54b7c11a2dd47d49c (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
*** settings ***
Library           OperatingSystem
Library           Process
Library           String
Library           Collections
Library           RequestsLibrary
Library           json


*** Variables ***
${csarpath}   ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/enterprise2DC.csar
${csarId}  0

*** Test Cases ***

Upload VNF Package to VNF Repository
    [Documentation]    Upload the VNF Package
    ${resp}=   Run    curl -s -X POST -H "Content-Type: multipart/form-data" -F "file=@${csarpath}" http://${REPO_IP}:8702/openoapi/vnfsdk-marketplace/v1/PackageResource/csars
    Should Contain    ${resp}    csarId
    ${csarjson}=    Evaluate    ${resp}
    ${csarId}=    Set Variable    ${csarjson["csarId"]}
    Set Global Variable    ${csarId}

Get VNF Package Information from Repository
    Create Session   refrepo  http://${REPO_IP}:8702
    &{headers}=  Create Dictionary      Content-Type=application/json
    ${resp}=    Get Request    refrepo   /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId}   headers=${headers}
    Should Be Equal As Strings  ${resp.status_code}     200

Download VNF Package from Repository
    Create Session   refrepo  http://${REPO_IP}:8702
    &{headers}=  Create Dictionary      Content-Type=application/json
    ${resp}=    Get Request    refrepo   /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId}/files   headers=${headers}
    Should Be Equal As Strings  ${resp.status_code}     200

Delete VNF Package from Repository
    Create Session   refrepo  http://${REPO_IP}:8702
    &{headers}=  Create Dictionary      Content-Type=application/json
    ${resp}=    Delete Request    refrepo    /openoapi/vnfsdk-marketplace/v1/PackageResource/csars/${csarId}   headers=${headers}
    Should Be Equal As Strings  ${resp.status_code}     200