From 36c62fc81364469dc634a3ef3dae30309b5b67a3 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Thu, 18 Sep 2025 09:18:00 +0200 Subject: [PATCH 01/14] feat: add retrieve entity tests --- .../RetrieveEntity/D010_01_01_red.robot | 71 +++++++++++++++++++ .../RetrieveEntity/D010_01_02_red.robot | 68 ++++++++++++++++++ 2 files changed, 139 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot new file mode 100644 index 00000000..c2f5d09e --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot @@ -0,0 +1,71 @@ +** Settings *** +Documentation Verify that when a fragmented entity remotely exists on two Context Sources, a retrival request to the Context Broker is correctly forwarded to the Context Sources and the response contains the whole identity. + +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 Create Entity And Registration And Start Context Source Mock Server +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-second.json +${entity_payload_filename2} vehicle-simple-different-attributes.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_01_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} + + ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_query.status_code} + + Should Have Value In Json ${response_query.json()} $.brandName + Should Have Value In Json ${response_query.json()} $.speed + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + 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_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot new file mode 100644 index 00000000..45487e48 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot @@ -0,0 +1,68 @@ +* Settings *** +Documentation Verify that when entities are registered on a Context Source, they get redirected correctly to the Context Broker by their entity type. + +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 Create Entity And Registration And Start Context Source Mock Server +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.json +${entity_payload_filename2} vehicle-simple-attributes-second.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_02_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} + + ${response_query}= Retrieve Entity Type type=Vehicle context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_query.status_code} + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From c50e6140ab6c7133406f0dc5cbb981ddd77d5972 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 23 Sep 2025 16:22:39 +0200 Subject: [PATCH 02/14] fix: change input files --- .../Consumption/Entity/RetrieveEntity/D010_01_01_red.robot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot index c2f5d09e..5f6c8191 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot @@ -14,8 +14,8 @@ Test Teardown Delete Created Entity And Registration And Stop Context Sour *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes-second.json -${entity_payload_filename2} vehicle-simple-different-attributes.json +${entity_payload_filename} vehicle-simple-attributes.json +${entity_payload_filename2} vehicle-simple-attributes-second.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld @@ -33,7 +33,7 @@ D010_01_01_red Create Entity and Registration And Start Context Source Mock Serv Check Response Status Code 200 ${response_query.status_code} Should Have Value In Json ${response_query.json()} $.brandName - Should Have Value In Json ${response_query.json()} $.speed + Should Have Value In Json ${response_query.json()} $.isParked2 *** Keywords *** Create Entity And Registration And Start Context Source Mock Server -- GitLab From 639a0dfe6fc5807102170327a5e5b9d06b87005a Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 23 Sep 2025 16:46:08 +0200 Subject: [PATCH 03/14] feat: add redirect test for QueryEntities --- .../Entity/QueryEntities/D011_01_red.robot | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot new file mode 100644 index 00000000..f0680e90 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot @@ -0,0 +1,56 @@ +*** Settings *** +Documentation Verify that, when one has a redirect registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to 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.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + + +*** Test Cases *** +D011_01_red 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 returned + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} + ${response}= Query Entities entity_types=Vehicle 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()} + + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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} + ... mode=redirect + ... 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 -- GitLab From 783a97feedb5a520381d5db2c04fc9749be4c9b2 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 25 Sep 2025 10:28:32 +0200 Subject: [PATCH 04/14] 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 65d8069e4aaac49bab2fbd37a4cd0f540e953e90 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 14:58:37 +0200 Subject: [PATCH 05/14] fix: change comment as suggested --- .../Consumption/Entity/QueryEntities/D011_01_red.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot index f0680e90..88aa47d9 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_red.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has a redirect registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has a redirect registration and an entity on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/Common.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource -- GitLab From 7a9bec721c79cfb6b9a24b1757a8f2ab90f9623e Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 15:04:06 +0200 Subject: [PATCH 06/14] fix: update test and fix test logic --- .../Entity/RetrieveEntity/D010_01_red.robot | 68 +++++++++++++++++++ .../Entity/RetrieveEntity/D010_02_red.robot | 66 ++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot new file mode 100644 index 00000000..8f564cfc --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot @@ -0,0 +1,68 @@ +** Settings *** +Documentation Verify that when an entity remotely exists on two Context Sources, a retrieval request to the Context Broker is correctly forwarded to the Context Sources and the response contains the identity. + +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 Create Entity And Registration And Start Context Source Mock Server +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.json +${entity_payload_filename2} vehicle-simple-attributes-second.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_01_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} + + ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_query.status_code} + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + 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_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot new file mode 100644 index 00000000..383758a7 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot @@ -0,0 +1,66 @@ +* Settings *** +Documentation Verify that when entities are registered on two Context Sources and retrieved locally an error is raised. + +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 ../../../../../../resources/ApiUtils/ContextInformationConsumption.resource + +Test Setup Create Entity And Registration And Start Context Source Mock Server +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.json +${entity_payload_filename2} vehicle-simple-attributes-second.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_02_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} local=${true} + + Wait For No Request + Check Response Status Code 404 ${response_query.status_code} + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 3ab0332fa83463a3ea6113e244b33822f2fcab19 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 15:04:54 +0200 Subject: [PATCH 07/14] feat: add missing tests --- .../Entity/QueryEntities/D011_02_red.robot | 64 ++++++++++++++++ .../Entity/QueryEntities/D011_03_red.robot | 67 +++++++++++++++++ .../Entity/RetrieveEntity/D010_03_red.robot | 74 +++++++++++++++++++ 3 files changed, 205 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot new file mode 100644 index 00000000..002f6330 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot @@ -0,0 +1,64 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the request gets forwarded to the Context Source correctly 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 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.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + +*** Test Cases *** +D011_02_01_red 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-redirect 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_red 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-redirect 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 + [Arguments] ${operation} ${method} ${url} + ${entity_id}= Generate Random Vehicle Entity Id + + + ${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} + ... mode=redirect + ... 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_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_body} + @{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} + Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + +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 diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot new file mode 100644 index 00000000..1b901333 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot @@ -0,0 +1,67 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker Via Post the request gets forwarded to the Context Source correctly 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 Query The Context Broker With Type Via POST +Test Teardown Delete Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + +*** Test Cases *** +D011_04_01_inc 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 + +D011_04_02_inc Query The Context Broker By Id Via POST using the queryEntity operation + [Documentation] Check that if one queries the Context Broker for type via POST, 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 + +*** 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 + + ${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} + ... mode=redirect + ... 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_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_body} + &{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 Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot new file mode 100644 index 00000000..d06c0803 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot @@ -0,0 +1,74 @@ +*** Settings *** +Documentation Verify that, when one has a redirect 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.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + +*** Test Cases *** +D010_03_01_red 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 + [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + retrieveEntity GET /broker1/ngsi-ld/v1/entities/ + +D010_03_02_red 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 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_1 + [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle + +D010_03_03_red 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 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_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 + + 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=redirect + ... 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_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply ${method} ${url} 200 ${entity_body} + ${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} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 94db57aaa5c5891f8b67c44e75d1af79007817e2 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 15:12:16 +0200 Subject: [PATCH 08/14] Revert "feat: add retrieve entity tests" This reverts commit 36c62fc81364469dc634a3ef3dae30309b5b67a3. --- .../RetrieveEntity/D010_01_01_red.robot | 71 - .../RetrieveEntity/D010_01_02_red.robot | 68 - .../ReplaceEntity/D007_01_inc.robot | 70 + .../ReplaceEntity/D007_02_inc.robot | 57 + ...stration-vehicle-no-redirection-ops.jsonld | 17 + .../vehicle-speed-different-attribute.json | 12 + log.html | 2199 +++++++++++++++ output.xml | 972 +++++++ report.html | 2462 +++++++++++++++++ resources/variables.py | 12 +- 10 files changed, 5795 insertions(+), 145 deletions(-) delete mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot delete mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot create mode 100644 data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld create mode 100644 data/entities/vehicle-speed-different-attribute.json create mode 100644 log.html create mode 100644 output.xml create mode 100644 report.html diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot deleted file mode 100644 index 5f6c8191..00000000 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot +++ /dev/null @@ -1,71 +0,0 @@ -** Settings *** -Documentation Verify that when a fragmented entity remotely exists on two Context Sources, a retrival request to the Context Broker is correctly forwarded to the Context Sources and the response contains the whole identity. - -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 Create Entity And Registration And Start Context Source Mock Server -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.json -${entity_payload_filename2} vehicle-simple-attributes-second.json -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D010_01_01_red Create Entity and Registration And Start Context Source Mock Server - [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} - ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} - Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} - Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} - - ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_query.status_code} - - Should Have Value In Json ${response_query.json()} $.brandName - Should Have Value In Json ${response_query.json()} $.isParked2 - -*** Keywords *** -Create Entity And Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${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=redirect - ... endpoint=/broker1 - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - - ${registration_id2}= Generate Random CSR Id - Set Suite Variable ${registration_id2} - ${registration_payload2}= Prepare Context Source Registration From File - ... ${registration_id2} - ... ${registration_payload_file_path} - ... entity_id=${entity_id} - ... mode=redirect - ... endpoint=/broker2 - ${response}= Create Context Source Registration With Return ${registration_payload2} - Check Response Status Code 201 ${response.status_code} - - Start Context Source Mock Server - -Delete Created Entity And Registration And Stop Context Source Mock Server - Delete Context Source Registration ${registration_id} - Delete Context Source Registration ${registration_id2} - 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_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot deleted file mode 100644 index 45487e48..00000000 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot +++ /dev/null @@ -1,68 +0,0 @@ -* Settings *** -Documentation Verify that when entities are registered on a Context Source, they get redirected correctly to the Context Broker by their entity type. - -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 Create Entity And Registration And Start Context Source Mock Server -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.json -${entity_payload_filename2} vehicle-simple-attributes-second.json -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D010_01_02_red Create Entity and Registration And Start Context Source Mock Server - [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} - ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} - Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} - Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} - - ${response_query}= Retrieve Entity Type type=Vehicle context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_query.status_code} - -*** Keywords *** -Create Entity And Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${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=redirect - ... endpoint=/broker1 - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - - ${registration_id2}= Generate Random CSR Id - Set Suite Variable ${registration_id2} - ${registration_payload2}= Prepare Context Source Registration From File - ... ${registration_id2} - ... ${registration_payload_file_path} - ... entity_id=${entity_id} - ... mode=redirect - ... endpoint=/broker2 - ${response}= Create Context Source Registration With Return ${registration_payload2} - Check Response Status Code 201 ${response.status_code} - - Start Context Source Mock Server - -Delete Created Entity And Registration And Stop Context Source Mock Server - Delete Context Source Registration ${registration_id} - Delete Context Source Registration ${registration_id2} - Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot new file mode 100644 index 00000000..6fc4ad55 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot @@ -0,0 +1,70 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to replace an entire entity on both Context Broker and Context Source + +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 Entity Id And Registration And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_new_payload_filename} vehicle-simple-attributes-second.json +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D007_01_inc Create Entity On Both Context Broker and Context Source + [Documentation] Check that if one requests the Context Broker to replace an entity that matches an inclusive registration, this is replaced on the Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 + + Set Stub Reply POST /broker1/ngsi-ld/v1/entities 201 + ${response}= Create Entity ${entity_payload_filename} ${entity_id} + Check Response Status Code 201 ${response.status_code} + + Set Stub Reply PUT /broker1/ngsi-ld/v1/entities/${entity_id} 204 + ${response}= Replace Entity ${entity_id} ${entity_new_payload_filename} content_type=${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${stub_count}= Get Stub Count PUT /broker1/ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} > 0 + + # Wait for redirected request + # ${request_payload}= Get Request Body + # ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json + # @{entities_id}= Create List ${entity_id} + # Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} + + # ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} + # Check Response Status Code 200 ${response_query.status_code} + # Check Response Body Containing Entities URIS set to ${entities_id} ${response_query.json()} + + +*** Keywords *** +Setup Entity Id And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=inclusive + ... 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 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/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot new file mode 100644 index 00000000..ada4e310 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot @@ -0,0 +1,57 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to replace an entire entity on both Context Broker and Context Source + +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 Entity Id And Registration And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + + +*** Variables *** +${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_new_payload_filename} vehicle-simple-attributes-second.json +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D007_01_inc Create Entity On Both Context Broker and Context Source + [Documentation] Check that if one requests the Context Broker to replace an entity that matches an inclusive registration, this is replaced on the Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 + + Set Stub Reply PUT /broker1/ngsi-ld/v1/entities/${entity_id} 207 + ${response}= Replace Entity ${entity_id} ${entity_new_payload_filename} content_type=${CONTENT_TYPE_JSON} + ${stub_count}= Get Stub Count PUT /broker1/ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} == 0 + +*** Keywords *** +Setup Entity Id And 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=inclusive + ... 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 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-no-redirection-ops.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld new file mode 100644 index 00000000..27bb8310 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Vehicle" + } + ] + } + ], + "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-different-attribute.json b/data/entities/vehicle-speed-different-attribute.json new file mode 100644 index 00000000..bff88a0c --- /dev/null +++ b/data/entities/vehicle-speed-different-attribute.json @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "speed": { + "type": "Property", + "value": 66, + "source": { + "type": "Property", + "value": "Speedometer" + } + } +} \ No newline at end of file diff --git a/log.html b/log.html new file mode 100644 index 00000000..13d572e6 --- /dev/null +++ b/log.html @@ -0,0 +1,2199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/output.xml b/output.xml new file mode 100644 index 00000000..2e857165 --- /dev/null +++ b/output.xml @@ -0,0 +1,972 @@ + + + + + + +${entity_id} + +${entity_id} +${VEHICLE_ID_PREFIX} + +${random_id} +16 +[NUMBERS] +Generates a string with a desired ``length`` from the given ``chars``. +${random_id} = 5513668986908054 + + + +${entity_id} +${id_prefix}${random_id} +Catenates the given items together and returns the resulted string. +${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 + + + +${entity_id} + + +${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 + + + +${entity_id} + + +${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 + + + +${entity_id} +Makes a variable available everywhere within the scope of the current suite. +${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 + + + +${registration_id} + +${entity_id} +${CSR_ID_PREFIX} + +${random_id} +16 +[NUMBERS] +Generates a string with a desired ``length`` from the given ``chars``. +${random_id} = 4498222195898936 + + + +${entity_id} +${id_prefix}${random_id} +Catenates the given items together and returns the resulted string. +${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + + + +${entity_id} + + +${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + + + +${entity_id} + + +${registration_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + + + +${registration_id} +Makes a variable available everywhere within the scope of the current suite. +${registration_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + + + +${registration_payload} +${registration_id} +${registration_payload_file_path} +entity_id=${entity_id} +mode=redirect +endpoint=/broker1 + +${payload} +${EXECDIR}/data/${registration_file} +Load JSON from file. +${payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:randomUUID', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint': 'htt... + + + +${registration_payload} +${payload} +$.id +${id} +Update value to JSON using JSONPath +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... + + + +${registration_payload} +${registration_payload} +$..endpoint +${context_source_url}${endpoint} +Update value to JSON using JSONPath +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... + + + + + +${dict} +id=${entity_id} +Creates and returns a dictionary based on the given ``items``. +${dict} = {'id': 'urn:ngsi-ld:Vehicle:5513668986908054'} + + + +${registration_payload} +${registration_payload} +$..entities[*] +${dict} +Add an dictionary or list object to json object using json_path +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + + + + + + + +${dict} +mode=${mode} +Creates and returns a dictionary based on the given ``items``. +${dict} = {'mode': 'redirect'} + + + +${registration_payload} +${registration_payload} +$ +${dict} +Add an dictionary or list object to json object using json_path +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + + + + + + + +${dict} +operations=${operations} +Creates and returns a dictionary based on the given ``items``. + + + +${registration_payload} +${registration_payload} +$ +${dict} +Add an dictionary or list object to json object using json_path + + + + + + + +${registration_payload} + + +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + +${response} +${registration_payload} + +&{headers} +Content-Type=${content_type} +Creates and returns a dictionary based on the given ``items``. +&{headers} = { Content-Type=application/ld+json } + + + + + +${headers} +Accept=${context} +Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. + + + + + + + + + +${context_link} +${context} + + + +${headers} +Link=${context_link} +Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. + + + + + + + +${response} +url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} +json=${payload} +headers=${headers} +expected_status=any +Sends a POST request. +POST Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations + path_url=/ngsi-ld/v1/csourceRegistrations + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/ld+json', 'Content-Length': '448'} + body=b'{"id": "urn:ngsi-ld:ContextSourceRegistration:4498222195898936", "type": "ContextSourceRegistration", "information": [{"entities": [{"type": "Vehicle", "id": "urn:ngsi-ld:Vehicle:5513668986908054"}]}], "operations": ["redirectionOps"], "endpoint": "http://192.168.155.119:9092/broker1", "@context": ["https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"], "mode": "redirect"}' + +POST Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations + status=201, reason=Created + headers={'Location': '/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'content-length': '0'} + body=None + +${response} = <Response [201]> + + + +${response} +Create Context Source Registration +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Create Context Source Registration +Request -> +{ + "method": "POST", + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Type": "application/ld+json", + "Content-Length": "448" + }, + "body": { + "id": "urn:ngsi-ld:ContextSourceRegistration:4498222195898936", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Vehicle", + "id": "urn:ngsi-ld:Vehicle:5513668986908054" + } + ] + } + ], + "operations": [ + "redirectionOps" + ], + "endpoint": "http://192.168.155.119:9092/broker1", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ], + "mode": "redirect" + } +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", + "headers": { + "Location": "/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", + "content-length": "0" + }, + "status_code": 201, + "reason": "Created", + "body": null +} + + + +${response} + + +${response} = <Response [201]> + + + +201 +${response.status_code} + +${response_status_code} +${response_status_code} +Converts the given item to a Unicode string. +${response_status_code} = 201 + + + +${expected_status_code} +${response_status_code} +HTTP status code comparison failed with (expected, actual) -> +Fails if the given objects are unequal. + + + + + +${registration_id2} + +${entity_id} +${CSR_ID_PREFIX} + +${random_id} +16 +[NUMBERS] +Generates a string with a desired ``length`` from the given ``chars``. +${random_id} = 4682903117481091 + + + +${entity_id} +${id_prefix}${random_id} +Catenates the given items together and returns the resulted string. +${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + + + +${entity_id} + + +${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + + + +${entity_id} + + +${registration_id2} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + + + +${registration_id2} +Makes a variable available everywhere within the scope of the current suite. +${registration_id2} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + + + +${registration_payload2} +${registration_id2} +${registration_payload_file_path} +entity_id=${entity_id} +mode=redirect +endpoint=/broker2 + +${payload} +${EXECDIR}/data/${registration_file} +Load JSON from file. +${payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:randomUUID', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint': 'htt... + + + +${registration_payload} +${payload} +$.id +${id} +Update value to JSON using JSONPath +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... + + + +${registration_payload} +${registration_payload} +$..endpoint +${context_source_url}${endpoint} +Update value to JSON using JSONPath +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... + + + + + +${dict} +id=${entity_id} +Creates and returns a dictionary based on the given ``items``. +${dict} = {'id': 'urn:ngsi-ld:Vehicle:5513668986908054'} + + + +${registration_payload} +${registration_payload} +$..entities[*] +${dict} +Add an dictionary or list object to json object using json_path +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + + + + + + + +${dict} +mode=${mode} +Creates and returns a dictionary based on the given ``items``. +${dict} = {'mode': 'redirect'} + + + +${registration_payload} +${registration_payload} +$ +${dict} +Add an dictionary or list object to json object using json_path +${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + + + + + + + +${dict} +operations=${operations} +Creates and returns a dictionary based on the given ``items``. + + + +${registration_payload} +${registration_payload} +$ +${dict} +Add an dictionary or list object to json object using json_path + + + + + + + +${registration_payload} + + +${registration_payload2} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... + + + +${response} +${registration_payload2} + +&{headers} +Content-Type=${content_type} +Creates and returns a dictionary based on the given ``items``. +&{headers} = { Content-Type=application/ld+json } + + + + + +${headers} +Accept=${context} +Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. + + + + + + + + + +${context_link} +${context} + + + +${headers} +Link=${context_link} +Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. + + + + + + + +${response} +url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} +json=${payload} +headers=${headers} +expected_status=any +Sends a POST request. +POST Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations + path_url=/ngsi-ld/v1/csourceRegistrations + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/ld+json', 'Content-Length': '448'} + body=b'{"id": "urn:ngsi-ld:ContextSourceRegistration:4682903117481091", "type": "ContextSourceRegistration", "information": [{"entities": [{"type": "Vehicle", "id": "urn:ngsi-ld:Vehicle:5513668986908054"}]}], "operations": ["redirectionOps"], "endpoint": "http://192.168.155.119:9092/broker2", "@context": ["https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"], "mode": "redirect"}' + +POST Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations + status=201, reason=Created + headers={'Location': '/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'content-length': '0'} + body=None + +${response} = <Response [201]> + + + +${response} +Create Context Source Registration +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Create Context Source Registration +Request -> +{ + "method": "POST", + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Type": "application/ld+json", + "Content-Length": "448" + }, + "body": { + "id": "urn:ngsi-ld:ContextSourceRegistration:4682903117481091", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Vehicle", + "id": "urn:ngsi-ld:Vehicle:5513668986908054" + } + ] + } + ], + "operations": [ + "redirectionOps" + ], + "endpoint": "http://192.168.155.119:9092/broker2", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ], + "mode": "redirect" + } +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", + "headers": { + "Location": "/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", + "content-length": "0" + }, + "status_code": 201, + "reason": "Created", + "body": null +} + + + +${response} + + +${response} = <Response [201]> + + + +201 +${response.status_code} + +${response_status_code} +${response_status_code} +Converts the given item to a Unicode string. +${response_status_code} = 201 + + + +${expected_status_code} +${response_status_code} +HTTP status code comparison failed with (expected, actual) -> +Fails if the given objects are unequal. + + + + + + +${context_source_host} +${context_source_port} +Start HTTP server on specific address and port. Server should be closed when it is not required, for example, +when test is over. In case of double call of \`Start Server\`, the previous will be stopped and only then the +next one HTTP server will be started. +Prepare HTTP server '192.168.155.119:9092' and thread to serve it. +Exception in thread Thread-1 (start): +Traceback (most recent call last): + File "/home/bene/miniconda3/envs/ttf/lib/python3.11/threading.py", line 1045, in _bootstrap_inner + self.run() + File "/home/bene/miniconda3/envs/ttf/lib/python3.11/threading.py", line 982, in run + self._target(*self._args, **self._kwargs) + File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 47, in start + self.__server = self.__create_tcp_server() + ^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 85, in __create_tcp_server + return self.__create_ipv4_tcp_server() + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 104, in __create_ipv4_tcp_server + tcp_server = TCPServer((self.__host, self.__port), self.__handler) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/bene/miniconda3/envs/ttf/lib/python3.11/socketserver.py", line 456, in __init__ + self.server_bind() + File "/home/bene/miniconda3/envs/ttf/lib/python3.11/socketserver.py", line 472, in server_bind + self.socket.bind(self.server_address) +OSError: [Errno 99] Cannot assign requested address + + + + + + + + +${registration_id} + +${response} +url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} +Sends a DELETE request. +DELETE Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + path_url=/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} + body=None + +DELETE Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 + status=204, reason=No Content + headers={} + body=None + +${response} = <Response [204]> + + + +${response} +Delete Context Source Registration +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Delete Context Source Registration +Request -> +{ + "method": "DELETE", + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Length": "0" + }, + "body": null +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", + "headers": {}, + "status_code": 204, + "reason": "No Content", + "body": null +} + + + +${response} + + + + + +${registration_id2} + +${response} +url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} +Sends a DELETE request. +DELETE Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + path_url=/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} + body=None + +DELETE Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 + status=204, reason=No Content + headers={} + body=None + +${response} = <Response [204]> + + + +${response} +Delete Context Source Registration +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Delete Context Source Registration +Request -> +{ + "method": "DELETE", + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Length": "0" + }, + "body": null +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", + "headers": {}, + "status_code": 204, + "reason": "No Content", + "body": null +} + + + +${response} + + + + + +${entity_id} + +&{params} +Creates and returns a dictionary based on the given ``items``. +&{params} = { } + + + + + +${params} +local=${local} +Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. + + + + + + + +${response} +url=${url}/${ENTITIES_ENDPOINT_PATH}${id} +params=${params} +expected_status=any +Sends a DELETE request. +DELETE Request : url=http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 + path_url=/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} + body=None + +DELETE Response : url=http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 + status=404, reason=Not Found + headers={'content-length': '137', 'Content-Type': 'application/json'} + body={"type":"https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound","title":"Resource not found.","detail":"Resource not found.","status":404} + +${response} = <Response [404]> + + + + + +${id} + +${response} +url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} +expected_status=any +Sends a DELETE request. +DELETE Request : url=http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 + path_url=/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 + headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} + body=None + +DELETE Response : url=http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 + status=404, reason=Not Found + headers={'content-length': '221', 'Content-Type': 'application/json'} + body={"type":"https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound","title":"Resource not found.","detail":"urn:ngsi-ld:Vehicle:5513668986908054 does not exist","instanceId":"urn:ngsi-ld:Vehicle:5513668986908054","status":404} + +${response} = <Response [404]> + + + +${response} +Delete Temporal Representation Of Entity +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Delete Temporal Representation Of Entity +Request -> +{ + "method": "DELETE", + "url": "http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Length": "0" + }, + "body": null +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054", + "headers": { + "content-length": "221", + "Content-Type": "application/json" + }, + "status_code": 404, + "reason": "Not Found", + "body": { + "type": "https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound", + "title": "Resource not found.", + "detail": "urn:ngsi-ld:Vehicle:5513668986908054 does not exist", + "instanceId": "urn:ngsi-ld:Vehicle:5513668986908054", + "status": 404 + } +} + + + +${response} + + + + + + + + + +${response} +Delete Entity by Id +I/O +*Request and response are output to terminal and file (in JSON).* +:param response: response to a request +:param description: explains what request is being made +:param console: If false, the JSON is not written to terminal. Default is true. + +Delete Entity by Id +Request -> +{ + "method": "DELETE", + "url": "http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054", + "headers": { + "User-Agent": "python-requests/2.32.4", + "Accept-Encoding": "gzip, deflate", + "Accept": "*/*", + "Connection": "keep-alive", + "Content-Length": "0" + }, + "body": null +} +Response -> +{ + "url": "http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054", + "headers": { + "content-length": "137", + "Content-Type": "application/json" + }, + "status_code": 404, + "reason": "Not Found", + "body": { + "type": "https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound", + "title": "Resource not found.", + "detail": "Resource not found.", + "status": 404 + } +} + + + +${response} + + + + + + +Stop HTTP server if it has been started. This function should be called if server has been started. +HTTP server is stopped. + + + + + + +Check that if one retrieves an entity on the Context Source, entity gets redirected correctly +4_3_3 +4_3_6_3 +5_7_1 +cf_06 +dist-ops +proxy-redirect +since_v1.6.1 +Setup failed: +Execution terminated by signal + +Verify that when entities are registered on two Context Sources and retrieved locally an error is raised. + + + + +All Tests + + +4_3_3 +4_3_6_3 +5_7_1 +cf_06 +dist-ops +proxy-redirect +since_v1.6.1 + + +D010 02 red + + + + + diff --git a/report.html b/report.html new file mode 100644 index 00000000..f8a6e49e --- /dev/null +++ b/report.html @@ -0,0 +1,2462 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/variables.py b/resources/variables.py index 73857682..2796213d 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,14 +1,14 @@ -url = 'http://localhost:8080/ngsi-ld/v1' -temporal_api_url = 'http://localhost:8080/ngsi-ld/v1' +url = 'http://localhost:9090/ngsi-ld/v1' +temporal_api_url = 'http://localhost:9090/ngsi-ld/v1' ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' notification_server_host = '0.0.0.0' notification_server_port = 8085 mqtt_broker_host = '127.0.0.1' mqtt_broker_non_default_port = 8085 -context_source_host = '0.0.0.0' -context_source_port = 8086 -context_server_host = '0.0.0.0' -context_server_port = 8087 +context_source_host = '192.168.155.119' +context_source_port = 9092 +context_server_host = '192.168.155.119' +context_server_port = 9092 core_context = 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld' # whether the Temporal Representation of an Entity should be deleted when an Entity is deleted -- GitLab From 80bfcce41bd9cc13e5c4c3a19300e1a3aeaa9070 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 15:13:16 +0200 Subject: [PATCH 09/14] Reapply "feat: add retrieve entity tests" This reverts commit 94db57aaa5c5891f8b67c44e75d1af79007817e2. --- .../RetrieveEntity/D010_01_01_red.robot | 71 + .../RetrieveEntity/D010_01_02_red.robot | 68 + .../ReplaceEntity/D007_01_inc.robot | 70 - .../ReplaceEntity/D007_02_inc.robot | 57 - ...stration-vehicle-no-redirection-ops.jsonld | 17 - .../vehicle-speed-different-attribute.json | 12 - log.html | 2199 --------------- output.xml | 972 ------- report.html | 2462 ----------------- resources/variables.py | 12 +- 10 files changed, 145 insertions(+), 5795 deletions(-) create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot create mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot delete mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot delete mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot delete mode 100644 data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld delete mode 100644 data/entities/vehicle-speed-different-attribute.json delete mode 100644 log.html delete mode 100644 output.xml delete mode 100644 report.html diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot new file mode 100644 index 00000000..5f6c8191 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot @@ -0,0 +1,71 @@ +** Settings *** +Documentation Verify that when a fragmented entity remotely exists on two Context Sources, a retrival request to the Context Broker is correctly forwarded to the Context Sources and the response contains the whole identity. + +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 Create Entity And Registration And Start Context Source Mock Server +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.json +${entity_payload_filename2} vehicle-simple-attributes-second.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_01_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} + + ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_query.status_code} + + Should Have Value In Json ${response_query.json()} $.brandName + Should Have Value In Json ${response_query.json()} $.isParked2 + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + 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_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot new file mode 100644 index 00000000..45487e48 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot @@ -0,0 +1,68 @@ +* Settings *** +Documentation Verify that when entities are registered on a Context Source, they get redirected correctly to the Context Broker by their entity type. + +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 Create Entity And Registration And Start Context Source Mock Server +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.json +${entity_payload_filename2} vehicle-simple-attributes-second.json +${registration_id_prefix} urn:ngsi-ld:Registration: +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + + +*** Test Cases *** +D010_01_02_red Create Entity and Registration And Start Context Source Mock Server + [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} + + ${response_query}= Retrieve Entity Type type=Vehicle context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_query.status_code} + +*** Keywords *** +Create Entity And Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${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=redirect + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + + ${registration_id2}= Generate Random CSR Id + Set Suite Variable ${registration_id2} + ${registration_payload2}= Prepare Context Source Registration From File + ... ${registration_id2} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=redirect + ... endpoint=/broker2 + ${response}= Create Context Source Registration With Return ${registration_payload2} + Check Response Status Code 201 ${response.status_code} + + Start Context Source Mock Server + +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Delete Entity By Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot deleted file mode 100644 index 6fc4ad55..00000000 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_01_inc.robot +++ /dev/null @@ -1,70 +0,0 @@ -*** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to replace an entire entity on both Context Broker and Context Source - -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 Entity Id And Registration And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server - - -*** Variables *** -${entity_payload_filename} vehicle-simple-attributes.jsonld -${entity_new_payload_filename} vehicle-simple-attributes-second.json -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D007_01_inc Create Entity On Both Context Broker and Context Source - [Documentation] Check that if one requests the Context Broker to replace an entity that matches an inclusive registration, this is replaced on the Context Source too - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 - - Set Stub Reply POST /broker1/ngsi-ld/v1/entities 201 - ${response}= Create Entity ${entity_payload_filename} ${entity_id} - Check Response Status Code 201 ${response.status_code} - - Set Stub Reply PUT /broker1/ngsi-ld/v1/entities/${entity_id} 204 - ${response}= Replace Entity ${entity_id} ${entity_new_payload_filename} content_type=${CONTENT_TYPE_JSON} - Check Response Status Code 204 ${response.status_code} - ${stub_count}= Get Stub Count PUT /broker1/ngsi-ld/v1/entities/${entity_id} - Should Be True ${stub_count} > 0 - - # Wait for redirected request - # ${request_payload}= Get Request Body - # ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json - # @{entities_id}= Create List ${entity_id} - # Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} - - # ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} - # Check Response Status Code 200 ${response_query.status_code} - # Check Response Body Containing Entities URIS set to ${entities_id} ${response_query.json()} - - -*** Keywords *** -Setup Entity Id And Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${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=inclusive - ... 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 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/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot deleted file mode 100644 index ada4e310..00000000 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/ReplaceEntity/D007_02_inc.robot +++ /dev/null @@ -1,57 +0,0 @@ -*** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to replace an entire entity on both Context Broker and Context Source - -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 Entity Id And Registration And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server - - -*** Variables *** -${entity_payload_filename} vehicle-simple-attributes.jsonld -${entity_new_payload_filename} vehicle-simple-attributes-second.json -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D007_01_inc Create Entity On Both Context Broker and Context Source - [Documentation] Check that if one requests the Context Broker to replace an entity that matches an inclusive registration, this is replaced on the Context Source too - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 - - Set Stub Reply PUT /broker1/ngsi-ld/v1/entities/${entity_id} 207 - ${response}= Replace Entity ${entity_id} ${entity_new_payload_filename} content_type=${CONTENT_TYPE_JSON} - ${stub_count}= Get Stub Count PUT /broker1/ngsi-ld/v1/entities/${entity_id} - Should Be True ${stub_count} == 0 - -*** Keywords *** -Setup Entity Id And 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=inclusive - ... 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 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-no-redirection-ops.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld deleted file mode 100644 index 27bb8310..00000000 --- a/data/csourceRegistrations/context-source-registration-vehicle-no-redirection-ops.jsonld +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type": "ContextSourceRegistration", - "information": [ - { - "entities": [ - { - "type": "Vehicle" - } - ] - } - ], - "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-different-attribute.json b/data/entities/vehicle-speed-different-attribute.json deleted file mode 100644 index bff88a0c..00000000 --- a/data/entities/vehicle-speed-different-attribute.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": "urn:ngsi-ld:Vehicle:randomUUID", - "type": "Vehicle", - "speed": { - "type": "Property", - "value": 66, - "source": { - "type": "Property", - "value": "Speedometer" - } - } -} \ No newline at end of file diff --git a/log.html b/log.html deleted file mode 100644 index 13d572e6..00000000 --- a/log.html +++ /dev/null @@ -1,2199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Opening Robot Framework log failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/output.xml b/output.xml deleted file mode 100644 index 2e857165..00000000 --- a/output.xml +++ /dev/null @@ -1,972 +0,0 @@ - - - - - - -${entity_id} - -${entity_id} -${VEHICLE_ID_PREFIX} - -${random_id} -16 -[NUMBERS] -Generates a string with a desired ``length`` from the given ``chars``. -${random_id} = 5513668986908054 - - - -${entity_id} -${id_prefix}${random_id} -Catenates the given items together and returns the resulted string. -${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 - - - -${entity_id} - - -${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 - - - -${entity_id} - - -${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 - - - -${entity_id} -Makes a variable available everywhere within the scope of the current suite. -${entity_id} = urn:ngsi-ld:Vehicle:5513668986908054 - - - -${registration_id} - -${entity_id} -${CSR_ID_PREFIX} - -${random_id} -16 -[NUMBERS] -Generates a string with a desired ``length`` from the given ``chars``. -${random_id} = 4498222195898936 - - - -${entity_id} -${id_prefix}${random_id} -Catenates the given items together and returns the resulted string. -${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - - - -${entity_id} - - -${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - - - -${entity_id} - - -${registration_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - - - -${registration_id} -Makes a variable available everywhere within the scope of the current suite. -${registration_id} = urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - - - -${registration_payload} -${registration_id} -${registration_payload_file_path} -entity_id=${entity_id} -mode=redirect -endpoint=/broker1 - -${payload} -${EXECDIR}/data/${registration_file} -Load JSON from file. -${payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:randomUUID', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint': 'htt... - - - -${registration_payload} -${payload} -$.id -${id} -Update value to JSON using JSONPath -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... - - - -${registration_payload} -${registration_payload} -$..endpoint -${context_source_url}${endpoint} -Update value to JSON using JSONPath -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... - - - - - -${dict} -id=${entity_id} -Creates and returns a dictionary based on the given ``items``. -${dict} = {'id': 'urn:ngsi-ld:Vehicle:5513668986908054'} - - - -${registration_payload} -${registration_payload} -$..entities[*] -${dict} -Add an dictionary or list object to json object using json_path -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - - - - - - - -${dict} -mode=${mode} -Creates and returns a dictionary based on the given ``items``. -${dict} = {'mode': 'redirect'} - - - -${registration_payload} -${registration_payload} -$ -${dict} -Add an dictionary or list object to json object using json_path -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - - - - - - - -${dict} -operations=${operations} -Creates and returns a dictionary based on the given ``items``. - - - -${registration_payload} -${registration_payload} -$ -${dict} -Add an dictionary or list object to json object using json_path - - - - - - - -${registration_payload} - - -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - -${response} -${registration_payload} - -&{headers} -Content-Type=${content_type} -Creates and returns a dictionary based on the given ``items``. -&{headers} = { Content-Type=application/ld+json } - - - - - -${headers} -Accept=${context} -Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. - - - - - - - - - -${context_link} -${context} - - - -${headers} -Link=${context_link} -Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. - - - - - - - -${response} -url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} -json=${payload} -headers=${headers} -expected_status=any -Sends a POST request. -POST Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations - path_url=/ngsi-ld/v1/csourceRegistrations - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/ld+json', 'Content-Length': '448'} - body=b'{"id": "urn:ngsi-ld:ContextSourceRegistration:4498222195898936", "type": "ContextSourceRegistration", "information": [{"entities": [{"type": "Vehicle", "id": "urn:ngsi-ld:Vehicle:5513668986908054"}]}], "operations": ["redirectionOps"], "endpoint": "http://192.168.155.119:9092/broker1", "@context": ["https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"], "mode": "redirect"}' - -POST Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations - status=201, reason=Created - headers={'Location': '/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936', 'content-length': '0'} - body=None - -${response} = <Response [201]> - - - -${response} -Create Context Source Registration -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Create Context Source Registration -Request -> -{ - "method": "POST", - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Type": "application/ld+json", - "Content-Length": "448" - }, - "body": { - "id": "urn:ngsi-ld:ContextSourceRegistration:4498222195898936", - "type": "ContextSourceRegistration", - "information": [ - { - "entities": [ - { - "type": "Vehicle", - "id": "urn:ngsi-ld:Vehicle:5513668986908054" - } - ] - } - ], - "operations": [ - "redirectionOps" - ], - "endpoint": "http://192.168.155.119:9092/broker1", - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ], - "mode": "redirect" - } -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", - "headers": { - "Location": "/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", - "content-length": "0" - }, - "status_code": 201, - "reason": "Created", - "body": null -} - - - -${response} - - -${response} = <Response [201]> - - - -201 -${response.status_code} - -${response_status_code} -${response_status_code} -Converts the given item to a Unicode string. -${response_status_code} = 201 - - - -${expected_status_code} -${response_status_code} -HTTP status code comparison failed with (expected, actual) -> -Fails if the given objects are unequal. - - - - - -${registration_id2} - -${entity_id} -${CSR_ID_PREFIX} - -${random_id} -16 -[NUMBERS] -Generates a string with a desired ``length`` from the given ``chars``. -${random_id} = 4682903117481091 - - - -${entity_id} -${id_prefix}${random_id} -Catenates the given items together and returns the resulted string. -${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - - - -${entity_id} - - -${entity_id} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - - - -${entity_id} - - -${registration_id2} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - - - -${registration_id2} -Makes a variable available everywhere within the scope of the current suite. -${registration_id2} = urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - - - -${registration_payload2} -${registration_id2} -${registration_payload_file_path} -entity_id=${entity_id} -mode=redirect -endpoint=/broker2 - -${payload} -${EXECDIR}/data/${registration_file} -Load JSON from file. -${payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:randomUUID', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint': 'htt... - - - -${registration_payload} -${payload} -$.id -${id} -Update value to JSON using JSONPath -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... - - - -${registration_payload} -${registration_payload} -$..endpoint -${context_source_url}${endpoint} -Update value to JSON using JSONPath -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle'}]}], 'operations': ['redirectionOps'], 'endpoint'... - - - - - -${dict} -id=${entity_id} -Creates and returns a dictionary based on the given ``items``. -${dict} = {'id': 'urn:ngsi-ld:Vehicle:5513668986908054'} - - - -${registration_payload} -${registration_payload} -$..entities[*] -${dict} -Add an dictionary or list object to json object using json_path -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - - - - - - - -${dict} -mode=${mode} -Creates and returns a dictionary based on the given ``items``. -${dict} = {'mode': 'redirect'} - - - -${registration_payload} -${registration_payload} -$ -${dict} -Add an dictionary or list object to json object using json_path -${registration_payload} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - - - - - - - -${dict} -operations=${operations} -Creates and returns a dictionary based on the given ``items``. - - - -${registration_payload} -${registration_payload} -$ -${dict} -Add an dictionary or list object to json object using json_path - - - - - - - -${registration_payload} - - -${registration_payload2} = {'id': 'urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'type': 'ContextSourceRegistration', 'information': [{'entities': [{'type': 'Vehicle', 'id': 'urn:ngsi-ld:Vehicle:5513668986908054'}]}]... - - - -${response} -${registration_payload2} - -&{headers} -Content-Type=${content_type} -Creates and returns a dictionary based on the given ``items``. -&{headers} = { Content-Type=application/ld+json } - - - - - -${headers} -Accept=${context} -Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. - - - - - - - - - -${context_link} -${context} - - - -${headers} -Link=${context_link} -Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. - - - - - - - -${response} -url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} -json=${payload} -headers=${headers} -expected_status=any -Sends a POST request. -POST Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations - path_url=/ngsi-ld/v1/csourceRegistrations - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/ld+json', 'Content-Length': '448'} - body=b'{"id": "urn:ngsi-ld:ContextSourceRegistration:4682903117481091", "type": "ContextSourceRegistration", "information": [{"entities": [{"type": "Vehicle", "id": "urn:ngsi-ld:Vehicle:5513668986908054"}]}], "operations": ["redirectionOps"], "endpoint": "http://192.168.155.119:9092/broker2", "@context": ["https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"], "mode": "redirect"}' - -POST Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations - status=201, reason=Created - headers={'Location': '/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091', 'content-length': '0'} - body=None - -${response} = <Response [201]> - - - -${response} -Create Context Source Registration -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Create Context Source Registration -Request -> -{ - "method": "POST", - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Type": "application/ld+json", - "Content-Length": "448" - }, - "body": { - "id": "urn:ngsi-ld:ContextSourceRegistration:4682903117481091", - "type": "ContextSourceRegistration", - "information": [ - { - "entities": [ - { - "type": "Vehicle", - "id": "urn:ngsi-ld:Vehicle:5513668986908054" - } - ] - } - ], - "operations": [ - "redirectionOps" - ], - "endpoint": "http://192.168.155.119:9092/broker2", - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ], - "mode": "redirect" - } -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations", - "headers": { - "Location": "/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", - "content-length": "0" - }, - "status_code": 201, - "reason": "Created", - "body": null -} - - - -${response} - - -${response} = <Response [201]> - - - -201 -${response.status_code} - -${response_status_code} -${response_status_code} -Converts the given item to a Unicode string. -${response_status_code} = 201 - - - -${expected_status_code} -${response_status_code} -HTTP status code comparison failed with (expected, actual) -> -Fails if the given objects are unequal. - - - - - - -${context_source_host} -${context_source_port} -Start HTTP server on specific address and port. Server should be closed when it is not required, for example, -when test is over. In case of double call of \`Start Server\`, the previous will be stopped and only then the -next one HTTP server will be started. -Prepare HTTP server '192.168.155.119:9092' and thread to serve it. -Exception in thread Thread-1 (start): -Traceback (most recent call last): - File "/home/bene/miniconda3/envs/ttf/lib/python3.11/threading.py", line 1045, in _bootstrap_inner - self.run() - File "/home/bene/miniconda3/envs/ttf/lib/python3.11/threading.py", line 982, in run - self._target(*self._args, **self._kwargs) - File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 47, in start - self.__server = self.__create_tcp_server() - ^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 85, in __create_tcp_server - return self.__create_ipv4_tcp_server() - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/home/bene/Desktop/NS/ngsi-ld-test-suite/libraries/robotframework-httpctrl/src/HttpCtrl/http_server.py", line 104, in __create_ipv4_tcp_server - tcp_server = TCPServer((self.__host, self.__port), self.__handler) - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - File "/home/bene/miniconda3/envs/ttf/lib/python3.11/socketserver.py", line 456, in __init__ - self.server_bind() - File "/home/bene/miniconda3/envs/ttf/lib/python3.11/socketserver.py", line 472, in server_bind - self.socket.bind(self.server_address) -OSError: [Errno 99] Cannot assign requested address - - - - - - - - -${registration_id} - -${response} -url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} -Sends a DELETE request. -DELETE Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - path_url=/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} - body=None - -DELETE Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936 - status=204, reason=No Content - headers={} - body=None - -${response} = <Response [204]> - - - -${response} -Delete Context Source Registration -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Delete Context Source Registration -Request -> -{ - "method": "DELETE", - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Length": "0" - }, - "body": null -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4498222195898936", - "headers": {}, - "status_code": 204, - "reason": "No Content", - "body": null -} - - - -${response} - - - - - -${registration_id2} - -${response} -url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} -Sends a DELETE request. -DELETE Request : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - path_url=/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} - body=None - -DELETE Response : url=http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091 - status=204, reason=No Content - headers={} - body=None - -${response} = <Response [204]> - - - -${response} -Delete Context Source Registration -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Delete Context Source Registration -Request -> -{ - "method": "DELETE", - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Length": "0" - }, - "body": null -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/csourceRegistrations/urn:ngsi-ld:ContextSourceRegistration:4682903117481091", - "headers": {}, - "status_code": 204, - "reason": "No Content", - "body": null -} - - - -${response} - - - - - -${entity_id} - -&{params} -Creates and returns a dictionary based on the given ``items``. -&{params} = { } - - - - - -${params} -local=${local} -Adds the given ``key_value_pairs`` and/or ``items`` to the ``dictionary``. - - - - - - - -${response} -url=${url}/${ENTITIES_ENDPOINT_PATH}${id} -params=${params} -expected_status=any -Sends a DELETE request. -DELETE Request : url=http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 - path_url=/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} - body=None - -DELETE Response : url=http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054 - status=404, reason=Not Found - headers={'content-length': '137', 'Content-Type': 'application/json'} - body={"type":"https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound","title":"Resource not found.","detail":"Resource not found.","status":404} - -${response} = <Response [404]> - - - - - -${id} - -${response} -url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} -expected_status=any -Sends a DELETE request. -DELETE Request : url=http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 - path_url=/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 - headers={'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Length': '0'} - body=None - -DELETE Response : url=http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054 - status=404, reason=Not Found - headers={'content-length': '221', 'Content-Type': 'application/json'} - body={"type":"https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound","title":"Resource not found.","detail":"urn:ngsi-ld:Vehicle:5513668986908054 does not exist","instanceId":"urn:ngsi-ld:Vehicle:5513668986908054","status":404} - -${response} = <Response [404]> - - - -${response} -Delete Temporal Representation Of Entity -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Delete Temporal Representation Of Entity -Request -> -{ - "method": "DELETE", - "url": "http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Length": "0" - }, - "body": null -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/temporal/entities/urn:ngsi-ld:Vehicle:5513668986908054", - "headers": { - "content-length": "221", - "Content-Type": "application/json" - }, - "status_code": 404, - "reason": "Not Found", - "body": { - "type": "https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound", - "title": "Resource not found.", - "detail": "urn:ngsi-ld:Vehicle:5513668986908054 does not exist", - "instanceId": "urn:ngsi-ld:Vehicle:5513668986908054", - "status": 404 - } -} - - - -${response} - - - - - - - - - -${response} -Delete Entity by Id -I/O -*Request and response are output to terminal and file (in JSON).* -:param response: response to a request -:param description: explains what request is being made -:param console: If false, the JSON is not written to terminal. Default is true. - -Delete Entity by Id -Request -> -{ - "method": "DELETE", - "url": "http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054", - "headers": { - "User-Agent": "python-requests/2.32.4", - "Accept-Encoding": "gzip, deflate", - "Accept": "*/*", - "Connection": "keep-alive", - "Content-Length": "0" - }, - "body": null -} -Response -> -{ - "url": "http://localhost:9090/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:5513668986908054", - "headers": { - "content-length": "137", - "Content-Type": "application/json" - }, - "status_code": 404, - "reason": "Not Found", - "body": { - "type": "https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound", - "title": "Resource not found.", - "detail": "Resource not found.", - "status": 404 - } -} - - - -${response} - - - - - - -Stop HTTP server if it has been started. This function should be called if server has been started. -HTTP server is stopped. - - - - - - -Check that if one retrieves an entity on the Context Source, entity gets redirected correctly -4_3_3 -4_3_6_3 -5_7_1 -cf_06 -dist-ops -proxy-redirect -since_v1.6.1 -Setup failed: -Execution terminated by signal - -Verify that when entities are registered on two Context Sources and retrieved locally an error is raised. - - - - -All Tests - - -4_3_3 -4_3_6_3 -5_7_1 -cf_06 -dist-ops -proxy-redirect -since_v1.6.1 - - -D010 02 red - - - - - diff --git a/report.html b/report.html deleted file mode 100644 index f8a6e49e..00000000 --- a/report.html +++ /dev/null @@ -1,2462 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Opening Robot Framework report failed

-
    -
  • Verify that you have JavaScript enabled in your browser.
  • -
  • Make sure you are using a modern enough browser. If using Internet Explorer, version 11 is required.
  • -
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • -
-
- - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/variables.py b/resources/variables.py index 2796213d..73857682 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,14 +1,14 @@ -url = 'http://localhost:9090/ngsi-ld/v1' -temporal_api_url = 'http://localhost:9090/ngsi-ld/v1' +url = 'http://localhost:8080/ngsi-ld/v1' +temporal_api_url = 'http://localhost:8080/ngsi-ld/v1' ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' notification_server_host = '0.0.0.0' notification_server_port = 8085 mqtt_broker_host = '127.0.0.1' mqtt_broker_non_default_port = 8085 -context_source_host = '192.168.155.119' -context_source_port = 9092 -context_server_host = '192.168.155.119' -context_server_port = 9092 +context_source_host = '0.0.0.0' +context_source_port = 8086 +context_server_host = '0.0.0.0' +context_server_port = 8087 core_context = 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld' # whether the Temporal Representation of an Entity should be deleted when an Entity is deleted -- GitLab From b4828122f18a98de2bcea110c070c9bb67700bf8 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 30 Sep 2025 15:39:40 +0200 Subject: [PATCH 10/14] fix: remove incorrect tests --- .../RetrieveEntity/D010_01_01_red.robot | 71 ------------------- .../RetrieveEntity/D010_01_02_red.robot | 68 ------------------ 2 files changed, 139 deletions(-) delete mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot delete mode 100644 TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot deleted file mode 100644 index 5f6c8191..00000000 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_01_red.robot +++ /dev/null @@ -1,71 +0,0 @@ -** Settings *** -Documentation Verify that when a fragmented entity remotely exists on two Context Sources, a retrival request to the Context Broker is correctly forwarded to the Context Sources and the response contains the whole identity. - -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 Create Entity And Registration And Start Context Source Mock Server -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.json -${entity_payload_filename2} vehicle-simple-attributes-second.json -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D010_01_01_red Create Entity and Registration And Start Context Source Mock Server - [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} - ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} - Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} - Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} - - ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_query.status_code} - - Should Have Value In Json ${response_query.json()} $.brandName - Should Have Value In Json ${response_query.json()} $.isParked2 - -*** Keywords *** -Create Entity And Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${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=redirect - ... endpoint=/broker1 - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - - ${registration_id2}= Generate Random CSR Id - Set Suite Variable ${registration_id2} - ${registration_payload2}= Prepare Context Source Registration From File - ... ${registration_id2} - ... ${registration_payload_file_path} - ... entity_id=${entity_id} - ... mode=redirect - ... endpoint=/broker2 - ${response}= Create Context Source Registration With Return ${registration_payload2} - Check Response Status Code 201 ${response.status_code} - - Start Context Source Mock Server - -Delete Created Entity And Registration And Stop Context Source Mock Server - Delete Context Source Registration ${registration_id} - Delete Context Source Registration ${registration_id2} - 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_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot deleted file mode 100644 index 45487e48..00000000 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_02_red.robot +++ /dev/null @@ -1,68 +0,0 @@ -* Settings *** -Documentation Verify that when entities are registered on a Context Source, they get redirected correctly to the Context Broker by their entity type. - -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 Create Entity And Registration And Start Context Source Mock Server -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.json -${entity_payload_filename2} vehicle-simple-attributes-second.json -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld - - -*** Test Cases *** -D010_01_02_red Create Entity and Registration And Start Context Source Mock Server - [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} - ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} - Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} - Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} - - ${response_query}= Retrieve Entity Type type=Vehicle context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_query.status_code} - -*** Keywords *** -Create Entity And Registration And Start Context Source Mock Server - ${entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${entity_id} - - ${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=redirect - ... endpoint=/broker1 - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - - ${registration_id2}= Generate Random CSR Id - Set Suite Variable ${registration_id2} - ${registration_payload2}= Prepare Context Source Registration From File - ... ${registration_id2} - ... ${registration_payload_file_path} - ... entity_id=${entity_id} - ... mode=redirect - ... endpoint=/broker2 - ${response}= Create Context Source Registration With Return ${registration_payload2} - Check Response Status Code 201 ${response.status_code} - - Start Context Source Mock Server - -Delete Created Entity And Registration And Stop Context Source Mock Server - Delete Context Source Registration ${registration_id} - Delete Context Source Registration ${registration_id2} - Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file -- GitLab From a8a178e4bc48cff36d909f19309d8b63e7e4f201 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 2 Oct 2025 17:49:59 +0200 Subject: [PATCH 11/14] fix: apply requested changes --- .../Entity/QueryEntities/D011_02_red.robot | 12 +++++++----- .../Entity/QueryEntities/D011_03_red.robot | 6 +++--- .../Entity/RetrieveEntity/D010_01_red.robot | 12 ++++++++++-- .../Entity/RetrieveEntity/D010_02_red.robot | 9 +++++---- .../Entity/RetrieveEntity/D010_03_red.robot | 17 ++++++++--------- 5 files changed, 33 insertions(+), 23 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot index 002f6330..0e0908df 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.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, if one queries the Context Broker the request gets forwarded to the Context Source correctly using the appropriate operation +Documentation Verify that, when one has an redirect registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the request gets forwarded to the Context Source correctly using only the queryEntity or the queryBatch operation Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -20,13 +20,13 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_02_01_red Query The Context Broker By Id using the queryEntity operation +D011_02_01_red Query The Context Broker By Id with a context source having only 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-redirect 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_red Query The Context Broker By Id using the queryBatch operation +D011_02_02_red Query The Context Broker By Id with a context source having only 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-redirect 4_3_6_2 5_7_2 [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type @@ -49,10 +49,12 @@ Setup Registration, Context Source Mock Server And Query The Context Broker With ... 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_body}= Load Entity ${entity_payload_filename} ${entity_id} - Set Stub Reply ${method} ${url} 200 ${entity_body} + @{entity_list}= Create List ${entity_body} + Set Stub Reply ${method} ${url} 200 ${entity_list} + @{entities_id}= Create List ${entity_id} ${response}= Query Entities entity_ids=${entities_id} context=${ngsild_test_suite_context} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot index 1b901333..1a10011e 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.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, if one queries the Context Broker Via Post the request gets forwarded to the Context Source correctly using the appropriate operation +Documentation Verify that, when one has a redirect registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker Via Post the request gets forwarded to the Context Source correctly using the appropriate operation Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -20,13 +20,13 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_04_01_inc Query The Context Broker By Id Via POST using the queryBatch operation +D011_03_01_red 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 -D011_04_02_inc Query The Context Broker By Id Via POST using the queryEntity operation +D011_03_02_red Query The Context Broker By Id Via POST using the queryEntity operation [Documentation] Check that if one queries the Context Broker for type via POST, 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 diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot index 8f564cfc..bb9c48bb 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot @@ -21,16 +21,24 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** -D010_01_01_red Create Entity and Registration And Start Context Source Mock Server +D010_01_red Query Context Broker And Retrieve Entity By Id [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_query.status_code} + + ${stub_count}= Get Stub Count GET /broker1/ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} > 0 + ${stub_count}= Get Stub Count GET /broker2/ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} > 0 + + Should Have Value In Json ${response_query.json()} $.isParked + Should Have Value In Json ${response_query.json()} $.isParked2 *** Keywords *** Create Entity And Registration And Start Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot index 383758a7..ba20546e 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot @@ -22,13 +22,14 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** -D010_01_02_red Create Entity and Registration And Start Context Source Mock Server - [Documentation] Check that if one retrieves an entity on the Context Source, entity gets redirected correctly +D010_02_red Query Context Broker And Retrieve Entity By Id + [Documentation] Check that if one retrieves an entity on the Context Source, the request raises an error when retrieved locally [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} local=${true} - - Wait For No Request Check Response Status Code 404 ${response_query.status_code} + ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} == 0 *** Keywords *** Create Entity And Registration And Start Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot index d06c0803..c33f3f1c 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot @@ -9,7 +9,7 @@ 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 Template Retrieve Entity By Id With Correct Operation Test Teardown Delete Registration And Stop Context Source Mock Server @@ -20,26 +20,26 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D010_03_01_red Retrieve Entity By Id using the retrieveEntity operation +D010_03_01_red Retrieve Entity By Id with a context source having only 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 - [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + [Template] Retrieve Entity By Id With Correct Operation retrieveEntity GET /broker1/ngsi-ld/v1/entities/ -D010_03_02_red Retrieve Entity By Id using the queryEntity operation +D010_03_02_red Retrieve Entity By Id with a context source having only the queryEntity operation [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, 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_1 - [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + [Template] Retrieve Entity By Id With Correct Operation queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle -D010_03_03_red Retrieve Entity By Id using the queryBatch operation +D010_03_03_red Retrieve Entity By Id with a context source having only the query by post operation [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, 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_1 - [Template] Setup Registration, Context Source Mock Server And Retrieve Entity + [Template] Retrieve Entity By Id With Correct Operation queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query *** Keywords *** -Setup Registration, Context Source Mock Server And Retrieve Entity +Retrieve Entity By Id With Correct Operation [Arguments] ${operation} ${method} ${url} ${entity_id}= Generate Random Vehicle Entity Id @@ -70,5 +70,4 @@ Setup Registration, Context Source Mock Server And Retrieve Entity 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 714ff4beb9750528e8d8d34bc76c6a24c773fbb5 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 7 Oct 2025 15:30:46 +0200 Subject: [PATCH 12/14] fix: implement additional review feedback --- .../Entity/QueryEntities/D011_02_red.robot | 8 +------- .../Entity/QueryEntities/D011_03_red.robot | 9 ++------- .../Entity/RetrieveEntity/D010_01_red.robot | 4 ++-- .../Entity/RetrieveEntity/D010_02_red.robot | 15 +++++++++++---- .../Entity/RetrieveEntity/D010_03_red.robot | 19 +++++++++++++------ 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot index 0e0908df..6fcdddfb 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot @@ -20,18 +20,12 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_02_01_red Query The Context Broker By Id with a context source having only the queryEntity operation +D011_02_red Query The Context Broker By Id with a context source having only 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-redirect 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_red Query The Context Broker By Id with a context source having only 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-redirect 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 [Arguments] ${operation} ${method} ${url} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot index 1a10011e..5313d33c 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot @@ -20,13 +20,7 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_03_01_red 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 - -D011_03_02_red Query The Context Broker By Id Via POST using the queryEntity operation +D011_03_red Query The Context Broker By Id Via POST using the queryEntity operation [Documentation] Check that if one queries the Context Broker for type via POST, 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 @@ -52,6 +46,7 @@ Setup Registration, Context Source Mock Server And Query The Context Broker With ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} Set Stub Reply ${method} ${url} 200 ${entity_body} + &{entities}= Create Dictionary Set To Dictionary ${entities} id=${entity_id} @{entities}= Create List ${entities} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot index bb9c48bb..1a89e1d1 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_red.robot @@ -9,7 +9,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entity And Registration And Start Context Source Mock Server +Test Setup Setup Registration And Start Context Source Mock Server Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -41,7 +41,7 @@ D010_01_red Query Context Broker And Retrieve Entity By Id Should Have Value In Json ${response_query.json()} $.isParked2 *** Keywords *** -Create Entity And Registration And Start Context Source Mock Server +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_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot index ba20546e..f7ef847f 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot @@ -10,7 +10,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource Resource ../../../../../../resources/ApiUtils/ContextInformationConsumption.resource -Test Setup Create Entity And Registration And Start Context Source Mock Server +Test Setup Setup Registration And Start Context Source Mock Server Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,16 +23,23 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D010_02_red Query Context Broker And Retrieve Entity By Id - [Documentation] Check that if one retrieves an entity on the Context Source, the request raises an error when retrieved locally + [Documentation] Check that if when retrieving an entity with local=true the Context Broker does not forward the request and raises an error [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} + Set Stub Reply GET /broker1/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} + Set Stub Reply GET /broker2/ngsi-ld/v1/entities/${entity_id} 200 ${entity_body2} ${response_query}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} local=${true} Check Response Status Code 404 ${response_query.status_code} - ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities/${entity_id} + + ${stub_count}= Get Stub Count GET /broker1/ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} == 0 + ${stub_count}= Get Stub Count GET /broker2/ngsi-ld/v1/entities/${entity_id} Should Be True ${stub_count} == 0 *** Keywords *** -Create Entity And Registration And Start Context Source Mock Server +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_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot index c33f3f1c..8ffdd8ad 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_red.robot @@ -32,11 +32,12 @@ D010_03_02_red Retrieve Entity By Id with a context source having only the query [Template] Retrieve Entity By Id With Correct Operation queryEntity GET /broker1/ngsi-ld/v1/entities?type=Vehicle -D010_03_03_red Retrieve Entity By Id with a context source having only the query by post operation - [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the queryBatch operation, the request is forwarded as expected +D010_03_03_red Retrieve Entity By Id with a context source having only the queryBatch operation + [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the query by post 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 [Template] Retrieve Entity By Id With Correct Operation queryBatch POST /broker1/ngsi-ld/v1/entityOperations/query + *** Keywords *** Retrieve Entity By Id With Correct Operation @@ -62,11 +63,17 @@ Retrieve Entity By Id With Correct Operation Start Context Source Mock Server ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} - Set Stub Reply ${method} ${url} 200 ${entity_body} - ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} - - Check Response Status Code 200 ${response.status_code} + IF '${operation}' == 'retrieveEntity' + Set Stub Reply ${method} ${url} 200 ${entity_body} + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + ELSE + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} + ${stub_count}= Get Stub Count ${method} ${url} + Check Response Status Code 404 ${response.status_code} + Should Be True ${stub_count} == 0 + END Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} -- GitLab From 13389a28440e900f43315aeb5303ea036ecb6d0a Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 9 Oct 2025 10:59:43 +0200 Subject: [PATCH 13/14] fix: update documentations --- .../Consumption/Entity/RetrieveEntity/D010_02_red.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot index f7ef847f..77819ffa 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_red.robot @@ -1,5 +1,5 @@ * Settings *** -Documentation Verify that when entities are registered on two Context Sources and retrieved locally an error is raised. +Documentation Check that when retrieving an entity locally, the Context Broker does not forward the request to the Context Sources and raises an error. Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -23,7 +23,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D010_02_red Query Context Broker And Retrieve Entity By Id - [Documentation] Check that if when retrieving an entity with local=true the Context Broker does not forward the request and raises an error + [Documentation] Check that when retrieving an entity locally, the Context Broker does not forward the request to the Context Sources and raises an error. [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_7_1 ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} ${entity_body2}= Load Entity ${entity_payload_filename2} ${entity_id} -- GitLab From 57915b649e74139f85b1ff0f7270777feaff835a Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 9 Oct 2025 11:25:49 +0200 Subject: [PATCH 14/14] fix: revert errors introduced in tests --- .../Consumption/Entity/QueryEntities/D011_02_red.robot | 8 +++++++- .../Consumption/Entity/QueryEntities/D011_03_red.robot | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot index 6fcdddfb..0e0908df 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_red.robot @@ -20,12 +20,18 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_02_red Query The Context Broker By Id with a context source having only the queryEntity operation +D011_02_01_red Query The Context Broker By Id with a context source having only 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-redirect 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_red Query The Context Broker By Id with a context source having only 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-redirect 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 [Arguments] ${operation} ${method} ${url} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot index 5313d33c..65a11198 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_red.robot @@ -20,7 +20,13 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** -D011_03_red Query The Context Broker By Id Via POST using the queryEntity operation +D011_03_01_red 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 + +D011_03_02_red Query The Context Broker By Id Via POST using the queryEntity operation [Documentation] Check that if one queries the Context Broker for type via POST, 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 -- GitLab