From 2705514ac14998879bbe26a41f0baee0f1a0c9f6 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 16:38:27 +0100 Subject: [PATCH 01/12] feat: implement test for inclusive --- .../DeleteEntityAttributes/D006_01_inc.robot | 60 +++++++++++++++++++ .../vehicle-delete-two-datasetid-speed.jsonld | 38 ++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot create mode 100644 data/entities/expectations/vehicle-delete-two-datasetid-speed.jsonld diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot new file mode 100644 index 00000000..45cc2b6a --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot @@ -0,0 +1,60 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute without the deleteAll flag nor a datasetId, the default Attribute instance is deleted. +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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} expectations/vehicle-delete-two-datasetid-speed.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_01_inc Delete Entity Attributes + [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} local=true + Should Contain ${response.json()} speed + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} + 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 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/data/entities/expectations/vehicle-delete-two-datasetid-speed.jsonld b/data/entities/expectations/vehicle-delete-two-datasetid-speed.jsonld new file mode 100644 index 00000000..9080bb4b --- /dev/null +++ b/data/entities/expectations/vehicle-delete-two-datasetid-speed.jsonld @@ -0,0 +1,38 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "datasetId": "urn:ngsi-ld:Relationship:parked12345" + }, + "speed": { + "type": "Property", + "value": 55, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "speed": { + "type": "Property", + "value": 70, + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed" + }, + "@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 -- GitLab From e40535a46eb94063b77b323088d7ff44dfac4c15 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 16:41:44 +0100 Subject: [PATCH 02/12] feat: implement test for inclusive with deleteAll flag --- .../DeleteEntityAttributes/D006_02_inc.robot | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot new file mode 100644 index 00000000..ab18af50 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute with the deleteAll flag, all the instances of that attribute are deleted. +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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} expectations/vehicle-delete-two-datasetid-speed.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_01_inc Delete Entity Attributes + [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... true + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context} local=true + Should Not Contain ${response.json()} speed + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} + 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 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 09f12d069abbe24792df435f8765e909e0445d5c Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:05:59 +0100 Subject: [PATCH 03/12] feat: implement test for exclusive --- .../DeleteEntityAttributes/D006_01_exc.robot | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot new file mode 100644 index 00000000..ba064bb8 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot @@ -0,0 +1,61 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute without the deleteAll flag nor a datasetId, the default Attribute instance is deleted in the 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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} vehicle-simple-attributes.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_01_exc Delete Entity Attributes + [Documentation] Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=true + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 2ac3cc6ae639df0927273408c691a8d78ec138d0 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:09:49 +0100 Subject: [PATCH 04/12] feat: implement test for exclusive with deleteAll flag --- .../DeleteEntityAttributes/D006_02_exc.robot | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot new file mode 100644 index 00000000..18bf401f --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute with the deleteAll flag, all the instances of that attribute are deleted in the 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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} vehicle-simple-attributes.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_01_exc Delete Entity Attributes + [Documentation] Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... true + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=true + Check Response Status Code 201 ${response.status_code} + + ${registration_id}= Generate Random CSR Id + Set Suite Variable ${registration_id} + ${registration_payload}= Prepare Context Source Registration From File + ... ${registration_id} + ... ${registration_payload_file_path} + ... entity_id=${entity_id} + ... mode=exclusive + ... endpoint=/broker1 + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 8f3a788030af076148a763299ee55ec91590ceab Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:12:59 +0100 Subject: [PATCH 05/12] fix: error in test case titles --- .../EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot | 2 +- .../EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot index 18bf401f..0eaa698e 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot @@ -19,7 +19,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi ${attribute_id} speed *** Test Cases *** -D006_01_exc Delete Entity Attributes +D006_02_exc Delete Entity Attributes [Documentation] Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_6_2 diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot index ab18af50..24b925c7 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot @@ -19,7 +19,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi ${attribute_id} speed *** Test Cases *** -D006_01_inc Delete Entity Attributes +D006_02_inc Delete Entity Attributes [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 -- GitLab From f50639819785394654359434ed57228b9c2477a7 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:33:35 +0100 Subject: [PATCH 06/12] feat: implement test for redirect --- .../DeleteEntityAttributes/D006_01_red.robot | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot new file mode 100644 index 00000000..5c6d21ff --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute without the deleteAll flag nor a datasetId, the default Attribute instance is deleted on the Context Sources. +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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} expectations/vehicle-delete-two-datasetid-speed.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_01_inc Delete Entity Attributes + [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + Set Stub Reply DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... false + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + ${stub_count}= Get Stub Count DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} + 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=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_payload}= 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_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 4f8d21eb486f27a5d578047a16c4c11c35461cad Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:34:14 +0100 Subject: [PATCH 07/12] fix: remove extra line in function --- .../EntityAttributes/DeleteEntityAttributes/D006_01_red.robot | 1 - 1 file changed, 1 deletion(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot index 5c6d21ff..ea507ee2 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot @@ -29,7 +29,6 @@ D006_01_inc Delete Entity Attributes ... ${entity_id} ... ${attribute_id} ... ${EMPTY} - ... false ... ${ngsild_test_suite_context} Wait For Request Check Response Status Code 204 ${response.status_code} -- GitLab From 181748f64386b157055b049838d28ce22978b0de Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:35:06 +0100 Subject: [PATCH 08/12] fix: error in test case title --- .../EntityAttributes/DeleteEntityAttributes/D006_01_red.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot index ea507ee2..c10b730b 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot @@ -19,7 +19,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi ${attribute_id} speed *** Test Cases *** -D006_01_inc Delete Entity Attributes +D006_01_red Delete Entity Attributes [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 -- GitLab From ebaaf9a253a300419bce2b2220764991ef66c158 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:40:44 +0100 Subject: [PATCH 09/12] feat: implement test for redirect with deleteAll flag --- .../DeleteEntityAttributes/D006_02_red.robot | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot new file mode 100644 index 00000000..f9693e46 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Check that if one request the Context Broker to delete an attribute with the deleteAll flag, all the instances of that attribute are deleted. +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 Create Entity And Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} expectations/vehicle-delete-two-datasetid-speed.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${attribute_id} speed + +*** Test Cases *** +D006_02_red Delete Entity Attributes + [Documentation] Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 + + Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + Set Stub Reply DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... ${attribute_id} + ... ${EMPTY} + ... true + ... ${ngsild_test_suite_context} + Wait For Request + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + ${stub_count}= Get Stub Count DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} + Should Be True ${stub_count} > 0 + +*** Keywords *** +Create Entity And Setup Registration And Start Context Source Mock Server + ${entity_id}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${entity_id} + 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=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_payload}= 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_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Delete Entity by Id ${entity_id} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 82aa72205338812bf4d95e921dde64d3d1501706 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:43:26 +0100 Subject: [PATCH 10/12] fix: typo in documentation --- .../EntityAttributes/DeleteEntityAttributes/D006_01_red.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot index c10b730b..a89b82c7 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot @@ -20,7 +20,7 @@ ${attribute_id} speed *** Test Cases *** D006_01_red Delete Entity Attributes - [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source + [Documentation] Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 -- GitLab From 524323d6e27404320341c27cb18ea6b80c63cd43 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 28 Oct 2025 17:47:14 +0100 Subject: [PATCH 11/12] add: data file --- ...t-source-registration-vehicle-speed.jsonld | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld diff --git a/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld new file mode 100644 index 00000000..b1798060 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-speed.jsonld @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle" + } + + ], + "propertyNames":["speed"] + } + ], + "operations": ["redirectionOps"], + "endpoint": "http://my.csource.org:1026/", + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file -- GitLab From 432c4e06c2f20042e6fa0391736b8c8db22404c1 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 30 Oct 2025 15:03:56 +0100 Subject: [PATCH 12/12] fix: correct clause numbers in tags --- .../EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot | 2 +- .../EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot | 4 ++-- .../EntityAttributes/DeleteEntityAttributes/D006_01_red.robot | 2 +- .../EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot | 2 +- .../EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot | 2 +- .../EntityAttributes/DeleteEntityAttributes/D006_02_red.robot | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot index ba064bb8..b7541411 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_exc.robot @@ -21,7 +21,7 @@ ${attribute_id} speed *** Test Cases *** D006_01_exc Delete Entity Attributes [Documentation] Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_6_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_5 Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 ${response}= Delete Entity Attributes diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot index 45cc2b6a..8d0db719 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_inc.robot @@ -20,8 +20,8 @@ ${attribute_id} speed *** Test Cases *** D006_01_inc Delete Entity Attributes - [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 + [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_5 Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 ${response}= Delete Entity Attributes diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot index a89b82c7..95ee39ad 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_01_red.robot @@ -21,7 +21,7 @@ ${attribute_id} speed *** Test Cases *** D006_01_red Delete Entity Attributes [Documentation] Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_5 Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 Set Stub Reply DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot index 0eaa698e..d10d1949 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_exc.robot @@ -21,7 +21,7 @@ ${attribute_id} speed *** Test Cases *** D006_02_exc Delete Entity Attributes [Documentation] Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_2 5_6_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_5 Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 ${response}= Delete Entity Attributes diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot index 24b925c7..7ccf2197 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_inc.robot @@ -21,7 +21,7 @@ ${attribute_id} speed *** Test Cases *** D006_02_inc Delete Entity Attributes [Documentation] Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_5 Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 ${response}= Delete Entity Attributes diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot index f9693e46..8e486055 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/DeleteEntityAttributes/D006_02_red.robot @@ -21,7 +21,7 @@ ${attribute_id} speed *** Test Cases *** D006_02_red Delete Entity Attributes [Documentation] Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to delete entities attributes on a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_2 5_6_2 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_5 Set Stub Reply DELETE /broker1/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 Set Stub Reply DELETE /broker2/ngsi-ld/v1/entities/${entity_id}/attrs/${attribute_id} 204 -- GitLab