Commit e956a413 authored by piscione's avatar piscione
Browse files

MEC012 v2.2.1 Draft TCs available. Simple notification is included too

parent 0a30faa4
Loading
Loading
Loading
Loading
+115 −0
Original line number Original line Diff line number Diff line
@@ -5,28 +5,76 @@
Resource    environment/variables.txt
Resource    environment/variables.txt
Resource    ../../../pics.txt
Resource    ../../../pics.txt
Resource    ../../../GenericKeywords.robot
Resource    ../../../GenericKeywords.robot
Resource    resources/RadioNetworkInformationAPI.robot
#Resource    resources/RadioNetworkInformationAPI.robot
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library     String



*** Test Cases ***
*** Test Cases ***
TC_MEC_MEC012_SRV_RNIS_011_BR
TC_MEC_MEC012_SRV_RNIS_011_BR
    [Documentation]   Request RNIS subscription list using bad parameters
    [Documentation]   Request RNIS subscription list using bad parameters
    ...  Check that the RNIS service responds with an error when it receives a request to get all RNIS subscriptions with a wrong subscription type
    ...  Check that the RNIS service responds with an error when it receives a request to 
    ...  ETSI GS MEC 012 2.1.1, clause 7.6.3.1
    ...  get all RNIS subscriptions with a wrong subscription type
    ...  ETSI GS MEC 012 2.2.1, clause 7.6.3.1
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml#/definitions/SubscriptionLinkList
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml#/definitions/SubscriptionLinkList
    [Setup]   Send a request for a subscription and get sub ID     CellChangeSubscription
    Get RNIS subscription list with wrong parameter
    Get RNIS subscription list with wrong parameter
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400
    [TearDown]    Delete subscription   ${SUB_ID} 
    
    


TC_MEC_MEC012_SRV_RNIS_012_BR
TC_MEC_MEC012_SRV_RNIS_012_BR
    [Documentation]   Create RNIS subscription using bad parameters
    [Documentation]   Create RNIS subscription using bad parameters
    ...  Check that the RNIS service responds with an error when it receives a request to create a new RNIS subscription with a wrong format
    ...  Check that the RNIS service responds with an error when it receives a request to create a new RNIS subscription with a wrong format
    ...  ETSI GS MEC 012 2.1.1, clause 7.6.3.4
    ...  ETSI GS MEC 012 2.2.1, clause 7.6.3.4
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml
    Post RNIS subscription request    {"CellChangeSubscription": {"subscriptionType": "CelCangeSubscription", "callbackReference": "${HREF}", "_links": {"self": { "href": "${LINKS_SELF}" } }, "filterCriteria": {"appInsId": "01", "associateId": [{"type": "UE_IPV4_ADDRESS", "value": 1}], "plmn": {"mcc": "01", "mnc": "001"}, "cellId": ["800000"], "hoStatus": "COMPLETED"}, "expiryDeadline": {"seconds": 1577836800, "nanoSeconds": 0}}}
    Send a request for a subscription     CellChangeSubscriptionBr
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400


TC_MEC_MEC012_SRV_RNIS_011_OK
    [Documentation]   Request RNIS subscription list
    ...  Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested
    ...  ETSI GS MEC 012 2.2.1, clause 7.6.3.1
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml#/definitions/SubscriptionLinkList
    [Setup]   Send a request for a subscription and get sub ID     CellChangeSubscription
    Get RNIS subscription list with filter   CellChangeSubscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   SubscriptionLinkList
    ${not_expected_syb_type}   Set Variable   ${FALSE}
    FOR    ${subscription}    IN    @{response['body']['_links']['subscription']}
    IF    '''${subscription}[subscriptionType]''' != '''CellChangeSubscription'''
        ${not_expected_syb_type}    Set Variable   ${TRUE}
      END
    END 
    Should Be Equal   ${not_expected_syb_type}      ${FALSE}
    [TearDown]    Delete subscription   ${SUB_ID} 

