From 05f54e24d00c6cf4e42b5f9f68ba762b9a5c50e2 Mon Sep 17 00:00:00 2001 From: Giacomo Bernini <g.bernini@nextworks.it> Date: Mon, 24 Dec 2018 14:26:11 +0100 Subject: [PATCH] fixes --- SOL002/VNFPerformanceManagement-API/PMJobs.robot | 4 ++-- .../NotificationEndpoint.robot | 2 +- .../InstantiateVNFTaskWithCheckAndNotifications.robot | 10 +++++----- .../environment/variables.txt | 7 ++++++- SOL003/VNFLifecycleOperationGranting-API/Grants.robot | 2 +- SOL003/VNFPackageManagement-API/VNFPackages.robot | 2 +- .../VNFPackageManagement-API/environment/generic.txt | 1 + SOL003/VNFPerformanceManagement-API/PMJobs.robot | 4 ++-- .../PMJobsWithChecks.robot | 9 +++++---- 9 files changed, 24 insertions(+), 17 deletions(-) diff --git a/SOL002/VNFPerformanceManagement-API/PMJobs.robot b/SOL002/VNFPerformanceManagement-API/PMJobs.robot index df214f4c..9f1e7408 100644 --- a/SOL002/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL002/VNFPerformanceManagement-API/PMJobs.robot @@ -85,7 +85,7 @@ GET all Pm Jobs - exclude_default GET all Pm Jobs - fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} @@ -108,7 +108,7 @@ GET all Pm Jobs - fields GET all Pm Jobs - exclude_fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} diff --git a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot index 191e2643..ae38099f 100644 --- a/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot +++ b/SOL003/VNFFaultManagementNotification-API/NotificationEndpoint.robot @@ -1,5 +1,5 @@ *** Settings *** -Resource variables.txt +Resource environment/variables.txt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true Library MockServerLibrary diff --git a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot index e087dfcf..fb44e0a8 100644 --- a/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot +++ b/SOL003/VNFLifecycleManagement-API/InstantiateVNFTaskWithCheckAndNotifications.robot @@ -66,7 +66,7 @@ Check HTTP Response Body Json Schema Is [Arguments] ${schema} ${json}= evaluate json.loads('''${response.body}''') json Validate Json ${schema} ${json} - ${vnfInstanceId}= ${response.body.id} + ${vnfInstanceId}= evaluate ${response.body.id} Log Json Schema Validation OK Check VNF Status @@ -104,7 +104,7 @@ Check Operation Notification Should Be Equal ${body.operationState} ${status} Clear Requests ${callback_endpoint} -Verify Notification COMPLETED +Verify Notification [Arguments] ${status} Verify Mock Expectation ${notification_request} @@ -122,15 +122,15 @@ Initialize System Create VNF Resource Check HTTP Response Status Code Is 201 Check HTTP Response Header Contains Location - Check HTTP Response Header Contains ${response.headers} Content-Type + Check HTTP Response Header Contains Content-Type Check HTTP Response Body Json Schema Is vnfInstance.schema.json Check Postcondition Log Retrieve VNF Instance Check VNF Instance ${vnfInstanceId} Should Not Be Empty ${response} - Check HTTP Status Code Is 200 + Check HTTP Response Status Code Is 200 Should Be Equal ${response.body.id} ${vnfInstanceId} Check HTTP Response Header Contains Content-Type - Check HTTP Response Json Schema ${response.body} vnfInstance.schema.json + Check HTTP Response Body Json Schema Is vnfInstance.schema.json Check VNF Status ${response.body.instantiationState} INSTANTIATED \ No newline at end of file diff --git a/SOL003/VNFLifecycleManagement-API/environment/variables.txt b/SOL003/VNFLifecycleManagement-API/environment/variables.txt index cbcd2e9f..63d8b188 100644 --- a/SOL003/VNFLifecycleManagement-API/environment/variables.txt +++ b/SOL003/VNFLifecycleManagement-API/environment/variables.txt @@ -41,4 +41,9 @@ ${sleep_interval} 20s ${GRANT_POLLING_TOT} 2 ${GRANT_POLLING_INTERVAL} 5s ${SCALE_POLLING_TOT} 10 -${SCALE_POLLING_INTERVAL} 15s \ No newline at end of file +${SCALE_POLLING_INTERVAL} 15s +${callback_uri} http://localhost +${callback_port} 9091 +${callback_endpoint} /endpoint +${callback_endpoint_error} /endpoint_404 +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.3.0-jar-with-dependencies.jar \ No newline at end of file diff --git a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot index 2d45b8db..be9b0956 100644 --- a/SOL003/VNFLifecycleOperationGranting-API/Grants.robot +++ b/SOL003/VNFLifecycleOperationGranting-API/Grants.robot @@ -1,5 +1,5 @@ *** Settings *** -Resource environmentvariables.txt +Resource environment/variables.txt Library REST http://${NFVO_HOST}:${NFVO_PORT} ... spec=SOL003-VNFLifecycleOperationGranting-API.yaml Library OperatingSystem diff --git a/SOL003/VNFPackageManagement-API/VNFPackages.robot b/SOL003/VNFPackageManagement-API/VNFPackages.robot index b41a5bde..2d3f0d1f 100644 --- a/SOL003/VNFPackageManagement-API/VNFPackages.robot +++ b/SOL003/VNFPackageManagement-API/VNFPackages.robot @@ -49,7 +49,7 @@ GET all Packages - Filter GET all Packages - Negative (wronge filter name) Log Trying to perform a negative get, filtering by the inexistent field 'nfvId' Set Headers {"Accept": "${ACCEPT_JSON}"} - Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FIELDS} Integer response status 400 Log Received 400 Bad Request as expected diff --git a/SOL003/VNFPackageManagement-API/environment/generic.txt b/SOL003/VNFPackageManagement-API/environment/generic.txt index d569bc82..aee1052a 100644 --- a/SOL003/VNFPackageManagement-API/environment/generic.txt +++ b/SOL003/VNFPackageManagement-API/environment/generic.txt @@ -16,3 +16,4 @@ ${apiName} vnfpkgm ${FIELD_USAGE} 1 ${NFVO_PLAIN} 1 ${NFVO_FIELDS} 1 +${vnfPackageId} 788106a2-d692-44f3-a86d-384f0ce35e42 diff --git a/SOL003/VNFPerformanceManagement-API/PMJobs.robot b/SOL003/VNFPerformanceManagement-API/PMJobs.robot index 373e7ef4..f07036fc 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobs.robot @@ -86,7 +86,7 @@ GET all Pm Jobs - exclude_default GET all Pm Jobs - fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} @@ -109,7 +109,7 @@ GET all Pm Jobs - fields GET all Pm Jobs - exclude_fields Log Trying to get all VNF Packages present in the VNFM, using filter params - Pass Execution If ${FIELDS_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' + Pass Execution If ${FIELD_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' Set Headers {"Accept": "${ACCEPT_JSON}"} Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields} diff --git a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot b/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot index 66c28bd4..83655b5f 100644 --- a/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot +++ b/SOL003/VNFPerformanceManagement-API/PMJobsWithChecks.robot @@ -1,5 +1,6 @@ *** Setting *** -Resource variables.txt +Resource environment/pmJobs.txt +Resource environment/generic.txt Library OperatingSystem Library BuiltIn Library Collections @@ -28,7 +29,7 @@ Create PMJob Create PMJob Log Creating a new PM Job Set Headers {"Accept": "${ACCEPT_JSON}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} ${body}= Get File jsons/CreatePmJobRequest.json POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} @@ -55,8 +56,8 @@ Validate JsonSchema Retrieve PMJob [Arguments] ${pmJobId} - Set Headers {"Accept":"${ACCEPT}"} - Set Headers {"Content-Type": "${CONTENT_TYPE}"} + Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} Get ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${pmJobId} [Return] response -- GitLab