diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_exc.robot new file mode 100644 index 0000000000000000000000000000000000000000..5161cbb41f85613166046a882fd333f3ae7fa648 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_exc.robot @@ -0,0 +1,65 @@ +*** Settings *** +Documentation Check that one can replace the entire content of a batch of entities on the Context Source and on the Context Broker thanks to an exclusive registration + +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 Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${old_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${new_entity_payload_filename} vehicle-simple-different-attributes.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed-with-redirection-ops.jsonld + +*** Test Cases *** +D013_01_exc Batch Upsert Entities With Exclusive Registration Without Update Flag + [Documentation] Check that if one requests the Context Broker to replace a batch of entities that match an exclusive registration, these are replaced on the Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_8 + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/upsert 201 + + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 201 ${response.status_code} + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Create Entity And Registration On The Context Broker And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${old_entity1}= Create Entity ${old_entity_payload_filename} ${entity_id1} local=true + ${old_entity2}= Create Entity ${old_entity_payload_filename} ${entity_id2} local=true + + ${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=${EMPTY} + ... 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 Created Entity And Registration And Stop Context Source Mock Server + @{entities_ids_to_be_deleted}= Create List ${entity_id1} ${entity_id2} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_inc.robot new file mode 100644 index 0000000000000000000000000000000000000000..16ae9cb04606b9a4facb0c8c31c9ea2501c18095 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_inc.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Check that one can replace the entire content of a batch of entities on both Context Source and Context Broker thanks to a inclusive registration + +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 Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${old_entity_payload_filename} vehicle-simple-attributes.jsonld +${new_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + +*** Test Cases *** +D013_01_inc Batch Upsert Entities With Inclusive Registration Without Update Flag + [Documentation] Check that if one requests the Context Broker to replace a batch of entities that match an inclusive registration, these are 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_8 + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + + Set Stub Reply POST /ngsi-ld/v1/entityOperations/upsert 201 + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 201 ${response.status_code} + + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Vehicle + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resources Set To ${entities_to_be_upserted} ${response1.json()} + +*** Keywords *** +Create Entity And Registration On The Context Broker And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${old_entity1}= Create Entity ${old_entity_payload_filename} ${entity_id1} + ${old_entity2}= Create Entity ${old_entity_payload_filename} ${entity_id2} + + ${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=${EMPTY} + ${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 + @{entities_ids_to_be_deleted}= Create List ${entity_id1} ${entity_id2} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_red.robot new file mode 100644 index 0000000000000000000000000000000000000000..8daf762788f7c04d9e541d5dbf29921403f7ab85 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_01_red.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation Check that one can replace the entire content of a batch of entities on the Context Source thanks to a redirect registration + +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 *** +${old_entity_payload_filename} vehicle-simple-attributes.jsonld +${new_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + +*** Test Cases *** +D013_01_red Batch Upsert Entities With Redirect Registration Without Update Flag + [Documentation] Check that if one requests the Context Broker to replace a batch of entities that match a redirect registration, these are replaced on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_8 + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/upsert 201 + Set Stub Reply POST /broker2/ngsi-ld/v1/entityOperations/upsert 201 + + ${response}= Batch Upsert Entities @{entities_to_be_upserted} + Check Response Status Code 201 ${response.status_code} + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + ${stub_count}= Get Stub Count POST /broker2/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Entity Id And Registration And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${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=${EMPTY} + ... 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_id} + ... ${registration_payload_file_path} + ... entity_id=${EMPTY} + ... 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 Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_exc.robot new file mode 100644 index 0000000000000000000000000000000000000000..9f6ebedb73934ba15680ec4813c3d797edd73b5e --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_exc.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Check that one can update the content of a batch of entities on the Context Source and on the Context Broker thanks to an exclusive registration + +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 Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${old_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${new_entity_payload_filename} vehicle-simple-different-attributes.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-speed-with-redirection-ops.jsonld + +*** Test Cases *** +D013_02_exc Batch Upsert Entities With Exclusive Registration With Update Flag + [Documentation] Check that if one requests the Context Broker to replace a batch of entities that match an exclusive registration, these are replaced on the Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-exclusive 4_3_6_3 5_6_8 + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/upsert 201 + + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update + Check Response Status Code 201 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} update + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Create Entity And Registration On The Context Broker And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${old_entity1}= Create Entity ${old_entity_payload_filename} ${entity_id1} local=true + ${old_entity2}= Create Entity ${old_entity_payload_filename} ${entity_id2} local=true + + ${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=${EMPTY} + ... 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 Created Entity And Registration And Stop Context Source Mock Server + @{entities_ids_to_be_deleted}= Create List ${entity_id1} ${entity_id2} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_inc.robot new file mode 100644 index 0000000000000000000000000000000000000000..02a4453bc910027a9c7111f3734cae28af5ba32e --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_inc.robot @@ -0,0 +1,77 @@ +*** Settings *** +Documentation Check that one can update the content of a batch of entities on both Context Source and Context Broker thanks to a inclusive registration + +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 Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server + +*** Variables *** +${old_entity_payload_filename} vehicle-simple-attributes.jsonld +${new_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + +*** Test Cases *** +D013_02_inc Batch Upsert Entities With Inclusive Registration With Update Flag + [Documentation] Check that if one requests the Context Broker to update a batch of entities that match an inclusive registration, these 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_8 + ${response}= Retrieve Entity by Id ${entity_id1} context=${ngsild_test_suite_context} + ${old_body}= Get From Dictionary ${response.json()} brandName + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + + Set Stub Reply POST /ngsi-ld/v1/entityOperations/upsert 201 + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update + Check Response Status Code 201 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} update + + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + ${expected_updated_entities_ids}= Catenate SEPARATOR=, @{upserted_entities_ids} + ${response1}= Query Entities + ... entity_ids=${expected_updated_entities_ids} + ... entity_types=Vehicle + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + + ${response}= Retrieve Entity by Id ${entity_id1} context=${ngsild_test_suite_context} + ${new_body}= Get From Dictionary ${response.json()} brandName + Should Not Be Equal ${old_body} ${new_body} + Should Contain ${response.json()} isParked2 + +*** Keywords *** +Create Entity And Registration On The Context Broker And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${old_entity1}= Create Entity ${old_entity_payload_filename} ${entity_id1} + ${old_entity2}= Create Entity ${old_entity_payload_filename} ${entity_id2} + + ${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=${EMPTY} + ${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 + @{entities_ids_to_be_deleted}= Create List ${entity_id1} ${entity_id2} + Batch Delete Entities entities_ids_to_be_deleted=@{entities_ids_to_be_deleted} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_red.robot new file mode 100644 index 0000000000000000000000000000000000000000..cc66b5d676046d0a4e6723ed007a0ed9047a3f48 --- /dev/null +++ b/TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpsertBatchEntities/D013_02_red.robot @@ -0,0 +1,79 @@ +*** Settings *** +Documentation Check that one can update the content of a batch of entities on the Context Source thanks to a redirect registration + +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 *** +${old_entity_payload_filename} vehicle-simple-attributes.jsonld +${new_entity_payload_filename} vehicle-simple-attributes-second.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + +*** Test Cases *** +D013_02_red Batch Upsert Entities With Redirect Registration With Update Flag + [Documentation] Check that if one requests the Context Broker to replace a batch of entities that match a redirect registration, these are replaced on the Context Source + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 proxy-redirect 4_3_6_3 5_6_8 + + ${new_entity1}= Load Entity ${new_entity_payload_filename} ${entity_id1} + ${new_entity2}= Load Entity ${new_entity_payload_filename} ${entity_id2} + @{entities_to_be_upserted}= Create List ${new_entity1} ${new_entity2} + @{upserted_entities_ids}= Create List ${entity_id1} ${entity_id2} + + Set Stub Reply POST /broker1/ngsi-ld/v1/entityOperations/upsert 201 + Set Stub Reply POST /broker2/ngsi-ld/v1/entityOperations/upsert 201 + + ${response}= Batch Upsert Entities @{entities_to_be_upserted} update_option=update + Check Response Status Code 201 ${response.status_code} + + ${stub}= Get Request Url Params options + Should Contain ${stub} update + + ${stub_count}= Get Stub Count POST /broker1/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + ${stub_count}= Get Stub Count POST /broker2/ngsi-ld/v1/entityOperations/upsert + Should Be Equal ${stub_count} 1 + +*** Keywords *** +Setup Entity Id And Registration And Start Context Source Mock Server + ${entity_id1}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id1} + ${entity_id2}= Generate Random Vehicle Entity Id + Set Suite Variable ${entity_id2} + + ${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=${EMPTY} + ... 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_id} + ... ${registration_payload_file_path} + ... entity_id=${EMPTY} + ... 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 Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Delete Context Source Registration ${registration_id2} + Stop Context Source Mock Server \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_01_exc.json b/doc/files/DistributedOperations/Provision/D013_01_exc.json new file mode 100644 index 0000000000000000000000000000000000000000..bf480c66f49c75c21423da082dff1546ad2d0eaa --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_01_exc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_01_exc", + "test_objective": "Check that one can replace the entire content of a batch of entities on the Context Source and on the Context Broker thanks to an exclusive registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and 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": "D013_01_exc Batch Upsert Entities With Exclusive Registration Without Update Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_01_exc", + "doc": "Check that if one requests the Context Broker to replace a batch of entities that match an exclusive registration, these are replaced on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_8", + "cf_06", + "dist-ops", + "proxy-exclusive", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpsertBatchEntities", + "robotfile": "D013_01_exc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_01_inc.json b/doc/files/DistributedOperations/Provision/D013_01_inc.json new file mode 100644 index 0000000000000000000000000000000000000000..cabd8d736fb264fa132fa777f0ba8db3e5c507c9 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_01_inc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/BatchEntitiesUpsert/D013_01_inc", + "test_objective": "Check that one can replace the entire content of a batch of entities on both Context Source and Context Broker thanks to a inclusive registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and 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": "D013_01_inc Batch Upsert Entities With Inclusive Registration Without Replace Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/BatchEntitiesUpsert/D013_01_inc", + "doc": "Check that if one requests the Context Broker to replace a batch of entities that match an inclusive registration, these are replaced on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_8", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/BatchEntitiesUpsert", + "robotfile": "D013_01_inc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_01_red.json b/doc/files/DistributedOperations/Provision/D013_01_red.json new file mode 100644 index 0000000000000000000000000000000000000000..f467c3aea1abf2badd6802910d424dcb703bbe1b --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_01_red.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_01_red", + "test_objective": "Check that one can replace the entire content of a batch of entities on the Context Source thanks to a redirect registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Setup Entity Id And Registration And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity id set to ${entity_id}\n and 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": "D013_01_red Batch Upsert Entities With Redirect Registration Without Replace Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_01_red", + "doc": "Check that if one requests the Context Broker to replace a batch of entities that match a redirect registration, these are replaced on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_8", + "cf_06", + "dist-ops", + "proxy-redirect", + "since_v1.6.1" + ], + "setup": "Setup Entity Id And Registration And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpsertBatchEntities", + "robotfile": "D013_01_red" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_02_exc.json b/doc/files/DistributedOperations/Provision/D013_02_exc.json new file mode 100644 index 0000000000000000000000000000000000000000..8f60b1c9a787e886c641deb169adb7f40379a606 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_02_exc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_exc", + "test_objective": "Check that one can update the content of a batch of entities on the Context Source and on the Context Broker thanks to an exclusive registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and 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": "D013_02_exc Batch Upsert Entities With Exclusive Registration With Update Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_exc", + "doc": "Check that if one requests the Context Broker to replace a batch of entities that match an exclusive registration, these are replaced on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_8", + "cf_06", + "dist-ops", + "proxy-exclusive", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpsertBatchEntities", + "robotfile": "D013_02_exc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_02_inc.json b/doc/files/DistributedOperations/Provision/D013_02_inc.json new file mode 100644 index 0000000000000000000000000000000000000000..dd1a262546a25ec1d6c1b0ab87b7f90f41127c73 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_02_inc.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_inc", + "test_objective": "Check that one can update the content of a batch of entities on both Context Source and Context Broker thanks to a inclusive registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and 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": "D013_02_inc Batch Upsert Entities With Inclusive Registration With Update Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_inc", + "doc": "Check that if one requests the Context Broker to update a batch of entities that match an inclusive registration, these are updated on the Context Source too", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_8", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpsertBatchEntities", + "robotfile": "D013_02_inc" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D013_02_red.json b/doc/files/DistributedOperations/Provision/D013_02_red.json new file mode 100644 index 0000000000000000000000000000000000000000..d93ebf93ee1d954a0874307e21bddb5e2745b685 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D013_02_red.json @@ -0,0 +1,43 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_red", + "test_objective": "Check that one can update the content of a batch of entities on the Context Source thanks to a redirect registration", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.3, 5.6.8", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.3", + "5.6.8" + ], + "pics_selection": "", + "keywords": [ + "Setup Entity Id And Registration And Start Context Source Mock Server", + "Delete Created Entity And 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 an initial Entity id set to ${entity_id}\n and 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": "D013_02_red Batch Upsert Entities With Redirect Registration With Update Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/BatchEntities/UpsertBatchEntities/D013_02_red", + "doc": "Check that if one requests the Context Broker to replace a batch of entities that match a redirect registration, these are replaced on the Context Source", + "tags": [ + "4_3_3", + "4_3_6_3", + "5_6_8", + "cf_06", + "dist-ops", + "proxy-redirect", + "since_v1.6.1" + ], + "setup": "Setup Entity Id And Registration And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entityOperations/upsert?options=${update_option}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/BatchEntities/UpsertBatchEntities", + "robotfile": "D013_02_red" +} \ No newline at end of file