Commit 2de4eb8e authored by Gabriele Scivoletto's avatar Gabriele Scivoletto
Browse files

Merge branch 'TTF_T027' of https://forge.etsi.org/rep/mec/gs032p3-robot-test-suite into TTF_T027

parents 6e560432 6ff2d981
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ TC_MEC_MEC012_SRV_RNIS_001_OK
    ...  service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.2
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    [Setup]  Send a request for a subscription    CellChangeSubscriptionRequest
    [Setup]  Send a request for a subscription    CellChangeSubscription
    Spawn Notification Server     CellChangeNotification    
    Validate Json   CellChangeNotification.schema.json    ${payload_notification}
    [TearDown]   Delete subscription   ${SUB_ID} 
@@ -157,8 +157,6 @@ Delete subscription
    ${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} 
+0 −165
Original line number Diff line number Diff line
''[Documentation]   robot --outputdir ../../outputs ./RnisNotifications_BV.robot
...    Test Suite to validate RNIS/Notification (RNIS) operations.

*** Settings ***

Resource     environment/variables.txt
Resource     ../../../pics.txt
Resource     ../../../GenericKeywords.robot
Library      libraries/Server.py
Library      REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library      BuiltIn
Library      OperatingSystem
Library      Collections
Library      String


*** Test Cases ***
TC_MEC_MEC012_SRV_RNIS_001_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about cell change if the RNIS 
    ...  service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.2
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    CellChangeSubscriptionRequest
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url        CellChangeNotification    
    Validate Json   CellChangeNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 

TC_MEC_MEC012_SRV_RNIS_002_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about RAB establishment 
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.3
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    RabEstSubscriptionRequest
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url         RabEstNotification
    Validate Json   RabEstNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 
    


TC_MEC_MEC012_SRV_RNIS_003_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about RAB modification 
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.4
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    RabModSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url      RabModNotification
    Validate Json   RabModNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 
    
    
TC_MEC_MEC012_SRV_RNIS_004_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about RAB release 
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.5
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    RabRelSubscription
    Spawn Notification Server  10.30.8.189  8888  5  POST  /callback_url      RabRelNotification
    Validate Json   RabRelNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 
        

TC_MEC_MEC012_SRV_RNIS_005_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about UE measurement report 
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.6
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    MeasRepUeSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url        MeasRepUeNotification
    Validate Json   MeasRepUeNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 

TC_MEC_MEC012_SRV_RNIS_006_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about UE timing advance  
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.7
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    MeasTaSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url        MeasTaNotification
    Validate Json   MeasTaNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 
    

TC_MEC_MEC012_SRV_RNIS_007_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about UE carrier aggregation reconfiguration   
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.8
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    CaReconfSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url     CaReconfNotification
    Validate Json   CaReconfNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 


TC_MEC_MEC012_SRV_RNIS_008_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about S1-U bearer   
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.10
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    S1BearerSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url          S1BearerNotification
    Validate Json   S1BearerNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 


TC_MEC_MEC012_SRV_RNIS_009_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about 5G NR UE measurement report
    ...  if the RNIS service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.11
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    NrMeasRepUeSubscription
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url      NrMeasRepUeNotification
    Validate Json   NrMeasRepUeNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 

TC_MEC_MEC012_SRV_RNIS_010_OK
    [Documentation]   
    ...  Check that the RNIS service sends an RNIS notification about cell change if the RNIS 
    ...  service has an associated subscription and the event is generated
    ...  ETSI GS MEC 012 2.2.1, clause 6.4.2
    Should Be True    ${PIC_RNIS_NOTIFICATIONS} == 1
    #[Setup]  Send a request for a subscription    CellChangeSubscriptionRequestWithExpiration
    Spawn Notification Server  10.30.8.189  8888  ${NOTIFICATION_SERVER_TIMEOUT}  POST  /callback_url        ExpiryNotification
    Validate Json   ExpiryNotification.schema.json    ${payload_notification}
    #[TearDown]   Delete subscription   ${SUB_ID} 
    
    
*** Keywords ***
Send a request for a 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    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    ${elements} =  Split String    ${response['headers']['Location']}       /
    Set Suite Variable    ${SUB_ID}    ${elements[4]} 


Delete subscription
    [Arguments]    ${subscription_id}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscription_id}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    


Spawn Notification Server
    [Arguments]  ${host}  ${port}  ${timeout}  ${method}  ${endpoint}         ${payload_notification}
    ${output}   Spawn Web Server  ${host}  ${port}  ${timeout}  ${method}  ${endpoint}    ${payload_notification} 
    Set Suite Variable    ${payload_notification}    ${output}
+2 −2
Original line number Diff line number Diff line
@@ -13,11 +13,11 @@ ${SUB_ID}


##Notification Server variables
${NOTIFICATION_SERVER_IP}      10.30.8.189
${NOTIFICATION_SERVER_IP}      127.0.0.1
${NOTIFICATION_SERVER_PORT}      8888
${NOTIFICATION_SERVER_HTTP_METHOD}      POST
${NOTIFICATION_SERVER_URI}      /callback_url
${NOTIFICATION_SERVER_TIMEOUT}      10
${NOTIFICATION_SERVER_TIMEOUT}      5


