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

Added Test Cases for ChangeStateOpperationOccurance.robot

parent dde2ecf3
Loading
Loading
Loading
Loading
+188 −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 State Operation Occurance - Method not implemented
    [Documentation]    Test ID: 8.3.1.3.1
    ...    Test title: POST Change State Operation Occurance - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.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 Change State Operation Occurance
    Check HTTP Response Status Code Is    405
    
GET Change State Operation Occurance
    [Documentation]    Test ID: 8.3.1.3.2
    ...    Test title: GET Change State Operation Occurance
    ...    Test objective: The objective is to query status information about multiple change state operation occurrences.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions:  
    Get Change State OpOcc
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOccs
    
GET Change State Operation Occurance - invalid attribute-based filter
    [Documentation]    Test ID: 8.3.1.3.3
    ...    Test title: GET Change State Operation Occurance - invalid attribute-based filter
    ...    Test objective:  The objective is to test that the retrieval of Change State Operation Occurance fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with invalid filter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails   
    
GET Change State Operation Occurance - invalid attribute selector
    [Documentation]    Test ID: 8.3.1.3.4
    ...    Test title: GET Change State Operation Occurance - invalid attribute selector
    ...    Test objective: The objective is to test that the retrieval of Change State Operation Occurance fails when using invalid attribute selector, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with invalid selector
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails  
    
GET Change State Operation Occurance - Bad Request Response too Big
    [Documentation]    Test ID: 8.3.1.3.5
    ...    Test title: GET Change State Operation Occurance - Bad Request Response too Big
    ...    Test objective: The objective is to test that the retrieval of Change State Operation Occurance fails when response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
GET Change State Operation Occurance with attribute-based filter
    [Documentation]    Test ID: 8.3.1.3.6
    ...    Test title: GET Change State Operation Occurance with attribute-based filter
    ...    Test objective: The objective is to query status information about multiple change state operation occurrences with attribute filters
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc
    
GET Change State Operation Occurance with "all_fields" attribute selector
    [Documentation]    Test ID: 8.3.1.3.7
    ...    Test title: GET Change State Operation Occurance with "all_fields" attribute selector
    ...    Test objective: The objective is to retrieve Change State Operation Occurance with "all_fields" attribute selector
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with all_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc
    
GET Change State Operation Occurance with "exclude_default" attribute selector
    [Documentation]    Test ID: 8.3.1.3.8
    ...    Test title: GET Change State Operation Occurance with "exclude_default" attribute selector
    ...    Test objective: The objective is to retrieve Change State Operation Occurance with "exclude_default" attribute selector
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with all_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc

    
GET Change State Operation Occurance with "fields" attribute selector
    [Documentation]    Test ID: 8.3.1.3.9
    ...    Test title: GET Change State Operation Occurance with "fields" attribute selector
    ...    Test objective: The objective is to retrieve Change State Operation Occurance with fields attribute selector
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc with fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc
     
GET Change State Operation Occurance with "exclude_fields" attribute selector
    [Documentation]    Test ID: 8.3.1.3.10
    ...    Test title: GET Change State Operation Occurance with "exclude_fields" attribute selector
    ...    Test objective: The objective is to retrieve Change State Operation Occurance with "exclude_fields" attribute selector
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: none
    Get Change State OpOcc with exclude_fields attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ChangeStateOpOcc
    
GET Change State Operation Occurance with Paged Response
    [Documentation]    Test ID: 8.3.1.3.11
    ...    Test title: GET Change State Operation Occurance with Paged Response
    ...    Test objective: The objective is to query Change State Operation Occurance to get Paged Response.
    ...    Pre-conditions:  
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    Get Change State OpOcc
    Check HTTP Response Status Code Is    200
    Check LINK in Header

PUT Change State Operation Occurance - Method not implemented
    [Documentation]    Test ID: 8.3.1.3.12
    ...    Test title: PUT Change State Operation Occurance - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.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 Change State Operation Occurance
    Check HTTP Response Status Code Is    405
    
PATCH Change State Operation Occurance - Method not implemented
    [Documentation]    Test ID: 8.3.1.3.13
    ...    Test title: PATCH Change State Operation Occurance - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.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 Change State Operation Occurance
    Check HTTP Response Status Code Is    405

DELETE Change State Operation Occurance - Method not implemented
    [Documentation]    Test ID: 8.3.1.3.14
    ...    Test title: DELETE Change State Operation Occurance - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.8.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 Change State Operation Occurance
    Check HTTP Response Status Code Is    405
 No newline at end of file
