Commit a431da9b authored by Elian Kraja's avatar Elian Kraja Committed by Michele Carignani
Browse files

Updating from v2.0.9 to v2.1.1. Cause 7: MEC Application support API

parent d3fc569c
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ TC_MEC_SRV_APPSUB_001_OK
    ...    Check that the IUT responds with a list of subscriptions for notifications
    ...    on services availability when queried by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.3.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecAppSupportApi.yaml#/definitions/MecAppSuptApiSubscriptionLinkList
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/MecAppSuptApiSubscriptionLinkList

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get Subscriptions list    ${APP_INSTANCE_ID}
@@ -32,7 +32,7 @@ TC_MEC_SRV_APPSUB_001_NF
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.3.3.1
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get Subscriptions list    ${NON_EXISTENT_APP_INSTANCE_ID}
@@ -44,16 +44,16 @@ TC_MEC_SRV_APPSUB_002_OK
    ...    Check that the IUT acknowledges the subscription by a MEC Application
    ...    to notifications on service availability events
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.3.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.3.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Create new subscription    ${APP_INSTANCE_ID}    AppTerminationNotificationSubscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    AppTerminationNotificationSubscription
    Check HTTP Response Header Contains    Location
    Check Result Contains    ${response['body']['AppTerminationNotificationSubscription']}    subscriptionType    "AppTerminationNotificationSubscription"
    Check Result Contains    ${response['body']['AppTerminationNotificationSubscription']}    callbackReference    ${APP_TERM_NOTIF_CALLBACK_URI}
    Check Result Contains    ${response['body']}    subscriptionType    "AppTerminationNotificationSubscription"
    Check Result Contains    ${response['body']}    callbackReference    ${APP_TERM_NOTIF_CALLBACK_URI}


