diff --git a/MEC013/SRV/RLOCLOOK/PlatRadioNodeLocation.robot b/MEC013/SRV/RLOCLOOK/PlatRadioNodeLocation.robot index 11e4ced2ca1235839ea32e06ed1c02503ab6695b..4ad2c8b3c0dd1f9a4fb910d9334bb79be18ad9a9 100644 --- a/MEC013/SRV/RLOCLOOK/PlatRadioNodeLocation.robot +++ b/MEC013/SRV/RLOCLOOK/PlatRadioNodeLocation.robot @@ -14,35 +14,77 @@ Default Tags TC_MEC_SRV_RLOCLOOK *** Test Cases *** + TC_MEC_MEC013_SRV_RLOCLOOK_001_OK [Documentation] ... Check that the IUT responds with the list of radio nodes currently associated with the MEC host and the location of each radio node ... when queried by a MEC Application ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.7 - ... OpenAPI https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/AccessPointList + ... Reference + ... ETSI GS MEC 013 3.1.1 Clause 5.3.7 + ... ETSI GS MEC 013 3.1.1 Clause 6.2.1 + ... ETSI GS MEC 013 3.1.1 Clause 7.9.3.1 - [Tags] PIC_MEC_PLAT PIC_SERVICES INCLUDE_UNDEFINED_SCHEMAS - Get the access points list ${ZONE_ID} + [Tags] PIC_MEC_PLAT PIC_SERVICES + Get the access points list by zone identifier ${ZONE_ID} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is AccessPointList - Should Be Equal As Strings ${response['body']['accessPointList']['zoneId']} ${ZONE_ID} + Should Be Equal As Strings ${response['body']['zoneId']} ${ZONE_ID} + TC_MEC_MEC013_SRV_RLOCLOOK_001_NF [Documentation] ... Check that the IUT responds with an error when - ... a request for an unknown URI is sent by a MEC Application + ... a request for an URI that cannot be mapped to a valid resource URI + ... is sent by a MEC Application ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.7 + ... Reference + ... ETSI GS MEC 013 3.1.1 Clause 5.3.7 + ... ETSI GS MEC 013 3.1.1 Clause 6.2.1 + ... ETSI GS MEC 013 3.1.1 Clause 7.9.3.1 [Tags] PIC_MEC_PLAT PIC_SERVICES - Get the access points list ${NON_EXISTENT_ZONE_ID} + Get the access points list by zone identifier ${NON_EXISTENT_ZONE_ID} Check HTTP Response Status Code Is 404 + +TC_MEC_MEC013_SRV_RLOCLOOK_002_OK + [Documentation] + ... Check that the IUT responds with the radio nodes when queried + ... by a MEC Application + ... + ... Reference + ... ETSI GS MEC 013 3.1.1 Clause 5.3.7 + ... ETSI GS MEC 013 3.1.1 Clause 6.2.1 + ... ETSI GS MEC 013 3.1.1 Clause 7.10.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Get the access points list by zone identifier and access point ${ZONE_ID} ${AP_ID} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is AccessPointList + Should Be Equal As Strings ${response['body']['zoneId']} ${ZONE_ID} + Should Be Equal As Strings ${response['body']['accessPoint'][0]['accessPointId']} ${AP_ID} + + +TC_MEC_MEC013_SRV_RLOCLOOK_002_NF + [Documentation] + ... Check that the IUT responds with an error when the + ... radio nodes does not exist + ... + ... Reference + ... ETSI GS MEC 013 3.1.1 Clause 5.3.7 + ... ETSI GS MEC 013 3.1.1 Clause 6.2.1 + ... ETSI GS MEC 013 3.1.1 Clause 7.10.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Get the access points list by zone identifier and access point ${ZONE_ID} ${NON_EXISTENT_AP_ID} + Check HTTP Response Status Code Is 404 + + *** Keywords *** -Get the access points list +Get the access points list by zone identifier [Arguments] ${zoneId} Set Headers {"Accept":"application/json"} Set Headers {"Authorization":"${TOKEN}"} @@ -51,5 +93,13 @@ Get the access points list Set Suite Variable ${response} ${output} +Get the access points list by zone identifier and access point + [Arguments] ${zoneId} ${accessPointId} + Set Headers {"Accept":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/queries/zones/${zoneId}/accessPoints/${accessPointId} + ${output}= Output response + Set Suite Variable ${response} ${output} + diff --git a/MEC013/SRV/RLOCLOOK/environment/variables.txt b/MEC013/SRV/RLOCLOOK/environment/variables.txt index a9bf262d487dcf1465071bbaa445ce33425ffcd5..58b70406b3a4892714c95f4a3cbfea992eb05c70 100644 --- a/MEC013/SRV/RLOCLOOK/environment/variables.txt +++ b/MEC013/SRV/RLOCLOOK/environment/variables.txt @@ -1,14 +1,16 @@ *** 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 # Specific variables ${ZONE_ID} 5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f ${NON_EXISTENT_ZONE_ID} NON_EXISTENT_ZONE_ID +${AP_ID} ap01 +${NON_EXISTENT_AP_ID} NON_EXISTENT_AP_ID \ No newline at end of file diff --git a/MEC013/SRV/RLOCLOOK/schemas/AccessPointList.schema.json b/MEC013/SRV/RLOCLOOK/schemas/AccessPointList.schema.json index 2a37408f034eacecfab37db3eb2aad2d9e503676..f321b15e6f9f2fc1e8d8b60992b6d716a9455eab 100644 --- a/MEC013/SRV/RLOCLOOK/schemas/AccessPointList.schema.json +++ b/MEC013/SRV/RLOCLOOK/schemas/AccessPointList.schema.json @@ -1,270 +1,255 @@ { - "accessPointList": { - "description": "A type containing list of access points.", - "properties": { - "accessPoint": { - "description": "Collection of the access point information list.", - "items": { - "description": "A type containing access point information.", - "properties": { - "accessPointId": { - "description": "Identifier of access point.", - "type": "string", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "string" - }, - "connectionType": { - "description": "The connection type for the access point", - "enum": [ - "Femto", - "LTE-femto", - "Smallcell", - "LTE-smallcell", - "Wifi", - "Pico", - "Micro", - "Macro", - "Wimax", - "Unknown" - ], - "type": "string" - }, - "interestRealm": { - "description": "Interest realm of access point.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "string" - }, - "locationInfo": { - "properties": { - "accuracy": { - "description": "Horizontal accuracy / (semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "accuracyAltitude": { - "description": "Altitude accuracy / uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "accuracySemiMinor": { - "description": "Horizontal accuracy / (semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "altitude": { - "description": "Location altitude relative to the WGS84 ellipsoid surface.", - "format": "float", - "type": "number", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "Float" - }, - "confidence": { - "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "includedAngle": { - "description": "Present only if \"shape\" equals 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "innerRadius": { - "description": "Present only if \"shape\" equals 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "latitude": { - "description": "Location latitude, expressed in the range -90� to +90�. Cardinality greater than one only if \"shape\" equals 7.", - "items": { - "format": "float", - "type": "number" - }, - "minItems": 1, - "type": "array", - "x-etsi-mec-cardinality": "1..N", - "x-etsi-mec-origin-type": "Float" - }, - "longitude": { - "description": "Location longitude, expressed in the range -180� to +180�. Cardinality greater than one only if \"shape\" equals 7.", - "items": { - "format": "float", - "type": "number" - }, - "minItems": 1, - "type": "array", - "x-etsi-mec-cardinality": "1..N", - "x-etsi-mec-origin-type": "Float" - }, - "offsetAngle": { - "description": "Present only if \"shape\" equals 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "orientationMajorAxis": { - "description": "Angle of orientation of the major axis, expressed in the range 0� to 180�, as defined in [14]. Present only if \"shape\" equals 4 or 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "shape": { - "description": "Shape information, as detailed in [14], associated with the reported location coordinate:
1 = ELLIPSOID_ARC
2 = ELLIPSOID_POINT
3 = ELLIPSOID_POINT_ALTITUDE
4 = ELLIPSOID_POINT_ALTITUDE_UNCERT_ELLIPSOID
5 = ELLIPSOID_POINT_UNCERT_CIRCLE
6 = ELLIPSOID_POINT_UNCERT_ELLIPSE
7 = POLYGON", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "Enum_inlined" - }, - "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" - }, - "uncertaintyRadius": { - "description": "Present only if \"shape\" equals 6", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "velocity": { - "description": "Structure with attributes relating to the target entity's velocity, as defined in [14].", - "properties": { - "bearing": { - "description": "Bearing, expressed in the range 0 deg to 360 deg, as defined in [14].", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "horizontalSpeed": { - "description": "Horizontal speed, expressed in km/h and defined in [14].", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "uncertainty": { - "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - }, - "velocityType": { - "description": "Velocity information, as detailed in [14], associated with the reported location coordinate:
1 = HORIZONTAL
2 = HORIZONTAL_VERTICAL
3 = HORIZONTAL_UNCERT
4 = HORIZONTAL_VERTICAL_UNCERT", - "type": "integer", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "Enum_inlined" - }, - "verticalSpeed": { - "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "Int" - }, - "verticalUncertainty": { - "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "UnsignedInt" - } - }, - "required": [ - "velocityType", - "bearing", - "horizontalSpeed" - ], - "type": "object", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "Structure (inlined)" - } - }, - "required": [ - "latitude", - "longitude", - "shape" - ], - "type": "object", - "x-etsi-ref": "6.5.3" - }, - "numberOfUsers": { - "description": "Number of users currently on the access point.", - "type": "integer", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "integer" - }, - "operationStatus": { - "enum": [ - "Serviceable", - "Unserviceable", - "Unknown" - ], - "type": "string" - }, - "resourceURL": { - "description": "Self referring URL", - "type": "string", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "anyURI" - }, - "timezone": { - "description": "Time zone of access point.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "dateTimeStamp" - } - }, - "required": [ - "accessPointId", - "connectionType", - "operationStatus", - "numberOfUsers", - "resourceURL" - ], - "type": "object" - }, - "type": "array", - "x-etsi-mec-cardinality": "0..N", - "x-etsi-mec-origin-type": "AccessPointInfo" - }, - "resourceURL": { - "description": "Self referring URL", - "type": "string", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "anyURI" - }, - "zoneId": { - "description": "Identifier of zone", - "type": "string", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "string" - } - }, - "required": [ - "zoneId", - "resourceURL" - ], - "type": "object" - } -} \ No newline at end of file + "description": "A type containing list of access points.", + "properties": { + "accessPoint": { + "description": "Collection of the access point information list.", + "items": { + "description": "A type containing access point information.", + "properties": { + "accessPointId": { + "description": "Identifier of access point.", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "string" + }, + "connectionType": { + "description": "This enumeration represents the connection type of an access point", + "enum": [ + "LTE", + "Wifi", + "Wimax", + "5G NR", + "UNKNOWN" + ], + "type": "string" + }, + "interestRealm": { + "description": "Interest realm of access point.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "string" + }, + "locationInfo": { + "properties": { + "accuracy": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracyAltitude": { + "description": "Altitude accuracy/uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracySemiMinor": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "confidence": { + "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "includedAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "innerRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "offsetAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "orientationMajorAxis": { + "description": "Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "shape": { + "description": "Shape information, as detailed in [14], associated with the reported location coordinate: 1 = Ellipsoid_Arc 2 = ellipsoid_Point 3 = ellipsoid_Point_Altitude 4 = ellipsoid_Point_Altitude_Uncert_Ellipsoid 5 = ellipsoid_Point_Uncert_Circle 6 = ellipsoid_Point_Uncert_Ellipse 7 = polygon", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "uncertaintyRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocity": { + "description": "Structure with attributes relating to the target entity’s velocity, as defined in [14].", + "properties": { + "bearing": { + "description": "Bearing, expressed in the range 0° to 360°, as defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "horizontalSpeed": { + "description": "Horizontal speed, expressed in km/h and defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "uncertainty": { + "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocityType": { + "description": "Velocity information, as detailed in [14], associated with the reported location coordinate: 1 = Horizontal 2 = Horizontal_Vertical 3 = Horizontal_Uncert 4 = Horizontal_Vertical_Uncert", + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "verticalSpeed": { + "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Int" + }, + "verticalUncertainty": { + "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "required": [ + "velocityType", + "bearing", + "horizontalSpeed" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "latitude", + "longitude", + "shape" + ], + "type": "object", + "x-etsi-ref": "6.5.3" + }, + "numberOfUsers": { + "description": "Number of users currently on the access point.", + "type": "integer", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "integer" + }, + "operationStatus": { + "description": "An enumeration defining the operations status of an access point.", + "enum": [ + "Serviceable", + "Unserviceable", + "Unknown" + ], + "type": "string" + }, + "resourceURL": { + "description": "Self referring URL", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "anyURI" + }, + "timezone": { + "description": "Time zone of access point.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "dateTimeStamp" + } + }, + "required": [ + "accessPointId", + "connectionType", + "operationStatus", + "numberOfUsers", + "resourceURL" + ], + "type": "object" + }, + "type": "array", + "x-etsi-mec-cardinality": "0..N", + "x-etsi-mec-origin-type": "AccessPointInfo" + }, + "resourceURL": { + "description": "Self referring URL", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "anyURI" + }, + "zoneId": { + "description": "Identifier of zone", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "string" + } + }, + "required": [ + "zoneId", + "resourceURL" + ], + "type": "object" + } \ No newline at end of file diff --git a/MEC013/SRV/UEAREALOOK/PlatUeAreaLookup.robot b/MEC013/SRV/UEAREALOOK/PlatUeAreaLookup.robot new file mode 100644 index 0000000000000000000000000000000000000000..6d51d584f6b542e753b3e5ba5d83598c325df7d9 --- /dev/null +++ b/MEC013/SRV/UEAREALOOK/PlatUeAreaLookup.robot @@ -0,0 +1,140 @@ +*** Settings *** + +Documentation +... A test suite for validating UE Area Lookup (UEAREALOOK) operations. + +Resource ../../../GenericKeywords.robot +Resource ../../../pics.txt +Resource environment/variables.txt +Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false +Library OperatingSystem +Library String + +Default Tags TC_MEC_SRV_UEAREASUB + + + +*** Test Cases *** +TP_MEC_MEC013_SRV_UEAREALOOK_001_OK_01 + [Documentation] + ... Check that the IUT responds with a list of UE area subscriptions when queried by a MEC Application - No 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.16.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create new subscription and get sub id UserAreaSubscription + Get all Subscriptions + Check HTTP Response Body Json Schema Is NotificationSubscriptionList + Check HTTP Response Status Code Is 200 + Should Be Equal As Strings ${response['body']['subscription'][0]['subscriptionType']} UserAreaSubscription + [TearDown] Remove subscription ${SUB_ID} + + +TP_MEC_MEC013_SRV_UEAREALOOK_001_OK_02 + [Documentation] + ... Check that the IUT responds with a list of UE area subscriptions when queried by a MEC Application - No filter + ... + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.2 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.16.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create new subscription and get sub id UserAreaSubscription + Get all Subscriptions with filter ${SUB_TYPE_FILTER} + Check HTTP Response Body Json Schema Is NotificationSubscriptionList + Check HTTP Response Status Code Is 200 + Should Be Equal As Strings ${response['body']['subscription'][0]['subscriptionType']} UserAreaSubscription + [TearDown] Remove subscription ${SUB_ID} + + +TP_MEC_MEC013_SRV_UEAREALOOK_002_OK + [Documentation] + ... Check that the IUT acknowledges the change of UE area subscription request + ... when commanded by a MEC Application + ... + ... Reference ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.17.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create new subscription and get sub id UserAreaSubscription + Get specific Subscription ${SUB_ID} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is UserAreaNotification + Should be Equal ${response['body']['notificationType']} UserAreaNotification + [TearDown] Remove subscription ${SUB_ID} + + +TP_MEC_MEC013_SRV_UEAREALOOK_002_NF + [Documentation] + ... Check that the IUT responds with an error + ... when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application + ... + ... Reference ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.17.3.1 + + [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]} + + +Get all Subscriptions + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get specific Subscription + [Arguments] ${subscriptionId} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area/${subscriptionId} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get all Subscriptions with filter + [Arguments] ${filter} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area?subscription_type=${filter} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Create new subscription + [Arguments] ${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} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area ${body} + ${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/area/${subscriptionId} + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/MEC013/SRV/UEAREALOOK/README.md b/MEC013/SRV/UEAREALOOK/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/MEC013/SRV/UEAREALOOK/environment/variables.txt b/MEC013/SRV/UEAREALOOK/environment/variables.txt new file mode 100644 index 0000000000000000000000000000000000000000..1956375a166b73927cc7afff63d7eb7e7d2c2438 --- /dev/null +++ b/MEC013/SRV/UEAREALOOK/environment/variables.txt @@ -0,0 +1,14 @@ +*** Variables *** +# Generic variables +${SCHEMA} http +${HOST} 127.0.0.1 +${PORT} 8081 +${response} {} +${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l +${apiRoot} +${apiName} location +${apiVersion} v3 + +${SUB_TYPE_FILTER} event +${SUB_TYPE_FILTER_ERROR} dummy +${NON_EXISTING_SUBSCRIPTION_ID} NON_EXISTING_SUBSCRIPTION_ID \ No newline at end of file diff --git a/MEC013/SRV/UEAREALOOK/jsons/UserAreaSubscription.json b/MEC013/SRV/UEAREALOOK/jsons/UserAreaSubscription.json new file mode 100644 index 0000000000000000000000000000000000000000..aafb8761a60473245b53c644de469ea41a9e76bf --- /dev/null +++ b/MEC013/SRV/UEAREALOOK/jsons/UserAreaSubscription.json @@ -0,0 +1,17 @@ +{ + "subscriptionType": "UserAreaSubscription", + "areaDefine": { + "shape": 1, + "points": [ + { + "latitide": 50, + "longitude": 52 + } + ], + "radius": 100 + }, + "addressList": [ + "http://someuri.com/123" + ], + "trackingAccuracy": 99 +} \ No newline at end of file diff --git a/MEC013/SRV/UEAREALOOK/schemas/NotificationSubscriptionList.schema.json b/MEC013/SRV/UEAREALOOK/schemas/NotificationSubscriptionList.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..4b245317effbe3f5a5e90afcf44f372bba29e50c --- /dev/null +++ b/MEC013/SRV/UEAREALOOK/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/UEAREALOOK/schemas/UserAreaNotification.schema.json b/MEC013/SRV/UEAREALOOK/schemas/UserAreaNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..42d19dea617e06a378a9d0dccdd609ed5685f1f5 --- /dev/null +++ b/MEC013/SRV/UEAREALOOK/schemas/UserAreaNotification.schema.json @@ -0,0 +1,539 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "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-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI).", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + }, + "civicInfo": { + "description": "Indicates a Civic address", + "type": "object", + "required": [ + "country" + ], + "properties": { + "country": { + "description": "The two-letter ISO 3166 country code in capital ASCII letters, e.g., DE or US", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "String" + }, + "A1": { + "description": "National subdivisions (state, canton, region, province, prefecture)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A2": { + "description": "County, parish, gun (JP), district (IN)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A3": { + "description": "City, township, shi (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A4": { + "description": "City division, borough, city district, ward, chou (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A5": { + "description": "Neighbourhood, block", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A6": { + "description": "Group of streets below the neighbourhood level", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRD": { + "description": "Leading street direction", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POD": { + "description": "Trailing street suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "STS": { + "description": "Street suffix or type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNO": { + "description": "House number", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNS": { + "description": "House number suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LMK": { + "description": "Landmark or vanity address", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LOC": { + "description": "Additional location information", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "NAM": { + "description": "Name (residence and office occupant)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PC": { + "description": "Postal/zip code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "BLD": { + "description": "Building (structure)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "UNIT": { + "description": "Unit (apartment, suite)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "FLR": { + "description": "Floor", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ROOM": { + "description": "Room", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PLC": { + "description": "Place-type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PCN": { + "description": "Postal community name", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POBOX": { + "description": "Post office box (P.O. box)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ADDCODE": { + "description": "Additional code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "SEAT": { + "description": "Seat (desk, cubicle, workstation)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RD": { + "description": "Primary road or street", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSEC": { + "description": "Road clause", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDBR": { + "description": "Road branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSUBBR": { + "description": "Road sub-branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRM": { + "description": "Road pre-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POM": { + "description": "Road post-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "usageRules": { + "description": "When present, this IE shall carry the value of \"usagerules\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "method": { + "description": "When present, this IE shall contain the method token, carried by the \"method\" Element of the PIDLLO XML document.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "providedBy": { + "description": "When present, this IE shall carry the value of \"provided-by\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + } + }, + "locationInfo": { + "properties": { + "accuracy": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracyAltitude": { + "description": "Altitude accuracy/uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracySemiMinor": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "confidence": { + "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "includedAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "innerRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "offsetAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "orientationMajorAxis": { + "description": "Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "shape": { + "description": "Shape information, as detailed in [14], associated with the reported location coordinate: 1 = Ellipsoid_Arc 2 = ellipsoid_Point 3 = ellipsoid_Point_Altitude 4 = ellipsoid_Point_Altitude_Uncert_Ellipsoid 5 = ellipsoid_Point_Uncert_Circle 6 = ellipsoid_Point_Uncert_Ellipse 7 = polygon", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "uncertaintyRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocity": { + "description": "Structure with attributes relating to the target entity’s velocity, as defined in [14].", + "properties": { + "bearing": { + "description": "Bearing, expressed in the range 0° to 360°, as defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "horizontalSpeed": { + "description": "Horizontal speed, expressed in km/h and defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "uncertainty": { + "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocityType": { + "description": "Velocity information, as detailed in [14], associated with the reported location coordinate: 1 = Horizontal 2 = Horizontal_Vertical 3 = Horizontal_Uncert 4 = Horizontal_Vertical_Uncert", + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "verticalSpeed": { + "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Int" + }, + "verticalUncertainty": { + "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "required": [ + "velocityType", + "bearing", + "horizontalSpeed" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "latitude", + "longitude", + "shape" + ], + "type": "object", + "x-etsi-ref": "6.5.3" + }, + "notificationType": { + "description": "Shall be set to \"UserAreaNotification\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "relativeLocationInfo": { + "properties": { + "X": { + "description": "Indicates the value (in the unit of meters) on x-axis of the relative location in the Cartesian system. Positive value represents easting from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Y": { + "description": "Indicates the value (in the unit of meters) on y-axis of the relative location in the Cartesian system. Positive value represents northing from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Z": { + "description": "Indicates the value (in the unit of meters) on z-axis of the relative location in the Cartesian system for a 3DPoint. Positive value represents height above origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "mapInfo": { + "properties": { + "ancillaryMapInfo": { + "description": "Ancillary map information may be used to convert coordinates between different coordinate systems.", + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Not_specified" + }, + "mapId": { + "description": "Indicates the ID of the map. ", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "origin": { + "description": "Indicates the location of the map origin in the local Cartesian coordinate system.", + "properties": { + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + } + }, + "required": [ + "latitude", + "longitude" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure(inlined)" + } + }, + "required": [ + "mapId" + ], + "type": "object", + "x-etsi-ref": "6.2.4" + } + }, + "required": [ + "mapInfo", + "X", + "Y" + ], + "type": "object", + "x-etsi-ref": "6.2.3" + }, + "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": "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" + }, + "userLocationEvent": { + "description": "This type represents specified event types for UE location report.", + "enum": [ + "ENTERING_AREA_EVENT", + "LEAVING_AREA_EVENT" + ], + "type": "string" + } + }, + "required": [ + "notificationType", + "address", + "userLocationEvent", + "_links" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAs specified in [17], clause 6.1.6.2.14.\nNOTE 2:\tAt least one of these attributes shall be present only when reportingLocationReq is set to TRUE in the UserAreaSubscription.", + "x-etsi-ref": "6.4.8" +} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/PlatUeAreaSubscription.robot b/MEC013/SRV/UEAREASUB/PlatUeAreaSubscription.robot index 35eb1170e9699033bb5d03b61549fdac01096631..78baa86e9e94543e848c79736d9362dcc452ab18 100644 --- a/MEC013/SRV/UEAREASUB/PlatUeAreaSubscription.robot +++ b/MEC013/SRV/UEAREASUB/PlatUeAreaSubscription.robot @@ -6,9 +6,10 @@ Documentation Resource ../../../GenericKeywords.robot Resource ../../../pics.txt Resource environment/variables.txt +Library libraries/Server.py Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false Library OperatingSystem - +Library String Default Tags TC_MEC_SRV_UEAREASUB @@ -16,58 +17,73 @@ Default Tags TC_MEC_SRV_UEAREASUB *** Test Cases *** TC_MEC_MEC013_SRV_UEAREASUB_001_OK [Documentation] - ... Check that the IUT acknowledges the UE area change subscription request when - ... commanded by a MEC Application and notifies it when the UE enters the specified circle - ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.11 - ... OpenAPI # TODO check this - - [Tags] PIC_MEC_PLAT PIC_SERVICES INCLUDE_UNDEFINED_SCHEMAS - Create new subscription CircleNotificationSubscription + ... Check that the IUT acknowledges the creation of UE area subscription request when commanded by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.11 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.16.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create new subscription UserAreaNotification Check HTTP Response Status Code Is 201 - Check HTTP Response Body Json Schema Is CircleNotificationSubscription - Should Be Equal As Strings ${response['body']['circleNotificationSubscription']['callbackReference']} ${APP_UEAREASUB_CALLBACK_URI} - Should Be Equal As Strings ${response['body']['circleNotificationSubscription']['address']} ${IP_ADDRESS} - + Check HTTP Response Body Json Schema Is UserAreaNotification + Should Be Equal As Strings ${response['body']['notificationType']} UserAreaNotification + Spawn Notification Server UserAreaNotification + Validate Json UserAreaNotification.schema.json ${payload_notification} + TC_MEC_MEC013_SRV_UEAREASUB_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 013 V2.1.1, clause 7.3.11 + ... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application - + ... Neither callbackReference nor websockNotifConfig provided + ... Reference ETSI GS MEC 013 3.1.1 Clause 5.3.11 + ... ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.16.3.4 [Tags] PIC_MEC_PLAT PIC_SERVICES - Create new subscription CircleNotificationSubscriptionError + Create new subscription UserAreaNotificationError Check HTTP Response Status Code Is 400 TC_MEC_MEC013_SRV_UEAREASUB_002_OK [Documentation] - ... Check that the IUT acknowledges the cancellation of UE area change notifications - ... when commanded by a MEC Application - ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.6 - - [Tags] PIC_MEC_PLAT PIC_SERVICES - Remove subscription ${SUBSCRIPTION_ID} - Check HTTP Response Status Code Is 204 + ... Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.17.3.2 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Create new subscription and get sub id UserAreaNotification + Update subscription ${SUB_ID} UserAreaNotificationUpdate + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is UserAreaNotification + Should Be Equal As Strings ${response['body']['notificationType']} UserAreaNotification + [TearDown] Remove subscription ${SUB_ID} + TC_MEC_MEC013_SRV_UEAREASUB_002_NF [Documentation] - ... Check that the IUT responds with an error when - ... a request sent by a MEC Application doesn't comply with a required condition - ... - ... Reference ETSI GS MEC 013 V2.1.1, clause 7.3.6 - - [Tags] PIC_MEC_PLAT PIC_SERVICES - Remove subscription ${NON_EXISTENT_SUBSCRIPTION_ID} + ... Check that the IUT acknowledges the change of UE area subscription request when commanded by a MEC Application + ... Reference ETSI GS MEC 013 3.1.1 Clause 6.3.8 + ... ETSI GS MEC 013 3.1.1 Clause 6.4.8 + ... ETSI GS MEC 013 3.1.1 Clause 7.17.3.2 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + [Setup] Remove subscription ${NON_EXISTING_SUBSCRIPTION_ID} + Update subscription ${NON_EXISTING_SUBSCRIPTION_ID} UserAreaNotificationUpdate 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"} @@ -75,14 +91,30 @@ Create new subscription Set Headers {"Authorization":"${TOKEN}"} ${file}= Catenate SEPARATOR= jsons/ ${content} .json ${body}= Get File ${file} - Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area/circle ${body} + Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area ${body} ${output}= Output response Set Suite Variable ${response} ${output} - + +Update subscription + [Arguments] ${subscription_id} ${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}/subscriptions/area/${subscription_id} ${body} + ${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/area/circle/${subscriptionId} + Delete ${apiRoot}/${apiName}/${apiVersion}/subscriptions/area/${subscriptionId} ${output}= Output response Set Suite Variable ${response} ${output} + +Spawn Notification Server + [Arguments] ${payload_notification} + ${output} Spawn Web Server ${NOTIFICATION_SERVER_IP} ${NOTIFICATION_SERVER_PORT} ${NOTIFICATION_SERVER_TIMEOUT} ${NOTIFICATION_SERVER_HTTP_METHOD} ${NOTIFICATION_SERVER_URI} ${payload_notification} + Set Suite Variable ${payload_notification} ${output} diff --git a/MEC013/SRV/UEAREASUB/environment/variables.txt b/MEC013/SRV/UEAREASUB/environment/variables.txt index ffb1ccff26b9014d49edd028fc99599375b69fff..f9812b80c0b21a468b1f417fb258d79dea6e51b7 100644 --- a/MEC013/SRV/UEAREASUB/environment/variables.txt +++ b/MEC013/SRV/UEAREASUB/environment/variables.txt @@ -1,18 +1,22 @@ *** 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 + +##Notification Server variables +${NOTIFICATION_SERVER_IP} 127.0.0.1 +${NOTIFICATION_SERVER_PORT} 8888 +${NOTIFICATION_SERVER_HTTP_METHOD} POST +${NOTIFICATION_SERVER_URI} /callback_url +${NOTIFICATION_SERVER_TIMEOUT} 5 +${SUB_ID} +${NON_EXISTING_SUBSCRIPTION_ID} NON_EXISTING_SUBSCRIPTION_ID + -# Specific variables -${UEAREASUB_CLIENT_ID} 0123 -${APP_UEAREASUB_CALLBACK_URI} {"callbackData": "1234", "notifyURL": "http://application.example.com/notifications/distance_notifications/123456"} -${IP_ADDRESS} acr:10.0.0.1 -${SUBSCRIPTION_ID} e0deee2b-6e50-4f33-ab09-8bf0585025d3 -${NON_EXISTENT_SUBSCRIPTION_ID} NON_EXISTENT_SUBSCRIPTION_ID \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscription.json b/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscription.json deleted file mode 100644 index 17b185bf2813579d602252751c22af5b74bb6d3d..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscription.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "circleNotificationSubscription": { - "clientCorrelator": "0123", - "callbackReference": { - "callbackData": "1234", - "notifyURL": "http://clientApp.example.com/location_notifications/123456" - }, - "address": "acr:10.0.0.1", - "checkImmediate": true, - "enteringLeavingCriteria": "Entering", - "frequency": 10, - "latitude": -80.88, - "longitude": 41.277, - "radius": 500, - "trackingAccuracy": 10 - } -} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscriptionError.json b/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscriptionError.json deleted file mode 100644 index 337880370f87affc6fe003a5848e47eabc7d5691..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEAREASUB/jsons/CircleNotificationSubscriptionError.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "circleNotificationSubscription": { - "clientCorrelator": "0123", - "callback": { - "callbackData": "1234", - "notifyURL": "http://clientApp.example.com/location_notifications/123456" - }, - "address": "acr:10.0.0.1", - "checkImmediate": true, - "enteringLeavingCriteria": "Entering", - "frequency": 10, - "latitude": -80.88, - "longitude": 41.277, - "radius": 500, - "trackingAccuracy": 10 - } -} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/jsons/UserAreaNotification.json b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotification.json new file mode 100644 index 0000000000000000000000000000000000000000..21d73f3e205c839d5eb5d40baa22d7822e208e1d --- /dev/null +++ b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotification.json @@ -0,0 +1,12 @@ +{ + "notificationType": "UserAreaNotification", + "callbackReference":"127.0.0.1:8888/callback_uri", + "address": "http://someuri.com/123", + "civicInfo": { + "country": "A1" + }, + "userLocationEvent": "ENTERING_AREA_EVENT", + "_links": { + "subscription": "someuri" + } +} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationError.json b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationError.json new file mode 100644 index 0000000000000000000000000000000000000000..0100ceddaf246dc843a67e0a32675951b0ee716c --- /dev/null +++ b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationError.json @@ -0,0 +1,11 @@ +{ + "notificationType": "UserAreaNotification", + "address": "http://someuri.com/123", + "civicInfo": { + "country": "A1" + }, + "userLocationEvent": "ENTERING_AREA_EVENT", + "_links": { + "subscription": "someuri" + } +} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationUpdate.json b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationUpdate.json new file mode 100644 index 0000000000000000000000000000000000000000..039608def8c30994008648b386fff82941d8cca3 --- /dev/null +++ b/MEC013/SRV/UEAREASUB/jsons/UserAreaNotificationUpdate.json @@ -0,0 +1,22 @@ +{ + "notificationType": "UserAreaNotification", + "callbackReference": "127.0.0.1:8888/callback_uri", + "addressList": ["acr:10.0.0.1"], + "civicInfo": { + "country": "A1" + }, + "userLocationEvent": "ENTERING_AREA_EVENT", + "_links": { + "subscription": "someuri" + }, + "areaDefine": { + "shape": 1, + "points": [ + { + "latitude": -80.86302, + "longitude": 41.277306 + } + ], + "radius": 500 + } +} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/libraries/Server.py b/MEC013/SRV/UEAREASUB/libraries/Server.py new file mode 100644 index 0000000000000000000000000000000000000000..c983c3b78a770fa8b41bb3976ebbd5543d739337 --- /dev/null +++ b/MEC013/SRV/UEAREASUB/libraries/Server.py @@ -0,0 +1,144 @@ +#!/usr/bin/python3 + +from http.server import BaseHTTPRequestHandler, HTTPServer +import json, os +import logging + +# Library version +__version__ = '0.0.1' + +def import_notification_json(subscription_type): + notification_type = subscription_type.split("Subscription")[0] + file_path = "./jsons/"+notification_type+".json" + logging.info(file_path) + logging.info(os.listdir()) + try: + with open(file_path, 'r') as json_file: + # Load the JSON data + data = json.load(json_file) + logging.info(data) + return data + except FileNotFoundError: + logging.error(f"Error: File not found at {file_path}") + + +class Server ( object ): + + ROBOT_LIBRARY_VERSION = '0.0.1' + + def spawn_web_server (self, host="127.0.0.1", port=8080, timeout=15, method="POST", endpoint="/callback_url", resp_body=None): + + class GET_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_GET(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + class POST_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + self.req_body = None + + + def do_POST(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + + #if self.path == self.endpoint: + # self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + #else: + # self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + content_len = int(self.headers.get('Content-Length')) + post_body = self.rfile.read(content_len) + self.req_body=post_body + + def get_req_body(self): + return self.req_body + + def get_resp_body(self): + return self.resp_body + + + class PUT_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_PUT(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + class DELETE_Server(BaseHTTPRequestHandler): + + def __call__(self, *args, **kwargs): + """Handle a request.""" + super().__init__(*args, **kwargs) + + def __init__(self, endpoint, resp_body): + self.resp_body = resp_body + self.endpoint = endpoint + + def do_DELETE(self): + self.send_response(200) + self.send_header('Content-Type', 'application/json') + self.end_headers() + if self.path == self.endpoint: + self.wfile.write(json.dumps(self.resp_body).encode(encoding='utf_8')) + else: + self.wfile.write(json.dumps("wrong endpoint").encode(encoding='utf_8')) + + if method == "GET": + self.handler = GET_Server(endpoint, resp_body) + elif method == "POST": + self.handler = POST_Server(endpoint, resp_body) + elif method == "PUT": + self.handler = PUT_Server(endpoint, resp_body) + elif method == "DELETE": + self.handler = DELETE_Server(endpoint, resp_body) + else: + logging.info("Error, unknown endpoint") + exit(1) + + self.app = HTTPServer((host, int(port)), self.handler) + self.app.timeout = int(timeout) + + + self.app.handle_request() + self.app.server_close() + logging.info(self.handler.get_resp_body()) + if(self.handler.get_req_body()!=None): + return json.loads(self.handler.get_req_body().decode("windows-1252")) + notification_json= import_notification_json(self.handler.get_resp_body()) + return notification_json + diff --git a/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.json b/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.json deleted file mode 100644 index 84f4a28f6a731357923960954f2c507bef5d4c24..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "type": "object", - "properties": { - "circleNotificationSubscription": { - "description": "A type containing data for notifications, when the area is defined as a circle.", - "properties": { - "address": { - "description": "Address of terminals to monitor (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)", - "items": { - "type": "string" - }, - "type": "array", - "x-etsi-mec-cardinality": "1..N", - "x-etsi-mec-origin-type": "anyURI" - }, - "callbackReference": { - "properties": { - "callbackData": { - "description": "Data the application can register with the server when subscribing to notifications, and that are passed back unchanged in each of the related notifications. These data can be used by the application in the processing of the notification, e.g. for correlation purposes.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "string" - }, - "notificationFormat": { - "enum": [ - "XML", - "JSON" - ], - "type": "string" - }, - "notifyURL": { - "description": "Notify Callback URL", - "type": "string", - "x-etsi-mec-cardinality": "1", - "x-etsi-mec-origin-type": "anyURI" - } - }, - "required": [ - "notifyURL" - ], - "type": "object" - }, - "checkImmediate": { - "description": "Check location immediately after establishing notification.", - "type": "boolean", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-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.", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "string" - }, - "count": { - "description": "Maximum number of notifications per individual address. 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": "int" - }, - "duration": { - "description": "Period of time (in seconds) notifications are provided for. If set to 0 (zero), a default duration time, which is specified by the service policy, will be used. If the parameter is omitted, the notifications will continue until the maximum duration time, which is specified by the service policy, unless the notifications are stopped by deletion of subscription for notifications.", - "type": "integer", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "int" - }, - "enteringLeavingCriteria": { - "enum": [ - "Entering", - "Leaving" - ], - "type": "string" - }, - "frequency": { - "description": "Maximum frequency (in seconds) of notifications per subscription (can also be considered minimum time between notifications).", - "type": "integer", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "int" - }, - "latitude": { - "description": "Latitude of center point.", - "format": "float", - "type": "number", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "float" - }, - "link": { - "description": "Link to other resources that are in relationship with the resource.", - "items": { - "description": "Link to other resources", - "properties": { - "href": { - "description": "URI", - "format": "anyURI", - "type": "string" - }, - "rel": { - "description": "Describes the relationship between the URI and the resource.", - "type": "string" - } - }, - "required": [ - "rel", - "href" - ], - "type": "object" - }, - "type": "array", - "x-etsi-mec-cardinality": "0..N", - "x-etsi-mec-origin-type": "Link" - }, - "longitude": { - "description": "Longitude of center point.", - "format": "float", - "type": "number", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "float" - }, - "radius": { - "description": "Radius circle around center point in meters.", - "format": "float", - "type": "number", - "x-etsi-mec-cardinality": 1, - "x-etsi-mec-origin-type": "float" - }, - "requester": { - "description": "Identifies the entity that is requesting the information (e.g. \"sip\" URI, \"tel\" URI, \"acr\" URI)", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "anyURI" - }, - "resourceURL": { - "description": "Self referring URL", - "type": "string", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "anyURI" - }, - "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" - } - }, - "required": [ - "callbackReference", - "address", - "latitude", - "longitude", - "radius", - "trackingAccuracy", - "enteringLeavingCriteria", - "checkImmediate", - "frequency" - ], - "type": "object" - } - }, - "example": { - "circleNotificationSubscription": { - "clientCorrelator": "0123", - "callbackReference": { - "callbackData": "1234", - "notifyURL": "http://clientApp.example.com/location_notifications/123456" - }, - "address": "acr:10.0.0.1", - "checkImmediate": true, - "enteringLeavingCriteria": "Entering", - "frequency": 10, - "latitude": -80.88, - "longitude": 41.277, - "radius": 500, - "trackingAccuracy": 10 - } - } -} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.v1.1.1.json b/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.v1.1.1.json deleted file mode 100644 index 6b745ec421507748b6cdc299bf4a8c31d4ede14d..0000000000000000000000000000000000000000 --- a/MEC013/SRV/UEAREASUB/schemas/CircleNotificationSubscription.schema.v1.1.1.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "definitions": {}, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://example.com/root.json", - "type": "object", - "title": "The Root Schema", - "required": [ - "address", - "callbackReference", - "checkImmediate", - "clientCorrelator", - "enteringLeavingCriteria", - "frequency", - "latitude", - "longitude", - "radius", - "trackingAccuracy" - ], - "properties": { - "address": { - "$id": "#/properties/address", - "type": "string", - "title": "The Address Schema", - "default": "", - "examples": [ - "acr:10.0.0.1" - ], - "pattern": "^(.*)$" - }, - "callbackReference": { - "$id": "#/properties/callbackReference", - "type": "object", - "title": "The Callbackreference Schema", - "required": [ - "callbackData", - "notifyURL" - ], - "properties": { - "callbackData": { - "$id": "#/properties/callbackReference/properties/callbackData", - "type": "string", - "title": "The Callbackdata Schema", - "default": "", - "examples": [ - "1234" - ], - "pattern": "^(.*)$" - }, - "notifyURL": { - "$id": "#/properties/callbackReference/properties/notifyURL", - "type": "string", - "title": "The Notifyurl Schema", - "default": "", - "examples": [ - "http://application.example.com/notifications/distance_notifications/123456" - ], - "pattern": "^(.*)$" - } - } - }, - "checkImmediate": { - "$id": "#/properties/checkImmediate", - "type": "string", - "title": "The Checkimmediate Schema", - "default": "", - "examples": [ - "true" - ], - "pattern": "^(.*)$" - }, - "clientCorrelator": { - "$id": "#/properties/clientCorrelator", - "type": "string", - "title": "The Clientcorrelator Schema", - "default": "", - "examples": [ - "0123" - ], - "pattern": "^(.*)$" - }, - "enteringLeavingCriteria": { - "$id": "#/properties/enteringLeavingCriteria", - "type": "string", - "title": "The Enteringleavingcriteria Schema", - "default": "", - "examples": [ - "Entering" - ], - "pattern": "^(.*)$" - }, - "frequency": { - "$id": "#/properties/frequency", - "type": "string", - "title": "The Frequency Schema", - "default": "", - "examples": [ - "10" - ], - "pattern": "^(.*)$" - }, - "latitude": { - "$id": "#/properties/latitude", - "type": "string", - "title": "The Latitude Schema", - "default": "", - "examples": [ - "-80.86302" - ], - "pattern": "^(.*)$" - }, - "longitude": { - "$id": "#/properties/longitude", - "type": "string", - "title": "The Longitude Schema", - "default": "", - "examples": [ - "41.277306" - ], - "pattern": "^(.*)$" - }, - "radius": { - "$id": "#/properties/radius", - "type": "string", - "title": "The Radius Schema", - "default": "", - "examples": [ - "500" - ], - "pattern": "^(.*)$" - }, - "trackingAccuracy": { - "$id": "#/properties/trackingAccuracy", - "type": "string", - "title": "The Trackingaccuracy Schema", - "default": "", - "examples": [ - "10" - ], - "pattern": "^(.*)$" - } - } -} \ No newline at end of file diff --git a/MEC013/SRV/UEAREASUB/schemas/UserAreaNotification.schema.json b/MEC013/SRV/UEAREASUB/schemas/UserAreaNotification.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..ea82b65679385ff09ab2a7eb95f9e06527f67b1e --- /dev/null +++ b/MEC013/SRV/UEAREASUB/schemas/UserAreaNotification.schema.json @@ -0,0 +1,539 @@ +{ + "properties": { + "_links": { + "description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.", + "properties": { + "subscription": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + } + }, + "required": [ + "subscription" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + }, + "address": { + "description": "Address of user (e.g. ‘sip’ URI, ‘tel’ URI, ‘acr’ URI).", + "format": "uri", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Uri" + }, + "civicInfo": { + "description": "Indicates a Civic address", + "type": "object", + "required": [ + "country" + ], + "properties": { + "country": { + "description": "The two-letter ISO 3166 country code in capital ASCII letters, e.g., DE or US", + "type": "string", + "x-etsi-mec-cardinality": 1, + "x-etsi-mec-origin-type": "String" + }, + "A1": { + "description": "National subdivisions (state, canton, region, province, prefecture)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A2": { + "description": "County, parish, gun (JP), district (IN)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A3": { + "description": "City, township, shi (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A4": { + "description": "City division, borough, city district, ward, chou (JP)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A5": { + "description": "Neighbourhood, block", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "A6": { + "description": "Group of streets below the neighbourhood level", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRD": { + "description": "Leading street direction", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POD": { + "description": "Trailing street suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "STS": { + "description": "Street suffix or type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNO": { + "description": "House number", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "HNS": { + "description": "House number suffix", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LMK": { + "description": "Landmark or vanity address", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "LOC": { + "description": "Additional location information", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "NAM": { + "description": "Name (residence and office occupant)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PC": { + "description": "Postal/zip code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "BLD": { + "description": "Building (structure)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "UNIT": { + "description": "Unit (apartment, suite)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "FLR": { + "description": "Floor", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ROOM": { + "description": "Room", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PLC": { + "description": "Place-type", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PCN": { + "description": "Postal community name", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POBOX": { + "description": "Post office box (P.O. box)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "ADDCODE": { + "description": "Additional code", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "SEAT": { + "description": "Seat (desk, cubicle, workstation)", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RD": { + "description": "Primary road or street", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSEC": { + "description": "Road clause", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDBR": { + "description": "Road branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "RDSUBBR": { + "description": "Road sub-branch", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "PRM": { + "description": "Road pre-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "POM": { + "description": "Road post-modifier", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "usageRules": { + "description": "When present, this IE shall carry the value of \"usagerules\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "method": { + "description": "When present, this IE shall contain the method token, carried by the \"method\" Element of the PIDLLO XML document.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "providedBy": { + "description": "When present, this IE shall carry the value of \"provided-by\" Element of the PIDL-LO XML document, with UTF-8 encoding.", + "type": "string", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + } + } + }, + "locationInfo": { + "properties": { + "accuracy": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracyAltitude": { + "description": "Altitude accuracy/uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "accuracySemiMinor": { + "description": "Horizontal accuracy/(semi-major) uncertainty of location provided in meters, as defined in [14]. Present only if \"shape\" equals 4, 5 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "confidence": { + "description": "Confidence by which the position of a target entity is known to be within the shape description, expressed as a percentage and defined in [14]. Present only if \"shape\" equals 1, 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "includedAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "innerRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°. Cardinality greater than one only if \"shape\" equals 7.", + "format": "float", + "items": { + "type": "number" + }, + "minItems": 1, + "type": "array", + "x-etsi-mec-cardinality": "1..N", + "x-etsi-mec-origin-type": "Float" + }, + "offsetAngle": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "orientationMajorAxis": { + "description": "Angle of orientation of the major axis, expressed in the range 0° to 180°, as defined in [14]. Present only if \"shape\" equals 4 or 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "shape": { + "description": "Shape information, as detailed in [14], associated with the reported location coordinate: 1 = Ellipsoid_Arc 2 = ellipsoid_Point 3 = ellipsoid_Point_Altitude 4 = ellipsoid_Point_Altitude_Uncert_Ellipsoid 5 = ellipsoid_Point_Uncert_Circle 6 = ellipsoid_Point_Uncert_Ellipse 7 = polygon", + "enum": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "uncertaintyRadius": { + "description": "Present only if \"shape\" equals 6.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocity": { + "description": "Structure with attributes relating to the target entity’s velocity, as defined in [14].", + "properties": { + "bearing": { + "description": "Bearing, expressed in the range 0° to 360°, as defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "horizontalSpeed": { + "description": "Horizontal speed, expressed in km/h and defined in [14].", + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "uncertainty": { + "description": "Horizontal uncertainty, as defined in [14]. Present only if \"velocityType\" equals 3 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + }, + "velocityType": { + "description": "Velocity information, as detailed in [14], associated with the reported location coordinate: 1 = Horizontal 2 = Horizontal_Vertical 3 = Horizontal_Uncert 4 = Horizontal_Vertical_Uncert", + "enum": [ + 1, + 2, + 3, + 4 + ], + "type": "integer", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Enum_inlined" + }, + "verticalSpeed": { + "description": "Vertical speed, expressed in km/h and defined in [14]. Present only if \"velocityType\" equals 2 or 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Int" + }, + "verticalUncertainty": { + "description": "Vertical uncertainty, as defined in [14]. Present only if \"velocityType\" equals 4.", + "type": "integer", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "UnsignedInt" + } + }, + "required": [ + "velocityType", + "bearing", + "horizontalSpeed" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure (inlined)" + } + }, + "required": [ + "latitude", + "longitude", + "shape" + ], + "type": "object", + "x-etsi-ref": "6.5.3" + }, + "notificationType": { + "description": "Shall be set to \"UserAreaNotification\".", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "relativeLocationInfo": { + "properties": { + "X": { + "description": "Indicates the value (in the unit of meters) on x-axis of the relative location in the Cartesian system. Positive value represents easting from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Y": { + "description": "Indicates the value (in the unit of meters) on y-axis of the relative location in the Cartesian system. Positive value represents northing from origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "Z": { + "description": "Indicates the value (in the unit of meters) on z-axis of the relative location in the Cartesian system for a 3DPoint. Positive value represents height above origin.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "mapInfo": { + "properties": { + "ancillaryMapInfo": { + "description": "Ancillary map information may be used to convert coordinates between different coordinate systems.", + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Not_specified" + }, + "mapId": { + "description": "Indicates the ID of the map. ", + "type": "string", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "String" + }, + "origin": { + "description": "Indicates the location of the map origin in the local Cartesian coordinate system.", + "properties": { + "altitude": { + "description": "Location altitude relative to the WGS84 ellipsoid surface.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Float" + }, + "latitude": { + "description": "Location latitude, expressed in the range -90° to +90°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + }, + "longitude": { + "description": "Location longitude, expressed in the range -180° to +180°.", + "format": "float", + "type": "number", + "x-etsi-mec-cardinality": "1", + "x-etsi-mec-origin-type": "Float" + } + }, + "required": [ + "latitude", + "longitude" + ], + "type": "object", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "Structure(inlined)" + } + }, + "required": [ + "mapId" + ], + "type": "object", + "x-etsi-ref": "6.2.4" + } + }, + "required": [ + "mapInfo", + "X", + "Y" + ], + "type": "object", + "x-etsi-ref": "6.2.3" + }, + "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": "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" + }, + "userLocationEvent": { + "description": "This type represents specified event types for UE location report.", + "enum": [ + "ENTERING_AREA_EVENT", + "LEAVING_AREA_EVENT" + ], + "type": "string" + } + }, + "required": [ + "notificationType", + "address", + "userLocationEvent", + "_links" + ], + "type": "object", + "x-etsi-notes": "NOTE 1:\tAs specified in [17], clause 6.1.6.2.14.\nNOTE 2:\tAt least one of these attributes shall be present only when reportingLocationReq is set to TRUE in the UserAreaSubscription.", + "x-etsi-ref": "6.4.8" +} \ No newline at end of file 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