Commit 79d9a876 authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch 'SOL011-NSInstanceUsageNotification' into '4.5.1-dev'

SOL011 NS Instance Usage - Implementation of deltas between v4.5.1 and v4.4.1

See merge request !326
parents 7bdbabdb ad256ef1
Loading
Loading
Loading
Loading
+31 −7
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ POST Individual Subscription - Method not implemented
    ...    Test title: POST Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.4.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -24,7 +24,7 @@ GET Information about an individual subscription - Successful
    ...    Test title: GET Information about an individual subscription - Successful
    ...    Test objective: The objective is to test the retrieval of NS instance usage notification subscription and perform a JSON schema validation of the returned subscription data structure
    ...    Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO.
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -37,7 +37,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 PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.4.3.3 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.3 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -49,7 +49,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 PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.4.3.4 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.4 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -61,7 +61,7 @@ DELETE an individual subscription
    ...    Test title: DELETE an individual subscription
    ...    Test objective: The objective is to test that DELETE method deletes an individual subscription
    ...    Pre-conditions: At least one instance usage notification subscription is available in the NFVO
    ...    Reference: Clause 8.5.4.3.5 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.5 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS instance usage notification subscription is not available anymore on NFVO
@@ -74,10 +74,34 @@ 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 the retrieval of individual NS instance usage notification subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO.
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    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 - Successful
     [Documentation]    Test ID: 9.3.2.2.7
    ...    Test title: GET Information about an individual subscription with permitted authorization scope - Successful
    ...    Test objective: The objective is to test the retrieval of NS instance usage notification subscription and perform a JSON schema validation of the returned subscription data structure
    ...    Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO.
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    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   subscription
GET Information about an individual subscription with not permitted authorization scope - Successful
     [Documentation]    Test ID: 9.3.2.2.8
    ...    Test title: GET Information about an individual subscription with not permitted authorization scope - Successful
    ...    Test objective: The objective is to test the retrieval of NS instance usage notification subscription and perform a JSON schema validation of the returned subscription data structure
    ...    Pre-conditions: An NS instance is instantiated. At least one NS instance usage notification subscription is available in the NFVO.
    ...    Reference: Clause 8.5.4.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual subscription with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is   ProblemDetails
+48 −1
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Library OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    String
Library    jwt

*** Keywords ***
Check HTTP Response Status Code Is
@@ -262,3 +263,49 @@ Check Postcondition Subscription Resource Returned in Location Header Is Availab
Check Postcondition Subscriptions Exist
    Log    Checking that subscriptions exists
    Get Subscriptions 
JWT Encode
    [Arguments]    ${payload}    ${key}    ${algorithm}
    ${encoded}=    Evaluate    jwt.encode(${payload}, ${key}, ${algorithm})
    [Return]    ${encoded}
POST subscriptions with permitted authorization scope
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    ${scope_value}=    Create Dictionary    scopeValue=${SUBSCRIPTION_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scope_value}    key=''    algorithm=${OAUTH_Encryption_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${authorizationToken}"}
    ${body}=    Get File    jsons/NsInstanceUsageSubscriptionRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
POST subscriptions with not permitted authorization scope
    Log    Create subscription instance by POST to ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    Set Headers  {"Accept":"${ACCEPT}"}  
    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":"${authorizationToken}"}
    ${body}=    Get File    jsons/NsInstanceUsageSubscriptionRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    allow_redirects=false
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
GET Individual subscription with permitted authorization scope
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    ${scope_value}=    Create Dictionary    scopeValue=${SUBSCRIPTION_SCOPE}
    ${authorizationToken}=    JWT Encode    payload=${scope_value}    key=''    algorithm=${OAUTH_Encryption_ALGORITHM}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${authorizationToken}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/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
    Set Headers    {"Accept":"${ACCEPT}"}  
    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":"${authorizationToken}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}  
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ NS Instance Usage Notification
    ...    Test title: NS Instance Usage Notification
    ...    Test objective: The objective is to test that NS Instance Usage Notification is delivered with success to the notification consumer
    ...    Pre-conditions: A subscription for instance usage notification is available in the NFVO.
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_Notif_Endpoint
    ...    Applicability: none
    ...    Post-Conditions: none 
