From 2d1743260d1025056f0e4592ef7cb4cdc2cc7315 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 8 Aug 2019 14:43:11 +0200 Subject: [PATCH] Add TC_MEC_SRV_RNIS_012_OK, TC_MEC_SRV_RNIS_011_BR, TC_MEC_SRV_RNIS_012_BR --- SRV/RNIS/RnisQuery_BV.robot | 56 +++++++++++++++++++ SRV/RNIS/RnisSpecificSubscription_BI_BO.robot | 43 ++++++++++++++ SRV/RNIS/RnisSpecificSubscription_BV.robot | 27 ++++++++- SRV/RNIS/environment/variables.txt | 4 ++ SRV/RNIS/resources/GenericKeywords.robot | 6 ++ .../RadioNetworkInformationAPI.robot | 12 ++++ .../RadioNetworkInformationAPI.schema.json | 7 ++- SRV/UETAG/PlatUeIdentity.robot | 5 ++ SRV/UETAG/resources/GenericKeywords.robot | 6 ++ 9 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 SRV/RNIS/RnisQuery_BV.robot create mode 100644 SRV/RNIS/RnisSpecificSubscription_BI_BO.robot diff --git a/SRV/RNIS/RnisQuery_BV.robot b/SRV/RNIS/RnisQuery_BV.robot new file mode 100644 index 0000000..145757f --- /dev/null +++ b/SRV/RNIS/RnisQuery_BV.robot @@ -0,0 +1,56 @@ +''[Documentation] robot --outputdir ../../outputs ./RnisQuery_BV.robot +... Test Suite to validate RNIS/Subscription (RNIS) operations. + +*** Settings *** +Resource environment/variables.txt +Resource environment/pics.txt +Resource resources/GenericKeywords.robot +Resource resources/RadioNetworkInformationAPI.robot +Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false + + + +*** Test Cases *** +Request RNIS subscription list + [Documentation] TC_MEC_SRV_RNIS_011_OK + ... Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested + ... ETSI GS MEC 012 2.0.4, clause 7.6.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/SubscriptionLinkList + Get RNIS subscription list + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is RadioNetworkInformationAPI + Check Subscription ${response['body']['SubscriptionLinkList']} ${SUBSCRIPTION_VALUE} + + +Create RNIS subscription + [Documentation] TC_MEC_SRV_RNIS_012_OK + ... Check that the RNIS service creates a new RNIS subscription + ... ETSI GS MEC 012 2.0.4, clause 7.6.3.4 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml + Post RNIS subscription request {"CellChangeSubscription": {"subscriptionType": CELL_CHANGE, "callbackReference": "${HREF}", "_links": {"self": "${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}}} + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is RadioNetworkInformationAPI + Check CellChangeSubscription ${response['body']['CellChangeSubscription']} + + +*** Keywords *** +Get RNIS subscription list + 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/subscriptions?subscription_type=${SUBSCRIPTION_HREF_VALUE} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Post RNIS subscription request + [Arguments] ${content} + Should Be True ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1 + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Post /exampleAPI/rni/v2/subscriptions ${content} + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SRV/RNIS/RnisSpecificSubscription_BI_BO.robot b/SRV/RNIS/RnisSpecificSubscription_BI_BO.robot new file mode 100644 index 0000000..a8874ab --- /dev/null +++ b/SRV/RNIS/RnisSpecificSubscription_BI_BO.robot @@ -0,0 +1,43 @@ +''[Documentation] robot --outputdir ../../outputs ./RnisSpecificSubscription_BI_BO.robot +... Test Suite to validate RNIS/Subscription (RNIS) operations. + +*** Settings *** +Resource environment/variables.txt +Resource environment/pics.txt +Resource resources/GenericKeywords.robot +Resource resources/RadioNetworkInformationAPI.robot +Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false + + + +*** Test Cases *** +Request RNIS subscription list using bad parameters + [Documentation] TC_MEC_SRV_RNIS_011_BR + ... Check that the RNIS service responds with an error when it receives a request to get all RNIS subscriptions with a wrong subscription type + ... ETSI GS MEC 012 2.0.4, clause 7.6.3.1 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/SubscriptionLinkList + Get RNIS subscription list with wrong parameter + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +Create RNIS subscription using bad parameters + [Documentation] TC_MEC_SRV_RNIS_012_BR + ... 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.0.4, clause 7.6.3.4 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml + Post RNIS subscription request {"CellChangeSubscription": {"subscriptionType": WRONG_PARAMETER, "callbackReference": "${HREF}", "_links": {"self": "${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}}} + Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + + +*** Keywords *** +Get RNIS subscription list with wrong parameter + 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"} + Post /exampleAPI/rni/v2/subscriptions?subscription_type=InvalidSubscriptionRef + ${output}= Output response + Set Suite Variable ${response} ${output} diff --git a/SRV/RNIS/RnisSpecificSubscription_BV.robot b/SRV/RNIS/RnisSpecificSubscription_BV.robot index f22246a..d0c3876 100644 --- a/SRV/RNIS/RnisSpecificSubscription_BV.robot +++ b/SRV/RNIS/RnisSpecificSubscription_BV.robot @@ -19,8 +19,18 @@ Request RNIS subscription list Get RNIS subscription list Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is RadioNetworkInformationAPI - log ${response['body']['SubscriptionLinkList']['_links']} - Should Be Equal ${response['body']['SubscriptionLinkList']['_links']['self']} ${LINKS_SELF} + Check Subscription ${response['body']['SubscriptionLinkList']} ${SUBSCRIPTION_VALUE} + + +Create RNIS subscription + [Documentation] TC_MEC_SRV_RNIS_012_OK + ... Check that the RNIS service creates a new RNIS subscription + ... ETSI GS MEC 012 2.0.4, clause 7.6.3.4 + ... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml + Post RNIS subscription request {"CellChangeSubscription": {"subscriptionType": CELL_CHANGE, "callbackReference": "${HREF}", "_links": {"self": "${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}}} + Check HTTP Response Status Code Is 201 + Check HTTP Response Body Json Schema Is RadioNetworkInformationAPI + Check CellChangeSubscription ${response['body']['CellChangeSubscription']} *** Keywords *** @@ -30,6 +40,17 @@ Get RNIS subscription list Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Content-Length":"0"} - Get /exampleAPI/rni/v2/subscriptions + Get /exampleAPI/rni/v2/subscriptions?subscription_type=${SUBSCRIPTION_HREF_VALUE} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Post RNIS subscription request + [Arguments] ${content} + Should Be True ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1 + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Post /exampleAPI/rni/v2/subscriptions ${content} ${output}= Output response Set Suite Variable ${response} ${output} diff --git a/SRV/RNIS/environment/variables.txt b/SRV/RNIS/environment/variables.txt index 0ab03a2..8e2f49e 100644 --- a/SRV/RNIS/environment/variables.txt +++ b/SRV/RNIS/environment/variables.txt @@ -7,5 +7,9 @@ ${MEC-APP_PORT} 8081 ${SUBSCRIPTION_ID} 7777 ${NON_EXISTENT_SUBSCRIPTION_ID} 6666 ${LINKS_SELF} http://example.com/exampleAPI/rni/v2/subscriptions +${SUBSCRIPTION_HREF_VALUE} cell_changed +${SUBSCRIPTION_TYPE} CELL_CHANGE +${HREF} http://meAppClient.example.com/rni/v1/notifications/cell_change/77777 +${SUBSCRIPTION_VALUE} {'href': '${HREF}', 'subscriptionType': '${SUBSCRIPTION_TYPE}'} ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l diff --git a/SRV/RNIS/resources/GenericKeywords.robot b/SRV/RNIS/resources/GenericKeywords.robot index d06df4d..800dc5d 100644 --- a/SRV/RNIS/resources/GenericKeywords.robot +++ b/SRV/RNIS/resources/GenericKeywords.robot @@ -36,3 +36,9 @@ Should Be Present In Json List Check Result Contains [Arguments] ${source} ${parameter} ${value} Should Be Present In Json List ${source} ${parameter} ${value} + +Check ProblemDetails + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['body']['problemDetails']['status']} ${status} + Log ProblemDetails Status code validated diff --git a/SRV/RNIS/resources/RadioNetworkInformationAPI.robot b/SRV/RNIS/resources/RadioNetworkInformationAPI.robot index 662e0b3..946be1c 100644 --- a/SRV/RNIS/resources/RadioNetworkInformationAPI.robot +++ b/SRV/RNIS/resources/RadioNetworkInformationAPI.robot @@ -7,3 +7,15 @@ Library JSONSchemaLibrary schemas/ *** Keywords *** +Check Subscription + [Arguments] ${received_value} ${expected_value} + Should Be Equal ${received_value['_links']['self']} ${LINKS_SELF} + :FOR ${item} IN @{received_value['subscription']} + \ Exit For Loop If ${item} == ${expected_value} + Log Item found ${item} + [return] ${item} + + +Check CellChangeSubscription + [Arguments] ${received_value} + Should Be Equal ${received_value['_links']['self']} ${LINKS_SELF} diff --git a/SRV/RNIS/schemas/RadioNetworkInformationAPI.schema.json b/SRV/RNIS/schemas/RadioNetworkInformationAPI.schema.json index 493ec2d..48e1753 100644 --- a/SRV/RNIS/schemas/RadioNetworkInformationAPI.schema.json +++ b/SRV/RNIS/schemas/RadioNetworkInformationAPI.schema.json @@ -688,10 +688,14 @@ "CellChangeSubscriptionPost": { "type": "object", "required": [ + "subscriptionType", "callbackReference", "filterCriteria" ], "properties": { + "subscriptionType": { + "$ref": "#/definitions/SubscriptionType" + }, "callbackReference": { "$ref": "#/definitions/CallbackReference" }, @@ -814,7 +818,8 @@ "MEAS_REPORT_UE", "MEAS_TIMING_ADVANCE", "CA_RECONF", - "S1_BEARE" + "S1_BEARE", + "WRONG_PARAMETER" ], "example": "CELL_CHANGE" }, diff --git a/SRV/UETAG/PlatUeIdentity.robot b/SRV/UETAG/PlatUeIdentity.robot index e45c2d6..d973bab 100644 --- a/SRV/UETAG/PlatUeIdentity.robot +++ b/SRV/UETAG/PlatUeIdentity.robot @@ -29,6 +29,8 @@ Request UE Identity Tag information using bad parameters ... Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo Get UE Identity Tag information using bad parameters Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 + Request UE Identity Tag information using non-existent application instance @@ -38,6 +40,7 @@ Request UE Identity Tag information using non-existent application instance ... Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo Get UE Identity Tag information using non-existent application instance Check HTTP Response Status Code Is 404 + Check ProblemDetails 404 Register an UE Identity Tag @@ -59,6 +62,7 @@ Register an UE Identity Tag using invalid state ... Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo Update an UE Identity Tag using invalid state {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG}","state":"INVALID_STATE"}]} Check HTTP Response Status Code Is 400 + Check ProblemDetails 400 Unregister an UE Identity Tag already in unregistered state @@ -68,6 +72,7 @@ Unregister an UE Identity Tag already in unregistered state ... Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo Update an UE Identity Tag using a not applicable valid state {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG_INVALID_STATE}","state":"UNREGISTERED"}]} Check HTTP Response Status Code Is 412 + Check ProblemDetails 412 *** Keywords *** diff --git a/SRV/UETAG/resources/GenericKeywords.robot b/SRV/UETAG/resources/GenericKeywords.robot index d06df4d..800dc5d 100644 --- a/SRV/UETAG/resources/GenericKeywords.robot +++ b/SRV/UETAG/resources/GenericKeywords.robot @@ -36,3 +36,9 @@ Should Be Present In Json List Check Result Contains [Arguments] ${source} ${parameter} ${value} Should Be Present In Json List ${source} ${parameter} ${value} + +Check ProblemDetails + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Should Be Equal ${response['body']['problemDetails']['status']} ${status} + Log ProblemDetails Status code validated -- GitLab