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

Added Test Cases for IndividualNFVMANOServiceInterface.robot

parent 7d8320f7
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 NFV-MANO Serive Interface - Method not implemented
    [Documentation]    Test ID: 8.3.1.6.1
    ...    Test title: POST Individual NFV-MANO Serive Interface - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.11.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 NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    405
    
GET Individual NFV-MANO Serive Interface
    [Documentation]    Test ID: 8.3.1.6.2
    ...    Test title: GET Individual NFV-MANO Serive Interface
    ...    Test objective: The objective is to query status information about an NFV-MANO service interface of the producer NFV-MANO functional entity by reading an "Individual NFV-MANO service interface" resource.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.11.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions:  
    Get Individual NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ManoServiceInterface
    
PUT Individual NFV-MANO Serive Interface - Method not implemented
    [Documentation]    Test ID: 8.3.1.6.3
    ...    Test title: PUT Individual NFV-MANO Serive Interface - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.11.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 NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    405
    
PATCH Individual NFV-MANO Serive Interface
    [Documentation]    Test ID: 8.3.1.6.4
    ...    Test title: PATCH Individual NFV-MANO Serive Interface
    ...    Test objective: This method modifies the Individual NFV-MANO Serive Interface resource
    ...    Pre-conditions: Individual NFV-MANO Serive Interface resource is already created.
    ...    Reference: clause 5.5.11.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Individual NFV-MANO Serive Interface is modified by the operation
    Send Patch request for Individual NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   ManoServiceInterfaceModifications
    
PATCH Individual NFV-MANO Serive Interface - Conflict
    [Documentation]    Test ID: 8.3.1.6.5
    ...    Test title: PATCH Individual NFV-MANO Serive Interface - Conflict
    ...    Test objective: The objective is to test that the modification of the Individual NFV-MANO Serive Interface resource failed due to a conflict with the state of the Individual NFV-MANO Serive Interface resource and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: Individual NFV-MANO Serive Interface resource is already created.
    ...    Reference: clause 5.5.11.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Individual NFV-MANO Serive Interface is not modified by the operation
    Send Patch request for Individual NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
PATCH Individual NFV-MANO Serive Interface - PreCondition Failed
    [Documentation]    Test ID: 8.3.1.6.6
    ...    Test title: PATCH Individual NFV-MANO Serive Interface - PreCondition Failed
    ...    Test objective: The objective is to test that the modification of the Individual NFV-MANO Serive Interface 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: Individual NFV-MANO Serive Interface resource is already created.
    ...    Reference: clause 5.5.11.3.4 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Individual NFV-MANO Serive Interface is not modified by the operation
    Send Patch request for Individual NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
DELETE Individual NFV-MANO Serive Interface - Method not implemented
    [Documentation]    Test ID: 8.3.1.6.7
    ...    Test title: DELETE Individual NFV-MANO Serive Interface - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Pre-conditions: 
    ...    Reference: clause 5.5.11.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 NFV-MANO Serive Interface
    Check HTTP Response Status Code Is    405
 No newline at end of file
+42 −0
Original line number Diff line number Diff line
@@ -344,3 +344,45 @@ Send DELETE request for NFV-MANO Serive Interface
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Post request for Individual NFV-MANO Serive Interface
    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}/mano_entity/mano_interfaces/${manoServiceInterfaceId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Get Individual NFV-MANO Serive Interface
    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}/mano_entity/mano_interfaces/${manoServiceInterfaceId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Put request for Individual NFV-MANO Serive Interface
    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}/mano_entity/mano_interfaces/${manoServiceInterfaceId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Patch request for Individual NFV-MANO Serive Interface
    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/ManoServiceInterfaceModificationRequest.json
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/mano_entity/mano_interfaces/${manoServiceInterfaceId}   ${body}	
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	
Send Delete request for Individual NFV-MANO Serive Interface
    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}/mano_entity/mano_interfaces/${manoServiceInterfaceId}
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
 No newline at end of file
+3 −1
Original line number Diff line number Diff line
@@ -28,3 +28,5 @@ ${filter_value}
${fields}

${changeStateOpOccId}