TC_MEC_SRV_APPSUB_003_OK
@@ -61,14 +61,14 @@ TC_MEC_SRV_APPSUB_003_OK
    ...    Check that the IUT responds with the information on a specific subscription
    ...    when queried by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.4.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.1
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationNotificationSubscription

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get individual subscription    ${APP_INSTANCE_ID}    ${SUBSCRIPTION_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    AppTerminationNotificationSubscription
    Check Result Contains    ${response['body']['AppTerminationNotificationSubscription']}    subscriptionType    "AppTerminationNotificationSubscription"
    Check Result Contains    ${response['body']}    subscriptionType    "AppTerminationNotificationSubscription"


TC_MEC_SRV_APPSUB_003_NF
@@ -76,7 +76,7 @@ TC_MEC_SRV_APPSUB_003_NF
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.4.3.1
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get individual subscription    ${APP_INSTANCE_ID}    ${NON_EXISTENT_SUBSCRIPTION_ID}
@@ -88,7 +88,7 @@ TC_MEC_SRV_APPSUB_004_OK
    ...    Check that the IUT acknowledges the unsubscribe from service availability event notifications
    ...    when commanded by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 7.2.4.3.5
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.4.3.5

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Remove subscription    ${APP_INSTANCE_ID}    ${SUBSCRIPTION_ID}
+10 −0
Original line number Diff line number Diff line
{
  "subscriptionType": "AppTerminationNotificationSubscription",
  "callbackReference": "https://somewhere.com/mecAppSuptApi/example",
  "_links": {
    "self": {
      "href": "https://somewhere.com/mecAppSuptApi/example"
    }
  },
  "appInstanceId": "est eiusmod nulla exercitation"
}
 No newline at end of file
+49 −0
Original line number Diff line number Diff line
{
	"description": "This type represents the information that the MEC platform notifies the subscribed application instance about  the corresponding application instance termination/stop.",
	"type": "object",
	"required": [
		"subscriptionType",
		"callbackReference",
		"_links",
		"appInstanceId"
	],
	"properties": {
		"subscriptionType": {
			"description": "Shall be set to AppTerminationNotificationSubscription.",
			"type": "string",
			"example": "AppTerminationNotificationSubscription"
		},
		"callbackReference": {
			"description": "URI selected by the MEC application instance to receive notifications on the subscribed MEC application instance management information. This shall be included in both the request and the response.",
			"type": "string",
			"format": "uri"
		},
		"_links": {
			"description": "Self-referring URI.",
			"type": "object",
			"required": [
				"self"
			],
			"properties": {
				"self": {
					"description": "This type represents a type of link and may be referenced from data structures",
					"type": "object",
					"properties": {
						"href": {
							"description": "URI referring to a resource",
							"type": "string",
							"format": "uri",
							"example": "/mecAppSuptApi/example"
						}
					}
				}
			},
			"readOnly": true
		},
		"appInstanceId": {
			"description": "It is used as the filtering criterion for the subscribed events.",
			"type": "string",
			"example": "ID1"
		}
	}
}
 No newline at end of file
+54 −0
Original line number Diff line number Diff line
{
        "description": "This type represents a list of links related to currently existing subscriptions for a MEC application instance. This information is returned when sending a request to receive current subscriptions.",
        "type": "object",
        "required": [
          "_links"
        ],
        "properties": {
          "_links": {
            "description": "Self-referring URI.",
            "type": "object",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "description": "This type represents a type of link and may be referenced from data structures",
                "type": "object",
                "properties": {
                  "href": {
                    "description": "URI referring to a resource",
                    "type": "string",
                    "format": "uri",
                    "example": "/mecAppSuptApi/example"
                  }
                }
              },
              "subscriptions": {
                "description": "The MEC application instance's subscriptions",
                "type": "array",
                "items": {
                  "description": "A link to a subscription.",
                  "type": "object",
                  "required": [
                    "href",
                    "rel"
                  ],
                  "properties": {
                    "href": {
                      "description": "URI referring to a resource",
                      "type": "string",
                      "format": "uri",
                      "example": "/mecAppSuptApi/example"
                    },
                    "rel": {
                      "description": "The values shall be set to AppTerminationNotificationSubscription.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
 No newline at end of file
+95 −0
Original line number Diff line number Diff line
*** Settings ***

Documentation
...    A test suite for validating DNS rules (DNS) operations.

Resource    ../../GenericKeywords.robot
Resource    environment/variables.txt
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem 

Default Tags    TC_MEC_SRV_CONF


*** Variables ***


*** Test Cases ***

TC_MEC_SRV_CONF_001_OK
    [Documentation]
    ...    Check that the IUT responds with an acknowledge
    ...    when requested graceful termination/stop of a MEC Application instance
    ...
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.11.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationConfirmation

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Request termination of MEC Application    ${APP_INSTANCE_ID}    AppTerminationConfirmation
    Check HTTP Response Status Code Is    204


TC_MEC_SRV_CONF_001_NF
    [Documentation]
    ...    Check that the IUT responds with an error
    ...    when requested graceful termination/stop of an unknown MEC Application instance
    ...
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.11.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppTerminationConfirmation

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Request termination of MEC Application    ${NON_ESISTENT_APP_INSTANCE_ID}    AppTerminationConfirmation
    Check HTTP Response Status Code Is    404
    



TC_MEC_SRV_CONF_002_OK
    [Documentation]
    ...    Check that the IUT responds with an acknowledge
    ...    when requested readiness status for a MEC Application instance
    ...
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.12.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppReadyConfirmation

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Request readiness status of MEC Application    ${APP_INSTANCE_ID}    AppReadyConfirmation
    Check HTTP Response Status Code Is    204


TC_MEC_SRV_CONF_002_NF
    [Documentation]
    ...    Check that the IUT responds with an error
    ...    when requested readiness status for an unknown MEC Application instance
    ...
    ...    Reference    ETSI GS MEC 011 V2.1.1, clause 7.2.12.3.4
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/master/MecAppSupportApi.yaml#/definitions/AppReadyConfirmation

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Request readiness status of MEC Application    ${NON_ESISTENT_APP_INSTANCE_ID}   AppReadyConfirmation
    Check HTTP Response Status Code Is    404


*** Keywords ***
Request termination of MEC Application
    [Arguments]    ${appInstanceId}    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/confirm_termination    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    

Request readiness status of MEC Application
    [Arguments]    ${appInstanceId}    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/confirm_ready    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Loading