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

This merge request refers to the implementation of deltas between v4.5.1 and v4.4.1 of SOL011 NS Instance Usage Interface.

Deadline for review: Wednesday 25th Sept 2024 @noon CEST

Merge request reports

Loading
+4 −0
Changes for SOL011/NSInstanceUsageNotification-API/environment/variables.txt: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ ${VNFM_SCHEMA} https
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${WRONG_AUTHORIZATION}    Bearer    XXXXXWRONGXXXXX

${SUBSCRIPTION_SCOPE}   nsiun:v1:all
${NEG_SCOPE}    nsiun:v1:invalid
${OAUTH_Encryption_ALGORITHM}   HS256

${vnfInstanceDescription}    description vnf
${vnfInstanceDescription_Update}    Updated description vnf 
${SINGLE_FILE_VNFD}    1    # If VNFD is PLAIN TEXT
+30 −6
Changes for SOL011/NSInstanceUsageNotification-API/IndividualSubscription.robot: 30 added lines, 6 removed lines.
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
+47 −0
Changes for SOL011/NSInstanceUsageNotification-API/NSInstanceUsageNotificationKeywords.robot: 47 added lines, 0 removed lines.
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
Changes for SOL011/NSInstanceUsageNotification-API/NotificationEndpoint.robot: 1 added line, 1 removed line.
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
Changes for SOL011/NSInstanceUsageNotification-API/Notifications.robot: 2 added lines, 2 removed lines.
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 
Loading
Loading