Commit 31d8765d authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

fixed issue #156 on v2.6.1

parent fd44ec14
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true


*** Test Cases ***
@@ -17,11 +20,13 @@ NS Instance Creation
    ...    Reference: Clause 6.3.1 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS lifecycle management operation occurrence is in NOT_ISTANTIATED state
    ...    Post-Conditions: The NS resource is in NOT_ISTANTIATED state
    POST New nsInstance
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is    NsIdentifierCreationNotification
    Check HTTP Response Body Json Schema Is    NsInstance
    Check Notification Http POST Request Body Json Schema Is    NsIdentifierCreationNotification
    Check Notification Http POST Request Body notificationType attribute Is    NsIdentifierCreationNotification
    Check resource not_instantiated
    
    
 No newline at end of file
+5 −2
Original line number Diff line number Diff line
@@ -5,6 +5,9 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true

*** Test Cases ***
NS Instance Deletion
@@ -16,8 +19,8 @@ NS Instance Deletion
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: NS Instance resource is deleted
    Check resource not_instantiated
    DELETE IndividualNSInstance
    Check HTTP Response Status Code Is    204
    Check HTTP Response Body Json Schema Is    NsIdentifierDeletionNotification
    Check Notification Http POST Request Body Json Schema Is    NsIdentifierDeletionNotification
    Check Notification Http POST Request Body notificationType attribute Is    NsIdentifierDeletionNotification
    Check Instance Deleted
 No newline at end of file
+4 −3
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true

@@ -13,14 +14,14 @@ Heal Flow of NS lifecycle management operations
     [Documentation]    Test ID: 5.3.2.20.1
    ...    Test title: Heal Flow of NS lifecycle management operations
    ...    Test objective: The objective is to test the workflow for Healing a NS instance
    ...    Pre-conditions: the resource is in INSTANTIATED state
    ...    Pre-conditions: The resource is in INSTANTIATED state
    ...    Reference: Clause 6.4.7 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: NS Instance still in INSTANTIATED state
    Check resource instantiated
    ...    Post-Conditions: The NS Instance still in INSTANTIATED state
    POST Heal NSInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Operation Occurrence Id
    Check Operation Notification Status is    START
    Check Operation Notification Status is    RESULT
+4 −4
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true

@@ -13,15 +14,14 @@ Instantiate Flow of NS lifecycle management operations
    [Documentation]    Test ID: 5.3.2.21.1
    ...    Test title: Instantiate Flow of NS lifecycle management operations
    ...    Test objective: The objective is to test the workflow for Instantiate a NS instance
    ...    Pre-conditions: the resource is in NOT_INSTANTIATED state
    ...    Pre-conditions: The resource is in NOT_INSTANTIATED state
    ...    Reference: Clause 6.4.4 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: the resource is in INSTANTIATED state
    Check resource existence
    Check resource not_instantiated
    ...    Post-Conditions: The resource is in INSTANTIATED state
    POST Instantiate nsInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Operation Occurrence Id
    Check Operation Notification Status is    START
    Check Operation Notification Status is    RESULT
+61 −7
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ Check Operation Notification
    ${json}=	Get File	schemas/${element}.schema.json
    Configure Notification Forward    ${element}    ${callback_endpoint}    ${callback_endpoint_fwd}
    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${status}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Wait Until Keyword Succeeds    ${notification_timeout}   ${poll_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    
@@ -109,25 +109,41 @@ Check resource operationState is
    [Arguments]    ${state} 
    String    ${response['body']['operationState']}   ${state}
    
Check resource instantiated
Check resource INSTANTIATED
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
    String    response body nsState    INSTANTIATED
    
Check resource not_instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${response['body']['id']}
    String    response body nsState     NOT_INSTANTIATED

Check NS resource not_instantiated
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
    String    response body nsState     NOT_INSTANTIATED

Check operation resource state is FAILED_TEMP    
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
    String    response body instantiationState    FAILED_TEMP 
    
Check operation resource state is not FAILED_TEMP
@@ -135,14 +151,20 @@ Check operation resource state is not FAILED_TEMP
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
    String  response body instantiationState  not  FAILED_TEMP

Check resource is finally failed
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${opocc['body']['nsInstanceId']}
    String    response body instantiationState    FINALLY_FAILED 

Launch another LCM operation
@@ -220,6 +242,16 @@ POST New nsInstance
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}     

POST New nsInstance resource workflow
    Log    Create NS instance by POST to ${apiRoot}/${apiName}/${apiVersion}/ns_instances
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${body}=    Get File    jsons/CreateNsRequest.json
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances    ${body}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

GET NsInstances
    Log    Query NS The GET method queries information about multiple NS instances.
    Set Headers  {"Accept":"${ACCEPT}"}  
@@ -1133,3 +1165,25 @@ PUT notification
Check LINK in Header
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}

Check Notification Http POST Request Body Json Schema Is  
    [Arguments]    ${element}
    ${schema}=	Get File	schemas/${element}.schema.json
    Configure Notification Forward    ${schema}    ${callback_endpoint}    ${callback_endpoint_fwd}

Check Notification Http POST Request Body notificationType attribute Is
    [Arguments]    ${type}
    Configure Notification NS Creation Handler    ${callback_endpoint_fwd}    ${type}
    Wait Until Keyword Succeeds    ${notification_timeout}   ${poll_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}

Configure Notification NS Creation Handler
    [Arguments]    ${endpoint}    ${type}
    ${json}=    evaluate    {}
    set to dictionary   ${json}    notificationType    ${type}
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{notification_response}=  Create Mock Response	headers="Content-Type: application/json"  status_code=204
    Create Mock Expectation  ${notification_request}  ${notification_response}
Loading