From d9395ac8cc0297e24b9248af8eccb1d6d0551067 Mon Sep 17 00:00:00 2001
From: Giacomo Bernini <g.bernini@nextworks.it>
Date: Sun, 9 Jun 2019 11:29:50 +0200
Subject: [PATCH] fixes

---
 .../HealVNFTask.robot                         |  3 +--
 .../environment/variables.txt                 |  1 +
 .../VNFPerformanceManagementKeywords.robot    | 22 +++++++++----------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot
index 15b71ce3..ff2fe25c 100644
--- a/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot
+++ b/SOL002/VNFLifecycleManagement-API/HealVNFTask.robot
@@ -48,13 +48,12 @@ Heal a vnfInstance Not Found
     ...    Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. 
     ...    Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. 
     ...    In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error.
-    [Setup]    Check heal not supported
     Log    Trying to heal a VNF instance, not exist
     Set Headers  {"Accept":"${ACCEPT}"}  
     Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
     Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
     ${body}=    Get File    jsons/healVnfRequest.json
-    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal    ${body}
+    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${badVnfInstanceId}/heal    ${body}
     Integer    response status    404
     Log    Status code validated
     ${problemDetails}=    Output    response body
diff --git a/SOL002/VNFLifecycleManagement-API/environment/variables.txt b/SOL002/VNFLifecycleManagement-API/environment/variables.txt
index b43c2b75..3c0d6ef3 100644
--- a/SOL002/VNFLifecycleManagement-API/environment/variables.txt
+++ b/SOL002/VNFLifecycleManagement-API/environment/variables.txt
@@ -15,6 +15,7 @@ ${apiVersion}     v1
 ${AUTH_USAGE}     1
 ${WRONG_AUTHORIZATION}    Bearer    XXXXXWRONGXXXXX
 ${vnfInstanceId}       6fc3539c-e602-4afa-8e13-962fb5a7d81f
+${badVnfInstanceId}       wrongId
 ${instantiatedVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f    #Change with an instantiated vnfInstanceID
 ${conflicVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
 ${vnfInstanceName}    Test-VnfInstance
diff --git a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
index f64ef659..d2c839c3 100644
--- a/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
+++ b/SOL002/VNFPerformanceManagement-API/VNFPerformanceManagementKeywords.robot
@@ -134,7 +134,7 @@ Send Post Request for Duplicated VNF Performance Subscription
     ...    the existing subscription resource with the same filter and callbackUri).
     Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
     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}"}
     ${body_request}=    Get File    jsons/subscriptions.json
     POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body_request}
     ${output}=    Output    response
@@ -155,7 +155,7 @@ Send Post Request for Duplicated VNF Performance Subscription
 Send Put Request for VNF Performance Subscriptions
     [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
     ...    Not Allowed" response as defined in clause 4.3.5.4.
-    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
+    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
     PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
@@ -165,7 +165,7 @@ Send Put Request for VNF Performance Subscriptions
 Send Patch Request for VNF Performance Subscriptions
     [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
     ...    Not Allowed" response as defined in clause 4.3.5.4.
-    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
+    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
     PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
@@ -175,7 +175,7 @@ Send Patch Request for VNF Performance Subscriptions
 Send Delete Request for VNF Performance Subscriptions
     [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
     ...    Not Allowed" response as defined in clause 4.3.5.4.
-    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
+    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
     DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
@@ -184,40 +184,40 @@ Send Delete Request for VNF Performance Subscriptions
 
 Get Individual VNF Performance Subscription
     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}/subscriptions/${subscriptionId}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
 
 GET individual VNF Performance Subscription with invalid resource identifier
     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}/subscriptions/${erroneousSubscriptionId}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
 
 Send Delete request for individual VNF Performance Subscription
     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}"}
     DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
     ${output}=    Output    response
     Set Suite Variable    ${response}    ${output}
 
 Send Delete request for individual VNF Performance Subscription with invalid resource identifier
     Log    Trying to delete a subscription in the VNFM 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}/subscriptions/${erroneousSubscriptionId}
     ${output}=    Output    response
     Set Suite Variable    @{response}    ${output}
 
 Send Post request for individual VNF Performance 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 Performance Threshold
-    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}
@@ -226,7 +226,7 @@ Send Put request for individual VNF Performance Threshold
     Set Suite Variable    @{response}    ${output}
     
 Send Patch request for individual VNF Performance Threshold
-    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}
-- 
GitLab