From b9345fcb4b59553d2d9ceb303b32dfab3eb6f580 Mon Sep 17 00:00:00 2001 From: garciay Date: Mon, 26 Aug 2019 16:20:25 +0200 Subject: [PATCH] Add RnisNotification support --- SRV/RNIS/RnisNotifications.robot | 52 +++++++++ SRV/RNIS/RnisQuery_BI_BO.robot | 179 +++++++++++++++++++++++++++++ SRV/RNIS/environment/variables.txt | 10 ++ pics.txt | 1 + 4 files changed, 242 insertions(+) create mode 100644 SRV/RNIS/RnisNotifications.robot create mode 100644 SRV/RNIS/RnisQuery_BI_BO.robot diff --git a/SRV/RNIS/RnisNotifications.robot b/SRV/RNIS/RnisNotifications.robot new file mode 100644 index 0000000..9ec6bd5 --- /dev/null +++ b/SRV/RNIS/RnisNotifications.robot @@ -0,0 +1,52 @@ +''[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 +Resource resources/RadioNetworkInformationAPI.robot +Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false +Library BuiltIn +Library OperatingSystem +Library MockServerLibrary + + +*** Test Cases *** +Cell change notification + [Documentation] TC_MEC_SRV_RNIS_001_OK + ... 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.0.4, clause 6.4.2 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml + Should Be True ${PIC_RNIS_NOTIFICATIONS} == 1 + ${json}= Get File schemas/RadioNetworkInformationAPI.schema.json + Log Creating mock request and response to handle Cell change notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint}/cell_change body_type="JSON_SCHEMA" body=${json} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +RAB Establishment notification + [Documentation] TC_MEC_SRV_RNIS_002_OK + ... 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.0.4, clause 6.4.3 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml + Should Be True ${PIC_RNIS_NOTIFICATIONS} == 1 + ${json}= Get File schemas/RadioNetworkInformationAPI.schema.json + Log Creating mock request and response to handle RAB establishment notification + &{req}= Create Mock Request Matcher POST ${callback_endpoint}/rab_est body_type="JSON_SCHEMA" body=${json} + &{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204 + Create Mock Expectation ${req} ${rsp} + Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${req} + Log Verifying results + Verify Mock Expectation ${req} + Log Cleaning the endpoint + Clear Requests ${callback_endpoint} + + +*** Keywords *** diff --git a/SRV/RNIS/RnisQuery_BI_BO.robot b/SRV/RNIS/RnisQuery_BI_BO.robot new file mode 100644 index 0000000..925c8e9 --- /dev/null +++ b/SRV/RNIS/RnisQuery_BI_BO.robot @@ -0,0 +1,179 @@ +''[Documentation] robot --outputdir ../../outputs ./RnisQuery_BI_BO.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 *** +Request RabInfo info using wrong parameters + [Documentation] TC_MEC_SRV_RNIS_016_BR + ... Check that the RNIS service returns an error when the RAB information is requested with a malformatted message + ... ETSI GS MEC 012 2.0.4, clause 7.3.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/RabInfo + Get RabInfo info using wrong parameters + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +Request RabInfo info using non existing cell id + [Documentation] TC_MEC_SRV_RNIS_016_BR + ... Check that the RNIS service returns an error when the RAB information for a not existing element is requested + ... ETSI GS MEC 012 2.0.4, clause 7.3.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/RabInfo + Get RabInfo info using non existing cell id + Check HTTP Response Status Code Is 404 + Check ProblemDetails 404 + + +Request Plmn info using wrong parameters + [Documentation] TC_MEC_SRV_RNIS_017_BR + ... Check that the RNIS service returns an error when the PLMN information is requested with a malformatted message + ... ETSI GS MEC 012 2.0.4, clause 7.4.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/PlmnInfo + Get PLMN info using wrong parameters + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +Request Plmn info using non existing application id + [Documentation] TC_MEC_SRV_RNIS_017_NF + ... Check that the RNIS service returns an error when the PLMN information for a not existing element is requested + ... ETSI GS MEC 012 2.0.4, clause 7.4.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/PlmnInfo + Get PLMN info using non existing application id + Check HTTP Response Status Code Is 404 + Check ProblemDetails 404 + + +Request S1Bearer info using wrong parameters + [Documentation] TC_MEC_SRV_RNIS_018_BR + ... Check that the RNIS service returns an error when the S1 bearer information is requested with a malformatted message + ... ETSI GS MEC 012 2.0.4, clause 7.4.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/S1BearerInfo + Get S1Bearer info using wrong parameters + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +Request S1Bearer info using non existing cell id + [Documentation] TC_MEC_SRV_RNIS_018_BR + ... Check that the RNIS service returns an error when the S1 bearer information is requested with a malformatted message + ... ETSI GS MEC 012 2.0.4, clause 7.4.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/S1BearerInfo + Get S1Bearer info using non existing cell id + Check HTTP Response Status Code Is 404 + Check ProblemDetails 404 + + +Request L2Meas info using wrong parameters + [Documentation] TC_MEC_SRV_RNIS_019_BR + ... Check that the RNIS service returns an error when the L2 measurements information is requested with a malformatted message + ... ETSI GS MEC 012 2.0.4, clause 7.5a.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/S1BearerInfo + Get L2Meas info using wrong parameters + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +Request L2Meas info using non existing cell id + [Documentation] TC_MEC_SRV_RNIS_019_BR + ... Check that the RNIS service returns an error when the L2 measurements information for a not existing element is requested + ... ETSI GS MEC 012 2.0.4, clause 7.5a.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/S1BearerInfo + Get L2Meas info using non existing cell id + Check HTTP Response Status Code Is 404 + Check ProblemDetails 404 + + +*** Keywords *** +Get RabInfo info using wrong parameters + 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 /exampleAPI/rni/v2/queries/rab_info?c_id=${C_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + +Get RabInfo info using non existing cell id + 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 /exampleAPI/rni/v2/queries/rab_info?cell_id=${NOT_EXISTENT_CELL_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get Plmn info using wrong parameters + 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 /exampleAPI/rni/v2/queries/plmn_info?app_id=${APP_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get Plmn info using non existing application id + 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 /exampleAPI/rni/v2/queries/plmn_info?app_ins_id=${NOT_EXISTENT_APP_INS_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get S1Bearer info using wrong parameters + 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 /exampleAPI/rni/v2/queries/s1_bearer_info?c_id=${C_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get S1Bearer info using non existing cell id + 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 /exampleAPI/rni/v2/queries/s1_bearer_info?cell_id=${NOT_EXISTENT_CELL_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get L2Meas info using wrong parameters + 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 /exampleAPI/rni/v2/queries/layer2_meas?c_id=${C_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get L2Meas info using non existing cell id + 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 /exampleAPI/rni/v2/queries/layer2_meas?cell_id=${NOT_EXISTENT_CELL_ID} + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SRV/RNIS/environment/variables.txt b/SRV/RNIS/environment/variables.txt index 017a4d4..40771ca 100644 --- a/SRV/RNIS/environment/variables.txt +++ b/SRV/RNIS/environment/variables.txt @@ -19,3 +19,13 @@ ${APP_ID} 10 ${NOT_EXISTENT_APP_INS_ID} 99 ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l + +# Notifications variables +${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar + +${callback_port} 9091 +${callback_uri} http://172.22.1.7:${callback_port} +${callback_endpoint} /subscriptions +${callback_endpoint_error} /subs_404 +${total_polling_time} 2 min +${polling_interval} 10 sec diff --git a/pics.txt b/pics.txt index 2c74d7a..89e9eac 100644 --- a/pics.txt +++ b/pics.txt @@ -4,4 +4,5 @@ ${PIC_MEC_PLAT} 1 ${PIC_SERVICES} 1 ${PIC_RNIS_QUERY} 1 ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} 1 +${PIC_RNIS_NOTIFICATIONS} 1 ${PIC_AMS} 1 -- GitLab