diff --git a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot index 2ff40359ef50c4867f8ffc10cc39ba13fab7df26..47a1aa7a0819a1783dbf8a19da3fe9f205e49d38 100644 --- a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot +++ b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot @@ -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. diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index 9304e5e069b767abe1985d5eb2a73dbfc3cd0329..325d91c6ba1e0f3d46274d369446622cdf99a394 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -4,13 +4,14 @@ Resource environment/subscriptions.txt Resource environment/nsDescriptors.txt # Specific nsDescriptors Parameters Resource environment/pnfDescriptors.txt # Specific pnfDescriptors Parameters Resource environment/individualSubscription.txt -Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=false Library MockServerLibrary Library OperatingSystem Library BuiltIn Library JSONLibrary Library Collections Library JSONSchemaLibrary schemas/ +Library RequestsLibrary Library Process Library String @@ -65,7 +66,7 @@ Get all Network Service Descriptors Information without authorization token Get all Network Service Descriptors Information with expired or revoked authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as it is not supporting authentication - Log The GET method queries using invalid token + Log The GET method queries using invalid token Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} Log Execute Query and validate response @@ -203,7 +204,6 @@ GET Individual Network Service Descriptor Information with invalid resource iden Integer response status 404 ${output}= Output response Set Suite Variable ${response} ${output} - Set Suite Variable ${usageState} ${response['body']['nsdUsageState']} Send PATCH to disable Individual Network Service Descriptor Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in enabled operational state @@ -333,14 +333,13 @@ Get NSD Content in Zip Format Log Trying to get a NSD present in the NFVO Catalogue Set Headers {"Accept": "${ACCEPT_ZIP}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content ${output}= Output response Set Suite Variable ${response} ${output} Get single file NSD Content in Plain or Zip Format Log Trying to get a NSD present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content ${output}= Output response @@ -348,10 +347,9 @@ Get single file NSD Content in Plain or Zip Format Get multi file NSD Content in Plain or Zip Format Log Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content ${output}= Output response Set Suite Variable ${response} ${output} @@ -359,14 +357,13 @@ Get multi file NSD Content in Plain Format Log Trying to get a negative case performing a get on a NSD present in the NFVO Catalogue. Accept will be text/plain but NSD is composed my multiple files. Set Headers {"Accept": "${ACCEPT_PLAIN}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content + GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdDownloadableZip}/nsd_content ${output}= Output response Set Suite Variable ${response} ${output} Get NSD Content with invalid resource identifier Log Trying to perform a negative get, using an erroneous package ID - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${erroneous_nsdInfoId}/nsd_content ${output}= Output response @@ -374,8 +371,7 @@ Get NSD Content with invalid resource identifier Get NSD Content with conflict due to onboarding state Log Trying to get a VNFD from a given NSD Management present in the NFVO Catalogue - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Accept": "${ACCEPT_ZIP}, ${ACCEPT_PLAIN}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${notOnboardedNsdInfoId}/nsd_content ${output}= Output response @@ -402,48 +398,39 @@ GET NSD Content with invalid Range Request Set Suite Variable ${response} ${output} Send PUT Request to upload NSD Content as zip file in asynchronous mode - 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 File ${contentZipFile} - PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content ${body} - ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + Create Session nbi ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} headers={"Accept": "${ACCEPT_JSON}", "Content-Type": "application/zip", "Authorization": "${AUTHORIZATION}"} verify=False + ${body}= Get Binary File ${contentZipFile} + ${response}= Put Request nbi ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content data=${body} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Set Suite Variable ${response} ${response} + Send PUT Request to upload NSD Content as plain text file in asynchronous mode Log Trying to perform a PUT. This method upload the content of a NSD - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Create Session nbi ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} headers={"Accept": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}", "Content-Type": "text/plain"} verify=False ${body}= Get File ${contentPlainFile} - PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content ${body} - ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + ${response}= Put Request nbi ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content data=${body} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Set Suite Variable ${response} ${response} Send PUT Request to upload NSD Content as zip file in synchronous mode - 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 File ${contentZipFile} - PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content ${body} - ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + Create Session nbi ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} headers={"Accept": "${ACCEPT_JSON}", "Content-Type": "application/zip", "Authorization": "${AUTHORIZATION}"} verify=False + ${body}= Get Binary File ${contentZipFile} + ${response}= Put Request nbi ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content data=${body} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Set Suite Variable ${response} ${response} Send PUT Request to upload NSD Content as plain text file in synchronous mode Log Trying to perform a PUT. This method upload the content of a NSD - Set Headers {"Accept": "${ACCEPT_PLAIN}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + Create Session nbi ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} headers={"Accept": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}", "Content-Type": "text/plain"} verify=False ${body}= Get File ${contentPlainFile} - PUT ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdPlain}/nsd_content ${body} - ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + ${response}= Put Request nbi ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content data=${body} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Set Suite Variable ${response} ${response} Check Post Condition NSD Content has been Uploaded Log Checking NsdOnboardingNotification Recieved @@ -653,7 +640,6 @@ GET Individual PNF Descriptor Information with invalid resource identifier Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${erroneous_pnfdInfoId} - Integer response status 404 ${output}= Output response Set Suite Variable ${response} ${output} @@ -742,14 +728,13 @@ Get PNFD Content with conflict due to onboarding state Send PUT Request to upload PNFD Content as plain text file 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 File ${contentFilePnfd} - PUT ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoId}/pnfd_content ${body} - ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + Create Session pnfd ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} headers={"Accept": "${ACCEPT_PLAIN}", "Content-Type": "${ACCEPT_PLAIN}", "Authorization": "${AUTHORIZATION}"} verify=False + ${body}= Get Binary File ${contentZipFile} + ${response}= Put Request pnfd ${apiRoot}/${apiName}/${apiVersion}/pnf_descriptors/${pnfdInfoUpld}/pnfd_content data=${body} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Set Suite Variable ${response} ${response} + Send PUT Request to upload PNFD Content with conflict due to onboarding state Log Trying to perform a PUT. This method upload the content of a PNFD @@ -830,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 @@ -843,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 @@ -895,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 @@ -910,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']} @@ -937,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 @@ -980,13 +970,13 @@ Send Delete request for individual NSD Management Subscription with invalid reso Set Suite Variable ${response} ${output} Send Post request for individual NSD Management Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId} ${output}= Output response Set Suite Variable ${response} ${output} Send Put request for individual NSD Management Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -995,7 +985,7 @@ Send Put request for individual NSD Management Subscription Set Suite Variable ${response} ${output} Send Patch request for individual NSD Management Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt index b16e19ee9d6f66bc9c2da0e885b399b15737addb..72804bd3ac36d2667c41c9acd7b9d8f0654d2733 100644 --- a/SOL005/NSDManagement-API/environment/nsDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/nsDescriptors.txt @@ -1,9 +1,10 @@ *** Variables *** ${POS_FIELDS} name=nsdOnboardingState ${NEG_FIELDS} wrongName=any_value -${nsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 -${nsdInfoIdPlain} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 -${nsdInfoIdZip} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 +${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 @@ -19,7 +20,7 @@ ${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 -${contentZipFile} files/nsdContent.zip +${contentZipFile} files/nsdContent.tar.gz ${contentPlainFile} files/nsdContent.yaml ${creatingNsdInfoId} 71241932-994a-46e2-ad6c-1740674dda44 ${NEG_AUTHORIZATION} Bearer negativetoken diff --git a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt index c3bf1896b6bff7e232e8f6e2b877f6e3547b62a0..57b78b807697b567061299adf82cf40f0146717c 100644 --- a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt @@ -1,7 +1,8 @@ *** Variables *** ${POS_FIELDS} name=pnfdOnboardingState ${NEG_FIELDS} wrongName=any_value -${pnfdInfoId} 40853bda-8a8f-4f63-9130-cef439f65348 +${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 @@ -10,6 +11,6 @@ ${ACCEPT_PLAIN} text/plain ${CONTENT_TYPE_PLAIN} text/plain ${erroneous_pnfdId} erroneousPnfdId ${onboardingStatePnfdId} 8ed2bf1f-f6ae-4d18-b478-bfab02fd4cd2 -${contentFilePnfd} files/pnfdContent.zip +${contentFilePnfd} files/nsdContent.yaml ${creatingPnfdId} 2e4ce0ef-3ea8-49f9-92dd-8771866015bb ${userDefinedDataSet} some \ No newline at end of file diff --git a/SOL005/NSDManagement-API/environment/subscriptions.txt b/SOL005/NSDManagement-API/environment/subscriptions.txt index d8c0411021732e5676a5aa65e2dc168a37e48d82..72c529236af0533e95b114b5053e4fa3bc8eb0be 100644 --- a/SOL005/NSDManagement-API/environment/subscriptions.txt +++ b/SOL005/NSDManagement-API/environment/subscriptions.txt @@ -1,4 +1,5 @@ *** 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 diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index 9de189269667ca498646849674ee0e05086a72e0..1d057864d1db58ea8a0ceb6a7542ee917c2ac73b 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -1,18 +1,18 @@ *** Variables *** -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO +${NFVO_PORT} 9999 # Listening port of the NFVO ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${AUTHORIZATION} Bearer lTxE0BXRcVPjlIUwHLVH5Dtjl39sZ9qp ${CONTENT_TYPE_JSON} application/json ${ACCEPT_JSON} application/json -${apiRoot} / +${apiRoot} /osm/ ${AUTH_USAGE} 1 ${NEG_AUTHORIZATION} Bearer negativetoken ${apiVersion} v1 ${apiName} nsd ${FIELD_USAGE} 1 -${NFVO_AUTHENTICATION} Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 -${NFVO_AUTH_USAGE} 1 +${NFVO_AUTHENTICATION} Bearer isDGF7TiifGUgzeNb0Fls9aatfZRy4iX #never referenced +${NFVO_AUTH_USAGE} 1 #never refernced ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar diff --git a/SOL005/NSDManagement-API/files/nsdContent.yaml b/SOL005/NSDManagement-API/files/nsdContent.yaml new file mode 100644 index 0000000000000000000000000000000000000000..94b9907bec8224f4d7ea44b751bf24551231a4f1 --- /dev/null +++ b/SOL005/NSDManagement-API/files/nsdContent.yaml @@ -0,0 +1,16 @@ +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: [] diff --git a/SOL005/NSDManagement-API/files/nsdContent.zip b/SOL005/NSDManagement-API/files/nsdContent.zip new file mode 100644 index 0000000000000000000000000000000000000000..7518dd85af2450c67ce648cb1a80760070040652 Binary files /dev/null and b/SOL005/NSDManagement-API/files/nsdContent.zip differ diff --git a/SOL005/NSDManagement-API/jsons/subscriptions.json b/SOL005/NSDManagement-API/jsons/subscriptions.json index c77b51999214233c08d34136b13b83f06821654a..92a9db1b03b5a34472817ea7475b3872da41b3c3 100644 --- a/SOL005/NSDManagement-API/jsons/subscriptions.json +++ b/SOL005/NSDManagement-API/jsons/subscriptions.json @@ -1,3 +1,3 @@ { - "callbackUri": "http://172.22.1.7:9091/nsd/subscriptions" + "callbackUri": "{notifCallbackUri}" } \ No newline at end of file diff --git a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot index a1c10db6a5c0504d3e697641b594b19db5dccdf0..f2df28a614fc7856a64900bc72d285b58993c240 100644 --- a/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot +++ b/SOL005/NSFaultManagement-API/NSFMOperationKeywords.robot @@ -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} diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index 7f86938c5d15e5aeb5f9385cd0968651d1e99286..f1f00fbe737de6d18e621e3bf01984c6fda3ebe5 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -1,15 +1,15 @@ *** Variables *** -${NFVO_HOST} localhost # Hostname of the VNFM -${NFVO_PORT} 8080 # Listening port of the VNFM +${NFVO_HOST} 172.21.248.145 # Hostname of the VNFM +${NFVO_PORT} 9999 # Listening port of the VNFM ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${AUTHORIZATION} Bearer 7EiP8HbWqpAaWVcZojq5WGm8theaCiym ${ACCEPT} application/json ${ACCEPT_JSON} application/json ${AUTH_USAGE} 1 ${alarm_filter} nsInstanceId ${nsInstanceId} 007c111c-38a1-42c0-a666-7475ecb1567c ${invalid_alarm_filter} badFilter -${apiRoot} / +${apiRoot} /osm ${apiName} nsfm ${apiVersion} v1 ${CONTENT_TYPE} application/json @@ -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 diff --git a/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json index 0f22fd8bbfc47a3584d8fa0ab6fdea372ebd79c7..e9a8b3b0120b63ec56eaa8e2330b2f9f14f8c08d 100644 --- a/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json +++ b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json @@ -1,10 +1,10 @@ -{ - "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 diff --git a/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot b/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot index 9092991e18f3d77c9af4d5c115d96e77bf383ecd..ae2915934654b47364b067847db209ac4eb6906b 100644 --- a/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot +++ b/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot @@ -24,4 +24,14 @@ NS Instance Creation Check HTTP Response Body Json Schema Is NsIdentifierCreationNotification Check resource not_instantiated - \ No newline at end of file +NS Instance Creation with DISABLED nsd + [Documentation] Test ID: 5.3.2.18.2 + ... Test title: NS Instance Creation with DISABLED nsd + ... Test objective: The objective is to test the workflow for Creating a NS instance with a disabled NSD + ... Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO in disabled operational state. + ... Reference: Clauses 6.4.2.3.1 and 5.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.6.1 + ... Config ID: Config_prod_NFVO + ... Applicability: none + ... Post-Conditions: none + POST New nsInstance with DISABLED nsd + Check HTTP Response Status Code Is 409 \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot b/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot index 480600cca790a8577baa6e5f49fb261f2baac2d6..fe061b72720b701f891dd41b4f548eded3ba7b6a 100644 --- a/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot +++ b/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot @@ -20,4 +20,4 @@ NS Instance Deletion DELETE IndividualNSInstance Check HTTP Response Status Code Is 204 Check HTTP Response Body Json Schema Is NsIdentifierDeletionNotification - Check Instance Deleted \ No newline at end of file + Check Instance Deleted diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index a11b0047ca9246ff98ed24e72cd80bfc0d1f37b4..49c77d238ed337e560a756903c061c6099d6aa82 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -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,11 +217,23 @@ POST New 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/CreateNsRequest.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} +POST New nsInstance with DISABLED nsd + Log Create NS instance by POST to ${apiRoot}/${apiName}/${apiVersion}/ns_instances + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} + ${template}= Get File jsons/CreateNsRequest.json + ${body}= Format String ${template} nsdId=${disabledNsdId} nsInstanceName=${nsInstanceName} vimAccountId=${vimAccountId} nsInstanceDescription=${nsInstanceDescription} + Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + GET NsInstances Log Query NS The GET method queries information about multiple NS instances. Set Headers {"Accept":"${ACCEPT}"} @@ -396,7 +411,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/InstantiateNsRequest.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} @@ -440,7 +456,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/ScaleNsRequest.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} @@ -484,7 +501,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} @@ -528,7 +546,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} @@ -699,7 +718,7 @@ GET Individual NS LCM OP Occurrence Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Log Execute Query and validate response - Get ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} + Get ${apiRoot}/${apiName}/${apiVersion}/ns_lcm_op_occs/${nsLcmOpOccId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -915,7 +934,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} @@ -926,7 +946,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} @@ -937,7 +958,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} diff --git a/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot b/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot index 9e9870149c4e7ad783e24e75edb5665f09a6ca23..20d927b2efa5691b1059e61eb3e188fc5986b5bb 100644 --- a/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot +++ b/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot @@ -20,6 +20,7 @@ POST Terminate a NSInstance Check HTTP Response Status Code Is 202 Check HTTP Response Header Contains Location Check resource not_instantiated + Sleep 15s POST Terminate a NSInstance Conflict [Documentation] Test ID: 5.3.2.7.2 diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 94a133ae40765be6092abcd73f89f7db450a59b9..9ad60b9bcc748ed9054fa91311915693b3207616 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -1,26 +1,31 @@ *** Variables *** ${VNFM_HOST} localhost # Hostname of the VNFM ${VNFM_PORT} 8080 # Listening port of the VNFM -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO +${NFVO_PORT} 9999 # Listening port of the NFVO ${VNFM_SCHEMA} https ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ== +${AUTHORIZATION} Bearer RW6sV6rtFa3TUEdazW4Dyd66muED2kBA ${CONTENT_TYPE} application/json ${CONTENT_TYPE_PATCH} application/merge-patch+json ${ACCEPT_JSON} application/json ${ACCEPT} application/json -${apiRoot} / +${apiRoot} /osm/ ${apiName} nslcm ${apiVersion} v1 ${AUTH_USAGE} 1 ${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX -${nsInstanceId} 6fc3539c-e602-4afa-8e13-962fb5a7d81f +${nsdId} 9e708376-4f96-4972-89c2-243760626f20 +${disabledNsdId} 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 @@ -28,7 +33,7 @@ ${nsPkgId_processing} 007c111c-38a1-42c0-a666-7475ecb1567c ${ARTIFACT_TYPE} application/octet-stream ${ARTIFACT_ID} artifactId ${WRONG_ACCEPT} application/json -${nsLcmOpOccId} 6fc3539c-e602-4afa-8e13-962fb5a7d81d +${nsLcmOpOccId} 4f704476-6a4f-4473-be24-2868b94ac214 ${CancelMode} GRACEFUL ${NFVO_DUPLICATION} 0 ${sub_filter} filter @@ -38,9 +43,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 diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json index eb879873a2ec8a5686bc32f29c4c76ef5233ef84..a8026a8109ee679fc97c2e00eafd76e493fb0216 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json @@ -1,24 +1,6 @@ -{ -"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 diff --git a/SOL005/NSLifecycleManagement-API/jsons/HealNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/HealNsRequest.json index 2922dc4a1b0749186d777ae1735226a9196dcb56..b8fa38ecbc2d25eb246284ccf08446a2dc9a68a3 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/HealNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/HealNsRequest.json @@ -1,3 +1,3 @@ -{ - "degreeHealing": "HEAL_RESTORE" -} \ No newline at end of file +{{ + "degreeHealing": "{nsDegreeHealing}" +}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json b/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json new file mode 100644 index 0000000000000000000000000000000000000000..60eee0859feda3a38281b3f1f95fd1a50ad71c8c --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json @@ -0,0 +1,3 @@ +{{ + "nsFlavourId": {nsFlavourId} +}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/LccnSubscriptionRequest.json b/SOL005/NSLifecycleManagement-API/jsons/LccnSubscriptionRequest.json index 091cc0cdb4c87e448f4ff5862a7db94009c328f7..4a6434f53956387602a3a507441c3eed33f8b1dc 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/LccnSubscriptionRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/LccnSubscriptionRequest.json @@ -1,10 +1,10 @@ -{ - "filter": { - "nsInstanceSubscriptionFilter": { +{{ + "filter": {{ + "nsInstanceSubscriptionFilter": {{ "nsdIds": [ - "6fc3539c-e602-4afa-8e13-962fb5a7d81f" + "{nsdId}" ] - } - }, - "callbackUri": "http://127.0.0.1/subscribe" -} \ No newline at end of file + }} + }}, + "callbackUri": "{callbackUri}{callbackEndpoint}" +}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json new file mode 100644 index 0000000000000000000000000000000000000000..39d410cfd850b83ca62502e92146a32242934c2b --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json @@ -0,0 +1,11 @@ +{{ + "scaleType": "{scaleType}", + "timeout_ns_scale": {scaleTimeout}, + "scaleVnfData": {{ + "scaleVnfType": "{scaleVnfType}", + "scaleByStepData": {{ + "scaling-group-descriptor": "{scaleGroupDescriptor}", + "member-vnf-index": "{scaleMemberVnfIndex}" + }} + }} +}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json index a65d7d3b024c779688898bec5213ae81e4664ea7..65e326002f3be2d7c61ece501943eb87c7496400 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json @@ -1,3 +1,4 @@ { - "terminationTime": "2021-04-12T23:20:50.52Z" + "timeout_ns_terminate": 1, + "autoremove": false } \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json index 64a2c0f4c92a484b3509044a5d4298a701effedd..336075de401be9e5b45d32555f44b27b3fa12fc0 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/UpdateNsRequest.json @@ -1,3 +1,3 @@ -{ - "updateType": "ADD_VNF" -} \ No newline at end of file +{{ + "updateType": "{vnfUpdateType}" +}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/scaleNsToLevelRequest.json b/SOL005/NSLifecycleManagement-API/jsons/scaleNsToLevelRequest.json index 1c39a7bb51571dfc2af274795d0bc9d932eccafd..ca0ea8d3fea407220ef2b6537ab9be062994a73b 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/scaleNsToLevelRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/scaleNsToLevelRequest.json @@ -1,3 +1,3 @@ -{ - "instantiationLevelId": "myNextLevel" -} \ No newline at end of file +{{ + "instantiationLevelId": "{instantiationLevelId}" +}} \ No newline at end of file diff --git a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot index fd2302fac9211f4673b259cd6a8ca50c1d3c57b6..48a306e048d0fe3e8d688053568208ef72218393 100644 --- a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot +++ b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot @@ -89,7 +89,8 @@ Send Post Request Create new NS Performance Monitoring Job Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body}= Get File jsons/CreatePmJobRequest.json + ${template}= Get File jsons/CreatePmJobRequest.json + ${body}= Format String ${template} pmJobId=${pmJobId} POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -273,7 +274,7 @@ Check HTTP Response Body Pm Job Identifier matches the requested Pm Job Get Individual Performance Report Log Trying to get a performance report present in the NFVO Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} ${output}= Output response Set Suite Variable ${response} ${output} @@ -281,21 +282,21 @@ Get Individual Performance Report Get Individual Performance Report with invalid resource endpoint Log Trying to get a performance report with invalid resource endpoint Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${erroneousReportId} ${output}= Output response Set Suite Variable ${response} ${output} Send Post request for Individual Performance Report Log Trying to create new performance report - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${newReportId} ${output}= Output response Set Suite Variable ${response} ${output} Send Put request for Individual Performance Report Log Trying to update performance report - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -305,7 +306,7 @@ Send Put request for Individual Performance Report Send Patch request for Individual Performance Report Log Trying to update performance report - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -315,7 +316,7 @@ Send Patch request for Individual Performance Report Send Delete request for Individual Performance Report Log Trying to delete performance report - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} ${output}= Output response Set Suite Variable ${response} ${output} @@ -343,7 +344,7 @@ Check Postcondition NS Individual Performance Report is Unmodified (Implicit) GET all Performance Thresholds Log Trying to get all thresholds present in the NFVO Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds ${output}= Output response Set Suite Variable ${response} ${output} @@ -359,7 +360,7 @@ GET Performance Thresholds with attribute-based filter GET Performance Thresholds with invalid attribute-based filter Log Trying to get thresholds present in the NFVO with invalid filter Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds?${FILTER_KO} ${output}= Output response Set Suite Variable ${response} ${output} @@ -367,24 +368,25 @@ GET Performance Thresholds with invalid attribute-based filter GET NS performance Thresholds with invalid resource endpoint Log Trying to get thresholds present in the NFVO with invalid resource endpoint Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/threshold ${output}= Output response Set Suite Variable ${response} ${output} Send Post Request Create new Performance Threshold Log Creating a new THreshold - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${request}= Get File jsons/CreateThresholdRequest.json + ${template}= Get File jsons/CreateThresholdRequest.json + ${body}= Format String ${template} pmJobId=${pmJobId} POST ${apiRoot}/${apiName}/${apiVersion}/thresholds ${request} ${output}= Output response Set Suite Variable ${response} ${output} Send PUT Request for all Performance Thresholds Log PUT THresholds - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} PUT ${apiRoot}/${apiName}/${apiVersion}/thresholds @@ -393,7 +395,7 @@ Send PUT Request for all Performance Thresholds Send PATCH Request for all Performance Thresholds Log PUT THresholds - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/thresholds @@ -402,7 +404,7 @@ Send PATCH Request for all Performance Thresholds Send DELETE Request for all Performance Thresholds Log DELETE THresholds - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds ${output}= Output response Set Suite Variable ${response} ${output} @@ -430,7 +432,7 @@ Check HTTP Response Body Thresholds match the requested attribute-based filter GET Individual NS performance Threshold Log Trying to get a Threhsold present in the NFVO Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} ${output}= Output response Set Suite Variable ${response} ${output} @@ -438,28 +440,28 @@ GET Individual NS performance Threshold GET individual NS performance Threshold with invalid resource identifier Log Trying to get a Threhsold with invalid resource endpoint Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} ${output}= Output response Set Suite Variable ${response} ${output} Send Delete request for individual NS performance Threshold Log Trying to delete a Threhsold in the NFVO - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} ${output}= Output response Set Suite Variable ${response} ${output} Send Delete request for individual NS performance Threshold with invalid resource identifier Log Trying to delete a Threhsold in the NFVO with invalid id - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} ${output}= Output response Set Suite Variable ${response} ${output} Send Post request for individual NS performance Threshold Log Trying to create new threshold - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/thresholds/${newThresholdId} ${output}= Output response Set Suite Variable ${response} ${output} @@ -467,7 +469,7 @@ Send Post request for individual NS performance Threshold Send Put request for individual NS performance Threshold Log Trying to PUT threshold Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -478,7 +480,7 @@ Send Put request for individual NS performance Threshold Send Patch request for individual NS performance Threshold Log Trying to PUT threshold Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${thresholdId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -576,8 +578,9 @@ Send Post Request for NS Performance Subscription Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Set headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + ${template}= Get File jsons/subscriptions.json + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} ${output}= Output response Set Suite Variable ${response} ${output} Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} == 1 @@ -597,8 +600,9 @@ Send Post Request for Duplicated NS Performance Subscription Set headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Set headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - ${body_request}= Get File jsons/subscriptions.json - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body_request} + ${template}= Get File jsons/subscriptions.json + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} ${output}= Output response Set Suite Variable ${response} ${output} Run Keyword If ${NFVO_CHECKS_NOTIF_ENDPOINT} @@ -663,7 +667,8 @@ Check HTTP Response Body Subscriptions Match the requested Attribute-Based Filte Check HTTP Response Body PmSubscription 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} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} ${subscription}= evaluate json.loads('''${body}''') json Should Be Equal ${response['body']['callbackUri']} ${subscription['callbackUri']} @@ -690,7 +695,8 @@ Check Postcondition Subscription Resource URI Returned in Location Header Is Ava ${result}= Output response body Validate Json PmSubscriptions.schema.json ${result} Log Validated PmSubscriptions schema - ${body}= Get File jsons/subscriptions.json + ${template}= Get File jsons/subscriptions.json + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} ${subscription}= evaluate json.loads('''${body}''') json Should Be Equal ${result['callbackUri']} ${subscription['callbackUri']} Log Validated Issued subscription is same as original diff --git a/SOL005/NSPerformanceManagement-API/environment/IndividualPmJob.txt b/SOL005/NSPerformanceManagement-API/environment/IndividualPmJob.txt index 99a00a7484150980769bc2d9c572d6dafc1331b5..cde92cf924a80606e6464a4dfb202ea34211225c 100644 --- a/SOL005/NSPerformanceManagement-API/environment/IndividualPmJob.txt +++ b/SOL005/NSPerformanceManagement-API/environment/IndividualPmJob.txt @@ -1,5 +1,5 @@ *** Variables *** -${pmJobId} 29f4ff6a-be91-4ec8-856e-fcf1e2479e4e +${pmJobId} 1f50d68b-82e8-4deb-bd40-c934d4d1ac0a ${erroneousPmJobId} erroneousPmJobId ${response}= httpresponse ${OrigResponse}= httpresponse diff --git a/SOL005/NSPerformanceManagement-API/environment/variables.txt b/SOL005/NSPerformanceManagement-API/environment/variables.txt index 64de1566ed183475beac88efd2a969031e80397f..6b07f6ad8dccc7319373e1203433320693b303f3 100644 --- a/SOL005/NSPerformanceManagement-API/environment/variables.txt +++ b/SOL005/NSPerformanceManagement-API/environment/variables.txt @@ -1,11 +1,11 @@ *** Variables *** -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO +${NFVO_PORT} 9999 # Listening port of the NFVO ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${AUTHORIZATION} Bearer ivwDluws6XVhdFqGznZiw8cK1wP67S9b ${CONTENT_TYPE_JSON} application/json ${ACCEPT_JSON} application/json -${apiRoot} / +${apiRoot} /osm ${AUTH_USAGE} 1 ${NEG_AUTHORIZATION} Bearer negativetoken ${apiVersion} v1 @@ -26,5 +26,9 @@ ${sleep_interval} 20s ${total_polling_time} 2 min ${polling_interval} 10 sec - -${response} +${performanceMetric} cpu_util +${thresholdType} SIMPLE +${thresholdValue} 10 +${hysteresis} 50 +${collectionPeriod} 10 +${reportingPeriod} 30 \ No newline at end of file diff --git a/SOL005/NSPerformanceManagement-API/jsons/CreatePmJobRequest.json b/SOL005/NSPerformanceManagement-API/jsons/CreatePmJobRequest.json index 75549f534008035d1c44877387a37021e764c190..506e254752a4e030563c24468c28586b5882e3ac 100644 --- a/SOL005/NSPerformanceManagement-API/jsons/CreatePmJobRequest.json +++ b/SOL005/NSPerformanceManagement-API/jsons/CreatePmJobRequest.json @@ -1,9 +1,9 @@ -{ - "objectInstanceIds": ["1f50d68b-82e8-4deb-bd40-c934d4d1ac0a"], - "criteria": { - "performanceMetric": [], +{{ + "objectInstanceIds": ["{pmJobId}"], + "criteria": {{ + "performanceMetric": "{performanceMetric}", "performanceMetricGroup": [], - "collectionPeriod": 10, - "reportingPeriod": 30 - } -} \ No newline at end of file + "collectionPeriod": {collectionPeriod}, + "reportingPeriod": {reportingPeriod} + }} +}} \ No newline at end of file diff --git a/SOL005/NSPerformanceManagement-API/jsons/CreateThresholdRequest.json b/SOL005/NSPerformanceManagement-API/jsons/CreateThresholdRequest.json index 1e58c2bac513f36d37597e8f11bbe06d68b664cc..e5b0b975cef2efe7690becfdb99ae08b1dcd2c71 100644 --- a/SOL005/NSPerformanceManagement-API/jsons/CreateThresholdRequest.json +++ b/SOL005/NSPerformanceManagement-API/jsons/CreateThresholdRequest.json @@ -1,12 +1,11 @@ -{ - "objectInstanceIds" : "1f50d68b-82e8-4deb-bd40-c934d4d1ac0a", - "criteria" : { - "performanceMetric": "cpu_util", - "thresholdType": "SIMPLE", - "simpleThresholdDetails": { - "thresholdValue": 10, - "hysteresis": 50 - } - - } -} \ No newline at end of file +{{ + "objectInstanceIds" : "{pmJobId}", + "criteria" : {{ + "performanceMetric": "{performanceMetric}", + "thresholdType": "{thresholdType}", + "simpleThresholdDetails": {{ + "thresholdValue": {thresholdValue}, + "hysteresis": {hysteresis} + }} + }} +}} \ No newline at end of file diff --git a/SOL005/NSPerformanceManagement-API/jsons/subscriptions.json b/SOL005/NSPerformanceManagement-API/jsons/subscriptions.json index 6293d99d2b56eb51db7fdd6c23884ffb69af0077..3ca4fc25ae9b33163639f7041e3f50efe537c320 100644 --- a/SOL005/NSPerformanceManagement-API/jsons/subscriptions.json +++ b/SOL005/NSPerformanceManagement-API/jsons/subscriptions.json @@ -1,6 +1,6 @@ -{ - "callbackUri": "http://172.22.1.7:9091/nspm/subscriptions", - "filter": { +{{ + "callbackUri": "{callback_uri}{callback_endpoint}", + "filter": {{ "notificationTypes": ["ThresholdCrossedNotification"] - } -} \ No newline at end of file + }} +}} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index ff83f44c601054446ece0a46dc88e86295f28a65..4efc809be1bf3b62de6700238b6a0dc60beeee27 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -173,7 +173,7 @@ GET all VNF Packages with invalid resource endpoint Log Trying to perform a GET on a erroneous URI Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_package + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId} ${output}= Output response Set Suite Variable ${response} ${output} @@ -266,7 +266,7 @@ Send PATCH to disable Individual VNF Package 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 jsons/NsdInfoModificationDisable.json + ${body}= Get File jsons/VnfPkgInfoModificationsDisabled.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} ${body} ${output}= Output response @@ -281,7 +281,7 @@ Send PATCH to enable Individual VNF Package Log Trying to perform a PATCH. As prerequisite the nsdInfo shall be in disabled operational state Set Headers {"Accept": "${ACCEPT_JSON}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} - ${body}= Get File jsons/NsdInfoModificationEnable.json + ${body}= Get File jsons/VnfPkgInfoModifications.json Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} ${body} ${output}= Output response @@ -387,7 +387,7 @@ Get VNFD in Individual VNF Package with conflict due to onboarding state Send POST Request for VNFD in individual VNF Package Log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd ${output}= Output response @@ -639,7 +639,8 @@ Send POST Request to upload VNF Package Content from URI 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 File jsons/UploadVnfPkgFromUriRequest.json + ${template}= Get File jsons/UploadVnfPkgFromUriRequest.json + ${body}= Format String ${template} vnfPkgUri=${vnfPkgUri} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgViaUriId}/package_content/upload_from_uri ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -648,7 +649,8 @@ Send POST Request to upload VNF Package Content from URI with conflict due to on 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 File jsons/UploadVnfPkgFromUriRequest.json + ${template}= Get File jsons/UploadVnfPkgFromUriRequest.json + ${body}= Format String ${template} vnfPkgUri=${vnfPkgUri} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${creatingVnfPkgViaUriId}/package_content/upload_from_uri ${body} ${output}= Output response Set Suite Variable ${response} ${output} @@ -728,7 +730,8 @@ Send Post Request for VNF Package 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} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} ${output}= Output response @@ -740,7 +743,8 @@ Send Post Request for Duplicated VNF Package 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} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} ${output}= Output response @@ -776,7 +780,8 @@ Check Postcondition VNF Package Subscriptions Exists Check HTTP Response Body PkgmSubscription 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} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} ${subscription}= evaluate json.loads('''${body}''') json Should Be Equal ${response['body']['callbackUri']} ${subscription['callbackUri']} @@ -806,7 +811,8 @@ Check Postcondition Subscription Resource Returned in Location Header Is Availab ${result}= Output response body Validate Json PkgmSubscription.schema.json ${result} Log Validated PkgmSubscription schema - ${body}= Get File jsons/subscriptions.json + ${template}= Get File jsons/subscriptions.json + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} ${subscription}= evaluate json.loads('''${body}''') json Should Be Equal ${result['callbackUri']} ${subscription['callbackUri']} Log Validated Issued subscription is same as original @@ -849,13 +855,13 @@ Send Delete request for individual VNF Package Subscription with invalid resourc Set Suite Variable ${response} ${output} Send Post request for individual VNF Package Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId} ${output}= Output response Set Suite Variable ${response} ${output} Send Put request for individual VNF Package Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -864,7 +870,7 @@ Send Put request for individual VNF Package Subscription Set Suite Variable ${response} ${output} Send Patch request for individual VNF Package Subscription - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} ${origOutput}= Output response Set Suite Variable ${origResponse} ${origOutput} @@ -928,7 +934,8 @@ Check Notification Endpoint Check HTTP Response Body Matches the Subscription Log Check Response matches subscription - ${body}= Get File jsons/subscriptions.json + ${template}= Get File jsons/subscriptions.json + ${body}= Format String ${template} callback_uri=${callback_uri} callback_endpoint=${callback_endpoint} vnfPkgId=${vnfPkgId} ${subscription}= evaluate json.loads('''${body}''') json Should Be Equal As Strings ${response['body']['callbackUri']} ${subscription['callbackUri']} diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt index 80469cdfead4dc91b9668e91d26b19968ed0f798..36cafcc881e732edfdd6b4f4c8757a3065e55788 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -1,12 +1,12 @@ *** Variables *** -${NFVO_HOST} localhost # Hostname of the NFVO -${NFVO_PORT} 8081 # Listening port of the NFVO +${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO +${NFVO_PORT} 9999 # Listening port of the NFVO ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 +${AUTHORIZATION} Bearer Vr37Kbwr4eWZUNoSpWwy49mkxVmpmPWG ${CONTENT_TYPE_JSON} application/json ${ACCEPT_JSON} application/json -${apiRoot} / +${apiRoot} /osm ${AUTH_USAGE} 1 ${NEG_AUTHORIZATION} Bearer negativetoken ${apiVersion} v1 @@ -20,8 +20,8 @@ ${testOptionalMethods} 0 ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -${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 diff --git a/SOL005/VNFPackageManagement-API/environment/vnfPackageContentViaUri.txt b/SOL005/VNFPackageManagement-API/environment/vnfPackageContentViaUri.txt index 9cb902861d34f0dc7c909832c489dc7a8cea5309..53981f9536954fb5ae90ce9155bb220ae681a789 100644 --- a/SOL005/VNFPackageManagement-API/environment/vnfPackageContentViaUri.txt +++ b/SOL005/VNFPackageManagement-API/environment/vnfPackageContentViaUri.txt @@ -1,4 +1,4 @@ *** Variables *** ${vnfPkgViaUriId} 788106a2-d692-44f3-a86d-384f0ce35e42 ${creatingVnfPkgViaUriId} d246ccdd-71aa-402f-b256-6a80ee54be3d - +${vnfPkgUri} http://localhost/content.zip diff --git a/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json b/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json index f76054e5fa6e0350cc2cafcff459bff2a88daab4..68534020426dcc0ab9cebe61a6e2e62a26718be6 100644 --- a/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json +++ b/SOL005/VNFPackageManagement-API/jsons/UploadVnfPkgFromUriRequest.json @@ -1,3 +1,3 @@ -{ -"addressInformation": "http://localhost/content.zip" -} \ No newline at end of file +{{ + "addressInformation": "{vnfPkgUri}" +}} \ No newline at end of file diff --git a/SOL005/VNFPackageManagement-API/jsons/subscriptions.json b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json index 4314ec0cee75d792059a04637926c589958f59a2..124004374232fc30da00625bcc01555365e8ddc9 100644 --- a/SOL005/VNFPackageManagement-API/jsons/subscriptions.json +++ b/SOL005/VNFPackageManagement-API/jsons/subscriptions.json @@ -1,6 +1,6 @@ -{ - "callbackUri": "http://127.0.0.1/subscribe", - "filter": { - "vnfPkgId": ["491ed430-67f5-4c6c-b78e-797f5d718868"] - } -} \ No newline at end of file +{{ + "callbackUri": "{callback_uri}{callback_endpoint}", + "filter": {{ + "vnfPkgId": ["{vnfPkgId}"] + }} +}} \ No newline at end of file