Commit 9d731e33 authored by AHMADABB's avatar AHMADABB
Browse files
parents 3b56d6fe 775bd409
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -48,13 +48,12 @@ Heal a vnfInstance Not Found
    ...    Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. 
    ...    Error: The API producer did not find a current representation for the target resource or is not willing to disclose that one exists. 
    ...    Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. 
    ...    Specifically in case of this task resource, the response code 404 shall also returned if the task is not supported for the VNF instance represented by the parent resource, which means that the task resource consequently does not exist. 
    ...    In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error.
    ...    In this case, the response body shall be present, and shall contain a ProblemDetails structure, in which the �detail� attribute shall convey more information about the error.
    [Setup]    Check heal not supported
    Log    Trying to heal a VNF instance, not exist
    Log    Trying to heal a VNF instance, not exist
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/healVnfRequest.json
    ${body}=    Get File    jsons/healVnfRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${vnfInstanceId}/heal    ${body}
    Post    ${apiRoot}/${apiName}/${apiVersion}/vnf_instances/${badVnfInstanceId}/heal    ${body}
    Integer    response status    404
    Integer    response status    404
    Log    Status code validated
    Log    Status code validated
    ${problemDetails}=    Output    response body
    ${problemDetails}=    Output    response body
+1 −0
Original line number Original line Diff line number Diff line
@@ -15,6 +15,7 @@ ${apiVersion} v1
${AUTH_USAGE}     1
${AUTH_USAGE}     1
${WRONG_AUTHORIZATION}    Bearer    XXXXXWRONGXXXXX
${WRONG_AUTHORIZATION}    Bearer    XXXXXWRONGXXXXX
${vnfInstanceId}       6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceId}       6fc3539c-e602-4afa-8e13-962fb5a7d81f
${badVnfInstanceId}       wrongId
${instantiatedVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f    #Change with an instantiated vnfInstanceID
${instantiatedVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f    #Change with an instantiated vnfInstanceID
${conflicVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${conflicVnfInstanceId}    6fc3539c-e602-4afa-8e13-962fb5a7d81f
${vnfInstanceName}    Test-VnfInstance
${vnfInstanceName}    Test-VnfInstance
+11 −11
Original line number Original line Diff line number Diff line
@@ -134,7 +134,7 @@ Send Post Request for Duplicated VNF Performance Subscription
    ...    the existing subscription resource with the same filter and callbackUri).
    ...    the existing subscription resource with the same filter and callbackUri).
    Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body_request}=    Get File    jsons/subscriptions.json
    ${body_request}=    Get File    jsons/subscriptions.json
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body_request}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body_request}
    ${output}=    Output    response
    ${output}=    Output    response
@@ -155,7 +155,7 @@ Send Post Request for Duplicated VNF Performance Subscription
Send Put Request for VNF Performance Subscriptions
Send Put Request for VNF Performance Subscriptions
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -165,7 +165,7 @@ Send Put Request for VNF Performance Subscriptions
Send Patch Request for VNF Performance Subscriptions
Send Patch Request for VNF Performance Subscriptions
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -175,7 +175,7 @@ Send Patch Request for VNF Performance Subscriptions
Send Delete Request for VNF Performance Subscriptions
Send Delete Request for VNF Performance Subscriptions
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    [Documentation]    This method is not supported. When this method is requested on this resource, the VNFM shall return a "405 Method
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    ...    Not Allowed" response as defined in clause 4.3.5.4.
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
@@ -184,40 +184,40 @@ Send Delete Request for VNF Performance Subscriptions


Get Individual VNF Performance Subscription
Get Individual VNF Performance Subscription
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


GET individual VNF Performance Subscription with invalid resource identifier
GET individual VNF Performance Subscription with invalid resource identifier
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Delete request for individual VNF Performance Subscription
Send Delete request for individual VNF Performance Subscription
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send Delete request for individual VNF Performance Subscription with invalid resource identifier
Send Delete request for individual VNF Performance Subscription with invalid resource identifier
    Log    Trying to delete a subscription in the VNFM with invalid id
    Log    Trying to delete a subscription in the VNFM with invalid id
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    @{response}    ${output}


Send Post request for individual VNF Performance Subscription
Send Post request for individual VNF Performance Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    @{response}    ${output}


Send Put request for individual VNF Performance Threshold
Send Put request for individual VNF Performance Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    Set Suite Variable    ${origResponse}    ${origOutput}
@@ -226,7 +226,7 @@ Send Put request for individual VNF Performance Threshold
    Set Suite Variable    @{response}    ${output}
    Set Suite Variable    @{response}    ${output}
    
    
Send Patch request for individual VNF Performance Threshold
Send Patch request for individual VNF Performance Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    Set Suite Variable    ${origResponse}    ${origOutput}
+84 −74
Original line number Original line Diff line number Diff line
@@ -2,88 +2,98 @@
Library           JSONSchemaLibrary    schemas/
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/variables.txt    # Generic Parameters
Resource          environment/individualSubscription.txt
Resource          environment/individualSubscription.txt
Resource          VNFPackageManagementKeywords.robot
Library           OperatingSystem
Library           OperatingSystem
Library           JSONLibrary
Library           JSONLibrary
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}
Library           REST    ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT}


*** Test Cases ***
*** Test Cases ***
GET Individual Subscription
GET Individual VNF Package Subscription
    Log    Trying to get a single subscription identified by subscriptionId
    [Documentation]    Test ID: 7.3.3.7.1
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: GET Individual VNF Package Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test the retrieval of individual VNF package subscription and perform a JSON schema and content validation of the returned subscription data structure
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    Integer    response status    200
    ...    Reference:  section 10.4.8.3.2 - SOL003 v2.4.1
    Log    Received a 200 OK as expected
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: none
    ${result}=    Output    response body
    Get Individual VNF Package Subscription
    Validate Json    PkgmSubscription.schema.json    ${result}
    Check HTTP Response Status Code Is    200
    Log    Validated PkgmSubscription schema
    Check HTTP Response Body Json Schema Is   PkgmSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription


GET Subscription - Negative (Not Found)
GET Individual VNF Package Subscription with invalid resource identifier
    Log    Trying to perform a request on a subscriptionID which doesn't exist
    [Documentation]    Test ID: 7.3.3.7.2
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: GET Individual VNF Package Subscription with invalid resource identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the retrieval of an individual VNF package subscription fails when using an invalid resource identifier
    GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    Integer    response status    404
    ...    Reference:  section 10.4.8.3.2 - SOL003 v2.4.1
    Log    Received 404 Not Found as expected
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: none
    Log    Trying to validate ProblemDetails
    GET individual VNF Package Subscription with invalid resource identifier
    ${problemDetails}=    Output    response body
    Check HTTP Response Status Code Is    404
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK


DELETE Subscription
DELETE Individual VNF Package Subscription with invalid resource identifier
    Log    Trying to perform a DELETE on a subscriptionId
    [Documentation]    Test ID: 7.3.3.7.3
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: DELETE Individual VNF Package Subscription with invalid resource identifier
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that the deletion of an individual VNF package subscription fails when using an invalid resource identifier
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    Integer    response status    204
    ...    Reference:  section 10.4.8.3.5 - SOL003 v2.4.1
    Log    Received 204 No Content as expected
    ...    Config ID: Config_prod_NFVO
    #Log    Trying to get the deleted element
    ...    Applicability: none
    #Create HTTP Context    ${NFVO_HOST}:${NFVO_PORT}    ${NFVO_SCHEMA}
    ...    Post-Conditions: none   
    #Set Request Header    Accept    ${ACCEPT_JSON}
    Send Delete request for individual VNF Package Subscription with invalid resource identifier
    #Run Keyword If    ${AUTH_USAGE} == 1    Set Request Header    Authorization    ${AUTHORIZATION}
    Check HTTP Response Status Code Is    404
    #GET    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    #Response Status Code Should Equal    404
    #Log    The subscriptionId is not present in database


DELETE Subscription - Negative (Not Found)
POST Individual VNF Package Subscription - Method not implemented
    Log    Trying to perform a DELETE on a subscriptionId which doesn't exist
    [Documentation]    Test ID: 7.3.3.7.4
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: POST Individual VNF Package Subscription - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF Package Subscription
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${erroneousSubscriptionId}
    ...    Pre-conditions: none
    Integer    response status    404
    ...    Reference:  section 10.4.8.3.1 - SOL003 v2.4.1
    Log    The subscriptionId is not present in database
    ...    Config ID: Config_prod_NFVO
    ${contentType}=    Output    response headers Content-Type
    ...    Applicability: none
    Should Contain    ${contentType}    ${CONTENT_TYPE_JSON}
    ...    Post-Conditions: The VNF Package Subscription is not created on the NFVO
    Log    Trying to validate ProblemDetails
    Send Post request for individual VNF Package Subscription
    ${problemDetails}=    Output    response body
    Check HTTP Response Status Code Is    405
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Check Postcondition VNF Package Subscription is not Created
    Log    Validation OK


PUT Subscription - (Method not implemented)
PUT Individual VNF Package Subscription - Method not implemented
    Log    Trying to perform a PUT. This method should not be implemented
    [Documentation]    Test ID: 7.3.3.7.5
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: PUT Individual VNF Package Subscription - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing VNF Package subscription
    PUT    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    Integer    response status    405
    ...    Reference:  section 10.4.8.3.3 - SOL003 v2.4.1
    Log    Received 405 Method not implemented as expected
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The VNF Package subscription is not modified by the operation
    Send Put request for individual VNF Package Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Package Subscription is Unmodified (Implicit)


PATCH Subscription - (Method not implemented)
PATCH Individual VNF Package Subscription - Method not implemented
    Log    Trying to perform a PATCH. This method should not be implemented
    [Documentation]    Test ID: 7.3.3.7.6
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ...    Test title: PATCH Individual VNF Package Subscription - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing VNF Package subscription
    PATCH    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    Integer    response status    405
    ...    Reference:  section 10.4.8.3.4 - SOL003 v2.4.1
    Log    Received 405 Method not implemented as expected
    ...    Config ID: Config_prod_NFVO

    ...    Applicability: none
POST Subscription - (Method not implemented)
    ...    Post-Conditions: The VNF Package subscription is not modified by the operation
    Log    Trying to perform a POST. This method should not be implemented
    Send Patch request for individual VNF Package Subscription
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Check HTTP Response Status Code Is    405
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Check Postcondition VNF Package Subscription is Unmodified (Implicit)
    POST    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
    Integer    response status    405
    Log    Received 405 Method not implemented as expected


DELETE Individual VNF Package Subscription
    [Documentation]    Test ID: 7.3.3.7.7
    ...    Test title: DELETE Individual VNF Package Subscription
    ...    Test objective: The objective is to test the deletion of an individual VNF package subscription
    ...    Pre-conditions: At least one VNF package subscription is available in the NFVO.
    ...    Reference:  section 10.4.8.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The VNF Package Subscription is not available anymore in the NFVO    
    Send Delete request for individual VNF Package Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition VNF Package Subscription is Deleted
 No newline at end of file
+87 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading