Commit aacc11c9 authored by Frank Bryden's avatar Frank Bryden Committed by Frank Bryden
Browse files

Templated JSON files in SOL005/ along with minor bug fixes



Signed-off-by: Frank Bryden's avatarbrydenf <frank.bryden@etsi.org>
parent b30d067e
......@@ -94,7 +94,7 @@ Enable Individual Network Service Descriptor with conflict due to onboarding sta
Check HTTP Response Status Code Is 409
Check HTTP Response Body Json Schema Is ProblemDetails
Enable Individual Network Service Descriptor with HTTP Etag precondition failure
Enable Individual Network Service Descriptor with HTTP Etag precondition failure
[Documentation] Test ID: 5.3.1.2.7
... Test title: Enable Individual Network Service Descriptor with HTTP Etag precondition failure
... Test objective: The objective is to test that the retrieval of an Network Service Descriptor fails due to a precondition failure when using an uncorrect Http Etag identified.
......
......@@ -815,7 +815,8 @@ Send Post Request for NSD Management Subscription
Log Trying to create a new subscription
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File jsons/subscriptions.json
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} notifCallbackUri=${notifCallbackUri}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${output}= Output response
......@@ -828,7 +829,8 @@ Send Post Request for Duplicated NSD Management Subscription
Log Trying to create a subscription with an already created content
Set Headers {"Accept": "${ACCEPT_JSON}"}
Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"}
${body}= Get File jsons/subscriptions.json
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} notifCallbackUri=${notifCallbackUri}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${output}= Output response
......@@ -880,6 +882,7 @@ Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response['headers']['Content-Type']} application/json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Log ${response['body']}
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
......@@ -895,7 +898,8 @@ Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filte
Check HTTP Response Body NsdmSubscription Attributes Values Match the Issued Subscription
Log Check Response matches subscription
${body}= Get File jsons/subscriptions.json
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} notifCallbackUri=${notifCallbackUri}
${subscription}= evaluate json.loads('''${body}''') json
Should Be Equal As Strings ${response['body']['callbackUri']} ${subscription['callbackUri']}
......@@ -922,7 +926,8 @@ Check Postcondition Subscription Resource Returned in Location Header Is Availab
${result}= Output response body
Validate Json NsdmSubscription.schema.json ${result}
Log Validated NsdmSubscription schema
${body}= Get File jsons/subscriptions.json
${template}= Get File jsons/subscriptions.json
${body}= Format String ${template} notifCallbackUri=${notifCallbackUri}
${subscription}= evaluate json.loads('''${body}''') json
Should Be Equal ${result['callbackUri']} ${subscription['callbackUri']}
Log Validated Issued subscription is same as original
......
*** Variables ***
${POS_FIELDS} name=nsdOnboardingState
${NEG_FIELDS} wrongName=any_value
${nsdInfoId} 7abbe544-6a51-4c86-af55-3a345f80e7cc
${nsdInfoIdPlain} 20734bbb-abf6-4cd8-a35d-f416f95dc180
${nsdInfoIdZip} 352fac1d-ddce-454b-b072-184cf5ed94f5
${nsdDownloadableZip} f3ce866a-a935-49db-9f39-8b14b662cedc
${nsdInfoId} 9e708376-4f96-4972-89c2-243760626f20
${nsdInfoIdPlain} 01872c48-3631-4060-afa8-ca7cbef8a4d8
${nsdInfoIdZip} 01872c48-3631-4060-afa8-ca7cbef8a4d8
${nsdDownloadableZip} cac6ac71-0fdf-45d1-a056-775cbb8157b5
${erroneous_nsdInfoId} erroneous_nsdInfoId
${disabledNsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56
${fields} _links
......
*** Variables ***
${POS_FIELDS} name=pnfdOnboardingState
${NEG_FIELDS} wrongName=any_value
${pnfdInfoId} 3327be9e-f716-43ac-aaeb-fcd54b0a5369 #used for testing downloads
${pnfdInfoUpld} 93c4cca6-b68b-4aa0-b06a-0e3725995585 #used for testing uploads
${pnfdInfoId} b227e618-cdb9-485b-8bfe-d4b8dee8e678 #used for testing downloads
${pnfdInfoUpld} dd7ff0f8-0e63-41b4-a572-568d0db30153 #used for testing uploads
${erroneous_pnfdInfoId} erroneous_pnfdInfoId
${enabledPnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348
${NFVO_FIELDS} 1
......
*** Variables ***
${filter_ok} callbackUri=http://172.22.1.7:9091/nsd/subscriptions
${notifCallbackUri} http://172.22.1.7:9091/nsd/subscriptions
${filter_ok} callbackUri=${notifCallbackUri}
${filter_ko} nfvId=f9f130e4-05eb-4082-a676-4c97d13a883d # Not existant filter attribute-based
${SEPERATOR} =
\ No newline at end of file
......@@ -2,8 +2,7 @@
${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO
${NFVO_PORT} 9999 # Listening port of the NFVO
${NFVO_SCHEMA} https
#auth token for OSM Access
${AUTHORIZATION} Bearer YguA4klaSzOxwE65MJ7aAWZvkOj2gAup
${AUTHORIZATION} Bearer lTxE0BXRcVPjlIUwHLVH5Dtjl39sZ9qp
${CONTENT_TYPE_JSON} application/json
${ACCEPT_JSON} application/json
${apiRoot} /osm/
......
nsd:nsd-catalog:
nsd:
- constituent-vnfd: []
description: myNSD descriptor
id: myNSDRevisitedA
name: myNSDRevisitedA
short-name: myNSD
vendor: OSM Composer
version: '1.0'
vld:
- id: ns_vl_u5el
mgmt-network: 'true'
name: ns_vl_u5el
type: ELAN
vim-network-name: PUBLIC
vnfd-connection-point-ref: []
{
"callbackUri": "http://172.22.1.7:9091/nsd/subscriptions"
"callbackUri": "{notifCallbackUri}"
}
\ No newline at end of file
......@@ -7,7 +7,8 @@ Library OperatingSystem
#Suite Teardown Terminate All Processes kill=true
Library MockServerLibrary
Library Process
Library Collections
Library Collections
Library String
*** Keywords ***
Create Sessions
......@@ -212,7 +213,8 @@ POST Subscription
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/fmSubscriptionRequest.json
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -223,7 +225,8 @@ Post Create subscription - DUPLICATION
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File jsons/fmSubscriptionRequest.json
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -234,7 +237,8 @@ Post Create subscription - NO-DUPLICATION
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
${body}= Get File jsons/fmSubscriptionRequest.json
${template}= Get File jsons/fmSubscriptionRequest.json
${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......
*** Settings ***
Resource environment/variables.txt
Resource NSFMOperationKeywords.robot
<<<<<<< Updated upstream
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
=======
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
>>>>>>> Stashed changes
Library OperatingSystem
Library DependencyLibrary
Library JSONLibrary
......
......@@ -2,7 +2,7 @@
${NFVO_HOST} 172.21.248.145 # Hostname of the VNFM
${NFVO_PORT} 9999 # Listening port of the VNFM
${NFVO_SCHEMA} https
${AUTHORIZATION} Bearer 3mT1BuYgMFj3UDqGGtj4ZTfKH74LUCLU
${AUTHORIZATION} Bearer 7EiP8HbWqpAaWVcZojq5WGm8theaCiym
${ACCEPT} application/json
${ACCEPT_JSON} application/json
${AUTH_USAGE} 1
......@@ -51,8 +51,8 @@ ${response} {}
${req_mock} {}
${resp_mock} {}
${callback_uri} http://localhost
${callback_port} 9091
${callback_uri} http://172.22.1.7:${callback_port}
${callback_endpoint} /endpoint
${callback_endpoint_fwd} /endpoint/check
${callback_endpoint_error} /endpoint_404
......
{
"filter": {
"nsInstanceSubscriptionFilter": {
{{
"filter": {{
"nsInstanceSubscriptionFilter": {{
"notificationTypes": [
"AlarmNotification"
]
}
},
"callbackUri": "http://127.0.0.1/subscribe"
}
\ No newline at end of file
}}
}},
"callbackUri": "{callback_uri}{callback_endpoint}"
}}
\ No newline at end of file
*** Settings ***
Resource environment/variables.txt
Resource NSLCMOperationKeywords.robot
<<<<<<< Updated upstream
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
=======
Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false
>>>>>>> Stashed changes
Library OperatingSystem
Library JSONLibrary
Library JSONSchemaLibrary schemas/
......
......@@ -7,6 +7,7 @@ Library JSONSchemaLibrary schemas/
Library OperatingSystem
Library MockServerLibrary
Library Collections
Library String
*** Keywords ***
Initialize System
......@@ -148,7 +149,8 @@ Launch another LCM operation
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/scaleNsToLevelRequest.json
${template}= Get File jsons/scaleNsToLevelRequest.json
${body}= Format String ${template} instantiationLevelId=${instantiationLevelId}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale_to_level ${body}
Integer response status 202
......@@ -182,13 +184,14 @@ Check Postcondition NS Instance is deleted
Check Postcondition NS Instance is not modified
GET IndividualNSInstance
${resp_dict}= evaluate json.loads('''${response['body']}''') json
${body}= Get File jsons/CreateNsRequest.json
${template}= Get File jsons/CreateNsRequest.json
${body}= Format String ${template} nsdId=${nsdId} nsInstanceName=${nsInstanceName} vimAccountId=${vimAccountId} nsInstanceDescription=${nsInstanceDescription}
Dictionaries Should Be Equal ${resp_dict} ${body} values=True
Check HTTP Response Header Contains
[Arguments] ${HEADER_TOCHECK}
Should Contain ${response['headers']} ${HEADER_TOCHECK}
Log Header is present
Log Header is present
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
......@@ -214,8 +217,8 @@ POST New nsInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
#changed CreateNsRequest to CreateNs
${body}= Get File jsons/CreateNs.json
${template}= Get File jsons/CreateNsRequest.json
${body}= Format String ${template} nsdId=${nsdId} nsInstanceName=${nsInstanceName} vimAccountId=${vimAccountId} nsInstanceDescription=${nsInstanceDescription}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -397,7 +400,8 @@ GET Instantiate NSInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/InstantiateNs.json
${template}= Get File jsons/InstantiateNs.json
${body}= Format String ${template} nsFlavourId=${nsFlavourId}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -441,7 +445,8 @@ POST scale nsInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/ScaleNs.json
${template}= Get File jsons/ScaleNs.json
${body}= Format String ${template} scaleType=${scaleType} scaleTimeout=${scaleTimeout} scaleVnfType=${scaleVnfType} scaleGroupDescriptor=${scaleGroupDescriptor} scaleMemberVnfIndex=${scaleMemberVnfIndex}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -485,7 +490,8 @@ POST Update NSInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/UpdateNsRequest.json
${template}= Get File jsons/UpdateNsRequest.json
${body}= Format String ${template} vnfUpdateType=${vnfUpdateType}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/update ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -529,7 +535,8 @@ POST Heal NSInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/HealNsRequest.json
${template}= Get File jsons/HealNsRequest.json
${body}= Format String ${template} nsDegreeHealing=${nsDegreeHealing}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/heal ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -916,7 +923,8 @@ POST subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/LccnSubscriptionRequest.json
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -927,7 +935,8 @@ POST subscriptions DUPLICATION
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/LccnSubscriptionRequest.json
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -938,7 +947,8 @@ POST subscriptions NO DUPLICATION
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${body}= Get File jsons/LccnSubscriptionRequest.json
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......
......@@ -6,7 +6,7 @@ ${NFVO_PORT} 9999 # Listening port of the NFVO
${VNFM_SCHEMA} https
${NFVO_SCHEMA} https
${AUTHORIZATION} Bearer kn6jROAkSsHj0Bw70j5jyJiLN8KO6xKI
${AUTHORIZATION} Bearer RW6sV6rtFa3TUEdazW4Dyd66muED2kBA
${CONTENT_TYPE} application/json
${CONTENT_TYPE_PATCH} application/merge-patch+json
${ACCEPT_JSON} application/json
......@@ -16,11 +16,15 @@ ${apiName} nslcm
${apiVersion} v1
${AUTH_USAGE} 1
${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX
${nsInstanceId} 66f27112-8b6b-4e70-91a8-b8625a20fc8f
${nsdId} 9e708376-4f96-4972-89c2-243760626f20
${nsInstanceId} bef2ab38-d117-4f29-bb07-0b02508575a9
${ConflictNsInstanceId} 007c111c-e602-4afa-8e13-962fb5a7d81d
${nsInstanceName} Test-nsInstance
${nsInstanceDescription} description ns
${nsInstanceDescription_Update} Updated description ns
${nsFlavourId} 0
${nsDegreeHealing} HEAL_RESTORE
${vimAccountId} 46baa285-994b-4615-8fd1-84fff6e90832
${SINGLE_FILE_VNFD} 1 # If VNFD is PLAIN TEXT
${ACCEPT_PLAIN} text/plain
${ACCEPT_ZIP} application/zip
......@@ -38,9 +42,17 @@ ${subscriptionId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f
${VnfLcmOperationOccurrenceNotification} {}
${VnfIdentifierCreationNotification} {}
${VnfIdentifierDeletionNotification} {}
${vnfUpdateType} ADD_VNF
${instantiationLevelId} myNextLevel
${scaleType} SCALE_VNF
${scaleTimeout} 1
${scaleVnfType} SCALE_IN
${scaleGroupDescriptor} myScalingGroup
${scaleMemberVnfIndex} 1
${callback_uri} http://localhost
${callback_port} 9091
${callback_uri} http://localhost:${callback_port}
${callback_endpoint} /endpoint
${callback_endpoint_fwd} /endpoint/check
${callback_endpoint_error} /endpoint_404
......
{{
"nsdId": "{nsdId}",
"nsName": "myNS",
"vimAccountId": "46baa285-994b-4615-8fd1-84fff6e90832",
"nsDescription": "fancy router and firewall combo"
}}
\ No newline at end of file
{
"CreateNsRequest": {
"type": "object",
"required": [
"nsdId",
"nsName",
"nsDescription"
],
"properties": {
"nsdId": {
"description": "Identifier of the NSD that defines the NS instance to be created.\n",
"$ref": "SOL005_def.yaml#/definitions/Identifier"
},
"nsName": {
"description": "Human-readable name of the NS instance to be created.\n",
"type": "string"
},
"nsDescription": {
"description": "Human-readable description of the NS instance to be created.\n",
"type": "string"
}
}
}
}
\ No newline at end of file
{{
"nsdId": "{nsdId}",
"nsName": "{nsInstanceName}",
"vimAccountId": "{vimAccountId}",
"nsDescription": "{nsInstanceDescription}"
}}
\ No newline at end of file
{
"degreeHealing": "HEAL_RESTORE"
}
\ No newline at end of file
{{
"degreeHealing": "{nsDegreeHealing}"
}}
\ No newline at end of file
{
"nsFlavourId": 0
}
\ No newline at end of file
{{
"nsFlavourId": {nsFlavourId}
}}
\ 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