Commit 7e28b22d authored by Elian Kraja's avatar Elian Kraja
Browse files

Fix on issues: 66, 69, 73 (NXW endpoints), 74, 76, 78, 79, 80, 81, 85, 87, 88

parent d03f349e
......@@ -36,7 +36,7 @@ Get NSD Management Subscriptions with attribute-based filter
... Post-Conditions: none
Get NSD Management Subscriptions with attribute-based filters
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is NsdmSubscription
Check HTTP Response Body Json Schema Is NsdmSubscriptions
Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filter
......@@ -110,7 +110,7 @@ Create duplicated NSD Management subscription with NFVO creating duplicated subs
... Post-Conditions: The duplicated NSD Management subscription is successfully set and it matches the issued subscription
Send Post Request for Duplicated NSD Management Subscription
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is PmSubscription
Check HTTP Response Body Json Schema Is NsdmSubscription
Check HTTP Response Body NsdmSubscription Attributes Values Match the Issued Subscription
Check Postcondition NSD Management Subscription Is Set
......
......@@ -28,3 +28,4 @@ ${original_etag} 1234
${wrong_etag} abcd
${usageState} state
${length} 1024
${createdNsdInfoId} f27200b1-1d8b-48c2-9d98-a993b8ab117f
......@@ -33,7 +33,7 @@ Create a new alarm subscription - DUPLICATION
... Applicability: the NFVO allows creating a subscription resource if another subscription resource with the same filter and callbackUri already exists
... Post-Conditions: none
Depends On Test Create a new subscription
Pass Execution If ${NFVO_DUPLICATION} == 0 NVFO is not permitting duplication. Skipping the test
Pass Execution If ${NFVO_ALLOWS_DUPLICATE_SUBS} == 0 NVFO is not permitting duplication. Skipping the test
POST Subscription
Check HTTP Response Status Code Is 201
Check HTTP Response Header Contains Location
......@@ -49,7 +49,7 @@ Create a new alarm subscription - NO DUPLICATION
... Applicability: the NFVO decides to not create a duplicate subscription resource
... Post-Conditions: none
Depends On Test Create a new subscription
Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO permits duplication. Skipping the test
Pass Execution If ${NFVO_ALLOWS_DUPLICATE_SUBS} == 1 NFVO permits duplication. Skipping the test
POST Subscription
Check HTTP Response Status Code Is 303
Check HTTP Response Header Contains Location
......
......@@ -13,7 +13,7 @@ ${apiName} nsfm
${apiVersion} v1
${CONTENT_TYPE} application/json
${NFVO_DUPLICATION} 0
${NFVO_ALLOWS_DUPLICATE_SUBS} 0
${alarmId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d
${invalidAlarmId} invalidAlramID
......
......@@ -13,7 +13,7 @@ Post Individual VNFInstance - Method not implemented
Check HTTP Response Status Code Is 405
Get Information about an individual NS Instance
Do POST individualNSInstance
Do GET IndividualNSInstance
Check HTTP Response Status Code Is 200
Check HTTP Response Header ContentType is ${CONTENT_TYPE}
Check HTTP Response Body Json Schema Is NsInstance.schema.json
......
......@@ -254,6 +254,15 @@ Do DELETE IndividualNSInstance
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do DELETE IndividualNSInstance Conflict
log Trying to delete an individual VNF instance
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${ConflictNsInstanceId}
${outputResponse}= Output response
Set Global Variable @{response} ${outputResponse}
Do DELETE Instantiate NSInstance
log Trying to delete an instantiate NS instance. This method should not be implemented
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
......
......@@ -143,11 +143,11 @@ Check HTTP Response Body PmJobs Matches the requested exclude selector
Check HTTP Response Body PmJobs Matches the requested include selector
Log Trying to validate criteria schema
${criteria}= Get Value From Json ${response['body']} $..criteria
Validate Json criteria.schema.json ${criteria[0]}
Validate Json criteria.schema.json ${criteria}
Log Validation for criteria schema OK
Log Trying to validate criteria schema
${reports}= Get Value From Json ${response['body']} $..reports
Validate Json reports.schema.json ${reports[0]}
Validate Json reports.schema.json ${reports}
Log Validation for reports schema OK
Check HTTP Response Body PmJobs Matches the requested exclude_default selector
......@@ -159,15 +159,15 @@ Check HTTP Response Body PmJobs Matches the requested exclude_default selector
Check HTTP Response Body PmJobs Matches the requested all_fields selector
Log Trying to validate criteria schema
${criteria}= Get Value From Json ${response['body']} $..criteria
Validate Json criteria.schema.json ${criteria[0]}
Validate Json criteria.schema.json ${criteria}
Log Validation for criteria schema OK
Log Trying to validate criteria schema
${reports}= Get Value From Json ${response['body']} $..reports
Validate Json reports.schema.json ${reports[0]}
Validate Json reports.schema.json ${reports}
Log Validation for reports schema OK
Log Validating _links schema
${links}= Get Value From Json ${response['body']} $.._links
Validate Json links.schema.json ${links[0]}
Validate Json links.schema.json ${links}
Log Validation for _links schema OK
Check HTTP Response Body PmJobs Matches the requested Attribute-Based Filter
......@@ -641,7 +641,7 @@ Check HTTP Response Status Code Is
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response['headers']['Content-Type']} application/json
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
......@@ -677,7 +677,7 @@ Check Postcondition NS Performance Subscription Is Set
Check Postcondition Subscription Resource URI Returned in Location Header Is Available
Log Going to check postcondition
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${response.headers['Location']}
GET ${response['headers']['Location']}
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
......@@ -771,7 +771,7 @@ Check HTTP Response Body Subscription Identifier matches the requested Subscript
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response.headers} ${CONTENT_TYPE}
Should Contain ${response['headers']} ${CONTENT_TYPE}
Log Header is present
......
{
"description": "Links for this resource.\n",
"type": "array",
"items": {
"type": "object",
"required": ["self"],
"description": "Links to resources related to this resource.\n",
"required": [
"self",
"packageContent"
],
"properties": {
"self": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": ["href"],
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
......@@ -15,13 +22,26 @@
}
}
},
"objects": {
"description": "Links to resources representing the VNF instances for which performance information is collected. Shall be present if the VNF instance information is accessible as a resource.\n",
"type": "array",
"items": {
"vnfd": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
"type": "string",
"format": "url"
}
}
},
"packageContent": {
"description": "This type represents a link to a resource.\n",
"type": "object",
"required": ["href"],
"required": [
"href"
],
"properties": {
"href": {
"description": "URI of the referenced resource.\n",
......
{
"type": "array",
"items": {
"description": "Information about available reports collected by this PM job.\n",
"type": "object",
"required": ["href", "readyTime"],
"required": [
"href",
"readyTime"
],
"properties": {
"href": {
"description": "The Uri where the report can be obtained.\n",
......@@ -23,4 +28,5 @@
"type": "integer"
}
}
}
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ GET Individual VNF Package
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
Log Trying to validate response
${vnfPkgInfo}= Output response body
Validate Json vnfPkgInfo.schema.json ${vnfPackageId}
Validate Json vnfPkgInfo.schema.json ${vnfPkgInfo}
Log Validation OK
GET Individual VNF Package - Negative (Not Found)
......
......@@ -13,7 +13,6 @@ GET VNF Package Artifact
Integer response status 200
Log Received a 200 OK as expected
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_OCTET}
GET VNF Package Artifact - Range
Log Trying to get an Artifact using RANGE Header and using an NFVO that can handle it
......
......@@ -9,17 +9,13 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
*** Test Cases ***
GET VNF Package Content
Log Trying to get a VNF Package Content
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content
Integer response status 200
${contentType}= Output response headers Content-Type
Should Contain ${contentType} ${CONTENT_TYPE_JSON}
GET VNF Package Content - Range
Log Trying to get a VNF Package 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_JSON}"}
Set Headers {"Range": "${range}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content
......@@ -35,51 +31,30 @@ GET VNF Package Content - Range
GET VNF Package Content - Negative Range
Log Trying to get a range of bytes of the limit of the VNF Package
Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests.
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Range": "${erroneousRange}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_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
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
GET VNF Package Content - Negative (Not Found)
Log Trying to perform a negative get, using an erroneous package ID
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_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
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
GET VNF Package Content - Negative (onboardingState issue)
Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_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
Validate Json ProblemDetails.schema.json ${problemDetails}
Log Validation OK
PUT VNF Package Content
Log Trying to perform a PUT. This method uploads the content of a VNF package.
Set Headers {"Contet-Type": "${CONTENT_TYPE_ZIP}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${content}= Get Binary File files/vnfPackage.zip
PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content ${content}
......@@ -93,7 +68,7 @@ PUT VNF Package Content
PUT VNF Package Content - Negative (Conflict on onboarding status not in CREATED)
Log Trying to perform a PUT. This method uploads the content of a VNF package.
Set Headers {"Contet-Type": "${CONTENT_TYPE_ZIP}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${content}= Get Binary File files/vnfPackage.zip
PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${creatingVnfPackageId}/package_content ${content}
......
......@@ -13,7 +13,7 @@ POST VNF Package Content
Log Trying to perform a POST. The POST method provides the information for the NFVO to get the content of a VNF package.
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File jsons/UploadVnfPkgFromUriRequest.json
${body}= Get File jsons/UploadVnfPkgFromUriRequest.json
POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content/upload_from_uri ${body}
Integer response status 202
Log Received 202 Accepted as expected
......@@ -27,7 +27,7 @@ POST VNF Package Content - Negative (VNF Package not in CREATED operational stat
Log Trying to perform a POST. The POST method provides the information for the NFVO to get the content of a VNF package.
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get Binary File jsons/UploadVnfPkgFromUriRequest.json
${body}= Get File jsons/UploadVnfPkgFromUriRequest.json
POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${creatingVnfPackageId}/package_content/upload_from_uri ${body}
Integer response status 409
Log Received 409 Conflict as expected
......
......@@ -85,35 +85,11 @@ Send Post Request for VNF Package Subscription
Set Suite Variable ${response} ${output}
Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
... Check Notification Endpoint
# 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
# Validate Json PkgmSubscription.schema.json ${result}
# Log Validation of PkgmSubscription OK
Send Post Request for Duplicated VNF Package Subscription
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 jsons/subscriptions.json
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1
... Check Notification Endpoint
# 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
# Validate Json PkgmSubscription.schema.json ${result}
# Log Validation of PkgmSubscription OK
Send Post Request for VNF Package Subscription
Send Put Request for VNF Package Subscriptions
......@@ -158,14 +134,14 @@ Create Sessions
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
Should Be Equal ${response['status']} ${expected_status}
Should Be Equal As Strings ${response['status']} ${expected_status}
Log Status code validated
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response['headers']['Content-Type']} application/json
${schema} = Catenate ${input} .schema.json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
......@@ -187,7 +163,7 @@ Check HTTP Response Body Matches the Subscription
Log Check Response matches subscription
${body}= Get File jsons/subscriptions.json
${subscription}= evaluate json.loads('''${body}''') json
Should Be Equal ${response['body']['callbackUri']} ${subscription['callbackUri']}
Should Be Equal As Strings ${response['body']['callbackUri']} ${subscription['callbackUri']}
Check Postcondition VNF Package Subscription Is Set
......@@ -196,8 +172,10 @@ Check Postcondition VNF Package Subscription Is Set
Log Trying to get the subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
Run Keyword If Should Not Be Equal As Strings ${location} Location GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
Run Keyword If Should Be Equal As Strings ${location} Location GET ${response['headers']['Location']}
Run Keyword If ${location} == Location
... GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${response['body']['id']}
Run Keyword If ${location} == Location
... GET ${response['headers']['Location']}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 200
......@@ -210,5 +188,5 @@ Check HTTP Response Body Is Empty
Check HTTP Response Header Contains
[Arguments] ${CONTENT_TYPE}
Should Contain ${response.headers} ${CONTENT_TYPE}
Should Contain ${response['headers']} ${CONTENT_TYPE}
Log Header is present
\ No newline at end of file
......@@ -100,14 +100,14 @@ GET all Packages - all_fields
Log Validation OK
Log Trying to validate softwareImages schema
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Validate Json softwareImage.schema.json ${softwareImages[0]}
Validate Json softwareImage.schema.json ${softwareImages}
Log Validation for softwareImage schema OK
Log Trying to validate additionalArtifacts schema
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]}
Validate Json additionalArtifacts.schema.json ${additional_artifacts}
Log Validation for additionalArtifacts schema OK
${links}= Get Value From Json ${vnfPkgInfos} $.._links
Validate Json links.schema.json ${links[0]}
Validate Json links.schema.json ${links}
Log Validation for _links schema OK
GET all Packages - exclude_default
......@@ -147,11 +147,11 @@ GET all Packages - fields
Log Validation for vnfPkgInfo OK
Log Trying to validate softwareImages schema
${softwareImages}= Get Value From Json ${vnfPkgInfos} $..softwareImages
Validate Json softwareImage.schema.json ${softwareImages[0]}
Validate Json softwareImage.schema.json ${softwareImages}
Log Validation for softwareImage schema OK
Log Trying to validate additionalArtifacts schema
${additional_artifacts}= Get Value From Json ${vnfPkgInfos} $..additionalArtifacts
Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]}
Validate Json additionalArtifacts.schema.json ${additional_artifacts}
Log Validation for additionalArtifacts schema OK
GET all Packages - exclude_fields
......
{
"callbackUri": "http://127.0.0.1/subscribe",
"filter": {
"vnfPkgId": "788106a2-d692-44f3-a86d-384f0ce35e42"
"vnfPkgId": ["491ed430-67f5-4c6c-b78e-797f5d718868"]
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment