Commit 01c5c06c authored by mengxuan.zhao's avatar mengxuan.zhao
Browse files

Merge branch 'master' of forge.etsi.org:stf/stf-557/api-tests

# Conflicts:
#	SOL003/VNFLifecycleManagement-API/ChangeVNFFlavourWorkflow.robot
parents d6f1b4ed 5b71d37c
Loading
Loading
Loading
Loading
+90 −63
Original line number Original line Diff line number Diff line
@@ -9,7 +9,8 @@ Library DependencyLibrary


*** Variables ***
*** Variables ***
${Etag}=    an etag
${Etag}=    an etag
${Etag_modified}=    a modified etag
${Etag_modified}=    12345
${response}=    httpresponse


*** Test Cases ***
*** Test Cases ***
POST Configuration - Method not implemented
POST Configuration - Method not implemented
@@ -21,29 +22,19 @@ POST Configuration - Method not implemented
    Integer    response status    405
    Integer    response status    405


Get information about a configuration
Get information about a configuration
    [Documentation]    Test ID: 9.4.2.1
    [Documentation]    Test ID: 9.4.2.2
    ...    Test title: Get information about a configuration
    ...    Test title: Get information about a configuration
    ...    Test objective: The objective is to read configuration information about a VNF instance and/or its VNFC instances
    ...    Test objective: The objective is to test the retrieval of an existing VNF instance configuration
    ...    Pre-conditions: 
    ...    Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1)
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
    ...    Post-Conditions:   
    ...    Post-Conditions: The VNF configuration is not modified by the operation
    Log    Query VNF The GET method queries information about a configuration.
    Get VNF configuration
    Set Headers  {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    200
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Check HTTP Response Header Contains    Etag
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Check HTTP Response Body Json Schema Is   vnfConfiguration
    Log    Execute Query and validate response
    Check Postcondition VNF Configuration Untouched
    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration
    ${Etag}=    Output    response headers Etag
    Log    Validate Status code
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    vnfConfiguration.schema.json    ${json}
    Log    Validation OK


PUT Config - Method not implemented
PUT Config - Method not implemented
    log    Trying to perform a PUT. This method should not be implemented
    log    Trying to perform a PUT. This method should not be implemented
@@ -53,40 +44,61 @@ PUT Config - Method not implemented
    Log    Validate Status code
    Log    Validate Status code
    Integer    response status    405
    Integer    response status    405


PATCH Config
Set new VNF Configuration
    [Documentation]    Test ID: 9.4.2.2
    [Documentation]    Test ID: 9.4.2.1
    ...    Test title: Set or modify a configuration resource
    ...    Test title: Set a new VNF Configuration
    ...    Test objective: The objective is to set or modify a configuration resource
    ...    Test objective: The objective is to test the creation of a new VNF configuration
    ...    Pre-conditions: A VNF instance and its VNFC instances exist
    ...    Pre-conditions: A VNF instance is up and running
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
    ...    Post-Conditions: The VNF configuration is set
    Send VNF configuration
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Contains    Etag
    Check HTTP Response Body Json Schema Is   vnfConfiModifications
    Check Postcondition VNF Is Configured

Set new VNF Configuration - HTTP Etag precondition failed
    [Documentation]    Test ID: 9.4.2.3
    ...    Test title: Set a new VNF Configuration - HTTP Etag precondition failed
    ...    Test objective: The objective is to test the failure in setting a duplication of VNF configuration identified by an already used HTTP Etag identifier.
    ...    Pre-conditions: A VNF instance is up and running. The VNF instance is already configured (Test ID: 9.4.2.1) with a given HTTP Etag identifier.
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: The VNF supports the generation of HTTP Etag opaque identifiers
    ...    Post-Conditions:  Configuration of the VNF instance and/or its VNFC instances has been set 
    ...    Post-Conditions:  The VNF configuration is not modified by the operation
    Send Duplicated VNF configuration
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is   ProblemDetails
    Check Postcondition VNF Configuration Untouched

DELETE Config - Method not implemented
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration
    Log    Validate Status code
    Integer    response status    405
    
*** Keywords ***    
Get VNF configuration
    Log    Query VNF The GET method queries information about a configuration.
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    ${response}=    Get    ${apiRoot}/${apiName}/${apiVersion}/configuration

Send VNF configuration
    log    Trying to perform a PATCH. This method modifies the configuration    
    log    Trying to perform a PATCH. This method modifies the configuration    
    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    json/vnfConfigModifications.json
    ${body}=    Get File    json/vnfConfigModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    ${response}=    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Log    Validate Status code
    ${Etag_modified}=    Output    response headers Etag
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    ${json}=    evaluate    json.loads('''${result}''')    json
    Validate Json    vnfConfigModifications.schema.json    ${json}
    Log    Validation OK


PATCH Config - Precondition failed
Send Duplicated VNF configuration
    [Documentation]    Test ID: 9.4.2.2-1
    ...    Test title: Set or modify a configuration resource  - Precondition failed
    ...    Test objective: The objective is to set or modify a configuration resource, but a precondition given in an HTTP request header is not fulfilled
    ...    Pre-conditions: A VNF instance and its VNFC instances exist, ETag modified in the meanwhile
    ...    Reference: section 9.4.2 - SOL002 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Post-Conditions:  
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
    Depends On Test    PATCH Alarm    # If the previous test scceeded, it means that Etag has been modified
    log    Trying to perform a PATCH. This method modifies an individual alarm resource  
    log    Trying to perform a PATCH. This method modifies an individual alarm resource  
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
@@ -94,18 +106,33 @@ PATCH Config - Precondition failed
    Set Headers    {"If-Match": "${Etag}"}
    Set Headers    {"If-Match": "${Etag}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    json/vnfConfigModifications.json
    ${body}=    Get File    json/vnfConfigModifications.json
    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    ${response}=    Patch    ${apiRoot}/${apiName}/${apiVersion}/configuration    ${body}
    Log    Validate Status code
    Integer    response status    412
    ${problemDetails}=    Output    response body
    ${json}=    evaluate    json.loads('''${problemDetails}''')    json
    Validate Json    ProblemDetails.schema.json    ${json}
    Log    Validation OK


DELETE Config - Method not implemented
Check HTTP Response Status Code Is
    log    Trying to perform a DELETE. This method should not be implemented
    [Arguments]    ${expected_status}    
    Set Headers  {"Accept":"${ACCEPT}"}  
    Should Be Equal    ${response.status_code}    ${expected_status}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Status code validated
    Delete    ${apiRoot}/${apiName}/${apiVersion}/configuration

    Log    Validate Status code
Check HTTP Response Header Contains
    Integer    response status    405   
    [Arguments]    ${CONTENT_TYPE}
 No newline at end of file
    Should Contain    ${response.headers}    ${CONTENT_TYPE}
    Log    Header is present
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${schema}
    ${contentType}=    Get Value From Json    ${response.headers}    $..Content-Type
    Should Be Equal    ${contentType}    ${CONTENT_TYPE}
    ${json}=    evaluate    json.loads('''${response.body}''')    json
    Validate Json    ${schema}    ${json}
    Log    Json Schema Validation OK
    
Check Postcondition VNF Configuration Untouched
    Log    Check Postcondition for GET
    #todo
    
Check Postcondition VNF Is Configured
    Log    Check Postcondition for PATCH
    Get VNF configuration
    ${output}=    evaluate    json.loads('''${response.body}''')    json
    ${input}=    Get File    json/vnfConfigModifications.json
    Should Be Equal  ${output}    ${input}   
 No newline at end of file
+14 −5
Original line number Original line Diff line number Diff line
@@ -16,24 +16,34 @@ Suite Teardown Terminate All Processes kill=true




*** Test Cases ***
*** Test Cases ***
<<<<<<< .merge_file_a08480
Change VNF Flavour Operation
Change VNF Flavour Operation
    [Documentation]    Test ID: 5.x.y.x
    [Documentation]    Test ID: 5.x.y.x
    ...    Test title: Change VNF Flavour Operation
    ...    Test title: Change VNF Flavour Operation
    ...    Test objective: The objective is to test a change flavour operation of an existing VNF instance
    ...    Test objective: The objective is to test a change flavour operation of an existing VNF instance
    ...    Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c)
    ...    Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.a.b.c)
    ...    Reference: section 5.3.3 - SOL003 v2.4.1
    ...    Reference: section 5.3.3 - SOL003 v2.4.1
=======
Change VNF Flavour
    [Documentation]    Test ID: 5.4.7.1
    ...    Test title: Change VNF Flavour Workflow
    ...    Test objective: The objective is to test the workflow for a change flavour of an existing VNF instance
    ...    Pre-conditions: VNF instance in INSTANTIATED state (Test ID: 5.4.4.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1)
    ...    Reference: section 5.4.7 - SOL003 v2.4.1
>>>>>>> .merge_file_a08764
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: change flavour operation is supported for the VNF (as capability in the VNFD)
    ...    Applicability: Multiple flavours are supported for the VNF (as capability in the VNFD). NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed
    ...    Post-Conditions: VNF instance still in INSTANTIATED state and the flavour is changed
    Send Change VNF Flavour Request
    Send Change VNF Flavour Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location 
    Check HTTP Response Header Contains    Location 
    Check Operation Occurrence Id
    Check Operation Occurrence Id
    Check Operation Notification For Change Flavour    STARTING
    Check Operation Notification For Change Flavour    STARTING
    Create a new Grant - Sync - CHANGE_FLAVOUR
    Check Operation Notification For Change Flavour    PROCESSING
    Check Operation Notification For Change Flavour    PROCESSING
    Check Operation Notification For Change Flavour    COMPLETED
    Check Operation Notification For Change Flavour    COMPLETED
    Check Postcondition VNF    CHANGE_FLAVOUR
    Check Postcondition VNF Flavor Changed
    
#Create a new Grant Sync - CHANGE_FLAVOU Scale REMOVED


*** Keywords ***
*** Keywords ***


@@ -48,8 +58,7 @@ Precondition Checks
    ${LccnSubscriptions}=    Check subscriptions about one VNFInstance and operation type    ${vnfInstanceId}    VnfLcmOperationOccurrenceNotification    operationType=SCALE
    ${LccnSubscriptions}=    Check subscriptions about one VNFInstance and operation type    ${vnfInstanceId}    VnfLcmOperationOccurrenceNotification    operationType=SCALE
    ${scaleInfo}=    Get Vnf Scale Info        ${vnfInstanceId}
    ${scaleInfo}=    Get Vnf Scale Info        ${vnfInstanceId}


Check Postcondition VNF
Check Postcondition VNF Flavor Changed
    [Arguments]    ${operation}
    Check resource instantiated
    Check resource instantiated
    ${newFlavour}=    Get Vnf Flavour Info    ${vnfInstanceId}
    ${newFlavour}=    Get Vnf Flavour Info    ${vnfInstanceId}
    Should be Equal    ${requestedFlavour}    ${newFlavour}
    Should be Equal    ${requestedFlavour}    ${newFlavour}
+17 −20
Original line number Original line Diff line number Diff line
@@ -16,35 +16,32 @@ Suite Teardown Terminate All Processes kill=true




*** Test Cases ***
*** Test Cases ***
Create a VNF Instance
Create VNF Instance Resource
    [Documentation]    Test ID: 5.x.y.x
    [Documentation]    Test ID: 5.3.1.1
    ...    Test title: Create a VNF instance procedure
    ...    Test title: Create VNF Instance workflow
    ...    Test objective: The objective is to test the procedure for the creation of a VNF instance resource.
    ...    Test objective: The objective is to test the workflow for the creation of a new VNF instance resource.
    ...    Pre-conditions: 
    ...    Pre-conditions: NFVO is subscribed to VNF Identifier Creation notifications (Test ID: 5.4.20.2)
    ...    Reference: section 5.3.1 - SOL003 v2.4.1; section
    ...    Reference: section 5.4.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: NFVO is able to receive notifications from VNFM
    ...    NFVO is not subscribed for
    ...    Post-Conditions: The VNF instance resource has been created in "NOT_INSTANTIATED" state.
    ...    Post-Conditions: upon successful completion, the VNF instance resource has been created in "NOT_INSTANTIATED" state.
    Send VNF Instance Resource create Request
    Send VNF create Request
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location 
    Check HTTP Response Header Contains    Location 
    Check Operation Notification For Create   VnfIdentifierCreationNotification
    Check Operation Notification For VNF Instance Creation
    Check Postcondition VNF    CREATE
    Check Postcondition VNF Instance Created  NOT_INSTANTIATED


*** Keywords ***
*** Keywords ***


Initialize System
Initialize System
    Create Sessions
    Create Sessions


