diff --git a/MEC013/SRV/UEDISTLOOK/PlatUeDistanceLookup.robot b/MEC013/SRV/UEDISTLOOK/PlatUeDistanceLookup.robot index 74dc0b1d55bebaeda29cfcbdca05caa8369e13b2..1db676a84602ef08f5c469c3429954432bb29e57 100644 --- a/MEC013/SRV/UEDISTLOOK/PlatUeDistanceLookup.robot +++ b/MEC013/SRV/UEDISTLOOK/PlatUeDistanceLookup.robot @@ -8,7 +8,7 @@ Resource ../../../pics.txt Resource environment/variables.txt Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem - +Library String Default Tags TC_MEC_SRV_UEDISTLOOK @@ -20,33 +20,118 @@ ${response} TC_MEC_MEC013_SRV_UEDISTLOOK_001_OK [Documentation] - ... Check that the IUT responds with the distance to a UE + ... Check that the IUT responds with the list of UE distance subscriptions to a UE ... when queried by a MEC Application ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.9 - ... OpenAPI # TODO check this + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.2 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.3 + ... ETSI GS MEC 013 3.1.1 Clause 7.14.3.1 [Tags] PIC_MEC_PLAT PIC_SERVICES INCLUDE_UNDEFINED_SCHEMAS - Set Headers {"Accept":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - Get ${apiRoot}/${apiName}/${apiVersion}/queries/distance?address=${LOC_QRY_UE_ADDRESS}&latitude=${LOC_QRY_UE_LAT}&longitude=${LOC_QRY_UE_LONG} - ${output}= Output response - Set Suite Variable ${response} ${output} + [Setup] Create new subscription and get sub id UserDistanceSubscription + Get all Subscriptions + Check HTTP Response Body Json Schema Is NotificationSubscriptionList Check HTTP Response Status Code Is 200 - Check HTTP Response Body Json Schema Is TerminalDistance - + Should Be Equal As Strings ${response['body']['subscription'][0]['subscriptionType']} UserDistanceSubscription + [TearDown] Remove subscription ${SUB_ID} TC_MEC_MEC013_SRV_UEDISTLOOK_001_BR [Documentation] - ... Check that the IUT responds with an error when - ... a request with incorrect parameters is sent by a MEC Application + ... Check that the IUT responds with an error when a request with + ... incorrect parameters is sent by a MEC Application - Invalid filter + ... + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.2 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.3 + ... ETSI GS MEC 013 3.1.1 Clause 7.14.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES INCLUDE_UNDEFINED_SCHEMAS + Get all Subscriptions with error + Check HTTP Response Status Code Is 400 + +TC_MEC_MEC013_SRV_UEDISTLOOK_002_OK + [Documentation] + ... Check that the IUT responds with the distance to a UE + ... when queried by a MEC Application + ... + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.2 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.9 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.9 + ... ETSI GS MEC 013 3.1.1 Clause 7.15.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create new subscription and get sub id UserDistanceSubscription + Get specific Subscription ${SUB_ID} + Check HTTP Response Body Json Schema Is UserDistanceSubscription + Check HTTP Response Status Code Is 200 + [TearDown] Remove subscription ${SUB_ID} + + + +TC_MEC_MEC013_SRV_UEDISTLOOK_002_NF + [Documentation] + ... Check that the IUT responds with the distance to a UE + ... when queried by a MEC Application ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.9 + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.2 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.9 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.9 + ... ETSI GS MEC 013 3.1.1 Clause 7.15.3.1 - [Tags] PIC_MEC_PLAT PIC_SERVICES + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Remove subscription ${NON_EXISTING_SUBSCRIPTION_ID} + Get specific Subscription ${NON_EXISTING_SUBSCRIPTION_ID} + Check HTTP Response Status Code Is 404 + + +*** Keywords *** +Create new subscription and get sub id + [Arguments] ${content} + Create new subscription ${content} + ${elements} = Split String ${response['headers']['Location']} / + Set Suite Variable ${SUB_ID} ${elements[3]} + +Create new subscription + [Arguments] ${content} Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} - Get ${apiRoot}/${apiName}/${apiVersion}/queries/distance?address=${LOC_QRY_UE_ADDRESS}&lat=${LOC_QRY_UE_LAT}&longitude=${LOC_QRY_UE_LONG} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance ${body} ${output}= Output response Set Suite Variable ${response} ${output} - Check HTTP Response Status Code Is 400 + +Get all Subscriptions + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get specific Subscription + [Arguments] ${subscription_id} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance/${subscription_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get all Subscriptions with error + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance?event=123 + ${output}= Output response + Set Suite Variable ${response} ${output} + +Remove subscription + [Arguments] ${subscriptionId} + Set Headers {"Accept":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance/${subscriptionId} + ${output}= Output response + Set Suite Variable ${response} ${output} \ No newline at end of file diff --git a/MEC013/SRV/UEDISTLOOK/environment/variables.txt b/MEC013/SRV/UEDISTLOOK/environment/variables.txt index 217a0d95f84f9ff7d0f901469234a286a852270c..87fa46bd909160ebe688745567419e699420b282 100644 --- a/MEC013/SRV/UEDISTLOOK/environment/variables.txt +++ b/MEC013/SRV/UEDISTLOOK/environment/variables.txt @@ -1,14 +1,18 @@ *** Variables *** # Generic variables ${SCHEMA} http -${HOST} 10.192.2.172 +${HOST} 127.0.0.1 + + ${PORT} 8081 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l ${apiRoot} ${apiName} location -${apiVersion} v2 +${apiVersion} v3 +${SUB_ID} +${NON_EXISTING_SUBSCRIPTION_ID} NON_EXISTING_SUBSCRIPTION_ID # Specific variables ${LOC_QRY_UE_ADDRESS} acr:10.0.0.1 ${LOC_QRY_UE_LAT} -80.86302 diff --git a/MEC013/SRV/UEDISTLOOK/jsons/UserDistanceSubscription.json b/MEC013/SRV/UEDISTLOOK/jsons/UserDistanceSubscription.json new file mode 100644 index 0000000000000000000000000000000000000000..337a1f13264d5ddacd58930e27ef5e4c2144a915 --- /dev/null +++ b/MEC013/SRV/UEDISTLOOK/jsons/UserDistanceSubscription.json @@ -0,0 +1,18 @@ +{ + "userDistanceSubscription": { + "subscriptionType": "UserDistanceSubscription", + "clientCorrelator": "0123", + "callbackReference": "http://my.callback.com/user-distance/some-id", + "referenceAddress": [ + "acr:10.0.0.3" + ], + "monitoredAddress": [ + "acr:10.0.0.1", + "acr:10.0.0.2" + ], + "distance": 100, + "trackingAccuracy": 10, + "criteria": "AllWithinDistance", + "checkImmediate": true + } + } \ No newline at end of file diff --git a/MEC013/SRV/UEDISTLOOK/schemas/NotificationSubscriptionList.schema.json b/MEC013/SRV/UEDISTLOOK/schemas/NotificationSubscriptionList.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..4b245317effbe3f5a5e90afcf44f372bba29e50c --- /dev/null +++ b/MEC013/SRV/UEDISTLOOK/schemas/NotificationSubscriptionList.schema.json @@ -0,0 +1,55 @@ +{ + "description": "This type contains a list of subscriptions.", + "properties": { + "resourceURL": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + }, + "subscription": { + "items": { + "description": "", + "minItems": 0, + "properties": { + "href": { + "description": "The URI referring to the subscription.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + }, + "subscriptionType": { + "description": "Type of the subscription. The string shall be set according to the \"subscriptionType\" attribute of the associated subscription data type defined in clauses 6.3.4, 6.3.5, 6.3.6, 6.3.7 6.3.8 and 6.3.9:\n\"UserLocationEventSubscription\"\n\"UserLocationPeriodicSubscription\"\n\"ZoneLocationEventSubscription\"\n\"ZoneStatusSubscription\"\n\"UserAreaSubscription\"\n\"UserDistanceSubscription\"", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + } + }, + "required": [ + "href", + "subscriptionType" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "type": "array" + } + }, + "required": [ + "resourceURL" + ], + "type": "object", + "x-etsi-ref": "6.3.3" + } \ No newline at end of file diff --git a/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.json b/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.json deleted file mode 100644 index ccee80aa3c7a00fba3b0266c1dd071bee60fc1a5..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "type": "object", - "properties": { - "terminalDistance": { - "description": "A type containing information about the distance from a terminal to a location or between two terminals, in addition the accuracy and a timestamp of the information are provided.", - "properties": { - "accuracy": { - "description": "Accuracy of the provided distance in meters", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "integer" - }, - "distance": { - "description": "Distance from terminal to a location or between two terminals specified in meters", - "type": "integer", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "integer" - }, - "timestamp": { - "properties": { - "nanoSeconds": { - "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", - "format": "int32", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "Uint32" - }, - "seconds": { - "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", - "format": "int32", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "Uint32" - } - }, - "required": [ - "seconds", - "nanoSeconds" - ], - "type": "object", - "x-etsi-ref": "6.5.2" - } - }, - "required": [ - "distance" - ], - "type": "object" - } - } -} \ No newline at end of file diff --git a/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.v1.1.1.json b/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.v1.1.1.json deleted file mode 100644 index b23ded186f8f1270e7ddcd32dd63515ebda4665c..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEDISTLOOK/schemas/TerminalDistance.schema.v1.1.1.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://example.com/root.json", - "type": "object", - "title": "The Root Schema", - "required": [ - " terminalDistance" - ], - "properties": { - " terminalDistance": { - "$id": "#/properties/ terminalDistance", - "type": "object", - "title": "The terminaldistance Schema", - "required": [ - "distance" - ], - "properties": { - "distance": { - "$id": "#/properties/ terminalDistance/properties/distance", - "type": "string", - "title": "The Distance Schema", - "default": "", - "examples": [ - "123" - ], - "pattern": "^(.*)$" - } - } - } - } -} diff --git a/MEC013/SRV/UEDISTLOOK/schemas/UserDistanceSubscription.schema.json b/MEC013/SRV/UEDISTLOOK/schemas/UserDistanceSubscription.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..6423a84b3cb0db0f248f3b75d48dac16cbdf182a --- /dev/null +++ b/MEC013/SRV/UEDISTLOOK/schemas/UserDistanceSubscription.schema.json @@ -0,0 +1,168 @@ +{ + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "self": { + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "href" + ], + "type": "object", + "x-etsi-ref": "6.7.2" + } + }, + "required": [ + "self" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "callbackReference": { + "description": "URI exposed by the client on which to receive notifications via HTTP. See note 1.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + }, + "checkImmediate": { + "type": "boolean" + }, + "clientCorrelator": { + "description": "A correlator that the client can use to tag this particular resource representation during a request to create a resource on the server. See note 2.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "criteria": { + "description": "An enumeration, defining the distance criteria between devices.", + "enum": [ + "AllWithinDistance", + "AnyWithinDistance", + "AllBeyondDistance", + "AnyBeyondDistance" + ], + "type": "string" + }, + "distance": { + "description": "Distance between users that shall be monitored. The unit is meter.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "expiryDeadline": { + "properties": { + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + }, + "seconds": { + "description": "The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "format": "uint32", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ], + "type": "object", + "x-etsi-ref": "6.5.2" + }, + "monitoredAddress": { + "description": "Contains addresses of users to monitor (e.g., ‘sip’ URI, ‘tel’ URI, ‘acr’ URI). Reference to a group could be provided here if supported by implementation.\nIf the ReferenceAddress is specified, then the distance between each monitored user and reference user(s) will be monitored.\nIf the ReferenceAddress is not present, then the distance between each pair of the monitored users will be monitored. Note that in that case there shall be at least two addresses specified here.", + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Array(Uri)" + }, + "referenceAddress": { + "description": "If specified, indicates address of each user that will be used as reference users from which the distances towards monitored users indicated in the Addresses will be monitored (e.g., ‘sip’ URI, ‘tel’ URI, ‘acr’ URI). Reference to a group could be provided here if supported by implementation.", + "items": { + "type": "string" + }, + "minItems": 0, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "Array(Uri)" + }, + "reportingCtrl": { + "properties": { + "maximumCount": { + "description": "Maximum number of notifications. For no maximum, either do not include this element or specify a value of zero. Default value is 0.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "maximumFrequency": { + "description": "Maximum frequency (in seconds) of notifications per subscription.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "minimumInterval": { + "description": "Minimum interval between reports in case frequently reporting. Unit is second.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "type": "object", + "x-etsi-ref": "6.5.6" + }, + "requestTestNotification": { + "description": "Set to TRUE by the service consumer to request a test notification via HTTP on the callbackReference URI, as specified in ETSI GS MEC 009 [4], clause 6.12a.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "subscriptionType": { + "description": "Shall be set to \"UserDistanceSubscription\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "trackingAccuracy": { + "description": "Number of meters of acceptable error in tracking distance.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "websockNotifConfig": { + "properties": { + "requestWebsocketUri": { + "description": "Set to true by the service consumer to indicate that Websocket delivery is requested.", + "type": "boolean", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Boolean" + }, + "websocketUri": { + "description": "Set by location server to indicate to the service consumer the Websocket URI to be used for delivering notifications.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "type": "object", + "x-etsi-ref": "6.5.4" + } + } \ No newline at end of file