diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_exc.robot new file mode 100644 index 0000000000000000000000000000000000000000..82c07184a8b373b015c67716c6570b47fa4e9ef8 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_exc.robot @@ -0,0 +1,67 @@ +*** Settings *** +Documentation Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to update a batch of entities 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 Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${entity_payload_filename} vehicle-simple-different-attributes.jsonld +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed-and-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_01_exc Update Batch Entities without noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_9 + + ${first_update_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_update_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_update_entity} ${second_update_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} local=true + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity ${entity_payload_filename} ${second_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_pattern=${entity_pattern} + ... 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 + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_inc.robot new file mode 100644 index 0000000000000000000000000000000000000000..3a06ac4269ab4cc8e8abc6822214aea1c6a0509f --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_inc.robot @@ -0,0 +1,71 @@ +*** Settings *** +Documentation Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to update a batch of entities on a Context Source too + +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_payload_filename} vehicle-simple-different-attributes.jsonld +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_01_inc Update Batch Entities without noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match an inclusive registration, they are updated 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_9 + + ${first_update_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_update_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_update_entity} ${second_update_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} + + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + ${response}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Vehicle + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + + Should Not Be Equal ${entities_to_be_updated} ${response.json()} + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity ${entity_payload_filename} ${second_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_pattern=${entity_pattern} + ${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 + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_red.robot new file mode 100644 index 0000000000000000000000000000000000000000..aebdbcbe79062c19d3abcea576a674009676da53 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_01_red.robot @@ -0,0 +1,73 @@ +*** Settings *** +Documentation Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to update a batch of entities on a 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 Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server + +*** Variables *** +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_01_red Update Batch Entities without noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_9 + + ${first_update_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_update_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_update_entity} ${second_update_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/update 204 + Set Stub Reply POST /broker2/ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} + Check Response Status Code 204 ${response.status_code} + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + ${stub_count}= Get Stub Count POST /broker2/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_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_pattern=${entity_pattern} + ... mode=redirect + ... endpoint=/broker1 + ${response1}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response1.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_pattern=${entity_pattern} + ... mode=redirect + ... endpoint=/broker2 + ${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 Context Source Registration ${registration_id2} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_exc.robot new file mode 100644 index 0000000000000000000000000000000000000000..07f5c7d3e719b385e311ad28ca3442d60a71029f --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_exc.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Check that, given an exclusive registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones. +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_payload_filename} vehicle-simple-different-attributes.jsonld +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed-and-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_02_exc Update Batch Entities with noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_9 + + ${first_update_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_update_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_update_entity} ${second_update_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code 204 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} noOverwrite + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} local=true + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity ${entity_payload_filename} ${second_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_pattern=${entity_pattern} + ... 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 + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_inc.robot new file mode 100644 index 0000000000000000000000000000000000000000..fcf18d25b794aed33dab6bdc6ed8bc827c03e5b4 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_inc.robot @@ -0,0 +1,74 @@ +*** Settings *** +Documentation Check that, given an inclusive registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones. + +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_payload_filename} vehicle-simple-different-attributes.jsonld +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_02_inc Update Batch Entities With The noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match an inclusive registration, they are updated 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_9 + + ${first_updated_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_updated_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_updated_entity} ${second_updated_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code 204 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} noOverwrite + + ${expected_entities_ids}= Catenate SEPARATOR=, @{entities_ids_to_be_updated} + ${response}= Query Entities + ... entity_ids=${expected_entities_ids} + ... entity_types=Vehicle + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + + Should Not Be Equal ${entities_to_be_updated} ${response.json()} + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_entity_id} + + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} + Check Response Status Code 201 ${response.status_code} + ${response}= Create Entity ${entity_payload_filename} ${second_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_pattern=${entity_pattern} + ${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 + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_red.robot new file mode 100644 index 0000000000000000000000000000000000000000..679611cbea5322d84caf68992b58867bad0c34ef --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchEntities/D014_02_red.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation Check that, given a redirect registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones. + +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 *** +${update_payload_filename} expectations/vehicle-replace-isParked-attribute.jsonld +${entity_pattern} urn:ngsi-ld:Vehicle:* +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld + +*** Test Cases *** +D014_02_red Update Batch Entities With noOverwrite Option + [Documentation] Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_9 + + ${first_update_entity}= Load Entity ${update_payload_filename} ${first_entity_id} + ${second_update_entity}= Load Entity ${update_payload_filename} ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_update_entity} ${second_update_entity} + @{entities_ids_to_be_updated}= Create List ${first_entity_id} ${second_entity_id} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/update 204 + Set Stub Reply POST /broker2/ngsi-ld/v1/entityOperations/update 204 + ${response}= Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + Check Response Status Code 204 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} noOverwrite + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + ${stub_count}= Get Stub Count POST /broker2/ngsi-ld/v1/entityOperations/update + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Registration And Start Context Source Mock Server + ${first_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${first_entity_id} + ${second_entity_id}= Generate Random Vehicle Entity Id + Set Test Variable ${second_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_pattern=${entity_pattern} + ... mode=redirect + ... endpoint=/broker1 + ${response1}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response1.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_pattern=${entity_pattern} + ... mode=redirect + ... endpoint=/broker2 + ${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 Context Source Registration ${registration_id2} + Stop Context Source Mock Server diff --git a/data/csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..d4e0422cd8ed219462e59d45f181c248e94dd421 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-idpattern-with-redirection-ops.jsonld @@ -0,0 +1,20 @@ + +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "idPattern": "urn:ngsi-ld:Vehicle:*", + "type": "Vehicle" + } + ] + } + ], + "operations": ["redirectionOps"], + "endpoint": "http://my.csource.org:1026/", + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-vehicle-speed-and-idpattern-with-redirection-ops.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-speed-and-idpattern-with-redirection-ops.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..024d83e882df2a7d5560780dc06f81be92c8b21a --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-speed-and-idpattern-with-redirection-ops.jsonld @@ -0,0 +1,21 @@ + +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "idPattern": "urn:ngsi-ld:Vehicle:*", + "type": "Vehicle" + } + ], + "propertyNames":["speed"] + } + ], + "operations": ["redirectionOps"], + "endpoint": "http://my.csource.org:1026/", + "@context":[ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_01_exc.json b/doc/files/DistributedOperations/Provision/D014_01_exc.json new file mode 100644 index 0000000000000000000000000000000000000000..5a54950d86910ed8755aba9101f436496b60126e --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_01_exc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_exc", + "test_objective": "Verify that, when one has an exclusive registration on a Context Broker with redirectionOps, one is able to update a batch of entities on both Context Broker and Context Source", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_01_exc Update Batch Entities without noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_exc", + "doc": "Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_9", + "cf_06", + "dist-ops", + "proxy-exclusive", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_01_exc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_01_inc.json b/doc/files/DistributedOperations/Provision/D014_01_inc.json new file mode 100644 index 0000000000000000000000000000000000000000..b75055f524b25606630371844b1d5bbd3950b553 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_01_inc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_inc", + "test_objective": "Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to update a batch of entities on a Context Source too", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_01_inc Update Batch Entities without noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_inc", + "doc": "Check that if one request the Context Broker to update a batch of entities that match an inclusive registration, they are updated on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_9", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_01_inc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_01_red.json b/doc/files/DistributedOperations/Provision/D014_01_red.json new file mode 100644 index 0000000000000000000000000000000000000000..65b8e453912d11a372dba5fe78166477c24d5f28 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_01_red.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_red", + "test_objective": "Verify that, when one has a redirect registration on a Context Broker with redirectionOps, one is able to update a batch of entities on a Context Source", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_01_red Update Batch Entities without noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_01_red", + "doc": "Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_9", + "cf_06", + "dist-ops", + "proxy-redirect", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_01_red" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_02_exc.json b/doc/files/DistributedOperations/Provision/D014_02_exc.json new file mode 100644 index 0000000000000000000000000000000000000000..ff56dc4a173907e925e66544de2af58fc0b848ea --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_02_exc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_exc", + "test_objective": "Check that, given an exclusive registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones.", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_02_exc Update Batch Entities with noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_exc", + "doc": "Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_9", + "cf_06", + "dist-ops", + "proxy-exclusive", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_02_exc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_02_inc.json b/doc/files/DistributedOperations/Provision/D014_02_inc.json new file mode 100644 index 0000000000000000000000000000000000000000..dc23f6d3f9befc8bfcbb7770fad2ae53e7f1a6f2 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_02_inc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_inc", + "test_objective": "Check that, given an inclusive registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones.", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_02_inc Update Batch Entities With The noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_inc", + "doc": "Check that if one request the Context Broker to update a batch of entities that match an inclusive registration, they are updated on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_9", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_02_inc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D014_02_red.json b/doc/files/DistributedOperations/Provision/D014_02_red.json new file mode 100644 index 0000000000000000000000000000000000000000..4b8674b6d6137793f74f6e46be9dceb671acbbb8 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D014_02_red.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_red", + "test_objective": "Check that, given a redirect registration with the noOverwrite flag, updating a batch entities creates the new attributes in the Context Source accordingly but does not modify existing ones.", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.9", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.9" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D014_02_red Update Batch Entities With noOverwrite Option", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpdateBatchEntities/D014_02_red", + "doc": "Check that if one request the Context Broker to update a batch of entities that match a redirect registration, they are updated on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_9", + "cf_06", + "dist-ops", + "proxy-redirect", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/update?${params_as_string}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpdateBatchEntities", + "robotfile": "D014_02_red" +} \ No newline at end of file