+95 −1
Original line number Diff line number Diff line
@@ -119,3 +119,97 @@ Send Delete request for NFV-MANO functional entity application state change
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/change_state
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Post request for Change State Operation Occurance
    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}/change_state_ops
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get Change State OpOcc
    Log    Query to GET information about multiple change state operation occurrences.
    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}/change_state_ops
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Get Change State OpOcc 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}/change_state_ops?attribute_not_exist=some_value
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	
	
Get Change State OpOcc 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}/change_state_ops?fields=wrong_field
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}	

Get Change State OpOcc with filter
    Log    Query  information about multiple change state operation occurrences 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}/change_state_ops?${filter}=${filter_value} 
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Get Change State OpOcc with all_fields attribute selector
    Log    Queries information about multiple change state operation occurrences, using all_fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops?exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Change State OpOcc with fields attribute selector
    Log    Queries information about multiple change state operation occurrences, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops?fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Change State OpOcc with exclude_fields attribute selector
    Log    Queries information about multiple change state operation occurrences, using fields
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/change_state_ops?exclude_fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check LINK in Header
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}

Send PUT request for Change State Operation Occurance
    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}/change_state_ops
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send PATCH request for Change State Operation Occurance
    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}/change_state_ops
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send DELETE request for Change State Operation Occurance
    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}/change_state_ops
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
+6 −1
Original line number Diff line number Diff line
@@ -21,3 +21,8 @@ ${apiMajorVersion} v1
${apiName}        nfvmanocim

${response}    

${filter}
${filter_value} 

${fields}
 No newline at end of file
+85 −0
Original line number Diff line number Diff line
{
    "description": "This type represents a Change state operation occurrence. \n",
    "type": "object",
    "properties": {
      "id": {
        "description": "An identifier with the intention of being globally unique.\n",
        "type": "string"
      },
      "operationState": {
        "description": "The enumeration ChangeStateOpOccStateEnumType defines permitted values for the change state operation. It shall comply with the provisions :\n  - PROCESSING\tThe change state operation is currently in execution.\n  - COMPLETED\tThe change state operation has been completed successfully.\n  - FAILED\tThe change state operation has failed.\n",
        "type": "string",
        "enum": [
          "PROCESSING",
          "COMPLETED",
          "FAILED"
        ]
      },
      "stateEnteredTime": {
        "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
        "type": "string",
        "format": "date-time"
      },
      "startTime": {
        "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
        "type": "string",
        "format": "date-time"
      },
      "managedObjectRef": {
        "description": "This type represents the identifier to reference a managed object of a  particular type. \n",
        "type": "object",
        "properties": {
          "type": {
            "description": "Indicates the type of managed object. Permitted values:\n  - MANO_ENTITY\n  - MANO_SERVICE\n  - MANO_SERVICE_IF\n  - CONSUMED_MANO_IF\n  - MANO_ENTITY_COMPONENT\n\nThe \"MANO_ENTITY COMPONENT\" is only applicable if attribute \"manoEntityComponents\" in \"ManoEntity\" is supported by the API producer.\n",
            "type": "string",
            "enum": [
              "MANO_ENTITY",
              "MANO_SERVICE",
              "MANO_SERVICE_IF",
              "CONSUMED_MANO_IF",
              "MANO_ENTITY_COMPONENT"
            ]
          },
          "objectId": {
            "description": "An identifier with the intention of being globally unique.\n",
            "type": "string"
          },
          "subObjectId": {
            "description": "An identifier that is unique for the respective type within a NFV-MANO functional entity, but that need not be globally unique. Representation: string of variable length..\n",
            "type": "string"
          }
        },
        "required": [
          "type",
          "objectId"
        ]
      },
      "changeOperationalStateRequest": {
        "description": "The enumeration ChangeOperationalStateEnumType defines permitted values  for the change state operation.  The ChangeOperationalStateEnumType shall comply with the provisions:\n  - START\tTo start the managed entity.\n  - STOP\tTo stop the managed entity.\n  - RESTART\tTo stop and start again the managed entity.\n",
        "type": "string",
        "enum": [
          "START",
          "STOP",
          "RESTART"
        ]
      },
      "changeAdministrativeStateRequest": {
        "description": "The enumeration ChangeAdministrativeStateEnumType defines permitted values  for the change of administrative state operation.  The ChangeAdministrativeStateEnumType shall comply with the provisions:\n  - LOCK\tTo lock the managed entity.\n  - UNLOCK\tTo unlock the managed entity.\n",
        "type": "string",
        "enum": [
          "LOCK",
          "UNLOCK"
        ]
      },
      "operationParams": {
        "description": "Input parameters of the change state operation. This attribute shall be  formatted according to the request data type of the related change state  operation. \nThe following mapping between operationType and the data type of this  attribute shall apply:\n  - CHANGE_STATE: ChangeStateRequest\n  \nThis attribute shall be present if this data type is returned in a response  to reading an individual resource, and may be present according to the chosen  attribute selector parameter if this data type is returned in a response to  a query of a container resource.\n"
      }
    },
    "required": [
      "id",
      "operationState",
      "stateEnteredTime",
      "startTime",
      "managedObjectRef"
    ]
  }
 No newline at end of file
