From eb39fbc09cae9803775ab73222e2eeca78c8c6c1 Mon Sep 17 00:00:00 2001 From: Frank Bryden Date: Tue, 30 Jun 2020 14:32:37 +0200 Subject: [PATCH 1/8] Issue fixes regarding NSD Management --- .../NSDManagementKeywords.robot | 118 +++++++++--------- .../NSDManagementNotification.robot | 2 + .../environment/nsDescriptors.txt | 9 +- .../environment/pnfDescriptors.txt | 5 +- .../environment/variables.txt | 17 +-- 5 files changed, 81 insertions(+), 70 deletions(-) diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index 9304e5e06..b6681872a 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,25 +333,24 @@ 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 + Rest Instances frankie.json ${output}= Output response Set Suite Variable ${response} ${output} 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 +358,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 +372,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 +399,54 @@ 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} + Log ${response} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Log ${response} + 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} + #Log Got frankie's put with ${response.status_code} + ${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}= 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 + Wait Until Keyword Succeeds ${retry} ${interval} Check Response is NsdOnboardingNotification + +Check Response is NsdOnboardingNotification ${response}= Output response body - Should Be Empty ${response} - ${output}= Output response - Set Suite Variable ${response} ${output} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= NsdOnboardingNotification .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + Check Post Condition NSD Content has been Uploaded Log Checking NsdOnboardingNotification Recieved @@ -653,7 +656,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 +744,16 @@ 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 github http://api.github.com + 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} + Log ${response} + Should Be Empty ${response.text} + ${response}= Create Dictionary status=${response.status_code} + Log ${response} + 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 @@ -980,13 +984,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 +999,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/NSDManagementNotification.robot b/SOL005/NSDManagement-API/NSDManagementNotification.robot index de6418c75..e2315bd50 100644 --- a/SOL005/NSDManagement-API/NSDManagementNotification.robot +++ b/SOL005/NSDManagement-API/NSDManagementNotification.robot @@ -295,6 +295,8 @@ Configure Notification Forward Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} Create Sessions + ${dir}= List Directory ${MOCK_SERVER_DIR} + Log ${dir} Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt index b16e19ee9..8c4ecdf58 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} 030b1c34-116a-4cfe-9226-19732c3a7b28 +${nsdInfoIdPlain} 20734bbb-abf6-4cd8-a35d-f416f95dc180 +${nsdInfoIdZip} 5548bf85-8580-4c52-90d1-13c1a7a1dcb0 +${nsdDownloadableZip} f3ce866a-a935-49db-9f39-8b14b662cedc ${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 c3bf1896b..1a7d70dbc 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} 3327be9e-f716-43ac-aaeb-fcd54b0a5369 #used for testing downloads +${pnfdInfoUpld} 93c4cca6-b68b-4aa0-b06a-0e3725995585 #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/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index 9de189269..9c5a80749 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -1,20 +1,23 @@ *** 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 +#auth token for OSM Access +${AUTHORIZATION} Bearer FJMG15bVJeJb4Y1t1fSKXFaCFUh0e8LD ${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 +#MOCK_SERVER_JAR one too many '..' +${MOCK_SERVER_JAR} ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar +${MOCK_SERVER_DIR} ../../bin/ ${callback_port} 9091 ${callback_uri} http://172.22.1.7:${callback_port} -- GitLab From 39963e1ab2bafaf8758c7257c0ebae0ea2d4a320 Mon Sep 17 00:00:00 2001 From: brydenf Date: Wed, 1 Jul 2020 15:37:24 +0200 Subject: [PATCH 2/8] Reverted extra changes Signed-off-by: brydenf --- SOL005/NSDManagement-API/NSDManagementKeywords.robot | 6 ------ SOL005/NSDManagement-API/NSDManagementNotification.robot | 2 -- SOL005/NSDManagement-API/environment/variables.txt | 2 -- 3 files changed, 10 deletions(-) diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index b6681872a..b2c513f74 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -342,7 +342,6 @@ Get single file NSD Content in Plain or Zip Format 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 - Rest Instances frankie.json ${output}= Output response Set Suite Variable ${response} ${output} @@ -402,10 +401,8 @@ Send PUT Request to upload NSD Content as zip file in asynchronous mode 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} - Log ${response} Should Be Empty ${response.text} ${response}= Create Dictionary status=${response.status_code} - Log ${response} Set Suite Variable ${response} ${response} @@ -423,7 +420,6 @@ Send PUT Request to upload NSD Content as zip file in synchronous mode ${body}= Get Binary File ${contentZipFile} ${response}= Put Request nbi ${apiRoot}/${apiName}/${apiVersion}/ns_descriptors/${nsdInfoIdZip}/nsd_content data=${body} Should Be Empty ${response.text} - #Log Got frankie's put with ${response.status_code} ${response}= Create Dictionary status=${response.status_code} Set Suite Variable ${response} ${response} @@ -748,10 +744,8 @@ Send PUT Request to upload PNFD Content as plain text file 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} - Log ${response} Should Be Empty ${response.text} ${response}= Create Dictionary status=${response.status_code} - Log ${response} Set Suite Variable ${response} ${response} diff --git a/SOL005/NSDManagement-API/NSDManagementNotification.robot b/SOL005/NSDManagement-API/NSDManagementNotification.robot index e2315bd50..de6418c75 100644 --- a/SOL005/NSDManagement-API/NSDManagementNotification.robot +++ b/SOL005/NSDManagement-API/NSDManagementNotification.robot @@ -295,8 +295,6 @@ Configure Notification Forward Create Mock Expectation With Http Forward ${notification_tmp} ${notification_fwd} Create Sessions - ${dir}= List Directory ${MOCK_SERVER_DIR} - Log ${dir} Start Process java -jar ${MOCK_SERVER_JAR} -serverPort ${callback_port} alias=mockInstance Wait For Process handle=mockInstance timeout=5s on_timeout=continue Create Mock Session ${callback_uri}:${callback_port} \ No newline at end of file diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index 9c5a80749..7d4b0a285 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -15,9 +15,7 @@ ${FIELD_USAGE} 1 ${NFVO_AUTHENTICATION} Bearer isDGF7TiifGUgzeNb0Fls9aatfZRy4iX #never referenced ${NFVO_AUTH_USAGE} 1 #never refernced -#MOCK_SERVER_JAR one too many '..' ${MOCK_SERVER_JAR} ../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar -${MOCK_SERVER_DIR} ../../bin/ ${callback_port} 9091 ${callback_uri} http://172.22.1.7:${callback_port} -- GitLab From e307fc45e44856084d2f282730a675d3ffdbc77d Mon Sep 17 00:00:00 2001 From: brydenf Date: Mon, 6 Jul 2020 10:46:18 +0200 Subject: [PATCH 3/8] New JS files. Merge with remote changes. --- .../environment/nsDescriptors.txt | 4 +- .../environment/variables.txt | 2 +- .../NSFaultManagement-API/Subscriptions.robot | 4 ++ .../environment/variables.txt | 8 ++-- .../DeleteNSInstanceWorkflow.robot | 2 +- .../NSInstances.robot | 4 ++ .../NSLCMOperationKeywords.robot | 9 +++-- .../TerminateNSTask.robot | 1 + .../environment/variables.txt | 12 +++--- .../jsons/CreateNs.json | 6 +++ .../jsons/InstantiateNs.json | 3 ++ .../jsons/ScaleNs.json | 11 +++++ .../jsons/TerminateNsRequest.json | 5 ++- .../NSPerformanceManagementKeywords.robot | 40 +++++++++---------- .../environment/variables.txt | 8 ++-- .../VNFPackageManagementKeywords.robot | 4 +- .../environment/variables.txt | 8 ++-- 17 files changed, 81 insertions(+), 50 deletions(-) create mode 100644 SOL005/NSLifecycleManagement-API/jsons/CreateNs.json create mode 100644 SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json create mode 100644 SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt index 8c4ecdf58..4956174c4 100644 --- a/SOL005/NSDManagement-API/environment/nsDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/nsDescriptors.txt @@ -1,9 +1,9 @@ *** Variables *** ${POS_FIELDS} name=nsdOnboardingState ${NEG_FIELDS} wrongName=any_value -${nsdInfoId} 030b1c34-116a-4cfe-9226-19732c3a7b28 +${nsdInfoId} 7abbe544-6a51-4c86-af55-3a345f80e7cc ${nsdInfoIdPlain} 20734bbb-abf6-4cd8-a35d-f416f95dc180 -${nsdInfoIdZip} 5548bf85-8580-4c52-90d1-13c1a7a1dcb0 +${nsdInfoIdZip} 352fac1d-ddce-454b-b072-184cf5ed94f5 ${nsdDownloadableZip} f3ce866a-a935-49db-9f39-8b14b662cedc ${erroneous_nsdInfoId} erroneous_nsdInfoId ${disabledNsdInfoId} 5a569e1d-4ffe-4e9a-8cf6-c24226651e56 diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index 7d4b0a285..0501bca2d 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -3,7 +3,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 FJMG15bVJeJb4Y1t1fSKXFaCFUh0e8LD +${AUTHORIZATION} Bearer YguA4klaSzOxwE65MJ7aAWZvkOj2gAup ${CONTENT_TYPE_JSON} application/json ${ACCEPT_JSON} application/json ${apiRoot} /osm/ diff --git a/SOL005/NSFaultManagement-API/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index 0fb8ac8ce..36b04350c 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -1,7 +1,11 @@ *** 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 diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index 7f86938c5..5b0d10e77 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 3mT1BuYgMFj3UDqGGtj4ZTfKH74LUCLU ${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 diff --git a/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot b/SOL005/NSLifecycleManagement-API/DeleteNSInstanceWorkflow.robot index 480600cca..fe061b727 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/NSInstances.robot b/SOL005/NSLifecycleManagement-API/NSInstances.robot index 3d579f4cc..bf22dac23 100644 --- a/SOL005/NSLifecycleManagement-API/NSInstances.robot +++ b/SOL005/NSLifecycleManagement-API/NSInstances.robot @@ -1,7 +1,11 @@ *** 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/ diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index a11b0047c..1b77de8b2 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -214,7 +214,8 @@ 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 + #changed CreateNsRequest to CreateNs + ${body}= Get File jsons/CreateNs.json Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -396,7 +397,7 @@ 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 + ${body}= Get File jsons/InstantiateNs.json Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -440,7 +441,7 @@ 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 + ${body}= Get File jsons/ScaleNs.json Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/scale ${body} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} @@ -699,7 +700,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} diff --git a/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot b/SOL005/NSLifecycleManagement-API/TerminateNSTask.robot index 9e9870149..20d927b2e 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 94a133ae4..3ce8b5edb 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -1,22 +1,22 @@ *** 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 kn6jROAkSsHj0Bw70j5jyJiLN8KO6xKI ${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 +${nsInstanceId} 66f27112-8b6b-4e70-91a8-b8625a20fc8f ${ConflictNsInstanceId} 007c111c-e602-4afa-8e13-962fb5a7d81d ${nsInstanceName} Test-nsInstance ${nsInstanceDescription} description ns @@ -28,7 +28,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 diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json new file mode 100644 index 000000000..58485d950 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json @@ -0,0 +1,6 @@ +{ + "nsdId": "20734bbb-abf6-4cd8-a35d-f416f95dc180", + "nsName": "myNS", + "vimAccountId": "46baa285-994b-4615-8fd1-84fff6e90832", + "nsDescription": "fancy router and firewall combo" +} \ 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 000000000..696945298 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json @@ -0,0 +1,3 @@ +{ + "nsFlavourId": 0 +} \ 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 000000000..d5c8dd902 --- /dev/null +++ b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json @@ -0,0 +1,11 @@ +{ + "scaleType": "SCALE_VNF", + "timeout_ns_scale": 1, + "scaleVnfData": { + "scaleVnfType": "SCALE_IN", + "scaleByStepData": { + "scaling-group-descriptor": "myScalingGroup", + "member-vnf-index": "1" + } + } + } \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json index a65d7d3b0..4ca37f187 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" -} \ No newline at end of file + "timeout_ns_terminate": 1, + "autoremove": false +} diff --git a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot index fd2302fac..a4c73f1a5 100644 --- a/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot +++ b/SOL005/NSPerformanceManagement-API/NSPerformanceManagementKeywords.robot @@ -273,7 +273,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 +281,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 +305,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 +315,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 +343,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 +359,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,14 +367,14 @@ 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 @@ -384,7 +384,7 @@ Send Post Request Create new Performance Threshold 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 +393,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 +402,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 +430,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 +438,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 +467,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 +478,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} diff --git a/SOL005/NSPerformanceManagement-API/environment/variables.txt b/SOL005/NSPerformanceManagement-API/environment/variables.txt index 64de1566e..3fa28a915 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 diff --git a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot index ff83f44c6..8f9cdeb61 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} @@ -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 diff --git a/SOL005/VNFPackageManagement-API/environment/variables.txt b/SOL005/VNFPackageManagement-API/environment/variables.txt index 80469cdfe..aef570b42 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 -- GitLab From b2ab97b535035162e04a6f331d2d5351fce3366f Mon Sep 17 00:00:00 2001 From: brydenf Date: Mon, 6 Jul 2020 12:20:39 +0200 Subject: [PATCH 4/8] Removed duplicate decleration of keywords --- .../NSDManagement-API/NSDManagementKeywords.robot | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index b2c513f74..2db6cd863 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -444,18 +444,6 @@ Check Response is NsdOnboardingNotification Log Json Schema Validation OK -Check Post Condition NSD Content has been Uploaded - Log Checking NsdOnboardingNotification Recieved - Wait Until Keyword Succeeds ${retry} ${interval} Check Response is NsdOnboardingNotification - -Check Response is NsdOnboardingNotification - ${response}= Output response body - Should Contain ${response['headers']['Content-Type']} application/json - ${schema} = Catenate SEPARATOR= NsdOnboardingNotification .schema.json - Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK - - Check Postcondition NSD Content is uploaded and available in the NFVO Get single file NSD Content in Plain or Zip Format Check HTTP Response Status Code Is 200 @@ -740,7 +728,6 @@ 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 - Create Session github http://api.github.com 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} -- GitLab From 3ce5ba13af59340382b306bc5711381c875ab37d Mon Sep 17 00:00:00 2001 From: brydenf Date: Mon, 6 Jul 2020 12:21:06 +0200 Subject: [PATCH 5/8] Made js file into template --- SOL005/NSLifecycleManagement-API/jsons/CreateNs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json index 58485d950..b014121df 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json @@ -1,6 +1,6 @@ -{ - "nsdId": "20734bbb-abf6-4cd8-a35d-f416f95dc180", +{{ + "nsdId": "{nsdId}", "nsName": "myNS", "vimAccountId": "46baa285-994b-4615-8fd1-84fff6e90832", "nsDescription": "fancy router and firewall combo" -} \ No newline at end of file +}} \ No newline at end of file -- GitLab From ad95cb5787dc2496e3fc654affd3d3b0730cf70c Mon Sep 17 00:00:00 2001 From: brydenf Date: Fri, 17 Jul 2020 10:08:33 +0200 Subject: [PATCH 6/8] Templated JSON files in SOL005/ along with minor bug fixes Signed-off-by: brydenf --- .../NSDManagementKeywords.robot | 13 ++++--- .../environment/nsDescriptors.txt | 8 ++--- .../environment/pnfDescriptors.txt | 4 +-- .../environment/subscriptions.txt | 3 +- .../environment/variables.txt | 3 +- .../NSDManagement-API/files/nsdContent.yaml | 16 +++++++++ SOL005/NSDManagement-API/files/nsdContent.zip | Bin 0 -> 391 bytes .../jsons/subscriptions.json | 2 +- .../NSFMOperationKeywords.robot | 12 ++++--- .../NSFaultManagement-API/Subscriptions.robot | 4 --- .../environment/variables.txt | 4 +-- .../jsons/fmSubscriptionRequest.json | 14 ++++---- .../NSInstances.robot | 4 --- .../NSLCMOperationKeywords.robot | 34 +++++++++++------- .../environment/variables.txt | 18 ++++++++-- .../jsons/CreateNs.json | 6 ---- .../jsons/CreateNsRequest.json | 30 ++++------------ .../jsons/HealNsRequest.json | 6 ++-- .../jsons/InstantiateNs.json | 6 ++-- .../jsons/LccnSubscriptionRequest.json | 16 ++++----- .../jsons/ScaleNs.json | 22 ++++++------ .../jsons/TerminateNsRequest.json | 2 +- .../jsons/UpdateNsRequest.json | 6 ++-- .../jsons/scaleNsToLevelRequest.json | 6 ++-- .../NSPerformanceManagementKeywords.robot | 22 +++++++----- .../environment/IndividualPmJob.txt | 2 +- .../environment/variables.txt | 8 +++-- .../jsons/CreatePmJobRequest.json | 16 ++++----- .../jsons/CreateThresholdRequest.json | 23 ++++++------ .../jsons/subscriptions.json | 10 +++--- .../VNFPackageManagementKeywords.robot | 31 +++++++++------- .../environment/variables.txt | 2 +- .../environment/vnfPackageContentViaUri.txt | 2 +- .../jsons/UploadVnfPkgFromUriRequest.json | 6 ++-- .../jsons/subscriptions.json | 12 +++---- 35 files changed, 202 insertions(+), 171 deletions(-) create mode 100644 SOL005/NSDManagement-API/files/nsdContent.yaml create mode 100644 SOL005/NSDManagement-API/files/nsdContent.zip delete mode 100644 SOL005/NSLifecycleManagement-API/jsons/CreateNs.json diff --git a/SOL005/NSDManagement-API/NSDManagementKeywords.robot b/SOL005/NSDManagement-API/NSDManagementKeywords.robot index 2db6cd863..325d91c6b 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -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 diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt index 4956174c4..72804bd3a 100644 --- a/SOL005/NSDManagement-API/environment/nsDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/nsDescriptors.txt @@ -1,10 +1,10 @@ *** 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 diff --git a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt index 1a7d70dbc..57b78b807 100644 --- a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt @@ -1,8 +1,8 @@ *** 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 diff --git a/SOL005/NSDManagement-API/environment/subscriptions.txt b/SOL005/NSDManagement-API/environment/subscriptions.txt index d8c041102..72c529236 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 0501bca2d..f79a4d346 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -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/ diff --git a/SOL005/NSDManagement-API/files/nsdContent.yaml b/SOL005/NSDManagement-API/files/nsdContent.yaml new file mode 100644 index 000000000..94b9907be --- /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 GIT binary patch literal 391 zcmWIWW@Zs#U}4~35U;rv@T}Tj?;-;OLpUP?g8+jJLvE#Cu!}yJ)T>O)%?Sx z>T4X=yRUJj72FJrEQ&zoU?MeOqaU*&&)uI~`R1%s8&##Z@OUg;8&c}D!YcNTP~k@Z zPW=`2@$+vhu>^nl^X7Y;+|&mvS*~xr^sVMgIRn@73Ng?57 zk&KE_rN{ECWgm?nFZO_A95@~DYS>HM$XN}sXhjrpJyW+=WnOYU8I zujaLTMt+*=+FHMFy+7{$rkB;@_!2ga`*Zf&m`rltBlGIJ&YAt(mb|k*rvBWr%j?RF zJg)02X5an%skCnKR)OWbf@Q({c@I{YrrJb!rw4d5GRZOH3LFWbzZn>S;l!|{5yZj_ aDpp8Pp#@WbH!B-RJtGi?0cmNF5exwIxQKxO literal 0 HcmV?d00001 diff --git a/SOL005/NSDManagement-API/jsons/subscriptions.json b/SOL005/NSDManagement-API/jsons/subscriptions.json index c77b51999..92a9db1b0 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 a1c10db6a..f2df28a61 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/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index 36b04350c..0fb8ac8ce 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -1,11 +1,7 @@ *** 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 diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index 5b0d10e77..f1f00fbe7 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -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 diff --git a/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json index 0f22fd8bb..e9a8b3b01 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/NSInstances.robot b/SOL005/NSLifecycleManagement-API/NSInstances.robot index bf22dac23..3d579f4cc 100644 --- a/SOL005/NSLifecycleManagement-API/NSInstances.robot +++ b/SOL005/NSLifecycleManagement-API/NSInstances.robot @@ -1,11 +1,7 @@ *** 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/ diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index 1b77de8b2..26c63494e 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,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} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 3ce8b5edb..cec5cabbc 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -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 diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json deleted file mode 100644 index b014121df..000000000 --- a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json +++ /dev/null @@ -1,6 +0,0 @@ -{{ - "nsdId": "{nsdId}", - "nsName": "myNS", - "vimAccountId": "46baa285-994b-4615-8fd1-84fff6e90832", - "nsDescription": "fancy router and firewall combo" -}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json index eb879873a..a8026a810 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 2922dc4a1..b8fa38ecb 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 index 696945298..60eee0859 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json @@ -1,3 +1,3 @@ -{ - "nsFlavourId": 0 -} \ No newline at end of file +{{ + "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 091cc0cdb..4a6434f53 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 index d5c8dd902..39d410cfd 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json @@ -1,11 +1,11 @@ -{ - "scaleType": "SCALE_VNF", - "timeout_ns_scale": 1, - "scaleVnfData": { - "scaleVnfType": "SCALE_IN", - "scaleByStepData": { - "scaling-group-descriptor": "myScalingGroup", - "member-vnf-index": "1" - } - } - } \ No newline at end of file +{{ + "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 4ca37f187..65e326002 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json @@ -1,4 +1,4 @@ { "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 64a2c0f4c..336075de4 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 1c39a7bb5..ca0ea8d3f 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 a4c73f1a5..48a306e04 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} @@ -377,7 +378,8 @@ Send Post Request Create new Performance Threshold 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} @@ -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 99a00a748..cde92cf92 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 3fa28a915..6b07f6ad8 100644 --- a/SOL005/NSPerformanceManagement-API/environment/variables.txt +++ b/SOL005/NSPerformanceManagement-API/environment/variables.txt @@ -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 75549f534..506e25475 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 1e58c2bac..e5b0b975c 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 6293d99d2..3ca4fc25a 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 8f9cdeb61..4efc809be 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -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 @@ -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 aef570b42..36cafcc88 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -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 9cb902861..53981f953 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 f76054e5f..685340204 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 4314ec0ce..124004374 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 -- GitLab From 9fbb51a06f8cba2975e060460fe894e710e3bff9 Mon Sep 17 00:00:00 2001 From: brydenf Date: Fri, 17 Jul 2020 10:08:33 +0200 Subject: [PATCH 7/8] Templated JSON files in SOL005/ along with minor bug fixes Signed-off-by: brydenf --- .../IndividualNSDescriptor.robot | 2 +- .../NSDManagementKeywords.robot | 13 ++++--- .../environment/nsDescriptors.txt | 8 ++--- .../environment/pnfDescriptors.txt | 4 +-- .../environment/subscriptions.txt | 3 +- .../environment/variables.txt | 3 +- .../NSDManagement-API/files/nsdContent.yaml | 16 +++++++++ SOL005/NSDManagement-API/files/nsdContent.zip | Bin 0 -> 391 bytes .../jsons/subscriptions.json | 2 +- .../NSFMOperationKeywords.robot | 12 ++++--- .../NSFaultManagement-API/Subscriptions.robot | 4 --- .../environment/variables.txt | 4 +-- .../jsons/fmSubscriptionRequest.json | 14 ++++---- .../NSInstances.robot | 4 --- .../NSLCMOperationKeywords.robot | 34 +++++++++++------- .../environment/variables.txt | 18 ++++++++-- .../jsons/CreateNs.json | 6 ---- .../jsons/CreateNsRequest.json | 30 ++++------------ .../jsons/HealNsRequest.json | 6 ++-- .../jsons/InstantiateNs.json | 6 ++-- .../jsons/LccnSubscriptionRequest.json | 16 ++++----- .../jsons/ScaleNs.json | 22 ++++++------ .../jsons/TerminateNsRequest.json | 2 +- .../jsons/UpdateNsRequest.json | 6 ++-- .../jsons/scaleNsToLevelRequest.json | 6 ++-- .../NSPerformanceManagementKeywords.robot | 22 +++++++----- .../environment/IndividualPmJob.txt | 2 +- .../environment/variables.txt | 8 +++-- .../jsons/CreatePmJobRequest.json | 16 ++++----- .../jsons/CreateThresholdRequest.json | 23 ++++++------ .../jsons/subscriptions.json | 10 +++--- .../VNFPackageManagementKeywords.robot | 31 +++++++++------- .../environment/variables.txt | 2 +- .../environment/vnfPackageContentViaUri.txt | 2 +- .../jsons/UploadVnfPkgFromUriRequest.json | 6 ++-- .../jsons/subscriptions.json | 12 +++---- 36 files changed, 203 insertions(+), 172 deletions(-) create mode 100644 SOL005/NSDManagement-API/files/nsdContent.yaml create mode 100644 SOL005/NSDManagement-API/files/nsdContent.zip delete mode 100644 SOL005/NSLifecycleManagement-API/jsons/CreateNs.json diff --git a/SOL005/NSDManagement-API/IndividualNSDescriptor.robot b/SOL005/NSDManagement-API/IndividualNSDescriptor.robot index 2ff40359e..47a1aa7a0 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 2db6cd863..325d91c6b 100644 --- a/SOL005/NSDManagement-API/NSDManagementKeywords.robot +++ b/SOL005/NSDManagement-API/NSDManagementKeywords.robot @@ -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 diff --git a/SOL005/NSDManagement-API/environment/nsDescriptors.txt b/SOL005/NSDManagement-API/environment/nsDescriptors.txt index 4956174c4..72804bd3a 100644 --- a/SOL005/NSDManagement-API/environment/nsDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/nsDescriptors.txt @@ -1,10 +1,10 @@ *** 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 diff --git a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt index 1a7d70dbc..57b78b807 100644 --- a/SOL005/NSDManagement-API/environment/pnfDescriptors.txt +++ b/SOL005/NSDManagement-API/environment/pnfDescriptors.txt @@ -1,8 +1,8 @@ *** 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 diff --git a/SOL005/NSDManagement-API/environment/subscriptions.txt b/SOL005/NSDManagement-API/environment/subscriptions.txt index d8c041102..72c529236 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 0501bca2d..f79a4d346 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -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/ diff --git a/SOL005/NSDManagement-API/files/nsdContent.yaml b/SOL005/NSDManagement-API/files/nsdContent.yaml new file mode 100644 index 000000000..94b9907be --- /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 GIT binary patch literal 391 zcmWIWW@Zs#U}4~35U;rv@T}Tj?;-;OLpUP?g8+jJLvE#Cu!}yJ)T>O)%?Sx z>T4X=yRUJj72FJrEQ&zoU?MeOqaU*&&)uI~`R1%s8&##Z@OUg;8&c}D!YcNTP~k@Z zPW=`2@$+vhu>^nl^X7Y;+|&mvS*~xr^sVMgIRn@73Ng?57 zk&KE_rN{ECWgm?nFZO_A95@~DYS>HM$XN}sXhjrpJyW+=WnOYU8I zujaLTMt+*=+FHMFy+7{$rkB;@_!2ga`*Zf&m`rltBlGIJ&YAt(mb|k*rvBWr%j?RF zJg)02X5an%skCnKR)OWbf@Q({c@I{YrrJb!rw4d5GRZOH3LFWbzZn>S;l!|{5yZj_ aDpp8Pp#@WbH!B-RJtGi?0cmNF5exwIxQKxO literal 0 HcmV?d00001 diff --git a/SOL005/NSDManagement-API/jsons/subscriptions.json b/SOL005/NSDManagement-API/jsons/subscriptions.json index c77b51999..92a9db1b0 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 a1c10db6a..f2df28a61 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/Subscriptions.robot b/SOL005/NSFaultManagement-API/Subscriptions.robot index 36b04350c..0fb8ac8ce 100644 --- a/SOL005/NSFaultManagement-API/Subscriptions.robot +++ b/SOL005/NSFaultManagement-API/Subscriptions.robot @@ -1,11 +1,7 @@ *** 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 diff --git a/SOL005/NSFaultManagement-API/environment/variables.txt b/SOL005/NSFaultManagement-API/environment/variables.txt index 5b0d10e77..f1f00fbe7 100644 --- a/SOL005/NSFaultManagement-API/environment/variables.txt +++ b/SOL005/NSFaultManagement-API/environment/variables.txt @@ -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 diff --git a/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json b/SOL005/NSFaultManagement-API/jsons/fmSubscriptionRequest.json index 0f22fd8bb..e9a8b3b01 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/NSInstances.robot b/SOL005/NSLifecycleManagement-API/NSInstances.robot index bf22dac23..3d579f4cc 100644 --- a/SOL005/NSLifecycleManagement-API/NSInstances.robot +++ b/SOL005/NSLifecycleManagement-API/NSInstances.robot @@ -1,11 +1,7 @@ *** 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/ diff --git a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index 1b77de8b2..26c63494e 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,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} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index 3ce8b5edb..cec5cabbc 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -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 diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json deleted file mode 100644 index b014121df..000000000 --- a/SOL005/NSLifecycleManagement-API/jsons/CreateNs.json +++ /dev/null @@ -1,6 +0,0 @@ -{{ - "nsdId": "{nsdId}", - "nsName": "myNS", - "vimAccountId": "46baa285-994b-4615-8fd1-84fff6e90832", - "nsDescription": "fancy router and firewall combo" -}} \ No newline at end of file diff --git a/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json b/SOL005/NSLifecycleManagement-API/jsons/CreateNsRequest.json index eb879873a..a8026a810 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 2922dc4a1..b8fa38ecb 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 index 696945298..60eee0859 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/InstantiateNs.json @@ -1,3 +1,3 @@ -{ - "nsFlavourId": 0 -} \ No newline at end of file +{{ + "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 091cc0cdb..4a6434f53 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 index d5c8dd902..39d410cfd 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json +++ b/SOL005/NSLifecycleManagement-API/jsons/ScaleNs.json @@ -1,11 +1,11 @@ -{ - "scaleType": "SCALE_VNF", - "timeout_ns_scale": 1, - "scaleVnfData": { - "scaleVnfType": "SCALE_IN", - "scaleByStepData": { - "scaling-group-descriptor": "myScalingGroup", - "member-vnf-index": "1" - } - } - } \ No newline at end of file +{{ + "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 4ca37f187..65e326002 100644 --- a/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json +++ b/SOL005/NSLifecycleManagement-API/jsons/TerminateNsRequest.json @@ -1,4 +1,4 @@ { "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 64a2c0f4c..336075de4 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 1c39a7bb5..ca0ea8d3f 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 a4c73f1a5..48a306e04 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} @@ -377,7 +378,8 @@ Send Post Request Create new Performance Threshold 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} @@ -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 99a00a748..cde92cf92 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 3fa28a915..6b07f6ad8 100644 --- a/SOL005/NSPerformanceManagement-API/environment/variables.txt +++ b/SOL005/NSPerformanceManagement-API/environment/variables.txt @@ -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 75549f534..506e25475 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 1e58c2bac..e5b0b975c 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 6293d99d2..3ca4fc25a 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 8f9cdeb61..4efc809be 100644 --- a/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot +++ b/SOL005/VNFPackageManagement-API/VNFPackageManagementKeywords.robot @@ -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 @@ -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 aef570b42..36cafcc88 100644 --- a/SOL005/VNFPackageManagement-API/environment/variables.txt +++ b/SOL005/VNFPackageManagement-API/environment/variables.txt @@ -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 9cb902861..53981f953 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 f76054e5f..685340204 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 4314ec0ce..124004374 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 -- GitLab From 9894a677dab5d88a689c57a391ae45c2973589b5 Mon Sep 17 00:00:00 2001 From: Frank Bryden Date: Fri, 24 Jul 2020 11:46:18 +0200 Subject: [PATCH 8/8] Introduced new NSLCM test to test the creation of an NS with a disabled NSD. Signed-off-by: Frank Bryden --- SOL005/NSDManagement-API/environment/variables.txt | 4 ++-- .../CreateNSInstanceWorkflow.robot | 12 +++++++++++- .../NSLCMOperationKeywords.robot | 11 +++++++++++ .../environment/variables.txt | 3 ++- 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/SOL005/NSDManagement-API/environment/variables.txt b/SOL005/NSDManagement-API/environment/variables.txt index f79a4d346..547e487e3 100644 --- a/SOL005/NSDManagement-API/environment/variables.txt +++ b/SOL005/NSDManagement-API/environment/variables.txt @@ -2,7 +2,7 @@ ${NFVO_HOST} 172.21.248.145 # Hostname of the NFVO ${NFVO_PORT} 9999 # Listening port of the NFVO ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer lTxE0BXRcVPjlIUwHLVH5Dtjl39sZ9qp +${AUTHORIZATION} Bearer u5JGp5D3k7m1VUlrCa39k8WX15em149q ${CONTENT_TYPE_JSON} application/json ${ACCEPT_JSON} application/json ${apiRoot} /osm/ @@ -14,7 +14,7 @@ ${FIELD_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 +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar ${callback_port} 9091 ${callback_uri} http://172.22.1.7:${callback_port} diff --git a/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot b/SOL005/NSLifecycleManagement-API/CreateNSInstanceWorkflow.robot index 9092991e1..ae2915934 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/NSLCMOperationKeywords.robot b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot index 26c63494e..49c77d238 100644 --- a/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot +++ b/SOL005/NSLifecycleManagement-API/NSLCMOperationKeywords.robot @@ -223,6 +223,17 @@ POST New nsInstance ${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}"} diff --git a/SOL005/NSLifecycleManagement-API/environment/variables.txt b/SOL005/NSLifecycleManagement-API/environment/variables.txt index cec5cabbc..b9a2ab988 100644 --- a/SOL005/NSLifecycleManagement-API/environment/variables.txt +++ b/SOL005/NSLifecycleManagement-API/environment/variables.txt @@ -6,7 +6,7 @@ ${NFVO_PORT} 9999 # Listening port of the NFVO ${VNFM_SCHEMA} https ${NFVO_SCHEMA} https -${AUTHORIZATION} Bearer RW6sV6rtFa3TUEdazW4Dyd66muED2kBA +${AUTHORIZATION} Bearer v1qDEucqjIZSua6t4R40sraMZafJxEKb ${CONTENT_TYPE} application/json ${CONTENT_TYPE_PATCH} application/merge-patch+json ${ACCEPT_JSON} application/json @@ -17,6 +17,7 @@ ${apiVersion} v1 ${AUTH_USAGE} 1 ${WRONG_AUTHORIZATION} Bearer XXXXXWRONGXXXXX ${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 -- GitLab