Commit 4844af41 authored by piscione's avatar piscione
Browse files

MEC013 v3.1.1 UEDISTLOOK Draft TCs avaialable.

parent c84c6078
Loading
Loading
Loading
Loading
+102 −17
Original line number Diff line number Diff line
@@ -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 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  
    [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 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]    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}
    
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
    Check HTTP Response Status Code Is    400
+6 −2
Original line number Diff line number Diff line
*** 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
+18 −0
Original line number Diff line number Diff line
{
                    "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
+55 −0
Original line number Diff line number Diff line
{
        "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
+0 −50
Original line number Diff line number Diff line
{
	"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
Loading