Skip to content
Snippets Groups Projects
Commit 00027262 authored by Elian Kraja's avatar Elian Kraja
Browse files

Extension for jsonlibrary in case of python3. Small fixies. SOL005 completed

parent f8cc3de1
No related branches found
No related tags found
No related merge requests found
Showing
with 997 additions and 46 deletions
{
"changeStateTo": "STOPPED",
"stopType": "FORCEFUL"
"stopType": "FORCEFUL",
"additionalParams": {}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
"crossingDirection": "UP",
"objectInstanceId": "vnfID",
"performanceMetric": "performanceMetric",
"performanceValue": 7
"performanceValue": 7,
"_links": {
"subscription": "link to subscription",
"threshold": "link to threshold"
......
{
"changeStateTo": "STOPPED",
"stopType": "FORCEFUL"
"stopType": "FORCEFUL",
"additionalParams": {}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
GET VNF Package Artifact
Log Trying to get a VNF Package Artifact
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
......@@ -20,7 +20,7 @@ GET VNF Package Artifact - Range
Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests.
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 206
Log Received 206 Partial Content as expected.
${headers}= Output response headers
......@@ -32,7 +32,7 @@ GET VNF Package Artifact - NFVO No RANGE
Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests.
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 200
Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored.
......@@ -41,7 +41,7 @@ GET VNF Package Artifact - Negative Range
Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests.
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 416
Log Received 416 Range not satisfiable as expected.
${contentType}= Output response headers Content-Type
......@@ -55,7 +55,7 @@ GET VNF Package Artifact - Negative Range
GET VNF Package Artifact- Negative (Not Found)
Log Trying to perform a negative get, using an erroneous package ID
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath}
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
......@@ -69,7 +69,7 @@ GET VNF Package Artifact- Negative (Not Found)
GET VNF Package Artifact - Negative (onboardingState issue)
Log Trying to get a VNF Package artifact present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/{artifactPath}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/${artifactPath}
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
......@@ -83,27 +83,27 @@ GET VNF Package Artifact - Negative (onboardingState issue)
POST VNF Package Artifact - (Method not implemented)
Log Trying to perform a POST (method should not be implemented)
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 405
Log Received 405 Method not implemented as expected
PUT VNF Package Artifact - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH VNF Package Artifact - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 405
Log Received 405 Method not implemented as expected
DELETE VNF Package Artifact - (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath}
DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/${artifactPath}
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -49,8 +49,14 @@ DELETE Individual PM Job - Negative (Not Found)
Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId}
Integer response status 404
Log Received 204 No Content as expected
Log Received 404 Not Found as expected
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
POST Individual PM Job - (Method not implemented)
Log Trying to perform a POST (method should not be implemented)
Set Headers {"Accept": "${ACCEPT_JSON}"}
......
......@@ -7,7 +7,7 @@
"crossingDirection": "UP",
"objectInstanceId": "vnfID",
"performanceMetric": "performanceMetric",
"performanceValue": 7
"performanceValue": 7,
"_links": {
"subscription": "link to subscription",
"threshold": "link to threshold"
......
......@@ -3,10 +3,12 @@ Documentation This clause defines all the resources and methods provided by
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters
Library OperatingSystem
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
Library JSONSchemaLibrary schemas/
*** Variable ***
*** Test Cases ***
GET Single Network Service Descriptor
[Documentation] The GET method reads information about an individual NS descriptor.
......@@ -44,6 +46,19 @@ GET Single Network Service Descriptor (Negative: Not found)
PATCH Single Network Service Descriptor - (Disabling a nsdInfo)
[Documentation] The PATCH method modifies the operational state and/or user defined data of an individual NS descriptor resource.
... This method can be used to:
...
... 1) Enable a previously disabled individual NS descriptor resource, allowing again its use for instantiation of new
... network service with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change as a
... result.
...
... 2) Disable a previously enabled individual NS descriptor resource, preventing any further use for instantiation of
... new network service(s) with this descriptor. The usage state (i.e. "IN_USE/NOT_IN_USE") shall not change
... as a result.
...
... 3) Modify the user defined data of an individual NS descriptor resource.
...
Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
......@@ -66,12 +81,57 @@ PATCH Single Network Service Descriptor - (Enabling an previously disabled nsdIn
PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId} ${body}
Integer response status 200
Log Received 200 OK as expected
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json NsdInfoModification.schema.json ${json}
# Log Validation of NsdInfoModifications OK
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdInfoModification.schema.json ${json}
Log Validation of NsdInfoModifications OK
PATCH Single Network Service Descriptor - NEGATIVE (Trying to enable an previously enabled nsdInfo)
Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File json/NsdInfoModificationEnable.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${enabledNsdInfoId} ${body}
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PATCH Single Network Service Descriptor - NEGATIVE (Trying to get an ETag mismatch)
Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be modified by another entity
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Set Headers {"If-Match": "${Etag}"}
${body}= Get File json/NsdInfoModificationEnable.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${modifiedNsdInfoId} ${body}
Integer response status 412
Log Received 412 Precondition failed as expected
${returned_etag}= Output response headers Etag
Log Verify different etags
Should Not Be Equal ${Etag} ${returned_etag}
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
DELETE Single Network Service Descriptor
[Documentation] The DELETE method deletes an individual NS descriptor resource.
... An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
... NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
... shall fail.
Log Trying to perform a DELETE nsdInfo. The nsdInfo should be in "NOT_USED" usageState and in "DISABLED" operationalState.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
......@@ -81,6 +141,10 @@ DELETE Single Network Service Descriptor
DELETE Single Network Service Descriptor (Negative: Trying to delete an enabled nsdInfo)
[Documentation] The DELETE method deletes an individual NS descriptor resource.
... An individual NS descriptor resource can only be deleted when there is no NS instance using it (i.e. usageState =
... NOT_IN_USE) and has been disabled already (i.e. operationalState = DISABLED). Otherwise, the DELETE method
... shall fail.
Log Trying to perform a DELETE nsdInfo in ENABLED operational state
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
......
......@@ -20,11 +20,11 @@ GET Single PNF Descriptor
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Validation of Content-Type : OK
# Log Trying to validate response
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json NsdInfo.schema.json ${json}
# Log Validation OK
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdInfo.schema.json ${json}
Log Validation OK
GET Single PNF Descriptor (Negative: Not found)
......@@ -55,10 +55,10 @@ PATCH Single PNF Descriptor - (Disabling a nsdInfo)
PATCH ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId} ${body}
Integer response status 200
Log Received 200 OK as expected
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json PnfdInfoModification.schema.json ${json}
# Log Validation of PnfdInfoModification OK
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfoModification.schema.json ${json}
Log Validation of PnfdInfoModification OK
DELETE Single PNF Descriptor
......
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/individualSubscription.txt
Library OperatingSystem
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
*** Test Cases ***
GET Individual Subscription
Log Trying to get a single subscription identified by subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdmSubscription.schema.json ${json}
Log Validated NsdmSubscription schema
GET Subscription - Negative (Not Found)
Log Trying to perform a request on a subscriptionID which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
DELETE Subscription
Log Trying to perform a DELETE on a subscriptionId
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 204
Log Received 204 No Content as expected
Comment Log Trying to get the deleted element
Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA}
Comment Set Request Header Accept ${ACCEPT_JSON}
Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION}
Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Comment Response Status Code Should Equal 404
Comment Log The subscriptionId is not present in database
DELETE Subscription - Negative (Not Found)
Log Trying to perform a DELETE on a subscriptionId which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
Integer response status 404
Log The subscriptionId is not present in database
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PUT Subscription - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
POST Subscription - (Method not implemented)
Log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
Integer response status 405
Log Received 405 Method not implemented as expected
*** Settings ***
Documentation This clause defines the content of the individual NS descriptor, i.e. NSD content
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
*** Test Cases ***
GET NSD Content
[Documentation] The GET method fetches the content of the NSD.
... The NSD can be implemented as a single file or as a collection of multiple files. If the NSD is implemented in the form
... of multiple files, a ZIP file embedding these files shall be returned. If the NSD is implemented as a single file, either
... that file or a ZIP file embedding that file shall be returned.
...
... The selection of the format is controlled by the "Accept" HTTP header passed in the GET request:
...
... - If the "Accept" header contains only "text/plain" and the NSD is implemented as a single file, the file shall be
... returned; otherwise, an error message shall be returned.
...
... - If the "Accept" header contains only "application/zip", the single file or the multiple files that make up the
... NSD shall be returned embedded in a ZIP file.
...
... - If the "Accept" header contains both "text/plain" and "application/zip", it is up to the NFVO to choose the
... format to return for a single-file NSD; for a multi-file NSD, a ZIP file shall be returned.
...
... NOTE: The structure of the NSD zip file is outside the scope of the present document.
...
... This method shall follow the provisions specified in the Tables 5.4.4.3.2-1 and 5.4.4.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Log The GET method queries multiple NS descriptors
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_ZIP}
GET NSD Content - Range
Log Trying to get a NSD Content using RANGE using an NFVO that can handle it
Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests.
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 206
Log Received 206 Partial Content as expected.
${headers}= Output response headers
Should Contain ${headers} Content-Range
Log Header Content-Range is present
Should Contain ${headers} Content-Length
Log Header Content-Length is present
GET NSD Content - Range NFVO No RANGE
Log Trying to get a NSD Content using RANGE using an NFVO that can handle it
Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests.
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 200
Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored.
GET NSD Content - Negative Range
Log Trying to get a range of bytes of the limit of the NSD Content
Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests.
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Set Headers {"Range": "${erroneousRange}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 416
Log Received 416 Range not satisfiable as expected.
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET NSD Content- Negative (Not Found)
Log Trying to perform a negative get, using an erroneous package ID
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET NSD Content - Negative (onboardingState issue)
Log Trying to get a NSD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${onboardingStateNsdInfoId}/nsd_content
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PUT a NSD Content - Asynchronous mode
[Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
... NSD.
...
... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
...
... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
...
... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
... request and response data structures, and response codes.
Log Trying to perform a PUT. This method upload the content of a NSD
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File ${contentFile}
PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content ${body}
Integer response status 202
Log Received 202 Accepted as expected
${response}= Output response body
Should Be Empty ${response}
PUT a NSD Content - Synchronous mode
[Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
... NSD.
...
... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
...
... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
...
... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
... request and response data structures, and response codes.
Log Trying to perform a PUT. This method upload the content of a NSD
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File ${contentFile}
PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content ${body}
Integer response status 200
Log Received 200 OK as expected
${response}= Output response body
Should Be Empty ${response}
PUT a NSD Content - Negative. Nsd in CREATING state
[Documentation] The NSD to be uploaded can be implemented as a single file or as a collection of multiple files, as defined in
... clause 5.4.4.3.2. If the NSD is implemented in the form of multiple files, a ZIP file embedding these files shall be
... uploaded. If the NSD is implemented as a single file, either that file or a ZIP file embedding that file shall be uploaded.
... The "Content-Type" HTTP header in the PUT request shall be set accordingly based on the format selection of the
... NSD.
...
... - If the NSD to be uploaded is a text file, the "Content-Type" header is set to "text/plain".
...
... - If the NSD to be uploaded is a zip file, the "Content-Type" header is set to "application/zip".
...
... This method shall follow the provisions specified in the Tables 5.4.4.3.3-1 and 5.4.4.3.3-2 for URI query parameters,
... request and response data structures, and response codes.
Log Trying to perform a PUT. This method upload the content of a NSD
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File ${contentFile}
PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${creatingNsdInfoId}/nsd_content ${body}
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
POST a NSD Content (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH a NSD Content (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 405
Log Received 405 Method not implemented as expected
DELETE a NSD Content (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoId}/nsd_content
Integer response status 405
Log Received 405 Method not implemented as expected
*** Setting ***
Resource environment/variables.txt
Suite Setup Create Sessions
Suite Teardown Terminate All Processes kill=true
Library MockServerLibrary
Library Process
Library OperatingSystem
Library BuiltIn
Library Collections
Library String
*** Test Cases ***
Check Notification Endpoint
&{req}= Create Mock Request Matcher GET ${callback_endpoint}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Clear Requests ${callback_endpoint}
Post NSD Change Notification
${json}= Get File schemas/NsdChangeNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Change Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Deletion Notification
${json}= Get File schemas/NsdDeletionNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Deletion Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Onboard Failure Notification
${json}= Get File schemas/NsdOnboardingFailureNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Failure Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post NSD Onboard Notification
${json}= Get File schemas/NsdOnboardingNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Deletion Notification
${json}= Get File schemas/PnfdDeletionNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle PNFD Deletion Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Onboard Failure Notification
${json}= Get File schemas/PNFDOnboardingFailureNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle PNFD Onboard Failure Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post PNFD Onboard Notification
${json}= Get File schemas/OPNFDOnboardingNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSD Onboard Notification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
Post Notification Negative 404
${json}= Get File schemas/ProblemDetails.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle Notification to handle 404 error
&{req}= Create Mock Request Matcher POST ${callback_endpoint_error} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=404
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
PUT VNF Package Management Notification
Log PUT Method not implemented
&{req}= Create Mock Request Matcher PUT ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
PATCH VNF Package Management Notification
Log PATCH Method not implemented
&{req}= Create Mock Request Matcher PATCH ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
DELETE VNF Package Management Notification
Log PATCH Method not implemented
&{req}= Create Mock Request Matcher DELETE ${callback_endpoint}
&{rsp}= Create Mock Response status_code=405
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
*** Keywords ***
Create Sessions
Start Process java -jar ../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort ${callback_port} alias=mockInstance
Wait For Process handle=mockInstance timeout=5s on_timeout=continue
Create Mock Session ${callback_uri}:${callback_port}
\ No newline at end of file
......@@ -104,6 +104,66 @@ GET all Network Service Descriptors (Negative: Not found)
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET all Network Service Descriptors - all_fields
[Documentation] The GET method queries information about multiple NS descriptor resources.
... This method shall follow the provisions specified in the Tables 5.4.2.3.2-1 and 5.4.2.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Log The GET method queries multiple NS descriptors using Attribute-based filtering parameters "all_fields"
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?all_fields
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdInfos.schema.json ${json}
Log NsdInfo schema validated
${links}= Get Value From Json ${json} $.._links
Validate Json links.schema.json ${links[0]}
Log Validation for _links schema OK
GET all Network Service Descriptors - exclude_default
Log Trying to get all VNF Packages present in the NFVO Catalogue, using exclude_default filter.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors?exclude_default
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdInfos.schema.json ${json}
Log NsdInfo schema validated
Log Checking missing information for _links element
${links}= Get Value From Json ${json} $.._links
Should Be Empty ${links}
Log _links element is missing as excepted
GET all Network Service Descriptors - exclude_fields
Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params
Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?exlude_fields=${fields}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdInfos.schema.json ${json}
Log NsdInfo schema validated
Log Checking missing information for _links element
${links}= Get Value From Json ${json} $.._links
Should Be Empty ${links}
Log _links element is missing as excepted
POST a new Network Service Descriptors
Log Creating a new network service descriptor
......
*** Settings ***
Documentation This clause defines the content of the individual NS descriptor, i.e. NSD content
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/pnfDescriptors.txt # Specific nsDescriptors Parameters
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library OperatingSystem
*** Test Cases ***
GET PNFD Content
[Documentation] The GET method fetches the content of the PNFD..
... This method shall follow the provisions specified in the Tables 5.4.7.3.2-1 and 5.4.7.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Log The GET method queries PNFD Content
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_PLAIN}
GET PNFD Content- Negative (Not Found)
Log Trying to perform a negative get, using an erroneous package ID
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdId}/pnfd_content
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET PNFD Content - Negative (onboardingState issue)
Log Trying to get a PNFD content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${onboardingStatePnfdId}/pnfd_content
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
PUT a PNFD Content
Log Trying to perform a PUT. This method upload the content of a PNFD
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File ${contentFile}
PUT ${apiRoot}/${apiName}/${apiVersion}//pnf_descriptors/${pnfdInfoId}/pnfd_content ${body}
Integer response status 204
Log Received 204 No Content as expected
${response}= Output response body
Should Be Empty ${response}
${contentType}= Output response headers Content-Type
Should Be Equal text/plain ${contentType}
PUT a PNFD Content - Negative. Nsd in CREATING state
Log Trying to perform a PUT.
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File ${contentFile}
PUT ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${creatingPnfdId}/pnfd_content ${body}
Integer response status 409
Log Received 409 Conflict as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
POST a PNFD Content (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH a NSDContent (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
Integer response status 405
Log Received 405 Method not implemented as expected
DELETE a NSDContent (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content
Integer response status 405
Log Received 405 Method not implemented as expected
......@@ -20,11 +20,11 @@ GET all PNF Descriptors
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Validation of Content-Type : OK
# Log Trying to validate response
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json PnfdInfos.schema.json ${json}
# Log Validation OK
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfos.schema.json ${json}
Log Validation OK
GET all PNF Descriptors - Filter
[Documentation] The GET method queries information about multiple PNF descriptor resources.
......@@ -37,11 +37,11 @@ GET all PNF Descriptors - Filter
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
# Log Trying to validate response
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json PnfdInfos.schema.json ${json}
# Log Validation OK
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfos.schema.json ${json}
Log Validation OK
GET all PNF Descriptors - Negative (wronge filter name)
Log The GET method queries multiple PNF descriptors using Attribute-based filtering parameters. Negative case, with erroneous attribute name
......@@ -104,6 +104,65 @@ GET all PNF Descriptors (Negative: Not found)
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET all PNF Descriptors - all_fields
[Documentation] The GET method queries information about multiple PNF descriptor resources
... This method shall follow the provisions specified in the Tables 5.4.5.3.2-1 and 5.4.5.3.2-2 for URI query parameters,
... request and response data structures, and response codes.
Log The GET method queries multiple PNF descriptors using Attribute-based filtering parameters "all_fields"
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?all_fields
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfos.schema.json ${json}
Log PnfdInfos schema validated
${links}= Get Value From Json ${json} $.._links
Validate Json links.schema.json ${links[0]}
Log Validation for _links schema OK
GET all PNF Descriptors - exclude_default
Log Trying to get all PNF Descriptors present in the NFVO Catalogue, using exclude_default filter.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exclude_default
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfos.schema.json ${json}
Log PnfdInfo schema validated
Log Checking missing information for _links element
${links}= Get Value From Json ${json} $.._links
Should Be Empty ${links}
Log _links element is missing as excepted
GET all PNF Descriptors - exclude_fields
Log Trying to get all PNF descriptors present in the NFVO Catalogue, using filter params
Pass Execution If ${NFVO_FIELDS} == 0 The NFVO is not able to use exclude_fields option
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors?exlude_fields=${fields}
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} application/json
Log Trying to validate response
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfos.schema.json ${json}
Log PnfdInfo schema validated
Log Checking missing information for _links element
${links}= Get Value From Json ${json} $.._links
Should Be Empty ${links}
Log _links element is missing as excepted
POST a new PNF Descriptor
Log Creating a new PNF descriptor
......@@ -117,10 +176,10 @@ POST a new PNF Descriptor
${headers}= Output response headers
Should Contain ${headers} Location
Log Response has header Location
# ${result}= Output response body
# ${json}= evaluate json.loads('''${result}''') json
# Validate Json PnfdInfo.schema.json ${json}
# Log Validation of PnfdInfo OK
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json PnfdInfo.schema.json ${json}
Log Validation of PnfdInfo OK
PUT all PNF Descriptors (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
......
*** Settings ***
Library JSONSchemaLibrary schemas/
Resource environment/generic.txt # Generic Parameters
Resource environment/subscriptions.txt
Library OperatingSystem
Library JSONLibrary
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
*** Test Cases ***
GET Subscription
[Documentation] This method shall support the URI query parameters, request and response data structures, and response codes, as
... specified in the Tables 5.4.8.3.2-1 and 5.4.8.3.2-2.
Log Trying to get the list of subscriptions
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdmSubscriptions.schema.json ${json}
Log Validated NsdmSubscription schema
GET Subscription - Filter
Log Trying to get the list of subscriptions using filters
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok}
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdmSubscriptions.schema.json ${json}
Log Validated NsdmSubscription schema
GET Subscription - Negative Filter
Log Trying to get the list of subscriptions using filters with wrong attribute name
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok}
Integer response status 400
Log Received a 400 Bad Request as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
GET Subscription - Negative (Not Found)
Log Trying to perform a request on a Uri which doesn't exist
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscription
Integer response status 404
Log Received 404 Not Found as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate ProblemDetails
${problemDetails}= Output response body
${json}= evaluate json.loads('''${problemDetails}''') json
Validate Json ProblemDetails.schema.json ${json}
Log Validation OK
POST Subscription
[Documentation] This method shall support the URI query parameters, request and response data structures, and response codes, as
... specified in the Tables 5.4.8.3.1-1 and 5.4.8.3.1-2.
Log Trying to create a new subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File json/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Integer response status 201
Log Received 201 Created as expected
${headers}= Output response headers
Should Contain ${headers} Location
Log Response has header Location
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdmSubscription.schema.json ${json}
Log Validation of NsdmSubscription OK
POST Subscription - DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File json/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Integer response status 201
Log Received 201 Created as expected
${headers}= Output response headers
Should Contain ${headers} Location
Log Response has header Location
${result}= Output response body
${json}= evaluate json.loads('''${result}''') json
Validate Json NsdmSubscription.schema.json ${json}
Log Validation of NsdmSubscription OK
POST Subscription - NO DUPLICATION
Log Trying to create a subscription with an already created content
Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File json/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
Integer response status 303
Log Received 303 See Other as expected
${headers}= Output response headers
Should Contain ${headers} Location
Log Response header contains Location
PUT Subscription - (Method not implemented)
Log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
PATCH Subscription - (Method not implemented)
Log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
DELETE Subscription - (Method not implemented)
Log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions
Integer response status 405
Log Received 405 Method not implemented as expected
*** Variables ***
${subscriptionId} f3ae6df7-07e1-47c9-8924-9ebe10343586
${erroneousSubscriptionId} 442e3ee5-0499-4849-9b31-eb91ce1638f1 # Not existing ID on the subscriptions
......@@ -3,4 +3,16 @@ ${POS_FIELDS} name=nsdOnboardingState
${NEG_FIELDS} wrongName=any_value
${nsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${erroneous_nsdInfoId} erroneous_nsdInfoId
${enabledNsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56
\ No newline at end of file
${enabledNsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${fields} _links
${NFVO_FIELDS} 1
${Etag}= an etag
${modifiedNsdInfoId} f27200b1-1d8b-48c2-9d98-a993b8ab117f
${ACCEPT_ZIP} application/zip
${CONTENT_TYPE_ZIP} application/zip
${NFVO_RANGE_OK} 1
${range} bytes=0-1023
${erroneousRange} bytes=100000-1000000 # Requesting a out of range number of bytes
${onboardingStateNsdInfoId} b992a851-08b1-45a8-9282-a5f7a7df04a6
${contentFile} files/nsdContent.zip
${creatingNsdInfoId} 71241932-994a-46e2-ad6c-1740674dda44
\ No newline at end of file
......@@ -3,4 +3,12 @@ ${POS_FIELDS} name=pnfdOnboardingState
${NEG_FIELDS} wrongName=any_value
${pnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348
${erroneous_pnfdInfoId} erroneous_pnfdInfoId
${enabledPnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348
\ No newline at end of file
${enabledPnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348
${NFVO_FIELDS} 1
${fields} _links
${ACCEPT_PLAIN} text/plain
${CONTENT_TYPE_PLAIN} text/plain
${erroneous_pnfdId} erroneousPnfdId
${onboardingStatePnfdId} 8ed2bf1f-f6ae-4d18-b478-bfab02fd4cd2
${contentFile} files/pnfdContent.zip
${creatingPnfdId} 2e4ce0ef-3ea8-49f9-92dd-8771866015bb
\ No newline at end of file
*** Variables ***
${filter_ok} callbackUri=http://127.0.0.1/subscription
${filter_ko} nfvId=f9f130e4-05eb-4082-a676-4c97d13a883d # Not existant filter attribute-based
${NFVO_DUPLICATION} 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment