Commit 1977524f authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

fixed issue #156 on v2.7.1

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


*** Test Cases ***
*** Test Cases ***
NS Instance Creation
NS Instance Creation
@@ -15,11 +18,13 @@ NS Instance Creation
    ...    Reference: Clause 6.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 6.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    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
    POST New nsInstance
    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 HTTP Response Body Json Schema Is    NsInstance
    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
    Check resource not_instantiated
    
    
NS Instance Creation with DISABLED Network Service Descriptor
NS Instance Creation with DISABLED Network Service Descriptor
@@ -27,7 +32,7 @@ NS Instance Creation with DISABLED Network Service Descriptor
    ...    Test title: NS Instance Creation with DISABLED Network Service Descriptor
    ...    Test title: NS Instance Creation with DISABLED Network Service Descriptor
    ...    Test objective: The objective is to test the workflow for Creating a NS instance with a disabled NSD
    ...    Test objective: The objective is to test the workflow for Creating a NS instance with a disabled NSD
    ...    Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO in disabled operational state.
    ...    Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO in disabled operational state.
    ...    Reference: Clauses 6.4.2.3.1 and 5.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.6.1
    ...    Reference: Clauses 6.4.2.3.1 and 5.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: none
    ...    Post-Conditions: none
+6 −1
Original line number Original line Diff line number Diff line
@@ -5,6 +5,10 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    OperatingSystem
Library    JSONLibrary
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true



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


@@ -17,10 +18,10 @@ Heal Flow of NS lifecycle management operations
    ...    Reference: Clause 6.4.7 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 6.4.7 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: NS Instance still in INSTANTIATED state
    ...    Post-Conditions: The NS Instance is still in INSTANTIATED state
    Check resource instantiated
    POST Heal NSInstance
    POST Heal NSInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Operation Occurrence Id
    Check Operation Occurrence Id
    Check Operation Notification Status is    START
    Check Operation Notification Status is    START
    Check Operation Notification Status is    RESULT
    Check Operation Notification Status is    RESULT
+4 −4
Original line number Original line Diff line number Diff line
@@ -5,6 +5,7 @@ Library REST ${NFVO_SCHEMA}://${NFVO_HOST}:${NFVO_PORT} ssl_verify=fal
Library    OperatingSystem
Library    OperatingSystem
Library    JSONLibrary
Library    JSONLibrary
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    Process
Suite Setup       Initialize System
Suite Setup       Initialize System
Suite Teardown    Terminate All Processes    kill=true
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
    [Documentation]    Test ID: 5.3.2.21.1
    ...    Test title: Instantiate Flow of NS lifecycle management operations
    ...    Test title: Instantiate Flow of NS lifecycle management operations
    ...    Test objective: The objective is to test the workflow for Instantiate a NS instance
    ...    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.7.1
    ...    Reference: Clause 6.4.4 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Config ID: Config_prod_NFVO
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Applicability: none
    ...    Post-Conditions: the resource is in INSTANTIATED state
    ...    Post-Conditions: The resource is in INSTANTIATED state
    Check resource existence
    Check resource not_instantiated
    POST Instantiate nsInstance
    POST Instantiate nsInstance
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check Operation Occurrence Id
    Check Operation Occurrence Id
    Check Operation Notification Status is    START
    Check Operation Notification Status is    START
    Check Operation Notification Status is    RESULT
    Check Operation Notification Status is    RESULT
+51 −12
Original line number Original line Diff line number Diff line
@@ -89,7 +89,7 @@ Check Operation Notification
    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${status}
    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${status}
    ${BODY}=    evaluate    json.dumps(${json})    json
    ${BODY}=    evaluate    json.dumps(${json})    json
    &{notification_request}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON"    body=${BODY}
    &{notification_request}=  Create Mock Request Matcher	POST  ${callback_endpoint}  body_type="JSON"    body=${BODY}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Wait Until Keyword Succeeds    ${total_polling_time}   ${polling_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    Clear Requests    ${callback_endpoint_fwd}
    
    
@@ -117,33 +117,43 @@ Check resource operationState is
    String    ${response['body']['operationState']}   ${state}
    String    ${response['body']['operationState']}   ${state}


Check resource Instantiated
Check resource Instantiated
    Wait Until Keyword Succeeds    2 min   10 sec   Probe resource Instantiated
    Wait Until Keyword Succeeds    ${total_polling_time}   ${polling_interval}   Probe resource Instantiated


Probe resource Instantiated 
Probe resource Instantiated 
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
    String    response body nsState    INSTANTIATED
    String    response body nsState    INSTANTIATED


Check resource not_instantiated
Check resource not_instantiated
    Wait Until Keyword Succeeds    2 min   10 sec   Probe 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}/${apiMajorVersion}/ns_instances/${response['body']['id']}
    String    response body nsState     NOT_INSTANTIATED


Probe resource not_instantiated
Check NS resource not_instantiated
    [Arguments]  ${fresh_resource}=0
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Log     ${fresh_resource}
    GET    ${response['headers']['Location']}  
    ${instanceId}=  Set Variable If	    ${fresh_resource} == 0   ${nsInstanceId}   ${response['body']['id']}
    ${opocc}=    Output    response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${instanceId}
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
    String    response body nsState     NOT_INSTANTIATED
    String    response body nsState     NOT_INSTANTIATED


Check operation resource state is FAILED_TEMP    
Check operation resource state is FAILED_TEMP    
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${opocc['body']['nsInstanceId']}  
    String    response body instantiationState    FAILED_TEMP 
    String    response body instantiationState    FAILED_TEMP 
    
    
Check operation resource state is not FAILED_TEMP
Check operation resource state is not FAILED_TEMP
@@ -151,14 +161,20 @@ Check operation resource state is not FAILED_TEMP
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${opocc['body']['nsInstanceId']} 
    String  response body instantiationState  not  FAILED_TEMP
    String  response body instantiationState  not  FAILED_TEMP


Check resource is finally failed
Check resource is finally failed
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${nsInstanceId} 
    GET    ${response['headers']['Location']}  
    ${opocc}=    Output    response
    Should Be Equal as Strings  ${opocc['status']}    200
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/ns_instances/${opocc['body']['nsInstanceId']}  
    String    response body instantiationState    FINALLY_FAILED 
    String    response body instantiationState    FINALLY_FAILED 


Launch another LCM operation
Launch another LCM operation
@@ -1392,3 +1408,26 @@ Check NsLcmOpOcc content against NS Descriptor
Match the NsLcmOpOcc Response Attributes with NS Descriptors
Match the NsLcmOpOcc Response Attributes with NS Descriptors
    Should Be Equal As Strings    ${response['body']['affectedNss'][0]['nsdId']}    ${NSDescriptor_ID}
    Should Be Equal As Strings    ${response['body']['affectedNss'][0]['nsdId']}    ${NSDescriptor_ID}
    Run Keyword If  '${descriptorType}'=='SOL006'    List Should Contain Value    ${SAP_IDs}    ${response['body']['affectedSaps'][0]['sapdId']}
    Run Keyword If  '${descriptorType}'=='SOL006'    List Should Contain Value    ${SAP_IDs}    ${response['body']['affectedSaps'][0]['sapdId']}

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 Deletion Handler    ${callback_endpoint_fwd}    ${type}
    Wait Until Keyword Succeeds    ${total_polling_time}   ${polling_interval}   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}

Configure Notification NS Creation Deletion 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