VNFDInIndividualVNFPackage.robot 6.09 KB
Newer Older
1
2
*** Settings ***
Library           JSONSchemaLibrary    schemas/
3
Resource          environment/variables.txt    # Generic Parameters
4
Resource          environment/vnfdInIndividualVnfPackage.txt
5
Library           JSONLibrary
6
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
7
8

*** Test Cases ***
9
GET VNFD in Individual VNF Package (PLAIN)
10
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
11
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
Elian Kraja's avatar
Elian Kraja committed
12
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
13
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd
14
15
16
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_PLAIN}
17

18
GET VNFD in Individual VNF Package (ZIP)
19
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
20
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
21
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
22
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
23
24
25
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_ZIP}
26

27
GET VNFD in Individual VNF Package (PLAIN-ZIP)
28
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
29
30
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
31
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
32
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
33
34
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
35
    Should Contain    ${contentType}    ${CONTENT_TYPE_ZIP}
36
37
38

GET VNFD in Individual VNF Package - Negative (PLAIN/ZIP)
    Log    Trying to get a negative case performing a get on a VNFD from a given VNF Package present in the NFVO Catalogue. Accept will be text/plain but VNFD is composed my multiple files.
39
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
Elian Kraja's avatar
Elian Kraja committed
40
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
41
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
42
43
44
    Integer    response status    406
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
45
    Log    Trying to validate ProblemDetails
46
    ${problemDetails}=    Output    response body
Elian Kraja's avatar
Elian Kraja committed
47
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
48
49
    Log    Validation OK

50
GET VNFD in Individual VNF Package - Negative (Not Found)
51
    Log    Trying to perform a negative get, using an erroneous package ID
52
53
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
54
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
55
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/vnfd
56
    Integer    response status    404
57
    Log    Received 404 Not Found as expected
58
59
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
60
    Log    Trying to validate ProblemDetails
61
    ${problemDetails}=    Output    response body
Elian Kraja's avatar
Elian Kraja committed
62
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
63
64
65
66
    Log    Validation OK

GET VNFD in Individual VNF Package - Negative (onboardingState issue)
    Log    Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue
67
68
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
69
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
70
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/vnfd
71
    Integer    response status    409
72
    Log    Received 409 Conflict as expected
73
74
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
75
    Log    Trying to validate ProblemDetails
76
    ${problemDetails}=    Output    response body
Elian Kraja's avatar
Elian Kraja committed
77
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
78
79
    Log    Validation OK

80
POST VNFD in Individual VNF Package (Method not implemented)
81
    Log    Trying to perform a POST (method should not be implemented)
82
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
83
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
84
    POST    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd
85
    Integer    response status    405
86
87
    Log    Received 405 Method not implemented as expected

88
PUT VNFD in Individual VNF Package (Method not implemented)
89
    Log    Trying to perform a PUT. This method should not be implemented
90
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
91
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
92
    PUT    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd
93
    Integer    response status    405
94
95
    Log    Received 405 Method not implemented as expected

96
PATCH VNFD in Individual VNF Package (Method not implemented)
97
    Log    Trying to perform a PATCH. This method should not be implemented
98
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
99
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
100
101
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd
    Integer    response status    405
102
103
    Log    Received 405 Method not implemented as expected

104
DELETE VNFD in Individual VNF Package (Method not implemented)
105
    Log    Trying to perform a DELETE. This method should not be implemented
106
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
Elian Kraja's avatar
Elian Kraja committed
107
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
108
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}
109
    Integer    response status    405
110
    Log    Received 405 Method not implemented as expected
111