Commit aed148ee authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

[test-new][SOL009][NFVMANO-CIM][v5.2.1][8.3.1.10.x Test-IDs] implemented new...

[test-new][SOL009][NFVMANO-CIM][v5.2.1][8.3.1.10.x Test-IDs] implemented new tests for NFV MANO CIM new resource Change consumed NFV-MANO interface state task, as per NFVSOL(24)000362
parent 9e9d8f8d
Loading
Loading
Loading
Loading
+110 −0
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt
Library           JSONLibrary
Library           OperatingSystem
Resource          NFVMANOCimKeywords.robot
Library           REST    ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT}    ssl_verify=false
Library           MockServerLibrary

*** Test Cases ***
POST Change consumed NFV MANO interface state task
    [Documentation]    Test ID: 8.3.1.10.1
    ...    Test title: POST Change cosumed NFV MANO interface state task
    ...    Test objective: The objective is send put request to change the state of the NFV-MANO consumed service interface produced by the NFV-MANO functional entity
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.1 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Consumed interface status changed
    Send Post request for Change consumed NFV MANO interface state task
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains Location
    Check PostCondition NFV-MANO consumed service interface state matches the requested state
    
POST Change consumed NFV MANO interface state task - Conflict
    [Documentation]    Test ID: 8.3.1.10.2
    ...    Test title: POST Change consumed NFV MANO interface state task - Conflict
    ...    Test objective: The objective is to test that request to cchange the state of the NFV-MANO consumed service interface produced by the NFV-MANO functional entity failed due to a conflict with the state of the NFV-MANO entity resource and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.1 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for Change consumed NFV-MANO interface state task
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
GET Change consumed NFV MANO interface state task - Method not implemented
    [Documentation]    Test ID: 8.3.1.10.3
    ...    Test title: GET Change consumed NFV MANO interface state task - Method not implemented
    ...    Test objective: The objective is to test that GET method is not allowed to retrieve the changed state of the NFV-MANO functional entity application.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.2 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Get request for Change consumed NFV-MANO interface state task
    Check HTTP Response Status Code Is    405
    
PUT Change consumed NFV MANO interface state task - Conflict - Method not implemented
    [Documentation]    Test ID: 8.3.1.10.4
    ...    Test title: PUT Change consumed NFV MANO interface state task - Conflict - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update the changed state of the NFV-MANO functional entity application.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.3 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Put request for Change consumed NFV-MANO interface state task
    Check HTTP Response Status Code Is    405
    
PATCH Change consumed NFV MANO interface state task - Conflict - Method not implemented
    [Documentation]    Test ID: 8.3.1.10.5
    ...    Test title: PATCH Change consumed NFV MANO interface state task - Conflict - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update the changed state of the NFV-MANO functional entity application.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.4 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for Change consumed NFV-MANO interface state task
    Check HTTP Response Status Code Is    405
    
DELETE Change consumed NFV MANO interface state task - Conflict - Method not implemented
    [Documentation]    Test ID: 8.3.1.10.6
    ...    Test title: DELETE Change consumed NFV MANO interface state task - Conflict - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete the changed state of the NFV-MANO functional entity application.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.5 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Delete request for Change consumed NFV-MANO interface state task
    Check HTTP Response Status Code Is    405

POST Change consumed NFV MANO interface state task with permitted authorization scope
    [Documentation]    Test ID: 8.3.1.10.7
    ...    Test title: POST Change consumed NFV MANO interface state task with permitted authorization scope
    ...    Test objective: The objective is send put request to change the state of the NFV-MANO consumed service interface with permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.1 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: interface status changed
    Send Post request for Change interface state task with permitted authorization scope
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains Location
    Check PostCondition NFV-MANO consumed service interface state matches the requested state

POST Change consumed NFV MANO interface state task with not permitted authorization scope
    [Documentation]    Test ID: 8.3.1.10.8
    ...    Test title: POST Change consumed NFV MANO interface state task with permitted authorization scope
    ...    Test objective: The objective is to verify that put request to change the state of the NFV-MANO consumed service interface fails with not permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.15.3.1 - ETSI GS NFV-SOL 009 [7] v5.2.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: interface status changed
    Send Post request for Change interface state task with not permitted authorization scope
    Check HTTP Response Status Code Is    401
 No newline at end of file
+86 −2
Original line number Diff line number Diff line
@@ -580,6 +580,26 @@ Send Post request for Change interface state task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change consumed NFV-MANO interface state task
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}   
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}    state=${state}     stateAction=${stateAction}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change consumed NFV MANO interface state task
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}   
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}    state=${state}     stateAction=${stateAction}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change interface state task with permitted authorization scope
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -593,6 +613,19 @@ Send Post request for Change interface state task with permitted authorization s
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change consumed NFV-MANO interface state task with permitted authorization scope
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${CHANGE_STATE_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Log    Authorization Token: ${authorizationToken}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"}
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}    state=${state}     stateAction=${stateAction}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change interface state task with not permitted authorization scope
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -606,9 +639,25 @@ Send Post request for Change interface state task with not permitted authorizati
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Post request for Change consumed NFV-MANO interface state task with not permitted authorization scope
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    ${scopeValue}=    Create Dictionary    scope=${NOT_PERMITTED_SCOPE} 
    ${authorizationToken}=    JWT Encode    payload=${scopeValue}    key=''    algorithm=${OAUTH_ENCRIPTION_ALGORITHM}
    Log    Authorization Token: ${authorizationToken}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${authorizationToken}"} 
    ${template}=    Get File    jsons/ChangeStateRequest.json
    ${body}=        Format String   ${template}    state=${state}     stateAction=${stateAction}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check PostCondition NFV-MANO service interface state matches the requested state
    Wait Until Keyword Succeeds    ${retry}   ${polling}    Check interface state  

Check PostCondition NFV-MANO consumed service interface state matches the requested state
    Wait Until Keyword Succeeds    ${retry}   ${polling}    Check interface state  
    
Check interface state
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
@@ -627,6 +676,14 @@ Send Get request for Change interface state task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Get request for Change consumed NFV-MANO interface state task
    Log    Trying to perform a GET (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Put request for Change interface state task
    Log    Trying to perform a PUT (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -638,6 +695,17 @@ Send Put request for Change interface state task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Put request for Change consumed NFV-MANO interface state task
    Log    Trying to perform a PUT (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PUT    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
 
Send Patch request for Change interface state task
    Log    Trying to perform a PATCH (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -646,6 +714,14 @@ Send Patch request for Change interface state task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Patch request for Change consumed NFV-MANO interface state task
    Log    Trying to perform a PATCH (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for Change interface state task
    Log    Trying to perform a DELETE (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -654,6 +730,14 @@ Send Delete request for Change interface state task
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for Change consumed NFV-MANO interface state task
    Log    Trying to perform a DELETE (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}/consumed_mano_interfaces/${consumedManoInterfaceId}/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Post request for Peer Entity
    Log    Trying to perform a POST for Peer Entity
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+2 −0
Original line number Diff line number Diff line
@@ -45,6 +45,8 @@ ${manoServiceInterfaceId}

${peerEntityId}

${consumedManoInterfaceId}

${callback_port}    9091
${callback_uri}    http://172.22.1.7:${callback_port}
${unreachable_callback_uri}   http://unreachable_callback_uri-error-code-422