fix(distops): exclusive registrations name the entity ids and do not overlap local data (TS 104-175 clause 9.3.3)

Exclusive registrations in the Distributed Operations setups.

Spec: TS 104-175 clause 4.3.3.2: an exclusive registration "always relates to specific Attributes of a single Entity", and the Context Broker "holds no data locally about the registered Attributes". Clause 9.3.3 (proxied registrations) builds on that.

Change:

  • D012-D016 (batch create, upsert, update, delete, merge): the exclusive registration names the two entity ids the Test Case creates instead of an id pattern. context-source-registration-vehicle-speed-with-batch-ops.jsonld now has one information item per entity id. The locally created entities do not carry the registered attribute (speed). D013 checks that the forwarded entities are the two ids, with speed.
  • D003 (append): the attribute fragment is sent with the suite's @context, so its names expand to the registration's IRIs. The local entity is created local=true and lacks speed.
  • D005: the local entity does not carry the registered attribute.
  • D006 (redirect): no local copy of the entity is created.
  • 033_01_02: the registration names an idPattern, so it is redirect, not exclusive.
  • Keywords: Append Entity Attributes and Append Entity Attributes With Parameters take an optional context (a Link header); Prepare Context Source Registration From File takes a second entity id.

Effect (against coraine): 12 Test Cases fail on develop and pass with this MR: D003_01_exc, D003_02_exc, D006_01_red, D006_02_red, D012_01_exc, D013_01_exc, D013_02_exc, D014_01_exc, D014_02_exc, D015_01_exc, D016_01_exc, 033_01_02. D005_01_exc passes on both. None breaks. In a run of the whole DistributedOperations/Provision directory, D001_02_inc and D001_03_03_inc also pass: on develop they fail on entities left over by earlier Test Cases.

Checks run: robocop format --check (0 files), scripts/find_unused_test_data.py (nothing new), statisticsDocumentationData.py (0 of 625 failed), doc unit tests OK.

Fix MR 9 of the plan: https://famzang.com/ttf/ngsi-ld-suite-plan.html

Edited by Ken Zangelin

Merge request reports

Loading
+2 −1
Changes for TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/CreateBatchOfEntities/D012_01_exc.robot: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id_pattern=${entity_pattern}
    ...    entity_id=${first_entity_id}
    ...    entity_id2=${second_entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ${response}=    Create Context Source Registration With Return    ${registration_payload}
+3 −2
Changes for TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/DeleteBatchOfEntities/D015_01_exc.robot: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ Test Teardown Delete Registration And Stop Context Source Mock Server


*** Variables ***
${entity_payload_filename}              vehicle-simple-different-attributes.jsonld
${entity_payload_filename}              vehicle-simple-attributes-second.jsonld
${entity_pattern}                       urn:ngsi-ld:Vehicle:*
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-speed-with-batch-ops.jsonld

@@ -58,7 +58,8 @@ Create Entities And Registration And Start Context Source Mock Server
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id_pattern=${entity_pattern}
    ...    entity_id=${first_entity_id}
    ...    entity_id2=${second_entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ${response}=    Create Context Source Registration With Return    ${registration_payload}
+2 −1
Changes for TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/MergeBatchOfEntities/D016_01_exc.robot: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -66,7 +66,8 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id_pattern=${entity_pattern}
    ...    entity_id=${first_entity_id}
    ...    entity_id2=${second_entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ${response}=    Create Context Source Registration With Return    ${registration_payload}
+3 −2
Changes for TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchOfEntities/D014_01_exc.robot: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ Test Teardown Delete Registration And Stop Context Source Mock Server


*** Variables ***
${entity_payload_filename}              vehicle-simple-different-attributes.jsonld
${entity_payload_filename}              vehicle-simple-attributes-second.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-with-batch-ops.jsonld
@@ -56,7 +56,8 @@ Setup Registration And Start Context Source Mock Server
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id_pattern=${entity_pattern}
    ...    entity_id=${first_entity_id}
    ...    entity_id2=${second_entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
+3 −2
Changes for TP/NGSI-LD/DistributedOperations/Provision/BatchEntities/UpdateBatchOfEntities/D014_02_exc.robot: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ Test Teardown Delete Registration And Stop Context Source Mock Server


*** Variables ***
${entity_payload_filename}              vehicle-simple-different-attributes.jsonld
${entity_payload_filename}              vehicle-simple-attributes-second.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-with-batch-ops.jsonld
@@ -59,7 +59,8 @@ Setup Registration And Start Context Source Mock Server
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id_pattern=${entity_pattern}
    ...    entity_id=${first_entity_id}
    ...    entity_id2=${second_entity_id}
    ...    mode=exclusive
    ...    endpoint=/broker1
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
Loading
Loading