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

Added Test Cases for PeerEntities.robot

parent 5dd701d9
Loading
Loading
Loading
Loading
+94 −2
Original line number Original line Diff line number Diff line
@@ -391,7 +391,8 @@ Send Post request for Change interface state task
    Log    Trying to perform a POST for Change interface state task
    Log    Trying to perform a POST for Change interface state task
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state
    ${body}=    Get File    jsons/ManoConfigModificationRequest.json
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
@@ -429,3 +430,94 @@ Send Delete request for Change interface state task
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}//mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}//mano_entity/mano_interfaces/${manoServiceInterfaceId}/change_state
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    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}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/CreatePeerEntityRequest.json
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get Peer Entity
    Log    Query to GET information about multiple peer entities.
    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
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Get Peer Entity with invalid filter
    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?attribute_not_exist=some_value
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
	
Get Peer Entity with invalid selector
    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?fields=wrong_field
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	

Get Peer Entity with filter
    Log    Query  information about multiple peer entities with attribute filters.
    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?${filter}=${filter_value} 
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Get Peer Entity with all_fields attribute selector
    Log    Queries information about multiple peer entities, using all_fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Peer Entity with fields attribute selector
    Log    Queries information about multiple peer entities, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities?fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Peer Entity with exclude_fields attribute selector
    Log    Queries information about multiple peer entities, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities?exclude_fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send PUT request for 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
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send PATCH request for Peer Entity
    log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT_JSON}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/peer_entities
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send DELETE request for 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
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
 No newline at end of file
+190 −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 Peer Entity
    [Documentation]    Test ID: 8.3.1.8.1
    ...    Test title: POST Peer Entity
    ...    Test objective: The objective is to creates in the producer NFV-MANO functional entity a new peer entity resource which contains configuration and information with regards to the peer functional entity.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.13.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 Peer Entity
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    PeerEntity
    Check Operation Occurrence Id
    
GET Peer Entity
    [Documentation]    Test ID: 8.3.1.8.2
    ...    Test title: GET Peer Entity
    ...    Test objective: The objective is to queries information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities.
    ...    Pre-conditions: At least one Peer Entity is already created.
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions:  
    Get Peer Entity
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities
    
GET Peer Entity - invalid attribute-based filter
    [Documentation]    Test ID: 8.3.1.8.3
    ...    Test title: GET Peer Entity - invalid attribute-based filter
    ...    Test objective:  The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with invalid filter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails   
    
GET Peer Entity - invalid attribute selector
    [Documentation]    Test ID: 8.3.1.8.4
    ...    Test title: GET Peer Entity - invalid attribute selector
    ...    Test objective: The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when using invalid attribute selector, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with invalid selector
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails  
    
GET Peer Entity - Bad Request Response too Big
    [Documentation]    Test ID: 8.3.1.8.5
    ...    Test title: GET Peer Entity - Bad Request Response too Big
    ...    Test objective: The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
GET Peer Entity with attribute-based filter
    [Documentation]    Test ID: 8.3.1.8.6
    ...    Test title: GET Peer Entity with attribute-based filter
    ...    Test objective: The objective is to query information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities with attribute filters
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities
    
GET Peer Entity with "all_fields" attribute selector
    [Documentation]    Test ID: 8.3.1.8.7
    ...    Test title: GET Peer Entity with "all_fields" attribute selector
    ...    Test objective: The objective is to retrieve information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities with "all_fields" attribute selector
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with all_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities
    
GET Peer Entity with "exclude_default" attribute selector
    [Documentation]    Test ID: 8.3.1.8.8
    ...    Test title: GET Peer Entity with "exclude_default" attribute selector
    ...    Test objective: The objective is to retrieve information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities with "exclude_default" attribute selector
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with all_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities

    
GET Peer Entity with "fields" attribute selector
    [Documentation]    Test ID: 8.3.1.8.9
    ...    Test title: GET Peer Entity with "fields" attribute selector
    ...    Test objective: The objective is to retrieve information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities with fields attribute selector
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity with fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities
     
GET Peer Entity with "exclude_fields" attribute selector
    [Documentation]    Test ID: 8.3.1.8.10
    ...    Test title: GET Peer Entity with "exclude_fields" attribute selector
    ...    Test objective: The objective is to retrieve information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities with "exclude_fields" attribute selector
    ...    Pre-conditions: At least one Peer Entity is already created. 
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: none
    Get Peer Entity with exclude_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    PeerEntities
    
GET Peer Entity with Paged Response
    [Documentation]    Test ID: 8.3.1.8.11
    ...    Test title: GET Peer Entity with Paged Response
    ...    Test objective: The objective is to query information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities to get Paged Response.
    ...    Pre-conditions: At least one Peer Entity is already created.  
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Peer Entity
    Check HTTP Response Status Code Is    200
    Check LINK in Header

PUT Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.12
    ...    Test title: PUT Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.13.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 Peer Entity
    Check HTTP Response Status Code Is    405
    
PATCH Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.13
    ...    Test title: PATCH Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemeted.
    ...    Pre-conditions:
    ...    Reference: clause 5.5.13.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 Peer Entity
    Check HTTP Response Status Code Is    405

DELETE Peer Entity - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.14
    ...    Test title: DELETE Peer Entity - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.13.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 Peer Entity
    Check HTTP Response Status Code Is    405
 No newline at end of file
+5 −0
Original line number Original line Diff line number Diff line
{
	"peerEntityId": "",	
	"name":	"NFV-MANO Entity",
	"type":	"NFVO"
}
 No newline at end of file
+215 −0

File added.

Preview size limit exceeded, changes collapsed.

+212 −0

File added.

Preview size limit exceeded, changes collapsed.