+87 −0
Original line number Diff line number Diff line
{  "type": "array",  
	"items": {
    "description": "This type represents a Change state operation occurrence. \n",
    "type": "object",
    "properties": {
      "id": {
        "description": "An identifier with the intention of being globally unique.\n",
        "type": "string"
      },
      "operationState": {
        "description": "The enumeration ChangeStateOpOccStateEnumType defines permitted values for the change state operation. It shall comply with the provisions :\n  - PROCESSING\tThe change state operation is currently in execution.\n  - COMPLETED\tThe change state operation has been completed successfully.\n  - FAILED\tThe change state operation has failed.\n",
        "type": "string",
        "enum": [
          "PROCESSING",
          "COMPLETED",
          "FAILED"
        ]
      },
      "stateEnteredTime": {
        "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
        "type": "string",
        "format": "date-time"
      },
      "startTime": {
        "description": "Date-time stamp. Representation: String formatted according to IETF RFC 3339.\n",
        "type": "string",
        "format": "date-time"
      },
      "managedObjectRef": {
        "description": "This type represents the identifier to reference a managed object of a  particular type. \n",
        "type": "object",
        "properties": {
          "type": {
            "description": "Indicates the type of managed object. Permitted values:\n  - MANO_ENTITY\n  - MANO_SERVICE\n  - MANO_SERVICE_IF\n  - CONSUMED_MANO_IF\n  - MANO_ENTITY_COMPONENT\n\nThe \"MANO_ENTITY COMPONENT\" is only applicable if attribute \"manoEntityComponents\" in \"ManoEntity\" is supported by the API producer.\n",
            "type": "string",
            "enum": [
              "MANO_ENTITY",
              "MANO_SERVICE",
              "MANO_SERVICE_IF",
              "CONSUMED_MANO_IF",
              "MANO_ENTITY_COMPONENT"
            ]
          },
          "objectId": {
            "description": "An identifier with the intention of being globally unique.\n",
            "type": "string"
          },
          "subObjectId": {
            "description": "An identifier that is unique for the respective type within a NFV-MANO functional entity, but that need not be globally unique. Representation: string of variable length..\n",
            "type": "string"
          }
        },
        "required": [
          "type",
          "objectId"
        ]
      },
      "changeOperationalStateRequest": {
        "description": "The enumeration ChangeOperationalStateEnumType defines permitted values  for the change state operation.  The ChangeOperationalStateEnumType shall comply with the provisions:\n  - START\tTo start the managed entity.\n  - STOP\tTo stop the managed entity.\n  - RESTART\tTo stop and start again the managed entity.\n",
        "type": "string",
        "enum": [
          "START",
          "STOP",
          "RESTART"
        ]
      },
      "changeAdministrativeStateRequest": {
        "description": "The enumeration ChangeAdministrativeStateEnumType defines permitted values  for the change of administrative state operation.  The ChangeAdministrativeStateEnumType shall comply with the provisions:\n  - LOCK\tTo lock the managed entity.\n  - UNLOCK\tTo unlock the managed entity.\n",
        "type": "string",
        "enum": [
          "LOCK",
          "UNLOCK"
        ]
      },
      "operationParams": {
        "description": "Input parameters of the change state operation. This attribute shall be  formatted according to the request data type of the related change state  operation. \nThe following mapping between operationType and the data type of this  attribute shall apply:\n  - CHANGE_STATE: ChangeStateRequest\n  \nThis attribute shall be present if this data type is returned in a response  to reading an individual resource, and may be present according to the chosen  attribute selector parameter if this data type is returned in a response to  a query of a container resource.\n"
      }
    },
    "required": [
      "id",
      "operationState",
      "stateEnteredTime",
      "startTime",
      "managedObjectRef"
    ]
  }
 }
 No newline at end of file