Commit a9131a60 authored by Elian Kraja's avatar Elian Kraja
Browse files

Updating MEC 016 to v2.2.1

parent 770b5aaf
Pipeline #6825 passed with stage
in 0 seconds
......@@ -3,117 +3,107 @@
*** Settings ***
Resource environment/variables.txt
Resource ../../pics.txt
Resource ../../GenericKeywords.robot
Resource resources/UeAppsContextAPI.robot
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
Creation of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_001_OK
TP_MEC_MEC016_MEO_UEAPPCTX_001_OK
[Documentation]
... Check that the IUT acknowledges the creation of the application context when requested by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
Create application context ${CREATE_APP_CTX}
... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context AppContext.json
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['appInfo']['appName']} == ${APP_NAME}
# Postamble
Delete an application context ${APP_CTX_ID}
Should Be Equal As Strings ${response['body']['appInfo']['appName']} MyNewWornderfulApp
Set Suite Variable ${contextId} ${response['body']['contextId']}
Creation of the application context with wrong parameters
[Documentation] TC_MEC_MEO_UEAPPCTX_001_BR
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
Create application context ${CREATE_APP_CTX_BR}
TP_MEC_MEC016_MEO_UEAPPCTX_001_BR
[Documentation]
... Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application
... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context AppContext_BR.json
Check HTTP Response Status Code Is 400
Check ProblemDetails 400
Update of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_002_OK
TP_MEC_MEC016_MEO_UEAPPCTX_001_NF
[Documentation]
... Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application
... Reference ETSI GS MEC 016 v2.2.1, clause 7.4.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create application context using wrong endpoint AppContext.json
Check HTTP Response Status Code Is 404
TP_MEC_MEC016_MEO_UEAPPCTX_002_OK
[Documentation]
... Check that the IUT updates the application callback reference when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
... Reference ETSI GS MEC 016 v2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX}= Set Variable ${CALLBACK_REFERENCE_1}
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Update application context ${contextId} UpdateAppContext.json
Check HTTP Response Status Code Is 204
Check HTTP Response Body Json Schema Is AppContext
Should Be True ${response['body']['appContext']['callbackReference']} == ${CALLBACK_REFERENCE_1}
# Postamble
Delete an application context ${APP_CTX_ID}
Should Be Equal As Strings ${response['body']['callbackReference']} http://127.0.0.1/callbackuri
Update of the application context with wrong parameters
[Documentation] TC_MEC_MEO_UEAPPCTX_002_BR
TP_MEC_MEC016_MEO_UEAPPCTX_002_BR
[Documentation]
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
... Reference ETSI GS MEC 016 v2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX}= Set Variable '' # Empty string
Update application context ${APP_CTX_ID} ${CREATE_APP_CTX}
Update application context ${contextId} UpdateAppContext_BR.json
Check HTTP Response Status Code Is 400
Check ProblemDetails 400
# Postamble
Delete an application context ${APP_CTX_ID}
Update of the application context with unknown URI
[Documentation] TC_MEC_MEO_UEAPPCTX_002_NF
TP_MEC_MEC016_MEO_UEAPPCTX_002_NF
[Documentation]
... 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 016 V1.1.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.2
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
${CREATE_APP_CTX}= Set Variable ${CALLBACK_REFERENCE_1}
Update application context ${NON_EXISTENT_APP_CTX_ID} ${CREATE_APP_CTX}
Update application context using wrong endpoint ${contextId} UpdateAppContext.json
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
# Postamble
Delete an application context ${APP_CTX_ID}
Delete of the application context
[Documentation] TC_MEC_MEO_UEAPPCTX_003_OK
TP_MEC_MEC016_MEO_UEAPPCTX_003_OK
[Documentation]
... Check that the IUT deletes the application context when commanded by an UE Application
... Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5
... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Create an application context
# Test Body
Delete application context ${APP_CTX_ID}
Delete application context ${contextId}
Check HTTP Response Status Code Is 204
Delete of the application context with non esistent APP CTX ID
[Documentation] TC_MEC_MEO_UEAPPCTX_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 016 V1.1.1, clause 7.5.3.5
TP_MEC_MEC016_MEO_UEAPPCTX_003_NF
[Documentation]
... Check that the IUT deletes the application context when commanded by an UE Application
... Reference ETSI GS MEC 016 2.2.1, clause 7.5.3.5
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/AppContext
# Preamble
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
# AppCtx not created!
# Test Body
Delete application context ${APP_CTX_ID}
Delete application context ${NON_EXISTING_CONTEXT_ID}
Check HTTP Response Status Code Is 404
Check ProblemDetails 404
......@@ -121,13 +111,24 @@ Delete of the application context with non esistent APP CTX ID
*** Keywords ***
Create application context
[Arguments] ${content}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Post /exampleAPI/mx2/v2/app_contexts ${content}
${path} Catenate SEPATATOR= jsons/ ${content}
${body} Get Binary File ${path}
Post ${apiRoot}/${apiName}/${apiVersion}/app_contexts ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Create application context using wrong endpoint
[Arguments] ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${path} Catenate SEPATATOR= jsons/ ${content}
${body} Get Binary File ${path}
Post ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
......@@ -137,18 +138,36 @@ Update application context
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Put /exampleAPI/mx2/v2/app_contexts/${context_id} ${content}
Put ${apiRoot}/${apiName}/${apiVersion}/app_contexts/${context_id} ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Update application context using wrong endpoint
[Arguments] ${context_id} ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Put ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error/${context_id} ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Delete application context
[Arguments] ${context_id}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete /exampleAPI/mx2/v2/app_contexts/${context_id}
Delete ${apiRoot}/${apiName}/${apiVersion}/app_contexts/${context_id}
${output}= Output response
Set Suite Variable ${response} ${output}
Delete application context using wrong endpoint
[Arguments] ${context_id}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Delete ${apiRoot}/${apiName}/${apiVersion}/app_contexts_error/${context_id}
${output}= Output response
Set Suite Variable ${response} ${output}
*** Variables ***
${apiRoot}
${apiName} dev_app
${apiVersion} v1
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${contextId}
${NON_EXISTING_CONTEXT_ID} NON_EXISTING_CONTEXT_ID
\ No newline at end of file
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"appInfo":{
"appName":"MyNewWornderfulApp",
"appProvider":"TF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"appInfo":{
"app":"MyNewWornderfulApp",
"appProvider":"TF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"associateDevAppId":"MyNewWornderfulDevAppId",
"contextId": "MyNewWornderfulDevAppId",
"callbackReference": "http://127.0.0.1/callbackuri",
"appInfo":{
"appName":"MyNewWornderfulApp",
"appProvider":"TF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"associateUeAppId":"MyNewWornderfulDevAppId",
"contextId": "MyNewWornderfulDevAppId",
"callbackReference": "http://127.0.0.1/callbackuri",
"appInfo":{
"appName":"MyNewWornderfulApp",
"appProvider":"TF012",
"appDVersion":"v0.0.1",
"userAppInstanceInfo":[
{
}
]
}
}
{
"properties": {
"appAutoInstantiation": {
"description": "Provides indication to the MEC system that instantiation of the requested application is desired should a requested appLocation become available that was not at the time of the request.",
"type": "boolean",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "Boolean"
},
"appInfo": {
"description": "",
"properties": {
"appDId": {
"description": "Identifier of this MEC application descriptor. This attribute shall be globally unique. It is equivalent to the appDId defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1]. It shall be present if the application is one in the ApplicationList.",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"appDVersion": {
"description": "Identifies the version of the application descriptor. It is equivalent to the appDVersion defined in clause 6.2.1.2 of ETSI GS MEC 0102 [1].",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"appDescription": {
"description": "Human readable description of the MEC application. The length of the value shall not exceed 128 characters.",
"type": "string",
"maxLength": 128,
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"appName": {
"description": "Name of the MEC application. The length of the value shall not exceed 32 characters.",
"type": "string",
"maxLength": 32,
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"appProvider": {
"description": "Provider of the MEC application.\nThe length of the value shall not exceed 32 characters.",
"type": "string",
"maxLength": 32,
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"appSoftVersion": {
"description": "Software version of the MEC application. The length of the value shall not exceed 32 characters.",
"type": "string",
"maxLength": 32,
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"appPackageSource": {
"description": "URI of the application package.\nIncluded in the request if the application is not one in the ApplicationList. appPackageSource enables on-boarding of the application package into the MEC system. The application package shall comply with the definitions in clause 6.2.1.2 of ETSI GS MEC 0102 [1].",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
},
"userAppInstanceInfo": {
"description": "List of user application instance information.",
"items": {
"type": "object",
"properties": {
"appInstanceId": {
"description": "Identifier of the user application instance. It shall only be included in the response.",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"appLocation": {
"properties": {
"area": {
"properties": {
"coordinates": {
"items": {
"items": {
"items": {
"type": "number",
"format": "float"
},
"type": "array"
},
"type": "array"
},
"minItems": 1,
"type": "array",
"x-etsi-mec-cardinality": 1,
"x-etsi-mec-origin-type": "array"
}
},
"type": "object"
},
"civicAddressElement": {
"description": "Zero or more elements comprising the civic address. Shall be absent if the \"area\" attribute is present.",
"items": {
"type": "object",
"properties": {
"caType": {
"description": "Describe the content type of caValue. The value of caType shall comply with section 3.4 of IETF RFC 4776 [6]. ",
"type": "integer",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "Integer"
},
"caValue": {
"description": "Content of civic address element corresponding to the caType. The format caValue shall comply with section 3.4 of IETF RFC 4776 [6].",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
}
}
},
"minItems": 0,
"required": [
"caType",
"caValue"
],
"type": "array",
"x-etsi-mec-cardinality": "0..N",
"x-etsi-mec-origin-type": "array (Structure inlined)"
},
"countryCode": {
"description": "The two-letter ISO 3166 [7] country code in capital letters. Shall be present in case the \"area\" attribute is absent. May be absent if the \"area\" attribute is present (see note).",
"type": "string",
"maxLength": 2,
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
}
},
"type": "object",
"x-etsi-notes": "NOTE:\tIf both \"countryCode\" and \"area\" are present, no conflicts should exist between the values of these two attributes. In case of conflicts, the API producer (e.g. MEO, MEAO) shall disregard parts of the geographic area signalled by \"area\" that are outside the boundaries of the country signalled by \"countryCode\". If \"countryCode\" is absent, it is solely the \"area\" attribute that defines the location constraint.",
"x-etsi-ref": "6.5.2"
},
"referenceURI": {
"description": "Address of the user application instance. It shall only be included in the response.",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
}
}
},
"minItems": 1,
"type": "array",
"x-etsi-mec-cardinality": "1..N",
"x-etsi-mec-origin-type": "array (Structure inlined)"
}
},
"required": [
"appName",
"appProvider",
"appDVersion",
"userAppInstanceInfo"
],
"type": "object",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "Structure (inlined)"
},
"appLocationUpdates": {
"description": "Used by the device application to request to receive notifications at the callbackReference URI relating to location availability for user application instantiation.",
"type": "boolean",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "Boolean"
},
"associateDevAppId": {
"description": "Uniquely identifies the device application. The length of the value shall not exceed 32 characters.",
"type": "string",
"maxLength": 32,
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"callbackReference": {
"description": "URI assigned by the device application to receive application lifecycle related notifications. Inclusion in the request implies the client supports the pub/sub mechanism and is capable of receiving notifications. This endpoint shall be maintained for the lifetime of the application context.",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
},
"contextId": {
"description": "Uniquely identifies the application context in the MEC system. Assigned by the MEC system and shall be present other than in a create request. The length of the value shall not exceed 32 characters.",
"type": "string",
"maxLength": 32,
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
}
},
"required": [
"associateDevAppId",
"appInfo"
],
"type": "object",
"x-etsi-notes": "NOTE 1:\tIf a value of the attribute is included in the request, the same value shall be included in the response.\nNOTE 2:\tThe design of the current operation with callback reference assumes no web proxy between the entity that originates the notification and the entity that receives it.\nNOTE 3:\tThe language support for the application description may be limited.\nNOTE 4:\tAttribute appLocationUpdates and appAutoInstantiation shall not both be set to TRUE.",
"x-etsi-ref": "6.2.3"
}
\ No newline at end of file
''[Documentation] robot --outputdir ../../outputs ./SysUeApplicationsLocation.robot
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
TP_MEC_MEC016_MEO_UEAPPLOC_001_OK
[Documentation]
... Check that the IUT sends the locations available for instantiation of a specific user application when requested by an UE Application
... Reference ETSI GS MEC 016 2.2.1, clause 7.6.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Obtain Application Location Availability Task AppLocationAvailability.json
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ApplicationLocationAvailability
Should Be Equal As Strings ${response['body']['appInfo']['appName']} MyNewWornderfulApp
TP_MEC_MEC016_MEO_UEAPPLOC_001_BR
[Documentation]
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference ETSI GS MEC 016 2.2.1, clause 7.6.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Obtain Application Location Availability Task AppLocationAvailability_BR.json
Check HTTP Response Status Code Is 400
TP_MEC_MEC016_MEO_UEAPPCTX_001_NF
[Documentation]
... Check that the IUT responds with an error when a request with incorrect URL is sent by a MEC Application
... Reference ETSI GS MEC 016 2.2.1, clause 7.6.3.4
... Reference https://forge.etsi.org/gitlab/mec/gs016-ue-app-api/blob/master/UEAppInterfaceApi.yaml#/definitions/ApplicationList
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Obtain Application Location Availability Task using wrong endpoint AppLocationAvailability.json
Check HTTP Response Status Code Is 404
*** Keywords ***
Obtain Application Location Availability Task
[Arguments] ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${path} Catenate SEPATATOR= jsons/ ${content}
${body} Get Binary File ${path}
Post ${apiRoot}/${apiName}/${apiVersion}/obtain_app_loc_availability ${content}
${output}= Output response
Set Suite Variable ${response} ${output}
Obtain Application Location Availability Task using wrong endpoint
[Arguments] ${content}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}