diff --git a/SOL002/VNFFaultManagement-API/Alarms.robot b/SOL002/VNFFaultManagement-API/Alarms.robot index 85e66e5ede230c3bda250beab7c7e0ae2fc1e11f..06c9fc6997c654ff22f2b8927a445ac1204ba889 100644 --- a/SOL002/VNFFaultManagement-API/Alarms.robot +++ b/SOL002/VNFFaultManagement-API/Alarms.robot @@ -6,6 +6,7 @@ Library JSONLibrary Library JSONSchemaLibrary schemas/ Library OperatingSystem Library Collections +Library jwt *** Test Cases *** POST Alarms - Method not implemented @@ -13,7 +14,7 @@ POST Alarms - Method not implemented ... Test title: POST Alarms - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -25,7 +26,7 @@ GET information about multiple alarms ... Test title: GET information about multiple alarms ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -38,7 +39,7 @@ GET information about multiple alarms with attribute-based filter ... Test title: GET information about multiple alarms with attribute-based filter ... Test objective: The objective is to retrieve information about the alarm list with attribute-based filter ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -51,7 +52,7 @@ GET information about multiple alarms with invalid attribute-based filter ... Test title: GET information about multiple alarms with invalid attribute-based filter ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -64,7 +65,7 @@ GET information about multiple alarms with "all_fields" attribute selector ... Test title: GET information about multiple alarms with "all_fields" attribute selector ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -77,7 +78,7 @@ GET information about multiple alarms with exclude_default attribute selector ... Test title: GET information about multiple alarms with "exclude_default" attribute selector ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -90,7 +91,7 @@ GET information about multiple alarms with fields attribute selector ... Test title: GET information about multiple alarms with fields attribute selector ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -103,7 +104,7 @@ GET information about multiple alarms with "exclude_fields" attribute selector ... Test title: GET information about multiple alarms with "exclude_fields" attribute selector ... Test objective: The objective is to retrieve information about the alarm list ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -116,7 +117,7 @@ PUT Alarms - Method not implemented ... Test title: PUT Alarms - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -128,7 +129,7 @@ PATCH Alarms - Method not implemented ... Test title: PATCH Alarms - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -140,7 +141,7 @@ DELETE Alarms - Method not implemented ... Test title: DELETE Alarms - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -152,7 +153,7 @@ GET information about multiple alarms to get Paged Response ... Test title: GET information about multiple alarms to get Paged Response ... Test objective: The objective is to retrieve information about the alarms to get paged response ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -165,7 +166,7 @@ GET information about multiple alarms for Bad Request Response too big ... Test title: GET information about multiple alarms for Bad Request Response too big ... Test objective: The objective is to test that GET method fail retrieving status information about Alarms when Response is too big, and perform the JSON schema validation of the failed operation HTTP response ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -178,7 +179,7 @@ GET information about alarms with attribute-based filter "id" ... Test title: GET information about alarms with attribute-based filter "id" ... Test objective: The objective is to retrieve information about the alarm list with alarm filter "id" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -192,7 +193,7 @@ GET information about multiple alarms with attribute-based filter "vnfcInstanceI ... Test title: GET information about multiple alarms with attribute-based filter "vnfcInstanceIds" ... Test objective: The objective is to retrieve information about the alarm list with attribute filter "vnfcInstanceIds" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -206,7 +207,7 @@ GET information about multiple alarms with attribute-based filter "rootCauseFaul ... Test title: GET information about multiple alarms with attribute-based filter "rootCauseFaultyResource.faultyResourceType" ... Test objective: The objective is to retrieve information about the alarm list with attribute filter "rootCauseFaultyResource.faultyResourceType" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -220,7 +221,7 @@ GET information about multiple alarms with attribute-based filter "eventType" ... Test title: GET information about multiple alarms with attribute-based filter "eventType" ... Test objective: The objective is to retrieve information about the alarm list with attribute filter "eventType" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -234,7 +235,7 @@ GET information about multiple alarms with attribute-based filter "perceivedSeve ... Test title: GET information about multiple alarms with attribute-based filter "perceivedSeverity" ... Test objective: The objective is to retrieve information about the alarm list with attribute filter "perceivedSeverity" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -248,7 +249,7 @@ GET information about multiple alarms with attribute-based filter "probableCause ... Test title: GET information about multiple alarms with attribute-based filter "probableCause" ... Test objective: The objective is to retrieve information about the alarm list with attribute filter "probableCause" ... Pre-conditions: none - ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -256,39 +257,68 @@ GET information about multiple alarms with attribute-based filter "probableCause Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is alarms Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "probableCause" +GET information about multiple alarms with permitted authorization scope + [Documentation] Test ID: 6.3.4.1.20 + ... Test title: GET information about multiple alarms with permitted authorization scope + ... Test objective: The objective is to retrieve information about the alarm list with permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET Alarms Task with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is alarms +GET information about multiple alarms with not permitted authorization scope + [Documentation] Test ID: 6.3.4.1.21 + ... Test title: GET information about multiple alarms with not permitted authorization scope + ... Test objective: The objective is to retrieve information about the alarm list with not permitted authorization scope + ... Pre-conditions: none + ... Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + GET Alarms Task with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** POST Alarms Task log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/alarms ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT Alarms Task log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/alarms ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH Alarms Task log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/alarms ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE Alarms Task log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/alarms ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET Alarms Task Log Query VNF The GET method queries information about multiple alarms. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms @@ -296,7 +326,8 @@ GET Alarms Task Set Global Variable ${response} ${outputResponse} GET Alarms Task with filter Log Query VNF The GET method queries information about multiple alarms with filters. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?${alarm_filter}=${managedObjectId} @@ -304,7 +335,8 @@ GET Alarms Task with filter Set Global Variable ${response} ${outputResponse} GET Alarms Task with invalid filter Log Query VNF The GET method queries information about multiple alarms with filters. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?${invalid_alarm_filter}=${managedObjectId} @@ -313,6 +345,7 @@ GET Alarms Task with invalid filter GET Alarms Task with all_fields attribute selector Log Query VNF The GET method queries information about multiple alarms, using fields 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}/alarms?exclude_default ${output}= Output response @@ -320,6 +353,7 @@ GET Alarms Task with all_fields attribute selector GET Alarms Task with exclude_default attribute selector Log Query VNF The GET method queries information about multiple alarms, using fields 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}/alarms?exclude_default ${output}= Output response @@ -327,6 +361,7 @@ GET Alarms Task with exclude_default attribute selector GET Alarms Task with fields attribute selector Log Query VNF The GET method queries information about multiple alarms, using fields 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}/alarms?fields=${fields} ${output}= Output response @@ -334,6 +369,7 @@ GET Alarms Task with fields attribute selector GET Alarms Task with exclude_fields attribute selector Log Query VNF The GET method queries information about multiple alarms, using fields 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}/alarms?exclude_fields=${fields} ${output}= Output response @@ -364,7 +400,8 @@ Check HTTP Response Header Contain Link GET Alarms Task with filter "id" Log Query VNF The GET method queries information about multiple alarms with filters "id". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?id=${alarmId} @@ -376,7 +413,8 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba GET Alarms Task with filter "vnfcInstanceIds" Log Query VNF The GET method queries information about multiple alarms with filters "vnfcInstanceIds". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?vnfcInstanceIds=${vnfcInstanceIds} @@ -390,7 +428,8 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba GET Alarms Task with filter "rootCauseFaultyResource_faultyResourceType" Log Query VNF The GET method queries information about multiple alarms with filters "rootCauseFaultyResource.faultyResourceType". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?rootCauseFaultyResource.faultyResourceType=${faultyResourceType} @@ -404,7 +443,8 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba GET Alarms Task with filter "eventType" Log Query VNF The GET method queries information about multiple alarms with filters "eventType". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?eventType=${eventType} @@ -418,7 +458,8 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba GET Alarms Task with filter "perceivedSeverity" Log Query VNF The GET method queries information about multiple alarms with filters "perceivedSeverity". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?perceivedSeverity=${perceivedSeverity} @@ -432,7 +473,8 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba GET Alarms Task with filter "probableCause" Log Query VNF The GET method queries information about multiple alarms with filters "probableCause". - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?probableCause=${probableCause} @@ -442,4 +484,31 @@ GET Alarms Task with filter "probableCause" Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "probableCause" FOR ${item} IN @{response['body']} Should Be Equal As Strings ${item['probableCause']} ${probableCause} - END \ No newline at end of file + END +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +GET Alarms Task with permitted authorization scope + Log Query VNF The GET method queries information about multiple alarms with permitted authorization scope. + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + ${scope_value}= Create Dictionary scopeValue=${ALARMS_READONLY_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}/alarms + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} + +GET Alarms Task with not permitted authorization scope + Log Query VNF The GET method queries information about multiple alarms with not permitted authorization scope. + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + ${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}/alarms + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/ApiVersion.robot b/SOL002/VNFFaultManagement-API/ApiVersion.robot index e86481de002f4c1a8ae4f6f744d0e0565b0117a9..5a64fe97e088c1db303c279681b84fbcc192aa30 100644 --- a/SOL002/VNFFaultManagement-API/ApiVersion.robot +++ b/SOL002/VNFFaultManagement-API/ApiVersion.robot @@ -132,70 +132,80 @@ DELETE API Version with apiMajorVerion - Method not implemented *** Keywords *** POST API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} POST API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE API Version with apiMajorVersion - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions ${outputResponse}= Output response diff --git a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot index 9f5720799b896943d11dcf9ad33b6e3a3b5942c5..b9f1023c667504c3fc941a248520a452f8e15fd6 100644 --- a/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot +++ b/SOL002/VNFFaultManagement-API/EscalatePerceivedSeverityTask.robot @@ -3,6 +3,7 @@ Resource environment/variables.txt Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false Library JSONSchemaLibrary Library OperatingSystem +Library jwt Library String Suite Setup Check resource existence @@ -12,7 +13,7 @@ Escalate the perceived severity ... Test title: Escalate the perceived severity ... Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource. ... Pre-conditions: The resource representing the individual alarm has been created - ... Reference: Clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -24,7 +25,7 @@ GET Escalate the perceived severity - Method not implemented ... Test title: GET Escalate the perceived severity - Method not implemented ... Test objective: The objective is to test that the GET HTTP method not implemented for escalate perceived severity ... Pre-conditions: none - ... Reference: Clause 7.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.4.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -36,7 +37,7 @@ PUT Escalate the perceived severity - Method not implemented ... Test title: PUT Escalate the perceived severity - Method not implemented ... Test objective: The objective is to test that the PUT HTTP method not implemented for escalate perceived severity ... Pre-conditions: none - ... Reference: Clause 7.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.4.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -48,7 +49,7 @@ PATCH Escalate the perceived severity - Method not implemented ... Test title: PATCH Escalate the perceived severity - Method not implemented ... Test objective: The objective is to test that the PATCH HTTP method not implemented for escalate perceived severity ... Pre-conditions: none - ... Reference: Clause 7.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.4.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -60,23 +61,47 @@ DELETE Escalate the perceived severity - Method not implemented ... Test title: DELETE Escalate the perceived severity - Method not implemented ... Test objective: The objective is to test that the DELETE HTTP method not implemented for escalate perceived severity ... Pre-conditions: none - ... Reference: Clause 7.4.4.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.4.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Delete escalate severity Check HTTP Response Status Code Is 405 +Escalate the perceived severity with permitted authorization scope + [Documentation] Test ID: 6.3.4.3.6 + ... Test title: Escalate the perceived severity with permitted authorization scope + ... Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource with permitted authorization scope. + ... Pre-conditions: The resource representing the individual alarm has been created + ... Reference: Clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + POST escalate severity with permitted authorization scope + Check HTTP Response Status Code Is 204 +Escalate the perceived severity with NOT permitted authorization scope + [Documentation] Test ID: 6.3.4.3.7 + ... Test title: Escalate the perceived severity with NOT permitted authorization scope + ... Test objective: To enable the consumer to escalate the perceived severity of an alarm that is represented by an individual alarm resource with NOT permitted authorization scope. + ... Pre-conditions: The resource representing the individual alarm has been created + ... Reference: Clause 7.4.4.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + POST escalate severity with not permitted authorization scope + Check HTTP Response Status Code Is 403 *** Keywords *** Check resource existence - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} Integer response status 200 POST escalate severity Log escalate the perceived severity of an alarm with the VNFM - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/EscalatePerceivedSeverity.json @@ -120,4 +145,34 @@ Check HTTP Response Body Json Schema Is Should Contain ${response['headers']['Content-Type']} application/json ${schema} = Catenate SEPARATOR= ${input} .schema.json Validate Json ${schema} ${response['body']} - Log Json Schema Validation OK \ No newline at end of file + Log Json Schema Validation OK +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +POST escalate severity with permitted authorization scope + Log escalate the perceived severity of an alarm with the VNFM with permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${ESCALATE_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template}= Get File jsons/EscalatePerceivedSeverity.json + ${body}= Format String ${template} perceivedSeverity=${PerceivedSeverity} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}/escalate ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +POST escalate severity with not permitted authorization scope + Log escalate the perceived severity of an alarm with the VNFM with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${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}"} + ${template}= Get File jsons/EscalatePerceivedSeverity.json + ${body}= Format String ${template} perceivedSeverity=${PerceivedSeverity} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId}/escalate ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot index 2bc4beff66b675052fbda2c328db5b6e09818c15..4ba0b4b5130479d933a28cf367929e48fc1652ba 100644 --- a/SOL002/VNFFaultManagement-API/IndividualAlarm.robot +++ b/SOL002/VNFFaultManagement-API/IndividualAlarm.robot @@ -5,6 +5,7 @@ Library OperatingSystem Library JSONLibrary Library JSONSchemaLibrary schemas/ Library DependencyLibrary +Library jwt *** Variables ** ${original_etag} 1234 @@ -15,7 +16,7 @@ POST Alarm - Method not implemented ... Test title: POST Alarm - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.3.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -27,7 +28,7 @@ GET information about an individual alarm ... Test title: GET information about an individual alarm ... Test objective: The objective is to read an individual alarm. ... Pre-conditions: The related alarm exists - ... Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -41,7 +42,7 @@ PUT Individual Alarm - Method not implemented ... Test title: PUT Individual Alarm - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.3.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -53,7 +54,7 @@ PATCH Individual Alarm ... Test title: PATCH Individual Alarm ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists - ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -67,7 +68,7 @@ PATCH Individual Alarm - Precondition failed ... Test title: PATCH Individual Alarm - Precondition failed ... Test objective: The objective is to attempt to Modify an individual alarm resource, where the precondition was not met ... Pre-conditions: The related alarm exists - ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The alarm resource is not modified @@ -81,7 +82,7 @@ PATCH Individual Alarm - Conflict ... Test title: PATCH Individual Alarm - Conflict ... Test objective: The objective is to Modify an individual alarm resource ... Pre-conditions: The related alarm exists - ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: The alarm resource is not modified @@ -95,7 +96,7 @@ DELETE Individual Alarm - Method not implemented ... Test title: DELETE Individual Alarm - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -107,25 +108,52 @@ GET information about an individual alarm - Not Found ... Test title: GET information about an individual alarm - Not Found ... Test objective: The objective is to test that GET method fail retrieving status information about individaual Alarms when alarm is not present. ... Pre-conditions: The related alarm doesnot exists - ... Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none GET Alarm Task Check HTTP Response Status Code Is 404 Check HTTP Response Body Json Schema Is ProblemDetails +PATCH Individual Alarm with permitted authorization scope + [Documentation] Test ID: 6.3.4.2.9 + ... Test title: PATCH Individual Alarm with permitted authorization scope + ... Test objective: The objective is to Modify an individual alarm resource with permitted authorization scope + ... Pre-conditions: The related alarm exists + ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + PATCH Alarm Task with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Header Contains ETag and Last-Modified + Check HTTP Response Body Json Schema Is alarmModifications +PATCH Individual Alarm with NOT permitted authorization scope + [Documentation] Test ID: 6.3.4.2.10 + ... Test title: PATCH Individual Alarm with NOT permitted authorization scope + ... Test objective: The objective is to Modify an individual alarm resource with NOT permitted authorization scope + ... Pre-conditions: The related alarm exists + ... Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + PATCH Alarm Task with not permitted authorization scope + Check HTTP Response Status Code Is 403 + Check HTTP Response Body Json Schema Is ProblemDetails *** Keywords *** POST Alarm Task log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PUT Alarm Task log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${body}= Get File jsons/alarmModifications.json Put ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} ${body} @@ -133,7 +161,8 @@ PUT Alarm Task Set Global Variable ${response} ${outputResponse} PATCH Alarm Task log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} Set Headers {"If-Match": "${original_etag[0]}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} @@ -143,7 +172,8 @@ PATCH Alarm Task Set Global Variable ${response} ${outputResponse} PATCH Alarm Task with wrong precondition log Trying to perform a PATCH. This method modifies an individual alarm resource - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${body}= Get File jsons/alarmModifications.json @@ -155,14 +185,16 @@ PATCH Alarm Task with wrong precondition Set Global Variable ${response} ${outputResponse} DELETE Alarm Task log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} GET Alarm Task Log Query VNF The GET method queries information about individual alarm. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms/${alarmId} @@ -179,7 +211,8 @@ Check HTTP Response Header Contains ETag and Last-Modified Log Etag and Last-Modified Headers are present GET Alarm Task with filter Log Query VNF The GET method queries information about individual alarm with filters. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?${alarm_filter}=${managedObjectId} @@ -187,7 +220,8 @@ GET Alarm Task with filter Set Global Variable ${response} ${outputResponse} GET Alarm Task with invalid filter Log Query VNF The GET method queries information about individual alarm with filters. - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + 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}/alarms?${invalid_alarm_filter}=${managedObjectId} @@ -215,4 +249,34 @@ Check HTTP Response Header Contains [Arguments] ${CONTENT_TYPE} Should Contain ${response['headers']} ${CONTENT_TYPE} Log Header is present +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +PATCH Alarm Task with permitted authorization scope + log Trying to perform a PATCH. This method modifies an individual alarm resource with permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} + ${scope_value}= Create Dictionary scopeValue=${ALARMS_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${body}= Get File jsons/alarmModifications.json + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +PATCH Alarm Task with not permitted authorization scope + log Trying to perform a PATCH. This method modifies an individual alarm resource with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE_PATCH}"} + Set Headers {"If-Match": "${original_etag[0]}"} + ${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}"} + ${body}= Get File jsons/alarmModifications.json + Patch ${apiRoot}/${apiName}/${apiMajorVersion}/alarms/${alarmId} ${body} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} diff --git a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot index 829a9b580a712331170f665823735fe4d30af9e8..9778058ae0eb2ddec3ac7746e5ee5df63a85485a 100644 --- a/SOL002/VNFFaultManagement-API/IndividualSubscription.robot +++ b/SOL002/VNFFaultManagement-API/IndividualSubscription.robot @@ -1,6 +1,7 @@ *** Settings *** Resource environment/variables.txt Library JSONLibrary +Library jwt Library JSONSchemaLibrary schemas/ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT} ssl_verify=false Documentation This resource represents an individual subscription for VNF alarms. @@ -13,7 +14,7 @@ POST Individual Subscription - Method not implemented ... Test title: POST Individual Subscription - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.6.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -25,7 +26,7 @@ GET Information about an individual subscription ... Test title: GET Information about an individual subscription ... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client ... Pre-conditions: The subscription with the given id exists - ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -38,7 +39,7 @@ PUT an individual subscription - Method not implemented ... Test title: PUT an individual subscription - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.6.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -50,7 +51,7 @@ PATCH an individual subscription - Method not implemented ... Test title: PATCH an individual subscription - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -62,7 +63,7 @@ DELETE an individual subscription ... Test title: DELETE an individual subscription ... Test objective: The objective is to test that the deletion of a individual subscription resource. ... Pre-conditions: one or more subscription already exsist - ... Reference: Clause 7.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: the subscription is deleted @@ -75,30 +76,55 @@ GET Information about an individual subscription - Not Found ... Test title: GET Information about an individual subscription - Not Found ... Test objective: The objective is to test that GET method fail retrieving individual subscription for VNF alarms subscribed by the client because it is not present. ... Pre-conditions: The subscription with the given id donot exists - ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Get individual subscription Check HTTP Response Status Code Is 404 Check HTTP Response Body Json Schema Is ProblemDetails - +GET Information about an individual subscription with permitted authorization scope + [Documentation] Test ID: 6.3.4.5.7 + ... Test title: GET Information about an individual subscription with permitted authorization scope + ... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client with the permitted authorization scope + ... Pre-conditions: The subscription with the given id exists + ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get individual subscription with permitted authorization scope + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is FmSubscription +GET Information about an individual subscription with NOT permitted authorization scope + [Documentation] Test ID: 6.3.4.5.8 + ... Test title: GET Information about an individual subscription with NOT permitted authorization scope + ... Test objective: The objective is to read an individual subscription for VNF alarms subscribed by the client with not permitted authorization scope + ... Pre-conditions: The subscription with the given id exists + ... Reference: Clause 7.4.6.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: none + Get individual subscription with not permitted authorization scope + Check HTTP Response Status Code Is 403 *** Keywords *** Check resource existence Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 Post Create individual subscription log Trying to perform a POST. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} Get individual subscription log Trying to get information about an individual subscription - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response @@ -119,14 +145,16 @@ Get individual subscription - invalid filter Set Global Variable ${response} ${outputResponse} PUT individual subscription log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH individual subscription log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} @@ -134,7 +162,8 @@ PATCH individual subscription Set Global Variable ${response} ${outputResponse} DELETE individual subscription log Try to delete an individual subscription - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} ${outputResponse}= Output response @@ -156,4 +185,27 @@ Check HTTP Response Body Json Schema Is Check Postcondition resource is deleted Get individual subscription Check HTTP Response Status Code Is 404 - \ No newline at end of file +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Get individual subscription with permitted authorization scope + log Trying to get information about an individual subscription with permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + ${scope_value}= Create Dictionary scopeValue=${SUBSCRIPTIONS_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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} +Get individual subscription with not permitted authorization scope + log Trying to get information about an individual subscription with not permitted authorization scope + Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + ${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} + ${outputResponse}= Output response + Set Global Variable ${response} ${outputResponse} \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot index 9c4284213752802b68953105d2f0b9f6bec1974e..5991559417d61bb78d420f5d5d7d00552665eff1 100644 --- a/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot +++ b/SOL002/VNFFaultManagement-API/NotificationEndpoint.robot @@ -13,7 +13,7 @@ VNF Fault Alarm Notification ... Test title: VNF Fault Alarm Notification ... Test objective: The objective is to test that VNF Fault Alarm Notification is delivered with success to the notification consumer ... Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -25,7 +25,7 @@ VNF Fault Alarm Cleared Notification ... Test title: VNF Fault Alarm Cleared Notification ... Test objective: The objective is to test that VNF Fault Alarm Cleared Notification is delivered with success to the notification consumer ... Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm cleared notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -37,7 +37,7 @@ VNF Fault Alarm List Rebuilt Notification ... Test title: VNF Fault List Rebuilt Alarm List Rebuilt Notification ... Test objective: The objective is to test that VNF Fault Alarm List Rebuilt Notification is delivered with success to the notification consumer ... Pre-conditions: A VNF instance is instantiated, and a subscription for fault alarm list rebuilt notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_Notif_Endpoint ... Applicability: none ... Post-Conditions: none @@ -46,7 +46,8 @@ VNF Fault Alarm List Rebuilt Notification *** Keywords *** Check resource existence and get CallbackUri - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} @@ -61,7 +62,8 @@ Check HTTP Response Status Code Is Post Alarm Notification log Trying to perform a POST to get notification - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmNotification.json @@ -72,7 +74,8 @@ Post Alarm Notification Post Alarm Cleared Notification log Trying to perform a POST to get notification - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmClearedNotification.json @@ -83,7 +86,8 @@ Post Alarm Cleared Notification Post Alarm List Rebuilt Notification log Trying to perform a POST to get notification - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template} = Get File jsons/AlarmListRebuiltNotification.json diff --git a/SOL002/VNFFaultManagement-API/Notifications.robot b/SOL002/VNFFaultManagement-API/Notifications.robot index e42ad091d386fc421b1e24ab33ccf6948e11ec18..662466ee77d351d984273e3011d88c44f83dfc51 100644 --- a/SOL002/VNFFaultManagement-API/Notifications.robot +++ b/SOL002/VNFFaultManagement-API/Notifications.robot @@ -15,7 +15,7 @@ VNF Fault Alarm Notification ... Test title: VNF Fault Alarm Notification ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Notification when a virtualised resource within an VNF instance fails, 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 instance is instantiated, and a subscription for fault alarm notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -28,7 +28,7 @@ VNF Fault Alarm Cleared Notification ... Test title: VNF Fault Alarm Cleared Notification ... Test objective: The objective is to test the dispatch of VNF Fault Alarm Cleared Notification when a faulty virtualised resource within an VNF instance is cleared, 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 instance is instantiated, a virtualised resource is in faulty state, and a subscription for fault alarm cleared notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -41,7 +41,7 @@ VNF Fault Alarm List Rebuilt Notification ... Test title: VNF Fault Alarm List Rebuilt Notification ... Test objective: The objective is to test the dispatch of VNF Fault Alarm List Rebuilt Notification when the VNFM decides to rebuild the list of its VNF alarms, e.g. due to a corruption in the alarm storage, 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 instance is instantiated, one or more virtualised resource are in faulty state, and a subscription for fault alarm list rebuilt notifications is available in the VNFM. - ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.7.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none diff --git a/SOL002/VNFFaultManagement-API/Subscriptions.robot b/SOL002/VNFFaultManagement-API/Subscriptions.robot index 2e3b5b7db3c316a75d39e9db4613109ea586e478..ee078294540063ae541ca2f0c691b049a5556e79 100644 --- a/SOL002/VNFFaultManagement-API/Subscriptions.robot +++ b/SOL002/VNFFaultManagement-API/Subscriptions.robot @@ -7,6 +7,7 @@ Library JSONSchemaLibrary schemas/ Library String Library Process Library MockServerLibrary +Library jwt Suite Setup Create Sessions Suite Teardown Terminate All Processes kill=true @@ -16,7 +17,7 @@ Create a new subscription ... Test title: Create a new subscription ... Test objective: The objective is to create a new subscription. ... Pre-conditions: no subscription with the same filter and callbackUri exists - ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: Resource created successfully @@ -31,7 +32,7 @@ Create a duplicated Subscription ... Test title: Create a duplicated Subscription ... Test objective: The objective is to create a duplicate subscription. ... Pre-conditions: subscription with the same filter and callbackUri exists - ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: ... Post-Conditions: duplicated subscription is created if the IUT allows duplications, otherwise the duplicated subscription is not created @@ -54,7 +55,7 @@ GET Subscriptions ... Test title: GET Subscriptions ... Test objective: The objective is to retrieve the list of active subscriptions ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -67,7 +68,7 @@ GET Subscription - Filter ... Test title: GET Subscription - Filter ... Test objective: The objective is to retrieve the list of active subscriptions with filter ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -80,7 +81,7 @@ GET subscriptions - Bad Request Invalid attribute-based filtering parameters ... Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters ... Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -93,7 +94,7 @@ GET subscriptions with "all_fields" attribute selector ... Test title: GET subscriptions with "all_fields" attribute selector ... Test objective: The objective is to retrieve the list of active subscriptions with attribute selector ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -106,7 +107,7 @@ GET subscriptions with "exclude_default" attribute selector ... Test title: GET subscriptions with "exclude_default" attribute selector ... Test objective: The objective is to retrieve the list of active subscriptions with attribute selector ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -119,7 +120,7 @@ GET subscriptions with "fields" attribute selector ... Test title: GET subscriptions with "fields" attribute selector ... Test objective: The objective is to retrieve the list of active subscriptions with attribute selector ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -132,7 +133,7 @@ GET subscriptions with "exclude_fields" attribute selector ... Test title: GET subscriptions with "exclude_fields" attribute selector ... Test objective: The objective is to retrieve the list of active subscriptions with attribute selector ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -145,7 +146,7 @@ PUT subscriptions - Method not implemented ... Test title: PUT subscriptions - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.3 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.3 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -157,7 +158,7 @@ PATCH subscriptions - Method not implemented ... Test title: PUT subscriptions - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.4 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.4 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -169,7 +170,7 @@ DELETE subscriptions - Method not implemented ... Test title: DELETE subscriptions - Method not implemented ... Test objective: The objective is to test that the method is not implemented ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.5 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.5 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -181,7 +182,7 @@ GET Subscriptions to get Paged Response ... Test title: GET Subscriptions to get Paged Response ... Test objective: The objective is to retrieve the list of active subscriptions to get paged response ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -194,7 +195,7 @@ GET subscriptions - Bad Request Response too Big ... Test title: GET subscriptions - Bad Request Response too Big ... Test objective: The objective is to test that GET method fail retrieving list of active subscription because Response is too big, and perform the JSON schema validation of the failed operation HTTP response ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -207,7 +208,7 @@ GET Subscription with attribute-based filter "id" ... Test title: GET Subscription with attribute-based filter "id" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "id" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -221,7 +222,7 @@ Get subscriptions with filter "filter.notificationTypes" ... Test title: GET Subscription with attribute-based filter "filter.notificationTypes" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.notificationTypes" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -235,7 +236,7 @@ Get subscriptions with filter "filter.faultyResourceTypes" ... Test title: GET Subscription with attribute-based filter "filter.faultyResourceTypes" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.faultyResourceTypes" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -249,7 +250,7 @@ Get subscriptions with filter "filter.perceivedSeverities" ... Test title: GET Subscription with attribute-based filter "filter.perceivedSeverities" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.perceivedSeverities" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -263,7 +264,7 @@ Get subscriptions with filter "filter.eventTypes" ... Test title: GET Subscription with attribute-based filter "filter.eventTypes" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.eventTypes" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -277,7 +278,7 @@ Get subscriptions with filter "filter.probableCauses" ... Test title: GET Subscription with attribute-based filter "filter.probableCauses" ... Test objective: The objective is to retrieve the list of active subscriptions with filter "filter.probableCauses" ... Pre-conditions: none - ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.2 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none @@ -291,13 +292,38 @@ 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. ... re-conditions: none - ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.4.1 + ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 ... Config ID: Config_prod_VNFM ... Applicability: none ... Post-Conditions: none Post Create subscription Check HTTP Response Status Code Is 422 Check HTTP Response Body Json Schema Is ProblemDetails +Create a new subscription with permitted authorization scope + [Documentation] Test ID: 6.3.4.4.23 + ... Test title: Create a new subscription with permitted authorization scope + ... Test objective: The objective is to create a new subscription with permitted authorization scope. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: Resource created successfully + Post Create subscription with permitted authorization scope + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is FmSubscription + Check HTTP Response Header Contain Link + Check Postcondition resource exists +Create a new subscription with not permitted authorization scope + [Documentation] Test ID: 6.3.4.4.24 + ... Test title: Create a new subscription with not permitted authorization scope + ... Test objective: The objective is to create a new subscription with not permitted authorization scope. + ... Pre-conditions: no subscription with the same filter and callbackUri exists + ... Reference: Clause 7.4.5.3.1 - ETSI GS NFV-SOL 002 [2] v4.5.1 + ... Config ID: Config_prod_VNFM + ... Applicability: none + ... Post-Conditions: Resource created successfully + Post Create subscription with not permitted authorization scope + Check HTTP Response Status Code Is 403 *** Keywords *** Void @@ -310,7 +336,8 @@ Create Sessions Post Create subscription Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} ${template}= Get File jsons/fmSubscriptionRequest.json @@ -349,7 +376,8 @@ Post Create subscription # Set Global Variable ${response} ${outputResponse} Get subscriptions Log Get the list of active subscriptions - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Set Headers {"Content-Type": "${CONTENT_TYPE}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Log Execute Query and validate response @@ -359,6 +387,7 @@ Get subscriptions Get subscriptions - filter Log Get the list of active subscriptions using a filter Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${sub_filter} ${outputResponse}= Output response @@ -366,6 +395,7 @@ Get subscriptions - filter Get subscriptions - invalid filter Log Get the list of active subscriptions using an invalid filter Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${sub_filter_invalid} ${outputResponse}= Output response @@ -373,6 +403,7 @@ Get subscriptions - invalid filter Get subscriptions with all_fields attribute selector Log Get the list of active subscriptions, using fields 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?exclude_default ${output}= Output response @@ -380,6 +411,7 @@ Get subscriptions with all_fields attribute selector Get subscriptions with exclude_default attribute selector Log Get the list of active subscriptions, using fields 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?exclude_default ${output}= Output response @@ -387,6 +419,7 @@ Get subscriptions with exclude_default attribute selector Get subscriptions with fields attribute selector Log Get the list of active subscriptions, using fields 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?fields=${fields} ${output}= Output response @@ -394,27 +427,31 @@ Get subscriptions with fields attribute selector Get subscriptions with exclude_fields attribute selector Log Get the list of active subscriptions, using fields 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?exclude_fields=${fields} ${output}= Output response Set Suite Variable ${response} ${output} PUT subscriptions log Trying to perform a PUT. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Put ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} PATCH subscriptions log Trying to perform a PATCH. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Patch ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${outputResponse}= Output response Set Global Variable ${response} ${outputResponse} DELETE subscriptions log Trying to perform a DELETE. This method should not be implemented - Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${outputResponse}= Output response @@ -440,6 +477,7 @@ Check HTTP Response Header Contain Link Get subscriptions with filter "id" Log Get the list of active subscriptions using a filter "id" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?id=${subscription_id} ${outputResponse}= Output response @@ -451,6 +489,7 @@ Check PostCondition HTTP Response Body Subscription Matches the requested attrib Get subscriptions with filter "filter_notificationTypes" Log Get the list of active subscriptions using a filter "filter.notificationTypes" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.notificationTypes=${notification_type} ${outputResponse}= Output response @@ -464,6 +503,7 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri Get subscriptions with filter "filter_faultyResourceTypes" Log Get the list of active subscriptions using a filter "filter.faultyResourceTypes" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.faultyResourceTypes=${faultyResourceType} ${outputResponse}= Output response @@ -477,6 +517,7 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri Get subscriptions with filter "filter_perceivedSeverities" Log Get the list of active subscriptions using a filter "filter.perceivedSeverities" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.perceivedSeverities=${perceivedSeverity} ${outputResponse}= Output response @@ -490,6 +531,7 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri Get subscriptions with filter "filter_eventTypes" Log Get the list of active subscriptions using a filter "filter.eventTypes" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.eventTypes=${eventType} ${outputResponse}= Output response @@ -503,6 +545,7 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri Get subscriptions with filter "filter_probableCauses" Log Get the list of active subscriptions using a filter "filter.probableCauses" Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?filter.probableCauses=${probableCause} ${outputResponse}= Output response @@ -515,6 +558,7 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri Check Postcondition resource exists Set Headers {"Accept":"${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"} Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} Integer response status 200 @@ -525,4 +569,46 @@ Check Postcondition Duplicate Subscription exsist Check Response for duplicated subscription Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 Check HTTP Response Status Code Is 201 Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 1 Check HTTP Response Body Json Schema Is FmSubscription - Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0 Check HTTP Response Status Code Is 303 \ No newline at end of file + Run Keyword If ${VNFM_ALLOWS_DUPLICATE_SUBS} == 0 Check HTTP Response Status Code Is 303 +JWT Encode + [Arguments] ${payload} ${key} ${algorithm} + ${encoded}= Evaluate jwt.encode(${payload}, ${key}, ${algorithm}) + [Return] ${encoded} +Post Create subscription with permitted authorization scope + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${scope_value}= Create Dictionary scopeValue=${SUBSCRIPTIONS_SCOPE} + ${authorizationToken}= JWT Encode payload=${scope_value} key='' algorithm=${OAUTH_Encryption_ALGORITHM} + Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} + ${template}= Get File jsons/fmSubscriptionRequest.json + ${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false + ${output}= Output response + Set Global Variable ${response} ${output} + Clear Requests ${callback_endpoint} +Post Create subscription with not permitted authorization scope + Log Create subscription instance by POST to ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions with not permitted authorization scope + Set Headers {"Accept": "${ACCEPT}"} + Set Headers {"Version": "${API_VERSION}"} + Set Headers {"Content-Type": "${CONTENT_TYPE}"} + ${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}"} + ${template}= Get File jsons/fmSubscriptionRequest.json + ${body}= Format String ${template} callback_uri=${callback_uri}:${callback_port} callback_endpoint=${callback_endpoint} + Log Creating mock request and response to handle GET operation on notification endpoint + &{notification_request}= Create Mock Request Matcher GET ${callback_endpoint} + &{notification_response}= Create Mock Response status_code=204 + Log Issue the subscription request + Create Mock Expectation ${notification_request} ${notification_response} + Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions ${body} allow_redirects=false + ${output}= Output response + Set Global Variable ${response} ${output} + Clear Requests ${callback_endpoint} \ No newline at end of file diff --git a/SOL002/VNFFaultManagement-API/environment/variables.txt b/SOL002/VNFFaultManagement-API/environment/variables.txt index 7641e281857ab2a1a011c535db87530d3cc3f9b6..27051abd172ec79beabfa4518f9baed4ab89eed6 100644 --- a/SOL002/VNFFaultManagement-API/environment/variables.txt +++ b/SOL002/VNFFaultManagement-API/environment/variables.txt @@ -15,6 +15,14 @@ ${apiName} vnffm ${apiMajorVersion} v1 ${CONTENT_TYPE} application/json +${ALARMS_SCOPE} vnffm:v1:alarms:with_vnfc +${ALARMS_READONLY_SCOPE} vnffm:v1:alarms:with_vnfc:readonly +${ESCALATE_SCOPE} vnffm:v1:escalate +${SUBSCRIPTIONS_SCOPE} vnffm:v1:subscriptions +${NEG_SCOPE} vnffm:v1:invalid +${OAUTH_Encryption_ALGORITHM} HS256 +${API_VERSION} 1.12.0 + ${HEADER_TEST_SUPPORTED} 0 ${origResponse}= httpresponse