diff --git a/SOL003/VNFIndicator-API_nxw/IndividualSubscription.robot b/SOL003/VNFIndicator-API_nxw/IndividualSubscription.robot index b30d469dc984f1da8399db5fb314e085ecbb6bcd..fbdcd20fa89c8eb36b6f2f31f1b3c33a676bae4e 100644 --- a/SOL003/VNFIndicator-API_nxw/IndividualSubscription.robot +++ b/SOL003/VNFIndicator-API_nxw/IndividualSubscription.robot @@ -1,109 +1,99 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/individualSubscription.txt Library OperatingSystem +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET Individual Subscription Log Trying to get a given subscription identified by subscriptionId - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 Log Received a 200 OK as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscriptions.schema.json ${json} + Log Trying to validate result with VnfIndicatorSubscription schema + Validate Json VnfIndicatorSubscription.schema.json ${json} Log Validated VnfIndicatorSubscription schema GET Subscription - Negative (Not Found) Log Trying to perform a request on a subscriptionID which doesn't exist - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Subscription - Negative (Unauthorized: Wrong Token) Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} + Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK DELETE Subscription Log Trying to perform a DELETE on a subscriptionId - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 204 + Integer response status 204 Log Received 204 No Content as expected - Log Trying to get the deleted element - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 404 - Log The subscriptionId is not present in database DELETE Subscription - Negative (Not Found) Log Trying to perform a DELETE on a subscriptionId which doesn't exist - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Response Status Code Should Equal 404 + Integer response status 404 Log The subscriptionId is not present in database - ${problemDetails}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${problemDetails}= Output ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK PUT Subscription - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Subscription - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 Log Received 405 Method not implemented as expected POST Subscription - (Method not implemented) Log Trying to perform a POST. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API_nxw/IndividualVNFindicator.robot b/SOL003/VNFIndicator-API_nxw/IndividualVNFindicator.robot index 4ef4c3169da21f94588056529ee0583f58b7615f..06a4e7c6a7bfc6cb12b842071f5c1d32a077dcbd 100644 --- a/SOL003/VNFIndicator-API_nxw/IndividualVNFindicator.robot +++ b/SOL003/VNFIndicator-API_nxw/IndividualVNFindicator.robot @@ -1,102 +1,98 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/individualVnfIndicator.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET Individual VNF Indicator Log The GET method reads a VNF indicator. - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${vnfPkgInfo}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfIndicators.schema.json ${json} Log Validation OK GET Individual VNF Indicator - Negative (Not Found) Log Trying to perform a negative get, using an erroneous package ID - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization" : "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Individual VNF Indicator - Negative (Unauthorized: Wrong Token) Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} + Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept" : "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Individual VNF Indicator - Negative (Unauthorized: No Token) Log Trying to perform a negative get, without authentication token. - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} + Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthozired as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST Individual VNF Indicator (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT Individual VNF Indicator (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Individual VNF Indicator (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} + Integer response status 405 Log Received 405 Method not implemented as expected DELETE Individual VNF Indicator (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}/${indicatorId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API_nxw/Subscriptions.robot b/SOL003/VNFIndicator-API_nxw/Subscriptions.robot index 2db9ed0fdc0457f7bcebcf20a190880aeff6e2cd..529a4a2fe3de3c0f175edde00b189192f07558c7 100644 --- a/SOL003/VNFIndicator-API_nxw/Subscriptions.robot +++ b/SOL003/VNFIndicator-API_nxw/Subscriptions.robot @@ -1,161 +1,154 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/subscriptions.txt Library OperatingSystem Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET Subscription Log Trying to get the list of subscriptions - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 Log Received a 200 OK as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json VnfIndicatorSubscription.schema.json ${json} Log Validated VnfIndicatorSubscription schema GET Subscription - Filter Log Trying to get the list of subscriptions using filters - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${POS_FILTER} - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Received a 200 OK as expected - ${result}= Get Response Body + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscriptions.schema.json ${json} + Validate Json VnfIndicatorSubscription.schema.json ${json} Log Validated VnfIndicatorSubscriptions schema GET Subscription - Negative Filter Log Trying to get the list of subscriptions using filters with wrong attribute name - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${NEG_FILTER} - Response Status Code Should Equal 400 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 400 Log Received a 400 Bad Request as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Subscription - Negative (Not Found) Log Trying to perform a request on a Uri which doesn't exist - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscription - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Subscription - Negative (Unauthorized: Wrong Token) Log Trying to perform a negative get, using wrong authorization bearer Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} + Set Headers {"Accept": "${ACCEPT_JSON}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST Subscription Log Trying to create a new subscription - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 201 + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 Log Received 201 Created as expected - Response Should Have Header Location + ${headers}= Output response headers + Should Contain ${headers} Location Log Response has header Location - ${result}= Get Response Body + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndicatorSubscriptions.schema.json ${json} + Validate Json VnfIndicatorSubscription.schema.json ${json} Log Validation of VnfIndicatorSubscription OK POST Subscription - DUPLICATION Log Trying to create a subscription with an already created content Pass Execution If ${VNFM_DUPLICATION} == 0 VNFM is not permitting duplication. Skipping the test - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 201 + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 Log Received 201 Created as expected - Response Should Have Header Location + ${headers}= Output response headers + Should Contain ${headers} Location Log Response has header Location - ${result} Get Response Body + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json VnfIndictorSubscriptions.schema.json ${json} - Log Validation of VnfIndicatorSubscriptions OK + Validate Json VnfIndicatorSubscription.schema.json ${json} + Log Validation of VnfIndicatorSubscription OK POST Subscription - NO DUPLICATION Log Trying to create a subscription with an already created content Pass Execution If ${VNFM_DUPLICATION} == 1 VNFM is permitting duplication. Skipping the test - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 303 + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 Log Received 303 See Other as expected - Response Should Have Header Location - Log Response header contains Location + ${headers}= Output response headers + Should Contain ${headers} Location + Log Response has header Location PUT Subscription - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Subscription - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 Log Received 405 Method not implemented as expected DELETE Subscription - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API_nxw/VNFIndicators.robot b/SOL003/VNFIndicator-API_nxw/VNFIndicators.robot index 84e41824c522553b7a4ffbbf7a0bf9657b9aaf24..948369344e4d7724c612e166d85b0dd87d492b38 100644 --- a/SOL003/VNFIndicator-API_nxw/VNFIndicators.robot +++ b/SOL003/VNFIndicator-API_nxw/VNFIndicators.robot @@ -1,132 +1,129 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Library JSONLibrary Resource environment/vnfIndicators.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET all Indicators Log The GET method queries multiple VNF indicators - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfIndicators.schema.json ${json} Log Validation OK GET all Indicators - Filter Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${POS_FIELDS} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfIndicators.schema.json ${json} Log Validation OK GET all Indicators - Negative (wronge filter name) Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters. Negative case, with erroneous attribute name - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators?${NEG_FIELDS} - Response Status Code Should Equal 400 + Integer response status 400 Log Received 400 Bad Request as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Indicators - Negative (Unauthorized: Wrong Token) Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} + Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM \ is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Indicators - Negative (Unauthorized: No Token) Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} + Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Indicators (Negative: Not found) Log Trying to perform a GET on a erroneous URI - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicator - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} application/json Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${problemDetails} + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST all Indicators (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT all Indicators (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH all Indicators (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 405 + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators + Integer response status 405 Log Received 405 Method not implemented as expected DELETE all Indicators (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API_nxw/VnfIndicatorsInVnfInstanceId.robot b/SOL003/VNFIndicator-API_nxw/VnfIndicatorsInVnfInstanceId.robot index d67c8adec02f4d7bf7c4b9e976f4efb397572090..23b7000929dd522288bda7f2e58462c0e0a78d74 100644 --- a/SOL003/VNFIndicator-API_nxw/VnfIndicatorsInVnfInstanceId.robot +++ b/SOL003/VNFIndicator-API_nxw/VnfIndicatorsInVnfInstanceId.robot @@ -1,131 +1,96 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/vnfIndicatorinVnfInstance.txt Library JSONLibrary +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET Indicators on VNF Instance Log This resource represents VNF indicators related to a VNF instance. - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfIndicators.schema.json ${json} Log Validation OK GET Indicators on VNF Instance - Filter Log This resource represents VNF indicators related to a VNF instance. - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${POS_FIELDS} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfIndicators.schema.json ${json} Log Validation OK GET Indicators on VNF Instance - Negative Filter Log This resource represents VNF indicators related to a VNF instance. - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId}?${NEG_FIELDS} - Response Status Code Should Equal 400 - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 400 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Indicators on VNF Instance - Negative (Not Found) Log Trying to perform a negative get, using wrong authorization bearer - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${erroneousVnfInstanceId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Indicators on VNF Instancee - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Indicators on VNF Instance - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, without authentication token. - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - GET ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST Indicators on VNF Instance - (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT Indicators on VNF Instance - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Indicators on VNF Instance - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} + Integer response status 405 Log Received 405 Method not implemented as expected DELETE Indicators on VNF Instance - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} - Response Status Code Should Equal 405 + PATCH ${apiRoot}/${apiName}/${apiVersion}/indicators/${vnfInstanceId} Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFIndicator-API_nxw/schemas/ProblemDetails.schema.json b/SOL003/VNFIndicator-API_nxw/schemas/ProblemDetails.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..2af3ef9b3f8c0e1dc6bfa39a818ba45e63ca223c --- /dev/null +++ b/SOL003/VNFIndicator-API_nxw/schemas/ProblemDetails.schema.json @@ -0,0 +1 @@ +{ "description": "The definition of the general \"ProblemDetails\" data structure from IETF RFC 7807 [19] is reproduced inthis structure. Compared to the general framework defined in IETF RFC 7807 [19], the \"status\" and \"detail\" attributes are mandated to be included by the present document, to ensure that the response contains additional textual information about an error. IETF RFC 7807 [19] foresees extensibility of the \"ProblemDetails\" type. It is possible that particular APIs in the present document, or particular implementations, define extensions to define additional attributes that provide more information about the error. The description column only provides some explanation of the meaning to Facilitate understanding of the design. For a full description, see IETF RFC 7807 [19].\n", "type": "object", "required": [ "status", "detail" ], "properties": { "type": { "description": "A URI reference according to IETF RFC 3986 [5] that identifies the problem type. It is encouraged that the URI provides human-readable documentation for the problem (e.g. using HTML) when dereferenced. When this member is not present, its value is assumed to be \"about:blank\".\n", "type": "string", "format": "URI" }, "title": { "description": "A short, human-readable summary of the problem type. It should not change from occurrence to occurrence of the problem, except for purposes of localization. If type is given and other than \"about:blank\", this attribute shall also be provided. A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization (e.g., using proactive content negotiation; see [RFC7231], Section 3.4).\n", "type": "string" }, "status": { "description": "The HTTP status code for this occurrence of the problem. The HTTP status code ([RFC7231], Section 6) generated by the origin server for this occurrence of the problem.\n", "type": "integer" }, "detail": { "description": "A human-readable explanation specific to this occurrence of the problem.\n", "type": "string" }, "instance": { "description": "A URI reference that identifies the specific occurrence of the problem. It may yield further information if dereferenced.\n", "type": "string", "format": "URI" } }} \ No newline at end of file diff --git a/SOL003/VNFPackageManagement-API_nxw/IndividualSubscription.robot b/SOL003/VNFPackageManagement-API_nxw/IndividualSubscription.robot index fbf646f75fe5ffeb3248ce7df85f6d7f122f1cd8..1a14bd04f7dd260beba1724a9cdde5e77fe2e814 100644 --- a/SOL003/VNFPackageManagement-API_nxw/IndividualSubscription.robot +++ b/SOL003/VNFPackageManagement-API_nxw/IndividualSubscription.robot @@ -1,110 +1,91 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/individualSubscription.txt Library OperatingSystem Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET Individual Subscription Log Trying to get a single subscription identified by subscriptionId - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 Log Received a 200 OK as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PkgmSubscription.schema.json ${json} Log Validated PkgmSubscription schema GET Subscription - Negative (Not Found) Log Trying to perform a request on a subscriptionID which doesn't exist - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK DELETE Subscription Log Trying to perform a DELETE on a subscriptionId - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 204 + Integer response status 204 Log Received 204 No Content as expected - Log Trying to get the deleted element - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 404 - Log The subscriptionId is not present in database + Comment Log Trying to get the deleted element + Comment Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} + Comment Set Request Header Accept ${ACCEPT_JSON} + Comment Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Comment GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Comment Response Status Code Should Equal 404 + Comment Log The subscriptionId is not present in database DELETE Subscription - Negative (Not Found) Log Trying to perform a DELETE on a subscriptionId which doesn't exist - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId} - Response Status Code Should Equal 404 + Integer response status 404 Log The subscriptionId is not present in database - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK PUT Subscription - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Subscription - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} + Integer response status 405 Log Received 405 Method not implemented as expected POST Subscription - (Method not implemented) Log Trying to perform a POST. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/IndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API_nxw/IndividualVNFPackage.robot index 2231786a4a6172b1a7c11c48e389ccae5d532d1d..43049239bda075b2ffa00911f3548e1ce9890fcd 100644 --- a/SOL003/VNFPackageManagement-API_nxw/IndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API_nxw/IndividualVNFPackage.robot @@ -1,103 +1,68 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/individualVnfPackage.txt Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET Individual VNF Package Log Trying to get a VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - ${json}= evaluate json.loads('''${vnfPkgInfo}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${vnfPkgInfo}= Output response body + ${json}= evaluate json.loads('''${vnfPkgInfo}''') json Validate Json vnfPkgInfo.schema.json ${json} Log Validation OK GET Individual VNF Package - Negative (Not Found) Log Trying to perform a negative get, using wrong authorization bearer - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPackageId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Package - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Package - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, without authentication token. - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST Individual VNF Package - (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT Individual VNF Package - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Individual VNF Package - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} + Integer response status 405 Log Received 405 Method not implemented as expected DELETE Individual VNF Package - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/Subscriptions.robot b/SOL003/VNFPackageManagement-API_nxw/Subscriptions.robot index 0553bd81d56b6757f1f9ee7bc904385d2fe3e2aa..dd66109ca8434bb07d839520bffc5030e65360b1 100644 --- a/SOL003/VNFPackageManagement-API_nxw/Subscriptions.robot +++ b/SOL003/VNFPackageManagement-API_nxw/Subscriptions.robot @@ -1,164 +1,139 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/subscriptions.txt Library OperatingSystem Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET Subscription Log Trying to get the list of subscriptions - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 Log Received a 200 OK as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PkgmSubscription.schema.json ${json} Log Validated PkgmSubscription schema GET Subscription - Filter Log Trying to get the list of subscriptions using filters - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 Log Received a 200 OK as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PkgmSubscription.schema.json ${json} Log Validated PkgmSubscription schema GET Subscription - Negative Filter Log Trying to get the list of subscriptions using filters with wrong attribute name - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions?${filter_ok} - Response Status Code Should Equal 400 - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 400 Log Received a 400 Bad Request as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET Subscription - Negative (Not Found) Log Trying to perform a request on a Uri which doesn't exist - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/subscription - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Subscription - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST Subscription Log Trying to create a new subscription - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 201 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 Log Received 201 Created as expected - Response Should Have Header Location + ${headers}= Output response headers + Should Contain ${headers} Location Log Response has header Location - ${result}= Get Response Body + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PkgmSubscription.schema.json ${json} Log Validation of PkgmSubscription OK POST Subscription - DUPLICATION Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is not permitting duplication. Skipping the test - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Pass Execution If ${NFVO_DUPLICATION} == 0 NFVO is not permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 201 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 201 Log Received 201 Created as expected - Response Should Have Header Location + ${headers}= Output response headers + Should Contain ${headers} Location Log Response has header Location - ${result} Get Response Body + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PkgmSubscription.schema.json ${json} Log Validation of PkgmSubscription OK POST Subscription - NO DUPLICATION Log Trying to create a subscription with an already created content - Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is not permitting duplication. Skipping the test - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} + Pass Execution If ${NFVO_DUPLICATION} == 1 NFVO is permitting duplication. Skipping the test + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${body}= Get File json/subscriptions.json - Set Request Body ${body} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 303 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body} + Integer response status 303 Log Received 303 See Other as expected - Response Should Have Header Location + ${headers}= Output response headers + Should Contain ${headers} Location Log Response header contains Location - Comment ${result}= Get Response Body - Comment ${count}= Get Length ${result} - Comment Run Keyword If $count == 0 Response body is empty as expected PUT Subscription - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Subscription - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/subscriptions + Integer response status 405 Log Received 405 Method not implemented as expected DELETE Subscription - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/VNFDInIndividualVNFPackage.robot b/SOL003/VNFPackageManagement-API_nxw/VNFDInIndividualVNFPackage.robot index 7c366fe10fef15206a1eaa15d299464266c2c514..fe149c08a9b5c2fb34fc9d89defc4fa2338bf273 100644 --- a/SOL003/VNFPackageManagement-API_nxw/VNFDInIndividualVNFPackage.robot +++ b/SOL003/VNFPackageManagement-API_nxw/VNFDInIndividualVNFPackage.robot @@ -1,167 +1,114 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/vnfdInIndividualVnfPackage.txt Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** -GET VNFD in Individual VNF Package (PLAIN/PLAIN) +GET VNFD in Individual VNF Package (PLAIN) Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_PLAIN} - Log How can I validate it? + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} -GET VNFD in Individual VNF Package (ZIP/ZIP) +GET VNFD in Individual VNF Package (ZIP) Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_ZIP} - Log How can I validate it? + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} -GET VNFD in Individual VNF Package (PLAIN-ZIP/ZIP) +GET VNFD in Individual VNF Package (PLAIN-ZIP) Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_ZIP} - Log How can I validate it? - -GET VNFD in Individual VNF Package (PLAIN-ZIP/PLAIN) - Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_PLAIN} - Log How can I validate it? + Integer response status 200 + ${contentType}= Output response headers Content-Type + Run Keyword If ${NFVO_PLAIN} == 0 Should Contain ${contentType} ${CONTENT_TYPE_ZIP} + Run Keyword If ${NFVO_PLAIN} == 1 Should Contain ${contentType} ${CONTENT_TYPE_PLAIN} GET VNFD in Individual VNF Package - Negative (PLAIN/ZIP) Log Trying to get a negative case performing a get on a VNFD from a given VNF Package present in the NFVO Catalogue. Accept will be text/plain but VNFD is composed my multiple files. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd - Response Status Code Should Equal 406 - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 406 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK -GET Individual VNF Package - Negative (Not Found) +GET VNFD in Individual VNF Package - Negative (Not Found) Log Trying to perform a negative get, using an erroneous package ID - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Accept ${ACCEPT_PLAIN} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/vnfd - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Package - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual VNF Package - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, without authentication token. - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_PLAIN} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgPlainVNFD}/vnfd - Response Status Code Should Equal 401 - Log Received 401 Unauthozired as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET VNFD in Individual VNF Package - Negative (onboardingState issue) Log Trying to get a VNFD from a given VNF Package present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Accept ${ACCEPT_PLAIN} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_PLAIN}"} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/vnfd - Response Status Code Should Equal 409 + Integer response status 409 Log Received 409 Conflict as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK -POST all PACKAGE (Method not implemented) +POST VNFD in Individual VNF Package (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected -PUT all PACKAGE (Method not implemented) +PUT VNFD in Individual VNF Package (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected -PATCH all PACKAGE (Method not implemented) +PATCH VNFD in Individual VNF Package (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/vnfd + Integer response status 405 Log Received 405 Method not implemented as expected -DELETE all PACKAGE (Method not implemented) +DELETE VNFD in Individual VNF Package (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization: "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/VNFPackageArtifacts.robot b/SOL003/VNFPackageManagement-API_nxw/VNFPackageArtifacts.robot index 0381e270b35eaa4db52e3e0f17d04645e9c75379..d761a466f7890d856ef477f13cc3cee8832a95a3 100644 --- a/SOL003/VNFPackageManagement-API_nxw/VNFPackageArtifacts.robot +++ b/SOL003/VNFPackageManagement-API_nxw/VNFPackageArtifacts.robot @@ -1,137 +1,109 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/vnfPackageArtifacts.txt Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET VNF Package Artifact Log Trying to get a VNF Package Artifact - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 200 - Response Header Should Equal Content-Type ${CONTENT_TYPE_OCTET} + Integer response status 200 Log Received a 200 OK as expected - Log How can I validate it? + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_OCTET} GET VNF Package Artifact - Range Log Trying to get an Artifact using RANGE Header and using an NFVO that can handle it Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Range ${range} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 206 - Response Should Have Header Content-Range - Response Should Have Header Content-Length + Integer response status 206 Log Received 206 Partial Content as expected. - Log How can I validate it? + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Should Contain ${headers} Content-Length GET VNF Package Artifact - NFVO No RANGE Log Trying to get an Artifact using RANGE Header and using an NFVO that cannot handle it Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Range ${range} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 200 + Integer response status 200 Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. - Log How can I validate it? GET VNF Package Artifact - Negative Range Log Trying to get a range of bytes of the limit of the VNF Package Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Range ${erroneousRange} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 416 + Integer response status 416 Log Received 416 Range not satisfiable as expected. - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET VNF Package Artifact- Negative (Not Found) Log Trying to perform a negative get, using an erroneous package ID - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Artifact - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET VNF Package Artifact - Negative (onboardingState issue) Log Trying to get a VNF Package artifact present in the NFVO Catalogue, but not in ONBOARDED operationalStatus - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 409 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/artifacts/{artifactPath} + Integer response status 409 Log Received 409 Conflict as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST VNF Package Artifact - (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT VNF Package Artifact - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH VNF Package Artifact - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 405 + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} + Integer response status 405 Log Received 405 Method not implemented as expected DELETE VNF Package Artifact - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/artifacts/{artifactPath} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/VNFPackageContent.robot b/SOL003/VNFPackageManagement-API_nxw/VNFPackageContent.robot index 58ed1878cbc1199654bec3ef2b122f84ef32a318..2a76057490f0b5f4440edce33bccce9a03d5dbcc 100644 --- a/SOL003/VNFPackageManagement-API_nxw/VNFPackageContent.robot +++ b/SOL003/VNFPackageManagement-API_nxw/VNFPackageContent.robot @@ -1,143 +1,120 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Resource environment/vnfPackageContent.txt Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET VNF Package Content Log Trying to get a VNF Package Content - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Response Status Code Should Equal 200 - ${vnfPkgInfo}= Get Response Body - Response Header Should Equal Content-Type ${CONTENT_TYPE_ZIP} - Log How can I validate it? + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_ZIP} GET VNF Package Content - Range Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Range ${range} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Response Status Code Should Equal 206 - Response Should Have Header Content-Range - Response Should Have Header Content-Length + Integer response status 206 Log Received 206 Partial Content as expected. - Log How can I validate it? + ${headers}= Output response headers + Should Contain ${headers} Content-Range + Log Header Content-Range is present + Should Contain ${headers} Content-Length + Log Header Content-Length is present GET VNF Package Content - Range NFVO No RANGE Log Trying to get a VNF Package Content using RANGE using an NFVO that can handle it Pass Execution If ${NFVO_RANGE_OK} == 1 Skipping this test as NFVO is able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Range ${range} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${range}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Response Status Code Should Equal 200 + Integer response status 200 Log Received 200 OK as expected. The content is all available on this request. RANGE request has been ignored. - Log How can I validate it? GET VNF Package Content - Negative Range Log Trying to get a range of bytes of the limit of the VNF Package Pass Execution If ${NFVO_RANGE_OK} == 0 Skipping this test as NFVO is not able to handle partial Requests. - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Range ${erroneousRange} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Set Headers {"Range": "${erroneousRange}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Response Status Code Should Equal 416 + Integer response status 416 Log Received 416 Range not satisfiable as expected. - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET VNF Package Content - Negative (Not Found) Log Trying to perform a negative get, using an erroneous package ID - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${erroneousVnfPkgId}/package_content - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET VNF Package Content - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgId}/package_content - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET VNF Package Content - Negative (onboardingState issue) Log Trying to get a VNF Package content present in the NFVO Catalogue, but not in ONBOARDED operationalStatus - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_ZIP} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${onboardingStateVnfPkgId}/package_content - Response Status Code Should Equal 409 + Integer response status 409 Log Received 409 Conflict as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST VNF Package Content - (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT VNF Package Content - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH VNF Package Content - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content + Integer response status 405 Log Received 405 Method not implemented as expected DELETE VNF Package Content - (Method not implemented) Log Trying to perform a DELETE. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_ZIP}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPackageId}/package_content - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/VNFPackages.robot b/SOL003/VNFPackageManagement-API_nxw/VNFPackages.robot index 7f07ea9dee5abed2ecd1c025c4001c7c5ad161d9..f945861d4eb205c4716d903278f4fce560c4a2e7 100644 --- a/SOL003/VNFPackageManagement-API_nxw/VNFPackages.robot +++ b/SOL003/VNFPackageManagement-API_nxw/VNFPackages.robot @@ -1,96 +1,95 @@ *** Settings *** -Library HttpLibrary.HTTP Resource environment/vnfPackages.txt # VNF Packages specific parameters Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Library JSONLibrary +Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} *** Test Cases *** GET all Packages Log Trying to get all VNF Packages present in the NFVO Catalogue - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfPkgInfo.schema.json ${json} Log Validation OK GET all Packages - Filter Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${POS_FIELDS} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json vnfPkgInfo.schema.json ${json} Log Validation OK GET all Packages - Negative (wronge filter name) Log Trying to perform a negative get, filtering by the inexistent field 'nfvId' - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} ${AUTHORIZATION} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?${NEG_FIELDS} - Response Status Code Should Equal 400 + Integer response status 400 Log Received 400 Bad Request as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Packages - Negative (Unauthorized: Wrong Token) Log Trying to perform a negative get, using wrong authorization bearer Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Authorization": "${NEG_AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Packages - Negative (Unauthorized: No Token) Log Trying to perform a negative get, using wrong authorization bearer Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting authentication - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 401 + Integer response status 401 Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK GET all Packages - all_fields Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?all_fields - Response Status Code Should Equal 200 - ${vnfPkgInfos}= Get Response Body + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} Log Trying to validate response Validate Json vnfPkgInfo.schema.json ${json} Log Validation OK @@ -108,15 +107,14 @@ GET all Packages - all_fields GET all Packages - fields Log Trying to get all VNF Packages present in the NFVO Catalogue, using filter params - Pass Execution If ${AUTH_USAGE} == 0 Skipping test as NFVO is not supporting 'fields' - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages?fields=${fields} - Response Status Code Should Equal 200 - ${vnfPkgInfos}= Get Response Body + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + ${vnfPkgInfos}= Output response body ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo Validate Json vnfPkgInfo.schema.json ${json} Log Validation for vnfPkgInfo OK @@ -131,51 +129,47 @@ GET all Packages - fields GET all PACKAGE (Negative: Not found) Log Trying to perform a GET on a erroneous URI - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/vnf_package - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response body + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK POST all PACKAGE (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT all PACKAGE (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH all PACKAGE (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 405 + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/vnf_packages + Integer response status 405 Log Received 405 Method not implemented as expected DELETE all PACKAGE (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${NFVO_HOST}:${NFVO_PORT} ${NFVO_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${AUTH_USAGE} == 1 Set Request Header Authorization ${AUTHORIZATION} + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/vnf_packages - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPackageManagement-API_nxw/environment/generic.txt b/SOL003/VNFPackageManagement-API_nxw/environment/generic.txt index 43015093e81e301f6c376437cc171d43e9ada987..4a966862e20780aade94d78f153d213ee1712a84 100644 --- a/SOL003/VNFPackageManagement-API_nxw/environment/generic.txt +++ b/SOL003/VNFPackageManagement-API_nxw/environment/generic.txt @@ -14,3 +14,4 @@ ${NEG_AUTHORIZATION} Bearer negativetoken ${apiVersion} v1 ${apiName} vnfpkgm ${FIELD_USAGE} 1 +${NFVO_PLAIN} 1 diff --git a/SOL003/VNFPerformanceManagement-API_nxw/IndividualPmJob.robot b/SOL003/VNFPerformanceManagement-API_nxw/IndividualPmJob.robot index 91f5227edf982a15c139bb4fb6db20875b389a18..c876be05e9d0f86a784832ad63025f98622e7336 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/IndividualPmJob.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/IndividualPmJob.robot @@ -1,110 +1,76 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Library JSONLibrary Resource environment/IndividualPmJob.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET Individual PM Job Log Trying to get a Pm Job present in the NFVO Catalogue - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json PmJob.schema.json ${json} Log Validation OK GET Individual PM Job - Negative (Not Found) Log Trying to perform a negative get, using erroneous PM Job identifier - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId} - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET Individual PM Job - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body + ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK -GET Individual PM Job - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, without authentication token. - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK +DELETE Individual PM Job + Log Trying to delete an existing PM Job + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} + Integer response status 204 + Log Received 204 No Content as expected + +DELETE Individual PM Job - Negative (Not Found) + Log Trying to delete an existing PM Job + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${erroneousPmJobId} + Integer response status 404 + Log Received 204 No Content as expected POST Individual PM Job - (Method not implemented) Log Trying to perform a POST (method should not be implemented) - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PUT Individual PM Job - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected PATCH Individual PM Job - (Method not implemented) Log Trying to perform a PATCH. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 405 + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} + Integer response status 405 Log Received 405 Method not implemented as expected - -DELETE Individual PM Job - (Method not implemented) - Log Trying to delete an existing PM Job - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 204 - Log Received 204 No Content as expected - Log Trying to delete the same resource again - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId} - Response Status Code Should Equal 404 - Log Received 404 Not Found as expected diff --git a/SOL003/VNFPerformanceManagement-API_nxw/IndividualSubscription.robot b/SOL003/VNFPerformanceManagement-API_nxw/IndividualSubscription.robot index 6bb132ddce85a7c0d6bb8d6fcb499fc8a7ffbb28..ce94498f731be421b8d887ac5103f699bf3eede5 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/IndividualSubscription.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/IndividualSubscription.robot @@ -23,7 +23,7 @@ GET Individual Subscription Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} + Validate Json PmSubscriptions.schema.json ${json} Log Validated PmSubscription schema GET Individual Subscription - Negative (Not Found) diff --git a/SOL003/VNFPerformanceManagement-API_nxw/IndividualThreshold.robot b/SOL003/VNFPerformanceManagement-API_nxw/IndividualThreshold.robot index 75240e97c2c1c906370b7ca9915b0a700d95bf01..108fc481f7a6bfc2a336e3ff4ac40d90962392ca 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/IndividualThreshold.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/IndividualThreshold.robot @@ -21,7 +21,7 @@ GET Individual Threshold ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Log Trying to validate result with thresholds schema - Validate Json Thresholds.schema.json ${json} + Validate Json Threshold.schema.json ${json} GET Individual Threshold - Negative (Not Found) [Documentation] The client can use this method to query information about thresholds. @@ -32,9 +32,9 @@ GET Individual Threshold - Negative (Not Found) GET ${apiRoot}/${apiName}/${apiVersion}/thresholds/${erroneousThresholdId} Integer response status 404 Log Received 404 Not Found as expected + Log Trying to validate ProblemDetails ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK diff --git a/SOL003/VNFPerformanceManagement-API_nxw/PMJobs.robot b/SOL003/VNFPerformanceManagement-API_nxw/PMJobs.robot index 6c68a1113b0c61be5b15931e4e85bf5a86c0dd88..634e8b330b799c92b9b83b2c4848f1a2e384319a 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/PMJobs.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/PMJobs.robot @@ -1,97 +1,51 @@ *** Settings *** -Library HttpLibrary.HTTP Library JSONSchemaLibrary schemas/ Resource environment/generic.txt # Generic Parameters Library JSONLibrary Library OperatingSystem Resource environment/pmJobs.txt +Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} *** Test Cases *** GET all Pm Jobs Log Trying to get all PM Jobs present in the VNFM - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json PmJob.schema.json ${json} Log Validation OK GET all Pm Jobs - Filter Log Trying to get all PM Jobs present in the VNFM, using filter params - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${POS_FILTER} - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response - Validate Json vnfPkgInfo.schema.json ${json} - Log Validation OK - -GET all Pm Jobs - Negative (wronge filter name) - Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER} - Response Status Code Should Equal 400 - Log Received 400 Bad Request as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Pm Jobs - Negative (Unauthorized: Wrong Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Authorization ${NEG_AUTHORIZATION} - GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} - Log Validation OK - -GET all Pm Jobs - Negative (Unauthorized: No Token) - Log Trying to perform a negative get, using wrong authorization bearer - Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting authentication - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 401 - Log Received 401 Unauthorized as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate ProblemDetails - Validate Json ProblemDetails.schema.json ${json} + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} Log Validation OK GET all Pm Jobs - all_fields Log Trying to get all PM Jobs present in the VNFM, using 'all_fields' filter - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?all_fields - Response Status Code Should Equal 200 - ${result}= Get Response Body - ${json}= evaluate json.loads('''${result}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json PmJob.schema.json ${json} Log Validation OK Log Trying to validate criteria schema @@ -110,80 +64,93 @@ GET all Pm Jobs - all_fields GET all Pm Jobs - fields Log Trying to get all VNF Packages present in the VNFM, using filter params Pass Execution If ${VNFM_AUTH_USAGE} == 0 Skipping test as VNFM is not supporting 'fields' - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + 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} - Response Status Code Should Equal 200 - ${vnfPkgInfos}= Get Response Body - ${json}= evaluate json.loads('''${vnfPkgInfos}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} - Log Trying to validate response, checking vnfPkgInfo and other complex attributes included in the vnfPkgInfo - Validate Json vnfPkgInfo.schema.json ${json} - Log Validation for vnfPkgInfo OK - Log Trying to validate softwareImages schema - ${softwareImages}= Get Value From Json ${json} $..softwareImages - Validate Json softwareImage.schema.json ${softwareImages[0]} - Log Validation for softwareImage schema OK - Log Trying to validate additionalArtifacts schema - ${additional_artifacts}= Get Value From Json ${json} $..additionalArtifacts - Validate Json additionalArtifacts.schema.json ${additional_artifacts[0]} - Log Validation for additionalArtifacts schema OK + Integer response status 200 + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate response + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json + Validate Json PmJob.schema.json ${json} + Log Validation OK + Log Trying to validate criteria schema + ${criteria}= Get Value From Json ${json} $..criteria + Validate Json criteria.schema.json ${criteria[0]} + Log Validation for criteria schema OK + Log Trying to validate criteria schema + ${reports}= Get Value From Json ${json} $..reports + Validate Json reports.schema.json ${reports[0]} + Log Validation for reports schema OK + +GET all Pm Jobs - Negative (wronge filter name) + Log Trying to get all PM Jobs present in the VNFM, using an erroneous filter param + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?${NEG_FILTER} + Integer response status 400 + Log Received 400 Bad Request as expected + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate ProblemDetails + ${problemDetails}= Output response headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json + Validate Json ProblemDetails.schema.json ${json} + Log Validation OK GET all Pm Jobs (Negative: Not found) Log Trying to perform a GET on a erroneous URI - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} GET ${apiRoot}/${apiName}/${apiVersion}/pm_job # wrong URI /pm_job instead of /pm_jobs - Response Status Code Should Equal 404 + Integer response status 404 Log Received 404 Not Found as expected - ${problemDetails}= Get Response Body - ${json}= evaluate json.loads('''${problemDetails}''') json - Response Header Should Equal Content-Type ${CONTENT_TYPE_JSON} + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate ProblemDetails + ${problemDetails}= Output response headers Content-Type + ${json}= evaluate json.loads('''${problemDetails}''') json Validate Json ProblemDetails.schema.json ${json} Log Validation OK -POST PM Jobs - Create new PM Job +POST all PM Jobs - Create new PM Job Log Creating a new PM Job - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Set Request Header Content-Type ${CONTENT_TYPE_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + 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 - Set Request Body ${body} - POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 201 + POST ${apiRoot}/${apiName}/${apiVersion}/pm_jobs ${body} + Integer response status 201 Log Received 201 Created as expected - ${result}= Get Response Body + ${contentType}= Output response headers Content-Type + Should Contain ${contentType} ${CONTENT_TYPE_JSON} + Log Trying to validate response + ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Validate Json PmJob.schema.json ${json} - Log Validated VnfIndicatorSubscription schema + Log Validation OK -PUT PM Jobs - (Method not implemented) +PUT all PM Jobs - (Method not implemented) Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} PUT ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected -PATCH Pm Jobs - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} - Http Request PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 405 +PATCH all Pm Jobs - (Method not implemented) + Log Trying to perform a PATCH. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} + PATCH ${apiRoot}/${apiName}/${apiVersion}/pm_jobs + Integer response status 405 Log Received 405 Method not implemented as expected -DELETE Pm Jobs - (Method not implemented) - Log Trying to perform a PUT. This method should not be implemented - Create HTTP Context ${VNFM_HOST}:${VNFM_PORT} ${VNFM_SCHEMA} - Set Request Header Accept ${ACCEPT_JSON} - Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Request Header Authorization ${VNFM_AUTHENTICATION} +DELETE all Pm Jobs - (Method not implemented) + Log Trying to perform a DELETE. This method should not be implemented + Set Headers {"Accept": "${ACCEPT_JSON}"} + Run Keyword If ${VNFM_AUTH_USAGE} == 1 Set Headers {"Authorization": "${VNFM_AUTHENTICATION}"} DELETE ${apiRoot}/${apiName}/${apiVersion}/pm_jobs - Response Status Code Should Equal 405 + Integer response status 405 Log Received 405 Method not implemented as expected diff --git a/SOL003/VNFPerformanceManagement-API_nxw/Reports.robot b/SOL003/VNFPerformanceManagement-API_nxw/Reports.robot index 11679b394270960f2d4df5ceefab1ab9030105b8..4bb2b37114053a8571485d43442296a725d3b911 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/Reports.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/Reports.robot @@ -21,10 +21,10 @@ GET Report on Single PM Job GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${reportId} Integer response status 200 ${contentType}= Output response headers Content-Type - Should Contain ${contentType} application/json - ${result}= Output response body - ${json}= evaluate json.loads('''${performanceReport}''') json + Should Contain ${contentType} ${CONTENT_TYPE_JSON} Log Trying to validate result with PerformanceReport schema + ${result}= Output response body + ${json}= evaluate json.loads('''${result}''') json Validate Json PerformanceReport.schema.json ${json} GET Report on Single PM Job - Negative (Not Found) @@ -36,9 +36,9 @@ GET Report on Single PM Job - Negative (Not Found) GET ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${erroneousReportId} Integer response status 404 Log Received 404 Not Found as expected + Log Trying to validate ProblemDetails ${problemDetails}= Output response body ${json}= evaluate json.loads('''${problemDetails}''') json - Log Trying to validate ProblemDetails Validate Json ProblemDetails.schema.json ${json} Log Validation OK diff --git a/SOL003/VNFPerformanceManagement-API_nxw/Subscriptions.robot b/SOL003/VNFPerformanceManagement-API_nxw/Subscriptions.robot index 5b883135d224cdce580073d0c2fd49cef5acb632..7e9d307cfc078c504fac5b02979d0936f6987f59 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/Subscriptions.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/Subscriptions.robot @@ -23,7 +23,7 @@ GET Subscription Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} + Validate Json PmSubscriptions.schema.json ${json} Log Validated PmSubscription schema GET Subscription - Filter @@ -40,7 +40,7 @@ GET Subscription - Filter Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} + Validate Json PmSubscriptions.schema.json ${json} Log Validated PmSubscription schema GET Subscription - Negative Filter (Erroneous filter) @@ -98,7 +98,7 @@ POST Subscription Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} + Validate Json PmSubscriptions.schema.json ${json} Log Validated PmSubscription schema Log Trying to validate the Location header ${headers}= Output response headers @@ -153,7 +153,7 @@ POST Subscription - NO DUPLICATION Should Contain ${contentType} application/json ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json - Validate Json PmSubscription.schema.json ${json} + Validate Json PmSubscriptions.schema.json ${json} Log Validated PmSubscription schema Log Trying to validate the Location header ${headers}= Output response headers diff --git a/SOL003/VNFPerformanceManagement-API_nxw/Thresholds.robot b/SOL003/VNFPerformanceManagement-API_nxw/Thresholds.robot index 8c57060ffae4625132ea578ea280d2ba0375c0cc..0cf61c7bc405d15eda62c28b04e27d27828e1e4c 100644 --- a/SOL003/VNFPerformanceManagement-API_nxw/Thresholds.robot +++ b/SOL003/VNFPerformanceManagement-API_nxw/Thresholds.robot @@ -21,7 +21,7 @@ GET Thresholds ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Log Trying to validate result with thresholds schema - Validate Json Thresholds.schema.json ${json} + Validate Json Threshold.schema.json ${json} GET Thresholds - Filter [Documentation] The client can use this method to query information about thresholds. @@ -34,9 +34,9 @@ GET Thresholds - Filter ${contentType}= Output response headers Content-Type Should Contain ${contentType} application/json ${result}= Output response body - ${json}= evaluate json.loads('''${performanceReport}''') json - Log Trying to validate result with PerformanceReport schema - Validate Json PerformanceReport.schema.json ${json} + ${json}= evaluate json.loads('''${result}''') json + Log Trying to validate result with Threshold schema + Validate Json Threshold.schema.json ${json} GET Thresholds - NEGATIVE Filter [Documentation] The client can use this method to query information about thresholds. @@ -80,7 +80,7 @@ POST Reports ${result}= Output response body ${json}= evaluate json.loads('''${result}''') json Log Trying to validate result with thresholds schema - Validate Json Thresholds.schema.json ${json} + Validate Json Threshold.schema.json ${json} Log Trying to validate the Location header ${headers}= Output response headers Should Contain ${headers} Location diff --git a/TrackingStatus.txt b/TrackingStatus.txt new file mode 100644 index 0000000000000000000000000000000000000000..dcf95275167e7abe6e69e23822eecee18d45fe23 --- /dev/null +++ b/TrackingStatus.txt @@ -0,0 +1,45 @@ +SOL003 + +SOL003 + - VirtualisedResourcesQuotaAvailableNotification-API_egm + + - VNFFaultManagement-API_egm + + - VNFFaultManagementNotification-API_egm + + - VNFIndicator-API_nxw ------------------------------------> [DONE] + * VNFIndicators --------------------------------------------> [DONE] + * VnfIndicatorsInVnfInstance -------------------------------> [DONE] + * IndividualVNFindicator -----------------------------------> [DONE] + * Subscriptions --------------------------------------------> [DONE] + * IndividualSubscription -----------------------------------> [DONE] + + - VNFIndicatorNotification-API_nxw ------------------------> [NOT STARTED] + + - VNFLifecycleManagement-API_egm + + - VNFLifecycleOperationGranting-API_egm + + - VNFPackageManagement-API_nxw ----------------------------> [ONGOING] + * VNFPackages -----------------------------------------------> [ONGOING] // Missing exclude fields + * IndividualVNFPackage --------------------------------------> [DONE] + * VNFDInIndividualVNFPackage --------------------------------> [DONE] + * VNFPackageContent -----------------------------------------> [DONE] + * VNFPackageArtifacts ---------------------------------------> [DONE] + * Subscriptions ---------------------------------------------> [DONE] + * IndividualSubscription ------------------------------------> [DONE] + + - VNFPackageManagementNotification-API_nxw ----------------> [NOT STARTED] + + - VNFPerformanceManagement-API_nxw ------------------------> [DONE] + * PMJobs ----------------------------------------------------> [DONE] + * IndividualPmJob -------------------------------------------> [DONE] + * Reports ---------------------------------------------------> [DONE] + * Thresholds ------------------------------------------------> [DONE] + * IndividualThreshold ---------------------------------------> [DONE] + * Subscriptions ---------------------------------------------> [DONE] + * IndividualSubscription ------------------------------------> [DONE] + + - VNFPerformanceManagementNotification-API_nxw -----------> [NOT STARTED] + +SOL005 \ No newline at end of file