Commit dde2ecf3 authored by Najam UI Hassan's avatar Najam UI Hassan Committed by Giacomo Bernini
Browse files

Added Test Cases for ChangeNFVMANOEntityStateTask.robot

parent ad1de307
Loading
Loading
Loading
Loading
+82 −0
Original line number Original line 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 NFV-MANO functional entity application state change
    [Documentation]    Test ID: 8.3.4.2.1
    ...    Test title: POST NFV-MANO functional entity application state change
    ...    Test objective: The objective is to request state change of the NFV-MANO functional entity application.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.7.3.1 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Post request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    202
    Check Operation Occurrence Id
    
POST NFV-MANO functional entity application state change - Conflict
    [Documentation]    Test ID: 8.3.4.2.2
    ...    Test title: POST NFV-MANO functional entity application state change - Conflict
    ...    Test objective: The objective is to test that request to change the state of the NFV-MANO functional entity application 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: 
    ...    Reference: clause 5.5.7.3.1 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Post request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
GET NFV-MANO functional entity application state change - Method not implemented
    [Documentation]    Test ID: 8.3.4.2.3
    ...    Test title: GET NFV-MANO functional entity application state change - 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: 
    ...    Reference: clause 5.5.7.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Get request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    405
    
PUT NFV-MANO functional entity application state change - Method not implemented
    [Documentation]    Test ID: 8.3.4.2.4
    ...    Test title: PUT NFV-MANO functional entity application state change - 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: 
    ...    Reference: clause 5.5.7.3.3 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Put request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    405
    
PATCH NFV-MANO functional entity application state change - Method not implemented
    [Documentation]    Test ID: 8.3.4.2.5
    ...    Test title: PATCH NFV-MANO functional entity application state change - 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: 
    ...    Reference: clause 5.5.7.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Patch request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    405
    
DELETE NFV-MANO functional entity application state change - Method not implemented
    [Documentation]    Test ID: 8.3.4.2.6
    ...    Test title: DELETE NFV-MANO functional entity application state change - 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: 
    ...    Reference: clause 5.5.7.3.5 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: 
    Send Delete request for NFV-MANO functional entity application state change
    Check HTTP Response Status Code Is    405
 No newline at end of file
+47 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,10 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    Log    Json Schema Validation OK
    
    
Check Operation Occurrence Id
    ${OpOccId}=    Get Value From Json    ${response['headers']}    $..Location
    Should Not Be Empty    ${OpOccId}

Send Post request for NFV-MANO Entity
Send Post request for NFV-MANO Entity
    Log    Trying to perform a POST (method should not be implemented)
    Log    Trying to perform a POST (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -72,3 +76,46 @@ Send Delete request for NFV-MANO Entity
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
Send Post request for NFV-MANO functional entity application state change
    Log    Trying to perform a POST for NFV-MANO functional entity application state change
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Get request for NFV-MANO functional entity application state change
    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": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Put request for NFV-MANO functional entity application state change
    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": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/log_jobs/mano_entity/change_state
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PUT    ${apiRoot}/${apiName}/${apiMajorVersion}/log_jobs/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Patch request for NFV-MANO functional entity application state change
    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": "${AUTHORIZATION}"}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for NFV-MANO functional entity application state change
    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": "${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
 No newline at end of file
+1 −1

File changed and moved.

Contains only whitespace changes.