Commit 426038eb authored by kzangeli's avatar kzangeli
Browse files

Merge branch 'fix/d012-d015-exclusive-pinned-ids' into integration/all-fixes

# Conflicts:
#	testsuite-doubts.md
parents 17670dc8 f57409f3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ Test Teardown Delete Created Entity And Registration And Stop Context Sour
${entity_payload_filename}              vehicle-simple-attributes.jsonld
${entity_speed_payload_filename}        vehicle-speed-attribute.jsonld
${entity_pattern}                       urn:ngsi-ld:Vehicle:*
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-speed-with-batch-ops.jsonld
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-speed-with-batch-ops-exclusive.jsonld


*** Test Cases ***
@@ -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}
+4 −3
Original line number Diff line number Diff line
@@ -11,9 +11,9 @@ Resource ${EXECDIR}/resources/MockServerUtils.resource
Test Setup          Create Entities And 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
${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
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-speed-with-batch-ops-exclusive.jsonld

*** Test Cases ***
D015_01_exc Delete Batch Of Entities On Both Context Broker And Context Source
@@ -54,7 +54,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}
+37 −0
Original line number Diff line number Diff line
@@ -3258,3 +3258,40 @@ conforming broker therefore returns the union: 5 `speed` instances

**Fix:** the expectation now carries the full union (including the duplicate
same-value/same-observedAt instances, which exist as distinct `instanceId`s).


## 95. `D012_01_exc` / `D015_01_exc` — missed by the § 9.3.3 exclusive-pinning sweep; their setup failures leak entities into D001/D011

**Hit (full-suite runs):** both tests fail in setup — the CSR create returns
400 (`exclusive Registration 'entities[]' entry must specify a specific
'id'`), and for D015 (after pinning) 409 (`registration overlaps with
locally-stored entity`). Because setup aborts before the test body sets its
suite variables, the teardown crashes (`Variable '@{expected_entities_ids}'
not found` / 404 on the registration delete) and the two `local=true`
entities created in setup are never removed. Those leaked Vehicles then
surface in every later unpinned `type=Vehicle` query —
`D001_01_inc` / `D001_02_inc` / `D001_03_03_inc` fail with
`Lengths are different: 1 != 5`.

**Analysis:** the exclusive-mode batch tests were restructured to satisfy
TS 104-175 § 9.3.3 (an exclusive registration shall pin specific entity ids;
the broker also rejects an exclusive claim over an entity it stores locally
with the claimed Attribute): `D013_*_exc` / `D014_*_exc` / `D016_01_exc` use
`entity_id=` + `entity_id2=` and the two-information-group fixture
`context-source-registration-vehicle-speed-with-batch-ops-exclusive.jsonld`,
and seed their local twins without the exclusively-claimed `speed`.
`D012_01_exc` and `D015_01_exc` were missed by that sweep and still used
`entity_id_pattern=urn:ngsi-ld:Vehicle:*` (D015 additionally seeding local
twins WITH `speed``vehicle-simple-different-attributes.jsonld`).

**Fix:** same recipe as the sweep —

- both tests register with `entity_id=` + `entity_id2=` and the
  `…-with-batch-ops-exclusive.jsonld` fixture;
- D015's local twins switch to `vehicle-simple-attributes-second.jsonld`
  (no `speed`), so the exclusive claim doesn't overlap locally-stored
  Attributes.

(The `entity_id2=` keyword support and the exclusive fixture are
re-declared identically to their origin branch since that MR is unmerged —
git deduplicates on merge.)