+2 −2
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ NS Instance Usage START Notification
    ...    Test title: NS Instance Usage START Notification
    ...    Test objective: The objective is to test the dispatch of NS Instance Usage Start Notification when the usage of an NS instance is started, 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 subscription for NS instance usage notification is available in the NFVO.
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -27,7 +27,7 @@ NS Instance Usage END Notification
    ...    Test title: NS Instance Usage END Notification
    ...    Test objective: The objective is to test the dispatch of NS Instance Usage End Notification when the usage of an NS instance is ended, 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 subscription for NS instance usage notification is available in the NFVO.
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.5.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
+44 −17
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ POST Create a new subscription
    ...    Test title: POST Create a new subscription
    ...    Test objective: The objective is to test that POST method creates a subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Subscription is created in the NFVO     
@@ -28,7 +28,7 @@ POST Create a new Subscription - DUPLICATION
    ...    Test title: POST Create a new subscription - DUPLICATION
    ...    Test objective: The objective is to test that POST method creates a duplicate subscription 
    ...    Pre-conditions: A subscription shall already exist 
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: Duplication supported by NFVO-C
    ...    Post-Conditions: Duplicate subscription is created in the NFVO     
@@ -44,7 +44,7 @@ POST Create a new Subscription - NO-DUPLICATION
    ...    Test title: POST Create a new subscription - NO-DUPLICATION
    ...    Test objective: The objective is to test that POST method cannot create a duplicate subscription 
    ...    Pre-conditions: A subscription shall already exist
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: Duplication NOT supported by NFVO-C
    ...    Post-Conditions: Duplicate subscription is not created in the NFVO     
@@ -58,7 +58,7 @@ GET Subscriptions
    ...    Test title: GET Subscriptions
    ...    Test objective: The objective is to test that GET method retrieves the list of existing subscriptions
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
@@ -71,7 +71,7 @@ GET Subscription - Filter
    ...    Test title: GET Subscription - Filter
    ...    Test objective: The objective is GET the list of active subscriptions using a filter
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
@@ -84,7 +84,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 GET the list of active subscriptions using an invalid filter
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -97,7 +97,7 @@ GET subscriptions - Bad Request Response too Big
    ...    Test title: GET subscriptions - Bad Request Response too Big
    ...    Test objective: The objective is test that the retrieval of active subscriptions list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none 
@@ -110,7 +110,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 "all_fields" attribute selector
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none 
    ...    Post-Conditions: none
@@ -123,7 +123,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 "exclude_default"s attribute selector
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability:  none
    ...    Post-Conditions: none
@@ -136,7 +136,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 "fields" attribute selector
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability:  none
    ...    Post-Conditions: none
@@ -149,7 +149,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 "exclude_fields" attribute selector
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability:  none
    ...    Post-Conditions: none
@@ -162,7 +162,7 @@ GET Subscriptions as Paged Response
    ...    Test title: GET Subscriptions as Paged Response
    ...    Test objective: The objective is to test that GET method  retrieve the list of existing subscriptions as paged response.
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none    
@@ -175,7 +175,7 @@ PUT subscriptions - Method not implemented
    ...    Test title: PUT subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.3 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.3 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -187,7 +187,7 @@ PATCH subscriptions - Method not implemented
    ...    Test title: PATCH subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.4 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.4 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -199,7 +199,7 @@ DELETE subscriptions - Method not implemented
    ...    Test title: DELETE subscriptions - Method not implemented
    ...    Test objective: The objective is to test that DELETE method cannot delete a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.5 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.5 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Subscriptions are not deleted
@@ -212,10 +212,37 @@ GET subscriptions with "exclude_default" and "fields" attribute selector
    ...    Test title: GET subscriptions with "exclude_default" and "fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default" and "fields" attribute selector
    ...    Pre-conditions: 
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.4.1
    ...    Reference: Clause 8.5.3.3.2 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none 
    ...    Post-Conditions: none
    Get subscriptions with exclude_default and fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   subscriptions  
POST Create a new subscription with permitted authorization scope
    [Documentation]    Test ID: 9.3.2.1.17
    ...    Test title: POST Create a new subscription with permitted authorization scope
    ...    Test objective: The objective is to test that POST method creates a subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Subscription is created in the NFVO     
    POST subscriptions with permitted authorization scope
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is    subscription
    Check HTTP Response Header Contains Resource URI
    Check Postcondition Subscription Is Set 
POST Create a new subscription with NOT permitted authorization scope
    [Documentation]    Test ID: 9.3.2.1.18
    ...    Test title: POST Create a new subscription with not permitted authorization scope
    ...    Test objective: The objective is to test that POST method creates a subscription
    ...    Pre-conditions: none
    ...    Reference: Clause 8.5.3.3.1 - ETSI GS NFV-SOL 011 [8] v4.5.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Subscription is created in the NFVO     
    POST subscriptions with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
Loading