diff --git a/SOL002/VNFIndicator-API/IndividualSubscription.robot b/SOL002/VNFIndicator-API/IndividualSubscription.robot index 73e01f6ce37d30c77343cd1e0ad0282cdca3fd54..2f82d44ef1f2eeb0b5b6159e0ee6ba836daff10c 100644 --- a/SOL002/VNFIndicator-API/IndividualSubscription.robot +++ b/SOL002/VNFIndicator-API/IndividualSubscription.robot @@ -1,6 +1,7 @@ *** Settings *** Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters +Library jwt Library OperatingSystem Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false @@ -10,7 +11,7 @@ GET Individual VNF Indicator Subscription ... Test title: Get individual subscription to VNF performance indicators ... Test objective: The objective is to test the retrieval of individual VNF performance indicator subscription and perform a JSON schema validation of the returned subscription data structure ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -23,7 +24,7 @@ GET Individual VNF Indicator Subscription with invalid resource identifier ... Test title: Get individual subscription to VNF performance indicators ... Test objective: The objective is to test that the retrieval of individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -36,7 +37,7 @@ DELETE Individual VNF Indicator Subscription ... Test title: Delete individual subscription to VNF performance indicators ... Test objective: The objective is to test the deletion of an individual VNF performance indicator subscription. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: clause 8.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: clause 8.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: The subscription to VNF performance indicators is deleted @@ -49,7 +50,7 @@ DELETE Individual VNF Indicator Subscription with invalid resource identifier ... Test title: Delete individual subscription to VNF performance indicators ... Test objective: The objective is to test that the deletion of an individual VNF performance indicator subscription fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: clause 8.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: clause 8.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -62,7 +63,7 @@ PUT Individual VNF Indicator Subscription - Method not implemented ... Test title: PUT individual VNF indicator subscription - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription ... Pre-conditions: none - ... Reference: Clause 8.4.6.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.6.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -74,7 +75,7 @@ PATCH Individual VNF Indicator Subscription - Method not implemented ... Test title: PUT individual VNF indicator subscription - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update an individual VNF performance indicator subscription ... Pre-conditions: none - ... Reference: Clause 8.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -86,17 +87,42 @@ POST Individual VNF Indicator Subscription - Method not implemented ... Test title: PUT individual VNF indicator subscription - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify an individual VNF performance indicator subscription ... Pre-conditions: none - ... Reference: Clause 8.4.6.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.6.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none Send Post Request for Individual VNF Indicator Subscription Check HTTP Response Status Code Is 405 +GET Individual VNF Indicator Subscription with permitted authorization scope + [Documentation] Test ID: 6.3.2.5.8 + ... Test title: Get individual subscription to VNF performance indicators with permitted authorization scope + ... Test objective: The objective is to test the retrieval of individual VNF performance indicator subscription and perform a JSON schema validation of the returned subscription data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get Individual VNF Indicator Subscription with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscription +GET Individual VNF Indicator Subscription with NOT permitted authorization scope + [Documentation] Test ID: 6.3.2.5.9 + ... Test title: Get individual subscription to VNF performance indicators with NOT permitted authorization scope + ... Test objective: The objective is to test the retrieval of individual VNF performance indicator subscription and perform a JSON schema validation of the returned subscription data structure with NOT permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: Clause 8.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get Individual VNF Indicator Subscription with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get Individual VNF Indicator Subscription Log Trying to get a given subscription identified by subscriptionId Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${output}= Output response @@ -105,6 +131,7 @@ Get Individual VNF Indicator Subscription GET Individual VNF Indicator Subscription with invalid resource identifier Log Trying to perform a request on a subscriptionID which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${erroneousSubscriptionId} ${output}= Output response @@ -113,6 +140,7 @@ GET Individual VNF Indicator Subscription with invalid resource identifier Send Delete Request for Individual VNF Indicator Subscription Log Trying to perform a DELETE on a subscriptionId Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${output}= Output response @@ -121,6 +149,7 @@ Send Delete Request for Individual VNF Indicator Subscription Send Delete Request for Individual VNF Indicator Subscription with invalid resource identifier Log Trying to perform a DELETE on a subscriptionId which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${erroneousSubscriptionId} ${output}= Output response @@ -136,6 +165,7 @@ Send Post Request for Individual VNF Indicator Subscription Send Put Request for Individual VNF Indicator Subscription Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${origOutput}= Output response @@ -178,3 +208,29 @@ Check Postcondition Individual VNF Indicator Subscription is Deleted Log Check Postcondition subscription is deleted GET Individual VNF Indicator Subscription Check HTTP Response Status Code Is 404 +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get Individual VNF Indicator Subscription with permitted authorization scope + Log Trying to get a given subscription identified by subscriptionId with permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${SUBSCRIPTIONS_VNF_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + ${output}= Output response + Set Suite Variable ${response} ${output} +Get Individual VNF Indicator Subscription with not permitted authorization scope + Log Trying to get a given subscription identified by subscriptionId with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot index 106f4deb1d4493aeecdb8c24273fce33c54af5a7..7bebc51ff5882f538c023b922fef2c3bd666bf6c 100644 --- a/SOL002/VNFIndicator-API/IndividualVNFindicator.robot +++ b/SOL002/VNFIndicator-API/IndividualVNFindicator.robot @@ -1,5 +1,6 @@ *** Settings *** Library JSONSchemaLibrary schemas/ +Library jwt Resource environment/variables.txt # Generic Parameters Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false @@ -9,7 +10,7 @@ Get Individual Indicator for VNF Instance ... Test title: Get individual performance indicator for a VNF instance ... Test objective: The objective is to test the retrieval of a performance indicator for a given VNF instance and perform a JSON schema validation of the returned indicator data structure ... Pre-conditions: A VNF instance is instantiated. At least one measure of performance indicator is available for the given VNF instance. - ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -24,7 +25,7 @@ Get Individual Indicator for VNF Instance with invalid indicator identifier ... Test title: Get individual performance indicator for a VNF instance with invalid indicator identifier ... Test objective: The objective is to test that the retrieval of a performance indicator for a given VNF instance fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. At least one measure of performance indicator is available for the given VNF instance. - ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -37,7 +38,7 @@ POST Individual VNF Indicator - Method not implemented ... Test title: POST individual performance indicator for VNF instance - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create a new performance indicator for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -49,7 +50,7 @@ PUT Individual VNF Indicator - Method not implemented ... Test title: PUT individual performance indicator for VNF instance - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify an existing performance indicator for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -61,7 +62,7 @@ PATCH Individual VNF Indicator - Method not implemented ... Test title: PATCH individual performance indicator for VNF instance - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update an existing performance indicator for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -73,7 +74,7 @@ DELETE Individual VNF Indicator - Method not implemented ... Test title: DELETE individual performance indicator indicators for VNF instance - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete an existing performance indicator for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -85,7 +86,7 @@ Get Individual Performance Indicator ... Test title: Get Individual Performance Indicator ... Test objective: The objective is to test the retrieval of a performance indicator and perform a JSON schema validation of the returned indicator data structure ... Pre-conditions: At least one measure of performance indicator is available.. - ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -99,7 +100,7 @@ Get Individual Performance Indicator with invalid indicator identifier ... Test title: Get Individual Performance Indicator with invalid indicator identifier ... Test objective: The objective is to test that the retrieval of a performance indicator fails when using an invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: At least one measure of performance indicator is available. - ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -112,7 +113,7 @@ POST Individual Performance Indicator - Method not implemented ... Test title: POST Individual Performance Indicator - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create a new performance indicator. ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -124,7 +125,7 @@ PUT Individual Performance Indicator - Method not implemented ... Test title: PUT Individual Performance Indicator - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify an existing performance indicator. ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -136,7 +137,7 @@ PATCH Individual Performance Indicator - Method not implemented ... Test title: PATCH Individual Performance Indicator - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update an existing performance indicator. ... Pre-conditions: none - ... Reference: Clause 8.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -148,17 +149,44 @@ DELETE Individual Performance Indicator - Method not implemented ... Test title: DELETE Individual Performance Indicator - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete an existing performance indicator. ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none Send DELETE Request for individual indicator Check HTTP Response Status Code Is 405 +Get Individual Indicator for VNF Instance with permitted authorization scope + [Documentation] Test ID: 6.3.2.3.13 + ... Test title: Get individual performance indicator for a VNF instance with permitted authorization scope + ... Test objective: The objective is to test the retrieval of a performance indicator for a given VNF instance and perform a JSON schema validation of the returned indicator data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one measure of performance indicator is available for the given VNF instance. + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get Individual Indicator for a VNF instance with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfIndicator + Check HTTP Response Body Includes Requested VNF Instance ID + Check HTTP Response Body Includes Requested Indicator ID +Get Individual Indicator for VNF Instance with NOT permitted authorization scope + [Documentation] Test ID: 6.3.2.3.14 + ... Test title: Get individual performance indicator for a VNF instance with NOT permitted authorization scope + ... Test objective: The objective is to test the retrieval of a performance indicator for a given VNF instance and perform a JSON schema validation of the returned indicator data structure with NOT permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one measure of performance indicator is available for the given VNF instance. + ... Reference: Clause 8.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get Individual Indicator for a VNF instance with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get Individual Indicator for a VNF instance Log This resource represents a VNF indicator related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} ${output}= Output response @@ -167,6 +195,7 @@ Get Individual Indicator for a VNF instance Get Individual Indicator for a VNF instance with invalid indicator identifier Log Trying to perform a negative get, using wrong identifier Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${erroneousIndicatorId} ${output}= Output response @@ -175,6 +204,7 @@ Get Individual Indicator for a VNF instance with invalid indicator identifier Send POST Request for individual indicator in VNF instance Log Trying to perform a POST (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} POST ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${notAllowedIndicatorId} ${output}= Output response @@ -183,6 +213,7 @@ Send POST Request for individual indicator in VNF instance Send PUT Request for individual indicator in VNF instance Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PUT ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} ${output}= Output response @@ -191,6 +222,7 @@ Send PUT Request for individual indicator in VNF instance Send PATCH Request for individual indicator in VNF instance Log Trying to perform a PATCH. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} ${output}= Output response @@ -199,6 +231,7 @@ Send PATCH Request for individual indicator in VNF instance Send DELETE Request for individual indicator in VNF instance Log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} ${output}= Output response @@ -235,6 +268,7 @@ Check HTTP Response Body Includes Requested VNF Instance ID Get Individual Indicator Log This resource represents a VNF indicator related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${indicatorId} ${output}= Output response @@ -243,6 +277,7 @@ Get Individual Indicator Get Individual Indicator with invalid indicator identifier Log Trying to perform a negative get, using wrong identifier Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${erroneousIndicatorId} ${output}= Output response @@ -251,6 +286,7 @@ Get Individual Indicator with invalid indicator identifier Send POST Request for individual indicator Log Trying to perform a POST (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} POST ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${notAllowedIndicatorId} ${output}= Output response @@ -259,6 +295,7 @@ Send POST Request for individual indicator Send PUT Request for individual indicator Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PUT ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${indicatorId} ${output}= Output response @@ -267,6 +304,7 @@ Send PUT Request for individual indicator Send PATCH Request for individual indicator Log Trying to perform a PATCH. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${indicatorId} ${output}= Output response @@ -275,7 +313,34 @@ Send PATCH Request for individual indicator Send DELETE Request for individual indicator Log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${indicatorId} ${output}= Output response - Set Suite Variable ${response} ${output} \ No newline at end of file + Set Suite Variable ${response} ${output} +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get Individual Indicator for a VNF instance with permitted authorization scope + Log This resource represents a VNF indicator related to a VNF instance with permitted authorization scope. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${INDICATORS_EM_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} + ${output}= Output response + Set Suite Variable ${response} ${output} +Get Individual Indicator for a VNF instance with not permitted authorization scope + Log This resource represents a VNF indicator related to a VNF instance with not permitted authorization scope. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}/${indicatorId} + ${output}= Output response + Set Suite Variable ${response} ${output} \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/NotificationEndpoint.robot b/SOL002/VNFIndicator-API/NotificationEndpoint.robot index a537c7f44067c2ac12457cf873f2f244bc3ee038..6eb13de5833beed3996e9056ce049c281f41ff3c 100644 --- a/SOL002/VNFIndicator-API/NotificationEndpoint.robot +++ b/SOL002/VNFIndicator-API/NotificationEndpoint.robot @@ -12,7 +12,7 @@ VNF Indicator Value Change Notification ... Test title: VNF Indicator Value Change Notification ... Test objective: The objective is to test that the POST request triggers VNF Indicator Value Change Notification . ... Pre-conditions: A VNF is instantiated, and a subscription for indicator value change notifications is available in the VNF. - ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -24,7 +24,7 @@ Supported Indicators Change Notification ... Test title: Supported Indicators Change Notification ... Test objective: The objective is to test that the POST request triggers Supported Indicators Change Notification . ... Pre-conditions: A VNF is instantiated, and a subscription for supported indicators change notifications is available in the VNF. - ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -36,7 +36,7 @@ Test the Notification Endpoint - Successful ... Test title: Test the Notification Endpoint - Successful ... Test objective: The objective is to test the Notification Endpoint provided by the notification consumer. ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. - ... Reference: Clause 8.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -48,7 +48,7 @@ Test the Notification Endpoint - NOT FOUND ... Test title: Test the Notification Endpoint - UNREACHABLE ... Test objective: The objective is to test the Notification Endpoint provided by the notification consumer. ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. - ... Reference: Clause 8.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: The notification endpoint is unreachable by the API producer. ... Post-Conditions: none @@ -61,7 +61,7 @@ PUT Notification endpoint - Method Not Implemented ... Test title: PUT Notification endpoint - Method Not Implemented ... Test objective: The objective is to test the PUT method for Notification Endpoint provided by the consumer is not implemented. ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. - ... Reference: Clause 8.4.7.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -73,7 +73,7 @@ PATCH Notification endpoint - Method Not Implemented ... Test title: PATCH Notification endpoint - Method Not Implemented ... Test objective: The objective is to test the PATCH method for Notification Endpoint provided by the consumer is not implemented. ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. - ... Reference: Clause 8.4.7.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -85,7 +85,7 @@ DELETE Notification endpoint - Method Not Implemented ... Test title: DELETE Notification endpoint - Method Not Implemented ... Test objective: The objective is to test the DELETE method for Notification Endpoint provided by the consumer is not implemented. ... Pre-conditions: A notification endpoint is provided by the API consumer upon subscription. - ... Reference: Clause 8.4.7.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -94,7 +94,8 @@ DELETE Notification endpoint - Method Not Implemented *** Keywords *** Check resource existence and get CallbackUri - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} @@ -109,7 +110,8 @@ Check HTTP Response Status Code Is Post Value Change Notification log Trying to perform a POST to get notification - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/ValueChangeNotification.json @@ -120,7 +122,8 @@ Post Value Change Notification Post Supported Indicators Change Notification log Trying to perform a POST to get notification - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/SupportedIndicatorsChangeNotification.json @@ -132,6 +135,7 @@ Post Supported Indicators Change Notification GET reach the notification endpoint Log Trying to reach the notification endpoint using GET method. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${callbackResp} ${outputResponse}= Output response @@ -140,6 +144,7 @@ GET reach the notification endpoint GET reach an unreachable notification endpoint Log Trying to reach the notification endpoint using GET method. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${unreachable_callback_uri} ${outputResponse}= Output response @@ -155,6 +160,7 @@ Check HTTP Response Body Json Schema Is PUT notification endpoint Log Trying to perform a PUT. This method should not be implemented. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${callbackResp} ${outputResponse}= Output response @@ -163,6 +169,7 @@ PUT notification endpoint PATCH notification endpoint Log Trying to perform a PATCH. This method should not be implemented. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${callbackResp} ${outputResponse}= Output response @@ -171,6 +178,7 @@ PATCH notification endpoint DELETE notification endpoint Log Trying to perform a DELETE. This method should not be implemented. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${callbackResp} ${outputResponse}= Output response diff --git a/SOL002/VNFIndicator-API/Notifications.robot b/SOL002/VNFIndicator-API/Notifications.robot index 140771bb7aece012602b5521bfd0c08baf4f3af8..337f4009dd737a31080d2b46b4a3f30d70a12e9c 100644 --- a/SOL002/VNFIndicator-API/Notifications.robot +++ b/SOL002/VNFIndicator-API/Notifications.robot @@ -16,7 +16,7 @@ VNF Indicator Value Change Notification ... Test title: VNF Indicator Value Change Notification ... Test objective: The objective is to test the dispatch of VNF Indicator Value Change Notification when new indicator values are available in the VNF, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. ... Pre-conditions: A VNF is instantiated, and a subscription for indicator value change notifications is available in the VNF. - ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNF ... Applicability: none ... Post-Conditions: none @@ -29,7 +29,7 @@ Supported Indicators Change Notification ... Test title: Supported Indicators Change Notification ... Test objective: The objective is to test the dispatch of Supported Indicators Change Notification when new indicator values are available in the VNF, and perform a JSON schema and content validation of the delivered notification. The action that triggers the notification under test is an explicit test step, but it is not performed by the test system. ... Pre-conditions: A VNF is instantiated, and a subscription for supported indicators change notifications is available in the VNF. - ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNF ... Applicability: none ... Post-Conditions: none diff --git a/SOL002/VNFIndicator-API/Subscriptions.robot b/SOL002/VNFIndicator-API/Subscriptions.robot index f837e00e2dd25f70e7c276efb5da81fc0a4413ef..5ae4c24a3960eae3a5d3797cd1db8ad09f240bb1 100644 --- a/SOL002/VNFIndicator-API/Subscriptions.robot +++ b/SOL002/VNFIndicator-API/Subscriptions.robot @@ -4,6 +4,7 @@ Resource environment/variables.txt # Generic Parameters Library OperatingSystem Library JSONLibrary Library Process +Library jwt Library MockServerLibrary Library String Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false @@ -16,7 +17,7 @@ GET VNF Indicators Subscriptions ... Test title: GET VNF Indicators Subscriptions ... Test objective: The objective is to test the retrieval of all VNF indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators ... Post-Conditions: none @@ -29,7 +30,7 @@ GET VNF Indicators Subscriptions with attribute-based filter ... Test title: GET VNF Indicators Subscriptions with attribute-based filter ... Test objective: The objective is to test the retrieval of all VNF indicators subscriptions using attribute-based filter and perform a JSON schema and content validation of the returned subscriptions data structure ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators ... Post-Conditions: none @@ -43,7 +44,7 @@ GET VNF Indicators Subscriptions with invalid attribute-based filter ... Test title: GET VNF Indicators Subscriptions with invalid attribute-based filter ... Test objective: The objective is to test that the retrieval of all VNF indicators subscriptions fails when using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators ... Post-Conditions: none @@ -56,7 +57,7 @@ GET VNF Indicators Subscriptions with invalid resource endpoint ... Test title: GET VNF Indicators Subscriptions with invalid resource endpoint ... Test objective: The objective is to test that the retrieval of all VNF indicators subscriptions fails when using invalid resource endpoint. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators. ... Post-Conditions: none @@ -69,7 +70,7 @@ Create new VNF indicator subscription ... Test title: Create new VNF indicator subscription ... Test objective: The objective is to test the creation of a new VNF indicator subscription perform a JSON schema and content validation of the returned subscriptions data structure ... Pre-conditions: A VNF instance is instantiated. - ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators. ... Post-Conditions: The VNF indicator subscription is successfully set and it matches the issued subscription @@ -84,7 +85,7 @@ PUT VNF Indicator Subscriptions - Method not implemented ... Test title: PUT VNF Indicator Subscriptions - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify VNF indicator subscriptions ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators. ... Post-Conditions: none @@ -96,7 +97,7 @@ PATCH VNF Indicator Subscriptions - Method not implemented ... Test title: PATCH VNF Indicator Subscriptions - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update VNF indicator subscriptions ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators. ... Post-Conditions: none @@ -108,7 +109,7 @@ DELETE VNF Indicator Subscriptions - Method not implemented ... Test title: DELETE VNF Indicator Subscriptions - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete VNF indicator subscriptions ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators. ... Post-Conditions: none @@ -120,7 +121,7 @@ GET VNF Indicators Subscriptions to get Paged Response ... Test title: GET VNF Indicators Subscriptions to get Paged Response ... Test objective: The objective is to test the retrieval of all VNF indicators subscriptions to get Paged Response. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators ... Post-Conditions: none @@ -133,7 +134,7 @@ GET VNF Indicators Subscriptions - Bad Request Response too Big ... Test title: GET VNF Indicators Subscriptions - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of all VNF indicators subscriptions fails because response is too big. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. - ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of indicators ... Post-Conditions: none @@ -146,7 +147,7 @@ POST Create a new Subscription - Unprocessable Content ... Test title: POST Create a new Subscription - Unprocessable Content ... Test objective: The objective is to test that content type of the message content is supported and the message content of a request contains syntactically correct data but the data cannot be processed. ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: none ... Post-Conditions: none @@ -159,7 +160,7 @@ Create new VNF indicator Subscription - DUPLICATION ... Test title: POST Create a new subscription - DUPLICATION ... Test objective: The POST method creates a new subscription even if an existing subscription to same content exist ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: SUT should support duplication of subscription creation ... Post-Conditions: In response header Location shall not be null @@ -173,18 +174,43 @@ Create new VNF indicator Subscription - NO-DUPLICATION ... Test title: POST Create a new subscription - NO-DUPLICATION ... Test objective: The POST method creates a new subscription even if an existing subscription to same content exist ... Pre-conditions: none - ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: SUT should not support duplication of subscription creation ... Post-Conditions: In response header Location shall not be null Post Create subscription - NO-DUPLICATION Check HTTP Response Status Code Is 303 Check Operation Occurrence Id +GET VNF Indicators Subscriptions with permitted authorization scope + [Documentation] Test ID: 6.3.2.4.14 + ... Test title: GET VNF Indicators Subscriptions with permitted authorization scope + ... Test objective: The objective is to test the retrieval of all VNF indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of indicators + ... Post-Conditions: none + Get VNF Indicators Subscriptions with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is VnfIndicatorSubscriptions +GET VNF Indicators Subscriptions with NOT permitted authorization scope + [Documentation] Test ID: 6.3.2.4.15 + ... Test title: GET VNF Indicators Subscriptions with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of all VNF indicators subscriptions and perform a JSON schema validation of the returned subscriptions data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. At least one VNF indicator subscription is available in the VNF. + ... Reference: Clause 8.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of indicators + ... Post-Conditions: none + Get VNF Indicators Subscriptions with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get VNF Indicators Subscriptions Log Trying to get the list of subscriptions Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${output}= Output response @@ -193,6 +219,7 @@ Get VNF Indicators Subscriptions Get VNF Indicators Subscriptions with filter Log Trying to get the list of subscriptions using filters Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${POS_FILTER} ${output}= Output response @@ -201,6 +228,7 @@ Get VNF Indicators Subscriptions with filter Get VNF Indicators Subscriptions with invalid filter Log Trying to get the list of subscriptions using filters with wrong attribute name Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${NEG_FILTER} ${output}= Output response @@ -209,6 +237,7 @@ Get VNF Indicators Subscriptions with invalid filter Get VNF Indicators Subscriptions with invalid resource endpoint Log Trying to perform a request on a Uri which doesn't exist Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscription ${output}= Output response @@ -217,6 +246,7 @@ Get VNF Indicators Subscriptions with invalid resource endpoint Send Post Request for VNF Indicator Subscription Log Trying to create a new subscription Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${template}= Get File jsons/subscriptions.json ${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint} @@ -236,6 +266,7 @@ Send Post Request for VNF Indicator Subscription Send Post Request for VNF Indicator Subscription with unprocessable content Log Trying to create a new subscription Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} ${template}= Get File jsons/subscriptions.json ${body}= Format String ${template} callback_uri=localhost #not reachable endpoint @@ -298,6 +329,7 @@ Check Postcondition VNF Indicator Subscription Is Set Log Check Postcondition subscription exist Log Trying to get the subscription Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${response['body']['id']} ${output}= Output response @@ -329,6 +361,7 @@ Post Create subscription - DUPLICATION Log Trying to create a subscription with an already created content Pass Execution If ${VNFM_CHECKS_NOTIF_ENDPOINT} == 0 VNFM is not permitting duplication. Skipping the test Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/subscriptions.json @@ -349,6 +382,7 @@ Post Create subscription - NO-DUPLICATION Log Trying to create a subscription with an already created content Pass Execution If ${VNFM_CHECKS_NOTIF_ENDPOINT} == 1 VNFM permits duplication. Skipping the test Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/subscriptions.json @@ -368,3 +402,29 @@ Post Create subscription - NO-DUPLICATION Check Operation Occurrence Id ${vnfLcmOpOccId}= Get Value From Json ${response['headers']} $..Location Should Not Be Empty ${vnfLcmOpOccId} +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get VNF Indicators Subscriptions with permitted authorization scope + Log Trying to get the list of subscriptions with permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${SUBSCRIPTIONS_VNF_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions + ${output}= Output response + Set Suite Variable ${response} ${output} +Get VNF Indicators Subscriptions with not permitted authorization scope + Log Trying to get the list of subscriptions with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SOL002/VNFIndicator-API/VNFIndicators.robot b/SOL002/VNFIndicator-API/VNFIndicators.robot index 6d5d5d98d2b1354a69205682431adb5183b8f919..a3e6e5ca4ed615fdd85ea78e0106f94bac459f28 100644 --- a/SOL002/VNFIndicator-API/VNFIndicators.robot +++ b/SOL002/VNFIndicator-API/VNFIndicators.robot @@ -3,6 +3,7 @@ Documentation This Clause defines all the resources and methods provided by Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Library JSONLibrary +Library jwt Library String Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false @@ -12,7 +13,7 @@ Get all VNF Indicators ... Test title: Get all VNF Indicators ... Test objective: The objective is to test the retrieval of all the available VNF indicators and perform a JSON schema validation of the collected indicators data structure ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -25,7 +26,7 @@ Get VNF Indicators with attribute-based filter ... Test title: Get VNF Indicators with attribute-based filter ... Test objective: The objective is to test the retrieval of VNF indicators using attribute-based filter, perform a JSON schema validation of the collected indicators data structure, and verify that the retrieved information matches the issued attribute-based filters ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -39,7 +40,7 @@ Get VNF Indicators with invalid attribute-based filter ... Test title: Get VNF Indicators with invalid attribute-based filter ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid attribute-based filters, and perform the JSON schema validation of the failed operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -52,7 +53,7 @@ Get all VNF Indicators with malformed authorization token ... Test title: GET all VNF Indicators with malformed authrization token. ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using malformed authorization token ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. The VNF requires the usage of access tokens for authorizing the API requests. ... Post-Conditions: none @@ -65,7 +66,7 @@ Get all VNF Indicators without authorization token ... Test title: GET all VNF Indicators without authorization token ... Test objective: The objective is to test that the retrieval of VNF indicators fails when omitting the authorization token ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. The VNF requires the usage of access tokens for authorizing the API requests. ... Post-Conditions: none @@ -78,7 +79,7 @@ GET all VNF Indicators with expired or revoked authorization token ... Test title: GET all VNF Indicators with expired or revoked authorization token ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using expired or revoked authorization token ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 4.5.3.3, 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. The VNF requires the usage of access tokens for authorizing the API requests. ... Post-Conditions: none @@ -91,7 +92,7 @@ Get all VNF Indicators with invalid resource endpoint ... Test title: GET all VNF Indicators with invalid resource endpoint ... Test objective: The objective is to test that the retrieval of VNF indicators fails when using invalid resource endpoint ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -104,7 +105,7 @@ POST all VNF Indicators - Method not implemented ... Test title: POST all VNF Indicators - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create new VNF indicators ... Pre-conditions: none - ... Reference: Clause 8.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -116,7 +117,7 @@ PUT all VNF Indicators - Method not implemented ... Test title: PUT all VNF Indicators - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify VNF indicators ... Pre-conditions: none - ... Reference: Clause 8.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -128,7 +129,7 @@ PATCH all VNF Indicators - Method not implemented ... Test title: PATCH all VNF Indicators - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update VNF indicators ... Pre-conditions: none - ... Reference: Clause 8.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -140,7 +141,7 @@ DELETE all VNF Indicators - Method not implemented ... Test title: DELETE all VNF Indicators - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete VNF indicators ... Pre-conditions: none - ... Reference: Clause 8.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -152,7 +153,7 @@ Get VNF Indicators to get Paged Response ... Test title: Get VNF Indicators to get Paged Response ... Test objective: The objective is to test the retrieval of all the available VNF indicators with Paged Response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -165,18 +166,42 @@ Get VNF Indicators - Bad Request Response too Big ... Test title: Get VNF Indicators - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of VNF indicators fails when response is too big, and perform the JSON schema validation of the failed operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. - ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none Get all VNF indicators Check HTTP Response Status Code Is 400 Check HTTP Response Body Json Schema Is ProblemDetails - +Get all VNF Indicators with permitted authorization scope + [Documentation] Test ID: 6.3.2.1.14 + ... Test title: Get all VNF Indicators with permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF indicators and perform a JSON schema validation of the collected indicators data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Get all VNF indicators with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfIndicators +Get all VNF Indicators with not permitted authorization scope + [Documentation] Test ID: 6.3.2.1.15 + ... Test title: Get all VNF Indicators with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of all the available VNF indicators and perform a JSON schema validation of the collected indicators data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more measures of VNF performance indicators are available in the VNF. + ... Reference: Clause 8.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators. + ... Post-Conditions: none + Get all VNF indicators with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get all VNF indicators Log The GET method queries multiple VNF indicators Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators @@ -186,6 +211,7 @@ Get all VNF indicators Get VNF indicators with filter Log The GET method queries multiple VNF indicators using Attribute-based filtering parameters Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators?${POS_FIELDS} @@ -195,6 +221,7 @@ Get VNF indicators with filter Get VNF indicators with invalid filter Log The GET method queries multiple VNF indicators using invalid Attribute-based filtering parameters Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators?${NEG_FIELDS} @@ -205,6 +232,7 @@ Get all VNF indicators with malformed authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication Log The GET method queries multiple VNF indicators using invalid token Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"${AUTHORIZATION_HEADER}": "${BAD_AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators @@ -215,6 +243,7 @@ Get all VNF indicators with expired or revoked authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication Log The GET method queries multiple VNF indicators using invalid token Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"${AUTHORIZATION_HEADER}": "${NEG_AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators @@ -225,6 +254,7 @@ Get all VNF indicators without authorization token Pass Execution If ${AUTH_USAGE} == 0 Skipping test as EM/VNF is not supporting authentication Log The GET method queries multiple VNF indicators omitting token Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators ${output}= Output response @@ -233,6 +263,7 @@ Get all VNF indicators without authorization token Get all VNF indicators with invalid resource endpoint Log The GET method queries multiple VNF indicators omitting token Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicator @@ -241,7 +272,8 @@ Get all VNF indicators with invalid resource endpoint Send POST Request for all VNF indicators log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/indicators ${output}= Output response @@ -249,7 +281,8 @@ Send POST Request for all VNF indicators Send PUT Request for all VNF indicators log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/indicators ${output}= Output response @@ -257,7 +290,8 @@ Send PUT Request for all VNF indicators Send PATCH Request for all VNF indicators log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/indicators ${output}= Output response @@ -265,7 +299,8 @@ Send PATCH Request for all VNF indicators Send DELETE Request for all VNF indicators log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT_JSON}"} + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/indicators ${output}= Output response @@ -302,3 +337,31 @@ Check HTTP Response Body vnfIndicators Matches the requested attribute-based fil Check HTTP Response Header Contain Link ${linkURL}= Get Value From Json ${response['headers']} $..Link Should Not Be Empty ${linkURL} +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get all VNF indicators with permitted authorization scope + Log The GET method queries multiple VNF indicators with permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${INDICATORS_VNF_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators + ${output}= Output response + Set Suite Variable ${response} ${output} +Get all VNF indicators with not permitted authorization scope + Log The GET method queries multiple VNF indicators with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Log Execute Query and validate response + Get ${apiRoot}/${apiName}/${apiMajorVersion}/indicators + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot index 719a3fb0f8373cdbbc9237929832befcf7eb711a..4dd13a9d457791ed24e18cc6875e022f76f21a9e 100644 --- a/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot +++ b/SOL002/VNFIndicator-API/VnfIndicatorsInVnfInstanceId.robot @@ -3,6 +3,7 @@ Documentation This resource represents VNF indicators related to a VNF insta Library JSONSchemaLibrary schemas/ Resource environment/variables.txt # Generic Parameters Library JSONLibrary +Library jwt Library String Library REST ${EM-VNF_SCHEMA}://${EM-VNF_HOST}:${EM-VNF_PORT} ssl_verify=false @@ -12,7 +13,7 @@ Get Indicators for VNF Instance ... Test title: Get all performance indicators for a VNF instance ... Test objective: The objective is to test the retrieval of all performance indicators for a given VNF instance and perform a JSON schema validation of the returned indicators data structure ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -26,7 +27,7 @@ GET Indicators for VNF Instance with attribute-based filter ... Test title: Get all performance indicators for a VNF instance with attribute-based filter ... Test objective: The objective is to test the retrieval of all performance indicators for a given VNF instance using attribute-based filter and perform a JSON schema validation of the returned indicators data structure ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -40,7 +41,7 @@ Get Indicators for VNF Instance with invalid attribute-based filter ... Test title: Get all performance indicators for a VNF instance with invalid attribute-based filter ... Test objective: The objective is to test that the retrieval of all performance indicators for a given VNF instance fails using invalid attribute-based filter. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -53,7 +54,7 @@ Get Indicators for VNF Instance with invalid resource identifier ... Test title: Get all performance indicators for a VNF instance with invalid resource identifier ... Test objective: The objective is to test that the retrieval of all performance indicators for a given VNF instance fails when using invalid resource identifier. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -66,7 +67,7 @@ POST Indicators for VNF instance - Method not implemented ... Test title: POST performance indicators for VNF instance - Method not implemented ... Test objective: The objective is to test that POST method is not allowed to create new performance indicators for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -78,7 +79,7 @@ PUT Indicators for VNF instance - Method not implemented ... Test title: PUT performance indicators for VNF instance - Method not implemented ... Test objective: The objective is to test that PUT method is not allowed to modify existing performance indicators for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -90,7 +91,7 @@ PATCH Indicators for VNF instance - Method not implemented ... Test title: PATCH performance indicators for VNF instance - Method not implemented ... Test objective: The objective is to test that PATCH method is not allowed to update existing performance indicators for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -102,7 +103,7 @@ DELETE Indicators for VNF instance - Method not implemented ... Test title: DELETE performance indicators for VNF instance - Method not implemented ... Test objective: The objective is to test that DELETE method is not allowed to delete performance indicators for a VNF instance ... Pre-conditions: none - ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none @@ -114,7 +115,7 @@ Get Indicators for VNF Instance to get Paged Response ... Test title: Get Indicators for VNF Instance to get Paged Response ... Test objective: The objective is to test the retrieval of all performance indicators for a given VNF instance to get paged response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators ... Post-Conditions: none @@ -127,18 +128,44 @@ Get Indicators for VNF Instance - Bad Request Response too Big ... Test title: Get Indicators for VNF Instance - Bad Request Response too Big ... Test objective: The objective is to test that the retrieval of all performance indicators for a given VNF instance fails when response is too big. The test also checks the JSON schema of the unsuccessful operation HTTP response. ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. - ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VE ... Applicability: The VNF supports the generation and maintenance of performance indicators. ... Post-Conditions: none Get all indicators for a VNF instance Check HTTP Response Status Code Is 400 Check HTTP Response Body Json Schema Is ProblemDetails +Get Indicators for VNF Instance with permitted authorization scope + [Documentation] Test ID: 6.3.2.2.11 + ... Test title: Get all performance indicators for a VNF instance with permitted authorization scope + ... Test objective: The objective is to test the retrieval of all performance indicators for a given VNF instance and perform a JSON schema validation of the returned indicators data structure with permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get all indicators for a VNF instance with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is vnfIndicators + Check HTTP Response Body Includes Requested VNF Instance ID +Get Indicators for VNF Instance with NOT permitted authorization scope + [Documentation] Test ID: 6.3.2.2.12 + ... Test title: Get all performance indicators for a VNF instance with not permitted authorization scope + ... Test objective: The objective is to test the retrieval of all performance indicators for a given VNF instance and perform a JSON schema validation of the returned indicators data structure with not permitted authorization scope + ... Pre-conditions: A VNF instance is instantiated. One or more measures of performance indicators are available for the given VNF instance. + ... Reference: Clause 8.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VE + ... Applicability: The VNF supports the generation and maintenance of performance indicators + ... Post-Conditions: none + Get all indicators for a VNF instance with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** Get all indicators for a VNF instance Log This resource represents VNF indicators related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} ${output}= Output response @@ -147,6 +174,7 @@ Get all indicators for a VNF instance Get all indicators for a VNF instance with filter Log This resource represents VNF indicators related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}?${POS_FIELDS} ${output}= Output response @@ -155,6 +183,7 @@ Get all indicators for a VNF instance with filter Get all indicators for a VNF instance with invalid filter Log This resource represents VNF indicators related to a VNF instance. Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId}?${NEG_FIELDS} ${output}= Output response @@ -163,6 +192,7 @@ Get all indicators for a VNF instance with invalid filter Get all indicators for a VNF instance with invalid resource identifier Log Trying to perform a negative get, using wrong identifier Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${erroneousVnfInstanceId} ${output}= Output response @@ -171,6 +201,7 @@ Get all indicators for a VNF instance with invalid resource identifier Send POST Request for indicators in VNF instance Log Trying to perform a POST (method should not be implemented) Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} POST ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} ${output}= Output response @@ -179,6 +210,7 @@ Send POST Request for indicators in VNF instance Send PUT Request for indicators in VNF instance Log Trying to perform a PUT. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PUT ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} ${output}= Output response @@ -187,6 +219,7 @@ Send PUT Request for indicators in VNF instance Send PATCH Request for indicators in VNF instance Log Trying to perform a PATCH. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} PATCH ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} ${output}= Output response @@ -195,6 +228,7 @@ Send PATCH Request for indicators in VNF instance Send DELETE Request for indicators in VNF instance Log Trying to perform a DELETE. This method should not be implemented Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} DELETE ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} ${output}= Output response @@ -231,4 +265,32 @@ Check HTTP Response Body Matches Attribute-Based Filter Check HTTP Response Header Contain Link ${linkURL}= Get Value From Json ${response['headers']} $..Link - Should Not Be Empty ${linkURL} \ No newline at end of file + Should Not Be Empty ${linkURL} +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get all indicators for a VNF instance with permitted authorization scope + Log This resource represents VNF indicators related to a VNF instance with permitted authorization scope. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${INDICATORS_EM_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} + ${output}= Output response + Set Suite Variable ${response} ${output} +Get all indicators for a VNF instance with not permitted authorization scope + Log This resource represents VNF indicators related to a VNF instance with not permitted authorization scope. + Set Headers {"Accept": "${ACCEPT_JSON}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_JSON}"} + ${scope_value}= Create Dictionary scopeValue=${NEG_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} + GET ${apiRoot}/${apiName}/${apiMajorVersion}/indicators/${vnfInstanceId} + ${output}= Output response + Set Suite Variable ${response} ${output} \ No newline at end of file diff --git a/SOL002/VNFIndicator-API/environment/variables.txt b/SOL002/VNFIndicator-API/environment/variables.txt index 69e6b434993a3e4fd70ef161f55b2397886b34a8..7692af75fe4803ef72bd6ecf76625d0e4e90ccd8 100644 --- a/SOL002/VNFIndicator-API/environment/variables.txt +++ b/SOL002/VNFIndicator-API/environment/variables.txt @@ -44,6 +44,13 @@ ${NEG_FILTER} callback=http://127.0.0.1/subscribe ${total_polling_time} 2 min ${polling_interval} 10 sec ${SEPERATOR} = +${INDICATORS_VNF_SCOPE}= vnfind_by_vnf:v1:indicators +${SUBSCRIPTIONS_VNF_SCOPE}= vnfind_by_vnf:v1:subscriptions +${INDICATORS_EM_SCOPE}= vnfind_by_em:v1:indicators +${SUBSCRIPTIONS_EM_SCOPE}= vnfind_by_em:v1:subscriptions +${OAUTH_Encryption_ALGORITHM}= HS256 +${NEG_SCOPE}= vnfind_by_vnf:v2:invalid +${API_VERSION}= 1.12.0 ${erroneousVnfInstanceId} erroneousVnfInstanceId ${POS_FIELDS} name=vnfIndicator