From 6dc57c2b4dfdd06d40b3a3aad4228e92d9788f84 Mon Sep 17 00:00:00 2001 From: Elian Kraja Date: Wed, 18 Sep 2019 19:22:24 +0200 Subject: [PATCH] Added MEO/Grant --- GenericKeywords.robot | 9 ++ MEO/GRANT/Grant.robot | 111 ++++++++++++++++++++++ MEO/GRANT/environment/variables.txt | 25 +++++ MEO/GRANT/jsons/grantRejectedRequest.json | 1 + MEO/GRANT/jsons/grantRequests.json | 2 + MEO/GRANT/schemas/Grant.json | 1 + 6 files changed, 149 insertions(+) create mode 100644 MEO/GRANT/Grant.robot create mode 100644 MEO/GRANT/environment/variables.txt create mode 100644 MEO/GRANT/jsons/grantRejectedRequest.json create mode 100644 MEO/GRANT/jsons/grantRequests.json create mode 100644 MEO/GRANT/schemas/Grant.json diff --git a/GenericKeywords.robot b/GenericKeywords.robot index bac5b57..09ffd24 100644 --- a/GenericKeywords.robot +++ b/GenericKeywords.robot @@ -37,3 +37,12 @@ Check ProblemDetails ${status}= Convert To Integer ${expected_status} Should Be Equal ${response['body']['problemDetails']['status']} ${status} Log ProblemDetails Status code validated + +Check HTTP Response Header Contains + [Arguments] ${HEADER_TOCHECK} + Should Contain ${response['headers']} ${HEADER_TOCHECK} + Log Header is present + +Check HTTP Response Body is Empty + Should Be Empty ${response['body']} + Log Body is empty \ No newline at end of file diff --git a/MEO/GRANT/Grant.robot b/MEO/GRANT/Grant.robot new file mode 100644 index 0000000..66b72ab --- /dev/null +++ b/MEO/GRANT/Grant.robot @@ -0,0 +1,111 @@ +''[Documentation] robot --outputdir ./outputs ./SRV/UETAG/PlatUeIdentity.robot +... Test Suite to validate UE Identity Tag (UETAG) operations. + +*** Settings *** +Resource environment/variables.txt +Resource ../../GenericKeywords.robot +Library REST ${MEO_SCHEMA}://${MEO_HOST}:${MEO_PORT} ssl_verify=false +Library BuiltIn +Library OperatingSystem +Library MockServerLibrary + + + + +*** Test Cases *** +Request a new Grant - Synchronous mode + [Documentation] TP_MEC_MEO_GRANT_001_OK + ... Check that MEO sends a synchronous grant response when a grant request is requested + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1 + ... ETSI GS MEC 010-2 2.0.10, Table 6.2.4.2.2-1 (GrantRequest) + ... ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant) + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Create a GRANT request grantRequest + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is Grant + + + +Request a new Grant - Malformed request + [Documentation] TP_MEC_MEO_GRANT_001_BR + ... Check that MEO responds with an error when it receives a malformed request when a new grant request is performed + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2 + ... ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant) + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Create a GRANT request grantRejectedRequest + Check HTTP Response Status Code Is 400 + + + +Request a new Grant - Asynchronous mode + [Documentation] TP_MEC_MEO_GRANT_002_OK + ... Check that MEO sends a asynchronous grant response when a grant request is requested + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1 + ... ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant) + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Create a GRANT request grantRequest + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check HTTP Response Body is Empty + + +Request an individual grant - Ongoing process + [Documentation] TP_MEC_MEO_GRANT_003_OK + ... Check that MEO sends the status of a grant request when a query on a granting ID is performed. + ... The process of creating the grant is ongoing, no grant is available yet + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2 + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Get an individual grant ${grantId} + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + Check HTTP Response Body is Empty + + + +Request an individual grant using non existant grant identifier + [Documentation] TP_MEC_MEO_GRANT_003_NF + ... Check that MEO responds with an error when it receives a request for returning a grant referred with a wrong ID + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2 + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Get an individual grant ${non_existant_grant_id} + Check HTTP Response Status Code Is 404 + + + +Request an individual grant - Successful + [Documentation] TP_MEC_MEO_GRANT_004_OK + ... Check that MEO sends the status of a grant request when a query on a granting ID is performed + ... ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2 + ... ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Get an individual grant ${grantId} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is Grant + + + +*** Keywords *** +Create a GRANT request + [Arguments] ${content} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= json/ ${content} .json + ${body}= Get File ${file} + Post ${apiRoot}/${apiName}/${apiVersion}/grants ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get an individual grant + [Arguments] ${grantId} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId} + ${output}= Output response + Set Suite Variable ${response} ${output} + + + \ No newline at end of file diff --git a/MEO/GRANT/environment/variables.txt b/MEO/GRANT/environment/variables.txt new file mode 100644 index 0000000..e14127f --- /dev/null +++ b/MEO/GRANT/environment/variables.txt @@ -0,0 +1,25 @@ +*** Variables *** +# Generic variables +${MEO_SCHEMA} http +${MEO_HOST} 10.192.2.172 +${MEO_PORT} 8081 +${response} {} +${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l +${apiRoot} +${apiName} granting +${apiVersion} v1 + +# Specific variables +${grantId} e0deee2b-6e50-4f33-ab09-8bf0585025d3 +${non_existant_grant_id} non_existant_grant_id + + +# 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} /granting/subscriptions +${callback_endpoint_error} /subs_404 +${total_polling_time} 2 min +${polling_interval} 10 sec \ No newline at end of file diff --git a/MEO/GRANT/jsons/grantRejectedRequest.json b/MEO/GRANT/jsons/grantRejectedRequest.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/MEO/GRANT/jsons/grantRejectedRequest.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/MEO/GRANT/jsons/grantRequests.json b/MEO/GRANT/jsons/grantRequests.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/MEO/GRANT/jsons/grantRequests.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/MEO/GRANT/schemas/Grant.json b/MEO/GRANT/schemas/Grant.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/MEO/GRANT/schemas/Grant.json @@ -0,0 +1 @@ +{} \ No newline at end of file -- GitLab