Check Postcondition VNF
Check Postcondition VNF Instance Created
    [Arguments]    ${operation}
    [Arguments]    ${status}
    Check VNF Instance    ${vnfInstanceId}
    Check VNF Instance    ${vnfInstanceId}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check VNF Status    ${response.body.instantiationState}    NOT_INSTANTIATED
    Check VNF Status    ${response.body.instantiationState}  ${status}  
     
     
Check Operation Notification For Create
Check Operation Notification For VNF Instance Creation
    [Arguments]    ${element}
    Check VNF Instance Operation Notification    VnfIdentifierCreationNotification   ${vnfInstanceId}
    ${json}=	Get File	schemas/${element}.schema.json
    Configure Notification Handler    ${notification_ep}       
    
    
 No newline at end of file
+14 −18
Original line number Original line Diff line number Diff line
@@ -16,32 +16,28 @@ Suite Teardown Terminate All Processes kill=true




*** Test Cases ***
*** Test Cases ***
Create a VNF Instance
Delete VNF Instance Resource
    [Documentation]    Test ID: 5.x.y.x
    [Documentation]    Test ID: 5.3.2.1
    ...    Test title: Delete a VNF instance procedure
    ...    Test title: Delete VNF Instance workflow
    ...    Test objective: The objective is to test the procedure for the deletion of a VNF instance resource.
    ...    Test objective: The objective is to test the workflow for the deleteion of an existing VNF instance resource
    ...    Pre-conditions: The resource representing the VNF instance to be deleted needs to be in NOT_INSTANTIATED state
    ...    Pre-conditions: The VNF Instance resource is in NOT_INSTANTIATED state. NFVO is subscribed to VNF Identifier Creation notifications (Test ID: 5.4.20.2)
    ...    Reference: section 5.3.2 - SOL003 v2.4.1
    ...    Reference: section 5.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: The resource representing the VNF instance has been removed from the list of VNF instance resources
    ...    Post-Conditions: The VNF instance resource is deleted on the VNFM.
    Send VNF delete Request
    Send VNF Instance Resource delete Request
    Check HTTP Response Status Code Is    204 
    Check HTTP Response Status Code Is    204 
    Check Operation Notification For Create   VnfIdentifierDeletionNotification
    Check Operation Notification For VNF Instance Deletion 
    Check Postcondition VNF    DELETE
    Check Postcondition VNF Instance Deleted


*** Keywords ***
*** Keywords ***


Initialize System
Initialize System
    Create Sessions
    Create Sessions


Check Postcondition VNF
Check Postcondition VNF Instance Deleted
    [Arguments]    ${operation}
    Check VNF Instance    ${vnfInstanceId}
    Check VNF Instance    ${vnfInstanceId}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404


Check Operation Notification For Create
Check Operation Notification For VNF Instance Deletion
    [Arguments]    ${element}
    Check VNF Instance Operation Notification    VnfIdentifierDeletionNotification   ${vnfInstanceId}
    ${json}=	Get File	schemas/${element}.schema.json
 No newline at end of file
    Configure Notification Handler    ${notification_ep}       
    
 No newline at end of file
+6 −6
Original line number Original line Diff line number Diff line
@@ -18,13 +18,13 @@ Library REST ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}


*** Test Cases ***
*** Test Cases ***
VNF Instantiation
VNF Instantiation
    [Documentation]    Test ID: 5.x.y.x
    [Documentation]    Test ID: 5.4.4.1
    ...    Test title: VNF Instantiation
    ...    Test title: VNF Instantiation worflow
    ...    Test objective: The objective is to test the instantiation of a VNF instance
    ...    Test objective: The objective is to test the workflow for the instantiation of a VNF instance
    ...    Pre-conditions: VNF instance resources is created (Test ID: 5.a.b.c)
    ...    Pre-conditions: VNF instance resources is already created (Test ID: 5.4.2.1). NFVO is subscribed to VNF LCM Operation Occurrence notifications (Test ID: 5.4.20.1)
    ...    Reference: section 5.x.y - SOL003 v2.4.1
    ...    Reference: section 5.4.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: VNFM is in direct mode
    ...    Applicability:  NFVO is able to receive notifications from VNFM
    ...    Post-Conditions: VNF instance in INSTANTIATED state
    ...    Post-Conditions: VNF instance in INSTANTIATED state
    Send VNF Instantiation Request
    Send VNF Instantiation Request
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
Loading