Commit dcb71faf authored by M. Rehan Abbasi's avatar M. Rehan Abbasi
Browse files

remove subscriptions and individual subscription resources from PM API

parent 1dac9845
Loading
Loading
Loading
Loading
+0 −171
Original line number Original line Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Library           REST    ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT}    ssl_verify=false
Library           OperatingSystem
Library           JSONLibrary
Resource          environment/individualSubscription.txt

*** Test Cases ***
GET Individual Performance Subscription
    [Documentation]    Test ID: 8.3.2.7.1
    ...    Test title: GET Individual Performance Subscription
    ...    Test objective: The objective is to test the retrieval of individual performance subscription and perform a JSON schema validation of the returned subscription data structure.
    ...    Pre-conditions: An instance is instantiated. At least one performance subscription is available in the NFV-MANO.
    ...    Reference: clause 6.5.9.3.2 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual Performance Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual Performance Subscription with invalid resource identifier
    [Documentation]    Test ID: 8.3.2.7.2
    ...    Test title: GET Individual Performance Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual performance subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: An instance is instantiated. At least one performance subscription is available in the NFV-MANO.
    ...    Reference: clause 6.5.9.3.2 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual Performance Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

DELETE Individual Performance Subscription
    [Documentation]    Test ID: 8.3.2.7.3
    ...    Test title: DELETE Individual Performance Subscription
    ...    Test objective: The objective is to test the deletion of an individual performance subscription
    ...    Pre-conditions: An instance is instantiated. At least one performance subscription is available in the NFV-MANO.
    ...    Reference: clause 6.5.9.3.5 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Performance Subscription is not available anymore in the NFV-MANO    
    Send Delete request for individual Performance Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition Performance Subscription is Deleted

DELETE Individual Performance Subscription with invalid resource identifier
    [Documentation]    Test ID: 8.3.2.7.4
    ...    Test title: DELETE Individual Performance Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual performance subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: An instance is instantiated. At least one performance subscription is available in the NFV-MANO.
    ...    Reference: clause 6.5.9.3.5 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send Delete request for individual Performance Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

POST Individual Performance Subscription - Method not implemented
    [Documentation]    Test ID: 8.3.2.7.5
    ...    Test title: POST Individual Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new Performance Subscription
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.9.3.1 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Post request for individual Performance Subscription
    Check HTTP Response Status Code Is    405

PUT Individual Performance Subscription - Method not implemented
    [Documentation]    Test ID: 8.3.2.7.6
    ...    Test title: PUT Individual Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing Performance subscription.
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.9.3.3 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Put request for individual Performance Threshold
    Check HTTP Response Status Code Is    405

PATCH Individual Performance Subscription - Method not implemented
    [Documentation]    Test ID: 8.3.2.7.7
    ...    Test title: PATCH Individual Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing Performance subscription
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.9.3.4 - ETSI GS NFV-SOL 009 [7] v3.5.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for individual Performance Threshold
    Check HTTP Response Status Code Is    405

*** Keywords ***
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    Run Keyword If    '${input}' == 'ProblemDetails'    Should Contain    ${response['headers']['Content-Type']}    application/problem+json
    ...    ELSE    Should Contain    ${response['headers']['Content-Type']}    application/json
    ${schema} =    Catenate    SEPARATOR=    ${input}    .schema.json
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK 

Get Individual Performance Subscription
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Check HTTP Response Body Subscription Identifier matches the requested Subscription
    Log    Trying to check response ID
    Should Be Equal As Strings   ${response['body']['id']}    ${subscriptionId} 
    Log    Subscription identifier as expected
    
