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

Added Test Cases for IndividualPeerEntity.robot

parent 958a1de1
Loading
Loading
Loading
Loading
+97 −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 Individual Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.9.1
    ...    Test title: POST Individual Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.14.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 Individual Peer Entity
    Check HTTP Response Status Code Is    405
    
GET Individual Peer Entity
    [Documentation]    Test ID: 8.3.1.9.2
    ...    Test title: GET Individual Peer Entity
    ...    Test objective: The objective is to retrieves information and configuration hold in the producer NFV-MANO functional entity with regards to a peer entity by reading an individual peer entity resource
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.14.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions:  
    Get Individual Peer Entity
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntity
    
PUT Individual Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.9.3
    ...    Test title: PUT Individual Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.14.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 Individual Peer Entity
    Check HTTP Response Status Code Is    405
    
PATCH Individual Peer Entity
    [Documentation]    Test ID: 8.3.1.9.4
    ...    Test title: PATCH Individual Peer Entity
    ...    Test objective: This method modifies configuration and information of the producer NFV-MANO functional entity with regards to a peer functional entity by updating the corresponding "Individual peer entity" resource.
    ...    Pre-conditions: At least one Peer Entity resource is created
    ...    Reference: clause 5.5.14.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Peer Entity Resource is modified by the operation
    Send Patch request for Individual Peer Entity
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   ManoServiceInterfaceModifications
    
PATCH Individual Peer Entity - Conflict
    [Documentation]    Test ID: 8.3.1.9.5
    ...    Test title: PATCH Individual Peer Entity - Conflict
    ...    Test objective: The objective is to test that the modification of configuration and information of the producer NFV-MANO functional entity with regards to a peer functional entity by updating the corresponding "Individual peer entity" resource failed due to a conflict with the state of the Individual Peer Entity resource and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: At least one Peer Entity resource is created
    ...    Reference: clause 5.5.14.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Peer Entity Resource is not modified by the operation
    Send Patch request for Individual Peer Entity
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
PATCH Individual Peer Entity - PreCondition Failed
    [Documentation]    Test ID: 8.3.1.9.6
    ...    Test title: PATCH Individual Peer Entity - PreCondition Failed
    ...    Test objective: The objective is to test that the modification of the Individual Peer Entity resource failed because precondition given in an HTTP request header is not fulfilled and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: At least one Peer Entity resource is created
    ...    Reference: clause 5.5.14.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: Peer Entity Resource is not modified by the operation
    Send Patch request for Individual Peer Entity
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
DELETE Individual Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.9.7
    ...    Test title: DELETE Individual Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.14.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 Individual Peer Entity
    Check HTTP Response Status Code Is    405
 No newline at end of file
+42 −0
Original line number Diff line number Diff line
@@ -521,3 +521,45 @@ Send DELETE request for Peer Entity
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Post request for Individual Peer Entity
    Log    Trying to perform a POST (method should not be implemented)
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get Individual Peer Entity
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Put request for Individual Peer Entity
    log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Patch request for Individual Peer Entity
    log    Trying to modify an NFV-MANO Entity
    Set Headers    {"Accept":"${ACCEPT_JSON}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE_PATCH}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${body}=    Get File    jsons/PeerEntityConfigModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Delete request for Individual Peer Entity
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities/${peerEntityId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -30,3 +30,5 @@ ${fields}
${changeStateOpOccId}

${manoServiceInterfaceId}

${peerEntityId}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
{
  "name": "PeerEntityConfigModificationRequest"
}
 No newline at end of file