From 20223dc926beb35a15d5f54987dc9db65d4eb3cb Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Thu, 18 Sep 2025 09:29:54 +0200 Subject: [PATCH 1/8] feat: add tests and data --- .../Entity/QueryEntities/D011_01_exc.robot | 58 +++++++++++++++ .../Entity/QueryEntities/D011_02_exc.robot | 73 +++++++++++++++++++ ...t-source-registration-vehicle-speed.jsonld | 21 ++++++ data/entities/vehicle-speed-attribute.json | 12 +++ 4 files changed, 164 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot create mode 100644 data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld create mode 100644 data/entities/vehicle-speed-attribute.json diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot new file mode 100644 index 00000000..c09c793c --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot @@ -0,0 +1,58 @@ +*** Settings *** +Documentation Verify that, when one has an exclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets merge with the Context Source correctly + +Resource ${EXECDIR}/resources/ApiUtils/Common.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + + +*** Test Cases *** +D011_01_exc Query The Context Broker With Type + [Documentation] Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets merged correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities?type=Vehicle 200 ${entity_speed} + + ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response1}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot new file mode 100644 index 00000000..d9110913 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot @@ -0,0 +1,73 @@ +*** Settings *** +Documentation Verify that an entity can be retrieved with queryEntity and queryBatch while using an exclusive registration. + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-speed.jsonld + +*** Test Cases *** +D0011_02_01_exc Query The Context Broker By Id Via GET using the queryEntity operation + [Documentation] Check that if one queries the Context Broker for type via GET, and the registration only allows the queryEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 6_23_3 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle + +D011_02_02_exc Query The Context Broker By Id Via POST using the queryBatch operation + [Documentation] Check that if one queries the Context Broker for type via POST, and the registration only allows the queryBatch operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 6_23_3 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query + +*** Keywords *** +Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + [Arguments] ${operation} ${method} ${url} + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + ${operations}= Create List ${operation} + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ... operations=${operations} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_speed} + &{entities}= Create Dictionary + Set To Dictionary ${entities} id=${entity_id} + @{entities}= Create List ${entities} + ${response}= Query Entities Via POST entities=${entities} context=${ngsild_test_suite_context} + + Check Response Status Code 200 ${response.status_code} + @{entities_id}= Create List ${entity_id} + Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld new file mode 100644 index 00000000..b1798060 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle" + } + + ], + "propertyNames":["speed"] + } + ], + "operations": ["redirectionOps"], + "endpoint": "http://my.csource.org:1026/", + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/vehicle-speed-attribute.json b/data/entities/vehicle-speed-attribute.json new file mode 100644 index 00000000..f9a2fdc0 --- /dev/null +++ b/data/entities/vehicle-speed-attribute.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "value": 56, + "source": { + "type": "Property", + "value": "Speedometer" + } + } +} \ No newline at end of file -- GitLab From 98ebdfc21b5daa4d61ca4231f761913a7cd37c51 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 23 Sep 2025 15:42:34 +0200 Subject: [PATCH 2/8] feat: add test for retrieve entity by id --- .../Entity/RetrieveEntity/D010_01_exc.robot | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot new file mode 100644 index 00000000..6410be29 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot @@ -0,0 +1,58 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + +*** Test Cases *** +D010_01_exc Retrieve Entity By Id using the retrieveEntity operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_1 + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_speed} + + ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From e04f80d4aeab95e7388909e1dd091a22f891f249 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 23 Sep 2025 15:43:25 +0200 Subject: [PATCH 3/8] Revert "feat: add test for retrieve entity by id" This reverts commit 98ebdfc21b5daa4d61ca4231f761913a7cd37c51. --- .../Entity/RetrieveEntity/D010_01_exc.robot | 58 ------------------- 1 file changed, 58 deletions(-) delete mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot deleted file mode 100644 index 6410be29..00000000 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot +++ /dev/null @@ -1,58 +0,0 @@ -*** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source - -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource -Resource ${EXECDIR}/resources/MockServerUtils.resource - -Test Setup Setup Registration And Start Context Source Mock Server -Test Teardown Delete Registration And Stop Context Source Mock Server - - -*** Variables *** -${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld -${entity_speed_filename} vehicle-speed-attribute.json -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld - -*** Test Cases *** -D010_01_exc Retrieve Entity By Id using the retrieveEntity operation - [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_1 - - ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} - Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_speed} - - ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - -*** Keywords *** -Setup Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} - Check Response Status Code 201 ${response.status_code} - - ${registration_id}= Generate Random CSR Id - Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File - ... ${registration_id} - ... ${registration_payload_file_path} - ... entity_id=${entity_id} - ... mode=exclusive - ... endpoint=/broker1 - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - - Start Context Source Mock Server - -Delete Registration And Stop Context Source Mock Server - Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file -- GitLab From e4b6ad8d07a4d608b72a6ec5d394152ad9f43331 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 23 Sep 2025 16:03:01 +0200 Subject: [PATCH 4/8] fix: revert change mistake --- .../Entity/RetrieveEntity/D010_01_exc.robot | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot new file mode 100644 index 00000000..6410be29 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot @@ -0,0 +1,58 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + +*** Test Cases *** +D010_01_exc Retrieve Entity By Id using the retrieveEntity operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_1 + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_speed} + + ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From f252f8b3913cfb39e6b9cf3e717eb8fdea798c30 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 25 Sep 2025 10:29:09 +0200 Subject: [PATCH 5/8] Merge remote-tracking branch 'origin/develop' --- .../Provision/Entities/CreateEntity/001_02.robot | 4 ++-- .../SubscriptionNotificationBehaviour/046_21_02.robot | 2 +- resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot index a9d3a691..47a71624 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_02.robot @@ -17,9 +17,9 @@ Test Template Create Entity With Invalid Request Scenarios 001_02_03 EntityWithNoContext [Tags] e-create 5_6_1 building-minimal.json ${ERROR_TYPE_BAD_REQUEST_DATA} -001_02_04 EntityWithNoContext +001_02_04 EntityWithInvalidType [Tags] e-create 5_6_1 - invalid-type.jsonld ${ERROR_TYPE_INVALID_REQUEST} + invalid-type.jsonld ${ERROR_TYPE_BAD_REQUEST_DATA} *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_21_02.robot b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_21_02.robot index acd4e36c..6ff061b9 100644 --- a/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_21_02.robot +++ b/TP/NGSI-LD/ContextInformation/Subscription/SubscriptionNotificationBehaviour/046_21_02.robot @@ -31,7 +31,7 @@ ${building_filename}= building-location-attribute.jsonld Should be Equal ${subscription_id} ${notification}[subscriptionId] Length Should Be ${notification}[data] ${1} ${notified_entity}= Set Variable ${notification}[data][0] - Length Should Be ${notified_entity} ${4} + Length Should Be ${notified_entity} ${5} Should be Equal ${entity_id} ${notified_entity}[id] Should Have Value In Json ... json_object=${notified_entity} diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld index 88d10bcb..ba572931 100644 --- a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld +++ b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld @@ -1,6 +1,6 @@ { "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" ] } -- GitLab From ee4f1dc39e08bbb7f54033b7bbd89717e5a48866 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 17:29:41 +0200 Subject: [PATCH 6/8] fix: correct mistakes in tests --- .../Entity/QueryEntities/D011_01_exc.robot | 4 +- .../Entity/QueryEntities/D011_02_exc.robot | 53 +++++++++---------- .../Entity/RetrieveEntity/D010_01_exc.robot | 6 +-- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot index c09c793c..8eaf5e82 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an exclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets merge with the Context Source correctly +Documentation Verify that, when one has an exclusive registration on a Context Broker and a fragment of an entity on a Context Source, if one queries the Context Broker the query gets merged with the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/Common.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource @@ -25,7 +25,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D011_01_exc Query The Context Broker With Type [Documentation] Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets merged correctly - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_2 ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} Set Stub Reply GET /broker1/ngsi-ld/v1/entities?type=Vehicle 200 ${entity_speed} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot index d9110913..d4a2519c 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_exc.robot @@ -1,6 +1,5 @@ *** Settings *** -Documentation Verify that an entity can be retrieved with queryEntity and queryBatch while using an exclusive registration. - +Documentation Verify that an entity can be retrieved by Id with a queryEntity and a queryBatch while using an exclusive registration. Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource @@ -8,43 +7,42 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type +Test Teardown Delete Registration And Stop Context Source Mock Server + *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${entity_payload_filename} vehicle-simple-attributes.jsonld ${entity_speed_filename} vehicle-speed-attribute.json ${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-speed.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld -*** Test Cases *** -D0011_02_01_exc Query The Context Broker By Id Via GET using the queryEntity operation - [Documentation] Check that if one queries the Context Broker for type via GET, and the registration only allows the queryEntity operation, the request is forwarded as expected - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 6_23_3 - [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST +*** Test Cases *** +D011_02_01_exc Query The Context Broker By Id using the queryEntity operation + [Documentation] Check that if one queries the Context Broker for type, and the registration only allows the queryEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_2 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle -D011_02_02_exc Query The Context Broker By Id Via POST using the queryBatch operation - [Documentation] Check that if one queries the Context Broker for type via POST, and the registration only allows the queryBatch operation, the request is forwarded as expected - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_2 6_23_3 - [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST +D011_02_02_exc Query The Context Broker By Id using the queryBatch operation + [Documentation] Check that if one queries the Context Broker for type, and the registration only allows the queryBatch operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_2 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query *** Keywords *** -Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST - [Arguments] ${operation} ${method} ${url} +Setup Registration, Context Source Mock Server And Query The Context Broker With Type + [Arguments] ${operation} ${method} ${url} ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random CSR Id - ${operations}= Create List ${operation} Set Suite Variable ${registration_id} + ${operations}= Create List ${operation} ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} @@ -52,22 +50,19 @@ Setup Registration, Context Source Mock Server And Query The Context Broker With ... mode=exclusive ... endpoint=/broker1 ... operations=${operations} - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} + ${response1}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} - Set Stub Reply ${method} ${url} 200 ${entity_speed} - &{entities}= Create Dictionary - Set To Dictionary ${entities} id=${entity_id} - @{entities}= Create List ${entities} - ${response}= Query Entities Via POST entities=${entities} context=${ngsild_test_suite_context} + Set Stub Reply ${method} ${url} 200 ${entity_speed} + @{entities_id}= Create List ${entity_id} + ${response}= Query Entities entity_ids=${entities_id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - @{entities_id}= Create List ${entity_id} Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} -Delete Created Entity And Registration And Stop Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot index 6410be29..99099794 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source +Documentation Verify that, when one has an exclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -21,9 +21,9 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld *** Test Cases *** -D010_01_exc Retrieve Entity By Id using the retrieveEntity operation +D010_01_exc Query Context Broker And Retrieve Entity By Id [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_7_1 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_speed} -- GitLab From 8817b46f8c85ecf02c9ce493864e79a411ec528c Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 17:30:34 +0200 Subject: [PATCH 7/8] feat: add new tests --- .../Entity/QueryEntities/D011_03_exc.robot | 73 ++++++++++++++++++ .../Entity/RetrieveEntity/D010_02_exc.robot | 58 ++++++++++++++ .../Entity/RetrieveEntity/D010_03_exc.robot | 76 +++++++++++++++++++ 3 files changed, 207 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_exc.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_exc.robot new file mode 100644 index 00000000..00e313dc --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_exc.robot @@ -0,0 +1,73 @@ +*** Settings *** +Documentation Verify that an entity can be retrieved by Id via POST with a queryEntity and a queryBatch while using an exclusive registration. + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource + +Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + +*** Test Cases *** +D0011_03_01_exc Query The Context Broker By Id Via POST using the queryEntity operation + [Documentation] Check that if one queries the Context Broker for type via GET, and the registration only allows the queryEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_2 6_23_3 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle + +D011_03_02_exc Query The Context Broker By Id Via POST using the queryBatch operation + [Documentation] Check that if one queries the Context Broker for type via POST, and the registration only allows the queryBatch operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_2 6_23_3 + [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query + +*** Keywords *** +Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST + [Arguments] ${operation} ${method} ${url} + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + ${operations}= Create List ${operation} + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ... operations=${operations} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_speed} + &{entities}= Create Dictionary + Set To Dictionary ${entities} id=${entity_id} + @{entities}= Create List ${entities} + ${response}= Query Entities Via POST entities=${entities} context=${ngsild_test_suite_context} + + Check Response Status Code 200 ${response.status_code} + @{entities_id}= Create List ${entity_id} + Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot new file mode 100644 index 00000000..db7500ff --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot @@ -0,0 +1,58 @@ +*** Settings *** +Documentation Verify that, when one has an exclusive registration on a Context Broker and part of an entity on a Context Source, a retrieval request to the Context Broker with the exclusive attribute raises an error. + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + +*** Test Cases *** +D010_02_exc Query Context Broker And Retrieve Entity By Id + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_speed} + + ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} local=${True} + Dictionary Should Not Contain Key ${response.json()} speed + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_exc.robot new file mode 100644 index 00000000..ec2c2f2a --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_exc.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation Verify that, when one has an exclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source using the appropriate operation + +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource + +Test Template Setup Registration, Context Source Mock Server And Retrieve Entity +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_speed_filename} vehicle-speed-attribute.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld + +*** Test Cases *** +D010_03_01_exc Retrieve Entity By Id Using The retrieveEntity Operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration allows the retrieveEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 + [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + retrieveEntity GET /broker1/ngsi-ld/v1/entities/ + +D010_03_02_exc Retrieve Entity By Id Using The queryEntity Operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration allows the queryEntity operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 + [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle +D010_03_03_exc Retrieve Entity By Id Using The queryBatch Operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration allows the queryBatch operation, the request is forwarded as expected + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 + [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query + +*** Keywords *** +Setup Registration, Context Source Mock Server And Retrieve Entity + [Arguments] ${operation} ${method} ${url} + ${entity_id}= Generate Random Vehicle Entity Id + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=${True} + Check Response Status Code 201 ${response.status_code} + + IF '${operation}' == 'retrieveEntity' + ${url}= Set Variable ${url}${entity_id} + END + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${operations}= Create List ${operation} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ... operations=${operations} + ${response1}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server + + ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_speed} + + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 0fc89d2ed2bd053c37f63d7e7af41630c0ba0a3d Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 7 Oct 2025 16:10:34 +0200 Subject: [PATCH 8/8] fix: update tests keywords --- .../Consumption/Entity/QueryEntities/D011_01_exc.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/D010_01_exc.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/D010_02_exc.robot | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot index 8eaf5e82..4a7f2020 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_exc.robot @@ -10,7 +10,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Registration And Start Context Source Mock Server +Test Setup Create Entity And Setup Registration And Start Context Source Mock Server Test Teardown Delete Registration And Stop Context Source Mock Server @@ -33,7 +33,7 @@ D011_01_exc Query The Context Broker With Type Check Response Status Code 200 ${response.status_code} *** Keywords *** -Setup Registration And Start Context Source Mock Server +Create Entity And Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Vehicle Entity Id Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot index 99099794..5da219f2 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_exc.robot @@ -9,7 +9,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Registration And Start Context Source Mock Server +Test Setup Create Entity And Setup Registration And Start Context Source Mock Server Test Teardown Delete Registration And Stop Context Source Mock Server @@ -32,7 +32,7 @@ D010_01_exc Query Context Broker And Retrieve Entity By Id Check Response Status Code 200 ${response.status_code} *** Keywords *** -Setup Registration And Start Context Source Mock Server +Create Entity And Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Vehicle Entity Id Set Suite Variable ${entity_id} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot index db7500ff..e52e4767 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_exc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an exclusive registration on a Context Broker and part of an entity on a Context Source, a retrieval request to the Context Broker with the exclusive attribute raises an error. +Documentation Verify that, when one has an exclusive registration on a Context Broker and part of an entity on a Context Source, a retrieval request to the Context Broker does not contain the exclusive attribute Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -9,7 +9,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Registration And Start Context Source Mock Server +Test Setup Create Entity And Setup Registration And Start Context Source Mock Server Test Teardown Delete Registration And Stop Context Source Mock Server @@ -22,7 +22,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D010_02_exc Query Context Broker And Retrieve Entity By Id - [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected + [Documentation] Check that if one retrieves a fragmented entity locally, the response does not contain the exclusive attribute [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_7_1 ${entity_speed}= Load Entity ${entity_speed_filename} ${entity_id} @@ -32,7 +32,7 @@ D010_02_exc Query Context Broker And Retrieve Entity By Id Dictionary Should Not Contain Key ${response.json()} speed *** Keywords *** -Setup Registration And Start Context Source Mock Server +Create Entity And Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Vehicle Entity Id Set Suite Variable ${entity_id} -- GitLab