${APP_INS_ID}                 appInsId
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
            {
                "enbInfo": {
                    "ipAddress": "127.0.0.1",
                    "tunnelIdaa": "tunnelId"
                    "tunnelId": "tunnelId"
                },
                "erabId": 1234,
                "sGwInfo": {
+59 −27
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ Resource ../../../pics.txt
Resource    environment/variables.txt
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem   

Library     libraries/Server.py
Library     String
Default Tags    TC_MEC_SRV_UEDISTSUB


@@ -19,55 +20,81 @@ TC_MEC_MEC013_SRV_UEDISTSUB_001_OK
    ...    Check that the IUT acknowledges the UE distance subscription request when commanded by a
    ...   MEC Application and notifies it when (all) the requested UE(s) is (are) within the specified distance
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.10
    ...    OpenAPI    # TODO check this
    ...    Reference    ETSI GS MEC 013 3.1.1 Clause 5.3.4
    ...    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.14.3.4

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Create new subscription    DistanceNotificationSubscription
    Create new subscription    UserDistanceSubscription
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    DistanceNotificationSubscription
    Check Result Contains    ${response['body']['distanceNotificationSubscription']}    clientCorrelator    ${UEDISTSUB_CLIENT_ID}
    Check Result Contains    ${response['body']['distanceNotificationSubscription']}    callbackReference    ${APP_SRVSUB_NOTIF_CALLBACK_URI}
    Check Result Contains    ${response['body']['distanceNotificationSubscription']}    monitoredAddress    ${UEDISTSUB_MONITORED_IP_ADDRESS}
    Check Result Contains    ${response['body']['distanceNotificationSubscription']}    referenceAddress    ${UEDISTSUB_IP_ADDRESS}

    Check HTTP Response Body Json Schema Is    UserDistanceSubscription
    ${CLIENT_CORRELATOR}   Get value entry from JSON file    UserDistanceSubscription    clientCorrelator
    ${CALLBACK_REF}   Get value entry from JSON file         UserDistanceSubscription    callbackReference
    ${MON_ADDRESSED}   Get value entry from JSON file        UserDistanceSubscription    monitoredAddress
    ${DISTANCE}   Get value entry from JSON file             UserDistanceSubscription    distance
    ${TRACK_ACCURACY}   Get value entry from JSON file       UserDistanceSubscription    trackingAccuracy
    ${CRITERIA}   Get value entry from JSON file             UserDistanceSubscription    criteria
    ${CHECK_IMMEDIATE}   Get value entry from JSON file      UserDistanceSubscription    checkImmediate
    
    Should be Equal    ${response['body']['userDistanceSubscription']['clientCorrelator']}    ${CLIENT_CORRELATOR}
    Should be Equal    ${response['body']['userDistanceSubscription']['callbackReference']}    ${CALLBACK_REF}
    Should be Equal    ${response['body']['userDistanceSubscription']['distance']}    ${DISTANCE}
    Should be Equal    ${response['body']['userDistanceSubscription']['trackingAccuracy']}    ${TRACK_ACCURACY}
    Should be Equal    ${response['body']['userDistanceSubscription']['criteria']}    ${CRITERIA}
    Should be Equal    ${response['body']['userDistanceSubscription']['checkImmediate']}    ${True}
    Spawn Notification Server     UserDistanceNotification
    Validate Json   UserDistanceNotification.schema.json    ${payload_notification}
    [TearDown]  Remove subscription  ${SUB_ID}

TC_MEC_MEC013_SRV_UEDISTSUB_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 - Neither callbackReference nor websockNotifConfig provided
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.10

    ...    Reference    ETSI GS MEC 013 3.1.1 Clause 5.3.4
    ...    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.14.3.4
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Create new subscription    DistanceNotificationSubscriptionError
    Create new subscription    UserDistanceSubscriptionError
    Check HTTP Response Status Code Is    400


TC_MEC_MEC013_SRV_UEDISTSUB_002_OK
    [Documentation]
    ...    Check that the IUT acknowledges the cancellation of UE distance notifications
    ...    when commanded by a MEC Application
    ...    Check that the IUT acknowledges the cancellation of UE distance 
    ...    notifications when commanded by a MEC Application
    ...
    ...    Reference    ETSI GS MEC 013 V2.1.1, clause 7.3.6
    ...    Reference    ETSI GS MEC 013 3.1.1 Clause 5.3.6
    ...    ETSI GS MEC 013 3.1.1 Clause 7.15.3.5

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Remove subscription    ${SUBSCRIPTION_ID}
    [Setup]   Create new subscription and get sub id    UserDistanceSubscription
    Remove subscription   ${SUB_ID}
    Check HTTP Response Status Code Is    204


TC_MEC_MEC013_SRV_UEDISTSUB_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 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.6
    ...    Reference    ETSI GS MEC 013 3.1.1 Clause 5.3.6
    ...    ETSI GS MEC 013 3.1.1 Clause 7.15.3.5

    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    Remove subscription    ${NON_EXISTENT_SUBSCRIPTION_ID}
    [Setup]   Remove subscription    ${NON_EXISTING_SUBSCRIPTION_ID}
    Remove 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"}
@@ -86,3 +113,8 @@ Remove subscription
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/distance/${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}
 No newline at end of file
Loading