TC_MEC_MEC012_SRV_RNIS_012_OK
    [Documentation]   Create RNIS subscription
    ...  Check that the RNIS service creates a new RNIS subscription
    ...  ETSI GS MEC 012 2.2.1, clause 7.6.3.4
    ...  Reference https://forge.etsi.org/rep/mec/gs012-rnis-api/blob/automatic_generation/RniAPI.yaml
    [Setup]  Send a request for a subscription and get sub ID     CellChangeSubscription
    ${sub_type}   Get value entry from JSON file    CellChangeSubscription    subscriptionType
    ${callback_ref}   Get value entry from JSON file    CellChangeSubscription    callbackReference
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is   CellChangeSubscription
    Should Be Equal   ${response['body']['subscriptionType']}      ${sub_type}
    Should Be Equal   ${response['body']['callbackReference']}      ${callback_ref}
    [TearDown]    Delete subscription   ${SUB_ID} 

*** Keywords ***
*** Keywords ***
Get RNIS subscription list with filter
    [Arguments]    ${sub_type_filter}
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/rni/${apiVersion}/subscriptions?subscription_type=${sub_type_filter}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get RNIS subscription list with wrong parameter
Get RNIS subscription list with wrong parameter
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
@@ -37,13 +85,31 @@ Get RNIS subscription list with wrong parameter
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


Send a request for a subscription and get sub ID
    [Arguments]    ${content}
    Send a request for a subscription      ${content}
    ${elements} =  Split String    ${response['headers']['Location']}       /
    Set Suite Variable    ${SUB_ID}    ${elements[4]} 



Post RNIS subscription request
Send a request for a subscription    
    [Arguments]    ${content}
    [Arguments]    ${content}
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Post    ${apiRoot}/rni/${apiVersion}/subscriptions    ${content}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    Set Suite Variable    ${response}    ${output} 
    
+134 −174

File changed.

Preview size limit exceeded, changes collapsed.

+165 −0
Original line number Original line 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}
+112 −29

File changed and moved.

Preview size limit exceeded, changes collapsed.

+0 −100
Original line number Original line Diff line number Diff line
''[Documentation]   robot --outputdir ../../outputs ./RnisQuery_BV.robot
...    Test Suite to validate RNIS/Subscription (RNIS) operations.

*** Settings ***
Resource    environment/variables.txt
Resource    ../../../pics.txt
Resource    ../../../GenericKeywords.robot
Resource    resources/RadioNetworkInformationAPI.robot
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false



*** Test Cases ***
TC_MEC_MEC012_SRV_RNIS_016_OK
    [Documentation]   Request RabInfo info
    ...  Check that the RNIS service returns the RAB information when requested
    ...  ETSI GS MEC 012 2.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/RabInfo
    Get RabInfo info
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   RabInfo
    Check RabInfo    ${response['body']}


TC_MEC_MEC012_SRV_RNIS_017_OK
    [Documentation]   Request Plmn info
    ...  Check that the RNIS service returns the PLMN information when requested
    ...  ETSI GS MEC 012 2.1.1, clause 7.4.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/PlmnInfo
    Get PLMN info
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PlmnInfos
    Check PlmnInfo    ${response['body'][0]}


TC_MEC_MEC012_SRV_RNIS_018_OK
    [Documentation]   Request S1Bearer info
    ...  Check that the RNIS service returns the S1 bearer information
    ...  ETSI GS MEC 012 2.1.1, clause 7.5.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/S1BearerInfo
    Get S1Bearer info
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   S1BearerInfos
    #log    ${response['body']}
    Check S1BearerInfo    ${response['body']}


TC_MEC_MEC012_SRV_RNIS_019_OK
        [Documentation]   Request L2Meas info
    ...  Check that the RNIS service returns the L2 measurements information
    ...  ETSI GS MEC 012 2.1.1, clause 7.5a.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/L2Meas
    Get Layer2Meas Info
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   L2Meas
    Check L2MeasInfo    ${response['body']}


*** Keywords ***
Get RabInfo info
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/rni/${apiVersion}/queries/rab_info?cell_id=${CELL_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get Plmn info
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/rni/${apiVersion}/queries/plmn_info?app_ins_id=${APP_INS_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get S1Bearer info
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/rni/${apiVersion}/queries/s1_bearer_info?cell_id=${CELL_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get Layer2Meas Info
    Should Be True    ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/rni/${apiVersion}/queries/layer2_meas?cell_id=${CELL_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
 No newline at end of file
Loading