GET individual Performance Subscription with invalid resource identifier
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send Delete request for individual Performance Subscription
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Delete request for individual Performance Subscription with invalid resource identifier
    Log    Trying to delete a subscription in the NFV-MANO with invalid id
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    DELETE    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${erroneousSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    
Check Postcondition Performance Subscription is Deleted
    Log    Check Postcondition Subscription is deleted
    GET individual Performance Subscription
    Check HTTP Response Status Code Is    404 
    
Send Post request for individual Performance Subscription
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${newSubscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    
Send Put request for individual Performance Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PUT    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
    
Send Patch request for individual Performance Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${origOutput}=    Output    response
    Set Suite Variable    ${origResponse}    ${origOutput}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    @{response}    ${output}
 No newline at end of file
+0 −323

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −7
Original line number Original line Diff line number Diff line
*** Variables ***
${callbackUri}    http://172.22.1.7:9091/nfvmanopm/subscriptions
${filter_ok}      callbackUri=${callbackUri}
${filter_ko}      erroneousFilter=erroneous
${total_polling_time}   2 min
${polling_interval}     10 sec
${response}    httpresponse
+0 −6
Original line number Original line Diff line number Diff line
{{
	"callbackUri": "{callback_uri}{callback_endpoint}",
	"filter": {{
		"notificationTypes": ["ThresholdCrossedNotification"]
	}}
}}
 No newline at end of file
+0 −110
Original line number Original line Diff line number Diff line
{
    "description": "This type represents a subscription. \n",
    "type": "object",
    "properties": {
      "id": {
        "description": "An identifier with the intention of being globally unique.\n",
        "type": "string"
      },
      "filter": {
        "description": "This type represents a filter that can be used to subscribe for notifications  related to performance management events.  At a particular nesting level in the filter structure, the following applies:  All attributes shall match in order for the filter to match (logical \"and\" between  different filter attributes). If an attribute is an array, the attribute shall  match if at least one of the values in the array matches (logical \"or\" between the  values of one filter attribute).\n",
        "type": "object",
        "properties": {
          "pmSubscriptionFilter": {
            "description": "This type represents subscription filter criteria to match NFV-MANO functional  entities and their associated managed objects. \n",
            "type": "object",
            "properties": {
              "manoEntityId": {
                "description": "An identifier with the intention of being globally unique.\n",
                "type": "string"
              },
              "manoServiceIds": {
                "description": "manoServiceIds\tIdentifierInManoEntity\t0..N\tIf present, match NFV-MANO  services with an instance identifier listed in this attribute.\nThe attributes \"manoServiceIds\" and \"manoServiceNames\" are alternatives  to reference to NFV-MANO services in a filter. They should not be used  together in the same filter instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "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"
                }
              },
              "manoServiceNames": {
                "description": "If present, match NFV-MANO services with an NFV-MANO service name listed  in this attribute.\nThe attributes \"manoServiceIds\" and \"manoServiceNames\" are alternatives  to reference to NFV-MANO services in a filter. They should not be used  together in the same filter instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "manoServiceInterfaceIds": {
                "description": "If present, match NFV-MANO functional entity produced interfaces with an  instance identifier listed in this attribute.\nThe attributes \"manoServiceInterfaceIds\" and \"manoServiceInterfaceNames\"  are alternatives to reference to NFV-MANO functional entity produced  interfaces in a filter. They should not be used both in the same filter  instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "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"
                }
              },
              "manoServiceInterfaceNames": {
                "description": "If present, match NFV-MANO functional entity produced interfaces with an  instance Name listed in this attribute.\nThe attributes \"manoServiceInterfaceIds\" and \"manoServiceInterfaceNames\"  are alternatives to reference to NFV-MANO functional entity produced  interfaces in a filter. They should not be used both in the same filter  instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "consumedManoInterfaceIds": {
                "description": "If present, match NFV-MANO functional entity consumed interfaces with an  instance identifier listed in this attribute.\nThe attributes \"consumedManoInterfaceIds\" and \"consumedManoInterfaceNames\"  are alternatives to reference to NFV-MANO functional entity consumed  interfaces in a filter. They should not be used both in the same filter  instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "description": "An identifier with the intention of being globally unique.\n",
                  "type": "string"
                }
              },
              "consumedManoInterfaceNames": {
                "description": "If present, match NFV-MANO functional entity consumed interfaces with an  instance Name listed in this attribute.\nThe attributes \"consumedManoInterfaceIds\" and \"consumedManoInterfaceNames\"  are alternatives to reference to NFV-MANO functional entity consumed  interfaces in a filter. They should not be used both in the same filter  instance, but one alternative should be chosen.\n",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "notificationTypes": {
            "description": "Match particular notification types.  Permitted values:\n  - ThresholdCrossedNotification\n  - PerformanceInformationAvailableNotification\n\nThe permitted values of the \"notificationTypes\" attribute are spelled exactly  as the names of the notification types to facilitate automated code generation  systems.\n",
            "type": "string",
            "enum": [
              "ThresholdCrossedNotification",
              "PerformanceInformationAvailableNotification"
            ]
          }
        }
      },
      "callbackUri": {
        "description": "The URI of the endpoint to send the notification to.\n",
        "type": "object",
        "properties": {
          "links": {
            "description": "String formatted according to IETF RFC 3986.\n",
            "type": "string"
          },
          "self": {
            "description": "This type represents a link to a resource using an absolute URI.\n",
            "type": "object",
            "required": [
              "href"
            ],
            "properties": {
              "href": {
                "description": "String formatted according to IETF RFC 3986.\n",
                "type": "string"
              }
            }
          }
        },
        "required": [
          "links",
          "self"
        ]
      }
    },
    "required": [
      "id",
      "callbackUri"
    ]
  }
 No newline at end of file
Loading