${manoServiceInterfaceId}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
{
  "name": "ManoServiceInterfaceModificationRequest"
}
 No newline at end of file
+215 −0
Original line number Diff line number Diff line
{
    "description": "This type represents an individual NFV-MANO service interface produced by  an NFV-MANO functional entity. \n",
    "type": "object",
    "properties": {
      "id": {
        "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"
      },
      "name": {
        "description": "Human-readable name of the NFV-MANO functional entity interface.\nThis attribute can be modified with the PATCH method.\n",
        "type": "string"
      },
      "type": {
        "description": "Type of the NFV-MANO service interface produced by the NFV-MANO functional  entity. Valid values are defined in clause 5.6.4.3.\n",
        "type": "string"
      },
      "standardVersion": {
        "description": "A version.\n",
        "type": "string"
      },
      "providerSpecificApiVersion": {
        "description": "A version.\n",
        "type": "string"
      },
      "apiVersion": {
        "description": "A version.\n",
        "type": "string"
      },
      "apiEndpoint": {
        "description": "Exposed API endpoint of the interface.\n",
        "type": "object",
        "properties": {
          "apiRoot": {
            "description": "String formatted according to IETF RFC 3986.\n",
            "type": "string"
          },
          "apiName": {
            "description": "Indicates the interface name in an abbreviated form. Shall be present  for ETSI NFV specified RESTful NFV-MANO APIs. The {apiName} of each  interface is defined in the standard the interface is compliant to  (see also clause 4.1 of ETSI GS NFV-SOL 013). May be present otherwise.\n",
            "type": "string"
          },
          "apiMajorVersion": {
            "description": "Indicates the current major version of the API. Shall be present for  ETSI NFV specified RESTful NFV-MANO APIs. The major version is defined  in the standard the interface is compliant to (see also clause 4.1 of  ETSI GS NFV-SOL 013). May be present otherwise.\n",
            "type": "string"
          },
          "apiUri": {
            "description": "String formatted according to IETF RFC 3986.\n",
            "type": "string"
          }
        },
        "required": [
          "apiUri"
        ]
      },
      "maxConcurrentIntOpNumber": {
        "description": "Maximum number of concurrent operation requests supported on this interface. \nNOTE:\tIf this attribute is not present, the value of this parameter  is undefined. Overload is handled by the error handling schemes defined  by the applicable API specification.\n",
        "type": "integer"
      },
      "supportedOperations": {
        "description": "Information about supported operations of this interface.\n",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "operationName": {
              "description": "Name of the operation supported on the interface.\n",
              "type": "string"
            },
            "maxConcurrentOpNumber": {
              "description": "Maximum number of concurrent requests supported by the interface operation. \nNOTE:\tIf this attribute is not present, the value of this parameter  is undefined. Overload is handled by the error handling schemes defined  by the applicable API specification.\n",
              "type": "integer"
            }
          },
          "required": [
            "operationName"
          ]
        },
        "minItems": 1
      },
      "interfaceState": {
        "description": "State of the NFV-MANO service interface.\n",
        "properties": {
          "operationalState": {
            "description": "The enumeration InterfaceOperationalStateEnumType defines values representing  the operational state of an NFV-MANO service interface type of managed entity.  The InterfaceOperationalStateEnumType shall comply with the provisions :\n   - STARTED\tThe managed entity is operational.\n   - STOPPED\tThe managed entity is not operational.\n   - STOPPING\tThe managed entity is in the transition to stop.\n   - STARTING\tThe managed entity is in the transition to start and become operational.\n",
            "type": "string",
            "enum": [
              "STARTED",
              "STOPPED",
              "STOPPING",
              "STARTING"
            ]
          },
          "administrativeState": {
            "description": "The enumeration AdministrativeStateEnumType defines values representing the administrative state of a managed entity. The AdministrativeStateEnumType shall comply with the provisions:\n  - LOCKED\tThe managed entity is administratively prohibited to be used.\n  - UNLOCKED\tThe managed entity is administratively allowed to be used.\n  - LOCKING\tThe managed entity is in the transition to be locked.\n",
            "type": "string",
            "enum": [
              "LOCKED",
              "UNLOCKED",
              "LOCKING"
            ]
          },
          "usageState": {
            "description": "The enumeration UsageStateEnumType defines values representing the usage  state of a managed entity.  The UsageStateEnumType shall comply with the provisions:\n  - IN_USE\tThe managed entity is currently being used.\n  - NOT_IN_USE\tThe managed entity is currently not being used.\n",
            "type": "string",
            "enum": [
              "IN_USE",
              "NOT_IN_USE"
            ]
          }
        },
        "required": [
          "operationalState",
          "administrativeState",
          "usageState"
        ]
      },
      "securityInfo": {
        "description": "This type represents security related information of an NFV-MANO  service interface produced by an NFV-MANO functional entity. \n",
        "type": "object",
        "properties": {
          "authType": {
            "description": "Type of API request authorization to be used by the API producer.\nThe support of authorization methods for the API producer is specified  in clause 8.3.6 of ETSI GS NFV-SOL 013.\nPermitted values:\n  - TLS_TUNNEL: Using TLS tunnel, as defined by TLS 1.2 in IETF RFC 5246.\n  - OAUTH2: Using access token, as defined by the OAuth 2.0 specification \n  in IETF RFC 6749. \n",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "TLS_TUNNEL",
                "OAUTH2"
              ]
            },
            "minItems": 1
          },
          "oauthServerInfo": {
            "description": "OAuth 2.0 authorization server information and configuration.\n",
            "type": "object",
            "properties": {
              "dynamicDiscovery": {
                "description": "Configuration data used when performing dynamic discovery of  the authorization server identifier. \nNOTE:\tProvided configuration of the OAuth 2.0 authorization  server information and configuration shall be supported, and  dynamic configuration may be supported.\n",
                "type": "object",
                "properties": {
                  "webFingerHost": {
                    "description": "String formatted according to IETF RFC 3986.\n",
                    "type": "string"
                  }
                },
                "required": [
                  "webFingerHost"
                ]
              },
              "providedConfiguration": {
                "description": "Configuration data used to setup the authorization server identifier. \nNOTE:\tProvided configuration of the OAuth 2.0 authorization  server information and configuration shall be supported, and  dynamic configuration may be supported.\n",
                "type": "object",
                "properties": {
                  "authServerId": {
                    "description": "String formatted according to IETF RFC 3986.\n",
                    "type": "string"
                  }
                },
                "required": [
                  "authServerId"
                ]
              },
              "tlsCipherSuites": {
                "description": "List of cipher suites that shall be declared as supported by the  API producer when performing the SSL or TLS negotiation with the  authorization server. Valid values of cipher suites are defined  in IETF RFC 8447.\n",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            },
            "required": [
              "providedConfiguration",
              "tlsCipherSuites"
            ]
          },
          "tlsTunnelInfo": {
            "description": "Information and configuration related to the use of TLS tunnel.  Shall be present if authType contains \"TLS_TUNNEL\".\n",
            "type": "object",
            "properties": {
              "tlsTunnelCipherSuites": {
                "description": "List of cipher suites that shall be declared as supported by the API producer when performing the SSL or TLS negotiation with the API client. Valid values of cipher suites are defined in IETF RFC 8447.",
                "type": "array",
                "items": {
                  "type": "string"
                },
                "minItems": 1
              }
            },
            "required": [
              "tlsTunnelCipherSuites"
            ]
          }
        },
        "required": [
          "authType",
          "oauthServerInfo"
        ]
      },
      "metadata": {
        "description": "This type represents a list of key-value pairs. The order of the pairs in the list is not significant. In JSON, a set of keyvalue pairs is represented as an object. It shall comply with the provisions defined in clause 4 of IETF RFC 8259. In the following example, a list of key-value pairs with four keys (\"aString\", \"aNumber\", \"anArray\" and \"anObject\") is provided to illustrate that the values associated with different keys can be of different type.\n",
        "type": "object"
      }
    },
    "required": [
      "id",
      "name",
      "type",
      "standardVersion",
      "providerSpecificApiVersion",
      "apiVersion",
      "apiEndpoint",
      "supportedOperations",
      "interfaceState"
    ]
  }
 No newline at end of file
Loading