Commit c84c6078 authored by piscione's avatar piscione
Browse files

MEC013 v3.1.1 UEAREASUB Draft TCs avaialable.

parent 66494ad4
Loading
Loading
Loading
Loading
+68 −36
Original line number Diff line number Diff line
@@ -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
    ...    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  
    Remove subscription    ${SUBSCRIPTION_ID}
    Check HTTP Response Status Code Is    204
    [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
    ...    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  
    Remove subscription    ${NON_EXISTENT_SUBSCRIPTION_ID}
    [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,7 +91,18 @@ 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}
        
@@ -83,6 +110,11 @@ 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}
+12 −8
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

##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
+0 −17
Original line number Diff line number Diff line
{
  "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
+0 −17
Original line number Diff line number Diff line
{
  "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
+12 −0
Original line number Diff line number Diff line
{
    "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
Loading