Commit 1ab59ce8 authored by piscione's avatar piscione
Browse files

MEC013 v3.1.1 UELOCLOOK Draft TCs available

parent 2a1b5bc0
Loading
Loading
Loading
Loading
+195 −41
Original line number Diff line number Diff line
@@ -8,90 +8,244 @@ Resource ../../../pics.txt
Resource    environment/variables.txt
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem 

Library     String
Default Tags    TC_MEC_SRV_UELOCLOOK

*** Variables ***
${response}

*** Test Cases ***

TC_MEC_MEC013_SRV_UELOCLOOK_001_OK
    [Documentation]
    ...    Check that the IUT responds with a list for the location of User Equipments 
    ...    when queried by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.3
    ...    OpenAPI    https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/UserInfo
    ...    Reference  ETSI GS MEC 013 3.1.1, clause 5.3.2,
    ...    ETSI GS MEC 013 3.1.1, clause 7.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Setup]   Create a subscription and get sub id    UserLocationEventSubscription
    Get subscriptions
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    NotificationSubscriptionList
    [TearDown]   Remove subscription    ${SUB_ID}



TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_01
    [Documentation]
    ...    Check that the IUT responds with the subscription 
    ...    when queried by a MEC Application - UE location Event
    ...
    ...    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.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get list of user equipments    zoneId    ${ZONE_ID}
    [Setup]   Create multiple subscriptions and get sub ids    UserLocationEventSubscription    UserLocationPeriodicSubscription
    Get subscriptions with filter    subscription_type     event
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    UserList
    Check Result Contains    ${response['body']['userList']['user']}    zoneId    ${ZONE_ID}
    Should be Equal   ${response['body']['subscription'][0]['subscriptionType']}    UserLocationEventSubscription
    Check HTTP Response Body Json Schema Is    NotificationSubscriptionList
    [TearDown]   Remove subscriptions    ${SUB_ID_01}   ${SUB_ID_02}



TC_MEC_MEC013_SRV_UELOCLOOK_001_BR
TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_02
    [Documentation]
    ...    Check that the IUT responds with the subscription 
    ...    when queried by a MEC Application - UE location Periodic
    ...
    ...    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.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Setup]   Create multiple subscriptions and get sub ids    UserLocationEventSubscription    UserLocationPeriodicSubscription
    Get subscriptions with filter    subscription_type     periodic
    Check HTTP Response Status Code Is    200
    Should be Equal   ${response['body']['subscription'][0]['subscriptionType']}    UserLocationPeriodicSubscription
    Check HTTP Response Body Json Schema Is    NotificationSubscriptionList
    [TearDown]   Remove subscriptions    ${SUB_ID_01}   ${SUB_ID_02}
    



TC_MEC_MEC013_SRV_UELOCLOOK_002_OK_03
    [Documentation]
    ...    Check that the IUT responds with the subscription 
    ...    when queried by a MEC Application - UE location Event and address
    ...
    ...    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.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Setup]   Create multiple subscriptions and get sub ids    UserLocationEventSubscription    UserLocationPeriodicSubscription
    Get subscriptions with filters    subscription_type     event     address     10.0.0.4
    Check HTTP Response Status Code Is    200
    Should be Equal   ${response['body']['subscription'][0]['subscriptionType']}    UserLocationEventSubscription
    Check HTTP Response Body Json Schema Is    NotificationSubscriptionList
    [TearDown]   Remove subscriptions    ${SUB_ID_01}   ${SUB_ID_02}


    
TP_MEC_MEC013_SRV_UELOCLOOK_002_BR
        [Documentation]
    ...  Check that the IUT responds with an error when 
    ...    a request with incorrect parameters is sent by a MEC Application
    ...   inconsistent request was sent by a MEC Application - Invalid filter
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.3
    ...    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.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get list of user equipments    z0n3    ${ZONE_ID}
    [Setup]   Create multiple subscriptions and get sub ids    UserLocationEventSubscription    UserLocationPeriodicSubscription
    Get subscriptions with filter    subscription_type     dummy
    Check HTTP Response Status Code Is    400
    [TearDown]   Remove subscriptions    ${SUB_ID_01}   ${SUB_ID_02}
    
TC_MEC_MEC013_SRV_UELOCLOOK_001_NF


TP_MEC_MEC013_SRV_UELOCLOOK_002_NF
        [Documentation]
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...  Check that the IUT responds with an error 
    ...  when inconsistent request was sent 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.3
    ...    ETSI GS MEC 013 3.1.1, clause 7.5.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Setup]   Create multiple subscriptions and get sub ids    UserLocationEventSubscription    UserLocationPeriodicSubscription
    Get subscriptions
    Check HTTP Response Status Code Is    404
    [TearDown]   Remove subscriptions    ${SUB_ID_01}   ${SUB_ID_02}
    


TP_MEC_MEC013_SRV_UELOCLOOK_003_OK_01
    [Documentation]
    ...    Check that the IUT responds with the subscription 
    ...    when queried by a MEC Application - UE location Event
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.2
    ...    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 6.3.4
    ...    ETSI GS MEC 013 3.1.1 Clause 6.4.4
    ...    ETSI GS MEC 013 3.1.1 Clause 7.6.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get list of user equipments    zoneId    ${NON_EXISTENT_ZONE_ID}
    [Setup]   Create a subscription and get sub id    UserLocationEventSubscription
    Get subscription by identifier   ${SUB_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    UserLocationEventSubscription
    [TearDown]   Remove subscription    ${SUB_ID}
    

TC_MEC_MEC013_SRV_UELOCLOOK_002_OK
TP_MEC_MEC013_SRV_UELOCLOOK_003_OK_02
    [Documentation]
    ...    Check that the IUT responds with a User Equipment information 
    ...    when queried by a MEC Application
    ...    Check that the IUT responds with the subscription when queried by a MEC Application - UE location Periodic
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.2
    ...    OpenAPI    https://forge.etsi.org/gitlab/mec/gs013-location-api/blob/master/LocationAPI.yaml#/definitions/UserInfo
    ...    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 6.3.4
    ...    ETSI GS MEC 013 3.1.1 Clause 6.4.4
    ...    ETSI GS MEC 013 3.1.1 Clause 7.6.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Log    Deprecated
    # Get specific user equipments    ${USER_ID}
    # Check HTTP Response Status Code Is    200
    # Check HTTP Response Body Json Schema Is    UserInfo
    [Setup]   Create a subscription and get sub id    UserLocationPeriodicSubscription
    Get subscription by identifier   ${SUB_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    UserLocationPeriodicSubscription
    [TearDown]   Remove subscription    ${SUB_ID}
    

    
TC_MEC_MEC013_SRV_UELOCLOOK_002_NF
TP_MEC_MEC013_SRV_UELOCLOOK_003_NF
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...    Check that the IUT responds with an error 
    ...    when the non existing subscription is queried by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.2
    ...    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 6.3.4
    ...    ETSI GS MEC 013 3.1.1 Clause 6.4.4
    ...    ETSI GS MEC 013 3.1.1 Clause 7.6.3.1

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Get specific user equipments    ${NON_EXISTENT_USER_ID}
    [Setup]  Remove subscription    ${NON_EXISTING_SUBSCRIPTION_ID}
    Get subscription by identifier   ${NON_EXISTING_SUBSCRIPTION_ID}
    Check HTTP Response Status Code Is    404
    


*** Keywords ***
Get list of user equipments
    [Arguments]    ${key}   ${value}
Create a subscription and get sub id
    [Arguments]    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users   ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    ${elements} =  Split String    ${response['headers']['Location']}       /
    Set Suite Variable    ${SUB_ID}    ${elements[3]}

Create multiple subscriptions and get sub ids
    [Arguments]    ${content}   ${content2}
    Create a subscription and get sub id  ${content}
    Set Suite Variable    ${SUB_ID_01}    ${SUB_ID}
    Create a subscription and get sub id  ${content2}
    Set Suite Variable    ${SUB_ID_02}    ${SUB_ID}


Remove subscriptions 
    [Arguments]    ${subscription_id01}   ${subscription_id02}
    Remove subscription  ${subscription_id01}
    Remove subscription  ${subscription_id02}
    

Remove subscription
    [Arguments]    ${subscription_id}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/queries/users?${key}=${value}
    Set Headers    {"Authorization":"${TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users/${subscription_id}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
  

Get specific user equipments
    [Arguments]    ${userId}
Get subscription by identifier
    [Arguments]    ${subscriptionId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/queries/users/${userId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users/${subscriptionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
  
Get subscriptions
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get subscriptions with filter
    [Arguments]    ${filter_name}    ${filter_value}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users?${filter_name}=${filter_value}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    


Get subscriptions with filters
    [Arguments]    ${filter_name01}    ${filter_value01}    ${filter_name02}    ${filter_value02}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/users?${filter_name01}=${filter_value01}&${filter_name02}=${filter_value02}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
+5 −5
Original line number Diff line number Diff line
*** Variables ***
# Generic variables
${SCHEMA}                   http
${HOST}                     10.30.7.120
${PORT}                     30007
${HOST}                     127.0.0.2
${PORT}                     8081
${response}                         {}
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
${apiRoot}        etsi-013
${apiRoot}        
${apiName}        location
${apiVersion}     v2
${apiVersion}     v3

# Specific variables
${ZONE_ID}                zone1
@@ -15,4 +15,4 @@ ${NON_EXISTENT_ZONE_ID} NON_EXISTENT_ZONE_ID

${USER_ID}                ue1
${NON_EXISTENT_USER_ID}   NON_EXISTENT_USER_ID
${NON_EXISTING_SUBSCRIPTION_ID}   NON_EXISTING_SUBSCRIPTION_ID
+5 −0
Original line number Diff line number Diff line
{
    "subscriptionType": "UserLocationEventSubscription",
    "address": "acr:10.0.0.1",
    "callbackReference": "http://10.3.0.0.8:8888"
}
 No newline at end of file
+8 −0
Original line number Diff line number Diff line
{
    "subscriptionType": "UserLocationPeriodicSubscription",
    "address": "acr:10.0.4.3",
    "periodicEventInfo": {
        "reportingAmount": 10,
        "reportingInterval": 5
    }
}
 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
Loading