Commit 3f772fdc authored by kzangeli's avatar kzangeli
Browse files

D002_02_01_inc: 204 kept (a source's 404 is no error - a wide registration's...

D002_02_01_inc: 204 kept (a source's 404 is no error - a wide registration's normal case); testsuite-doubts #67: our position, TS 104-176 § 6.3.5 read for what it says, raised with ETSI (spec-doubts #91)
parent 557e6da3
Loading
Loading
Loading
Loading
+2 −3
Changes for TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -21,12 +21,11 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi

*** Test Cases ***
D002_02_01_inc Delete Entity On The Context Broker
    [Documentation]    Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities locally and should get a BatchOperationResult structure
    [Documentation]    Verify that, when one has an inclusive registration on a Context Broker, one is able to delete an entity that exists locally. A 404 from an inclusive Context Source that simply does not hold the entity is not an error (TS 104-175 § 10.2.8.4 reserves ResourceNotFound for the case where neither the broker nor any registration knows the entity), so the operation returns 204 No Content.
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_04    additive-inclusive    4_3_6_2    5_6_6    6_3_3
    Set Stub Reply    DELETE    /ngsi-ld/v1/entities/${entity_id}    404
    ${response}=    Delete Entity    ${entity_id}
    Check Response Status Code    207    ${response.status_code}
    Check JSON Value In Response Body    ['status']    404    ${response.json()['errors'][0]['error']}
    Check Response Status Code    204    ${response.status_code}

    ${response_retrieve}=    Retrieve Entity    ${entity_id}    local=true
    Check Response Status Code    404    ${response_retrieve.status_code}
+8 −7
Changes for testsuite-doubts.md: 8 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -2159,13 +2159,14 @@ correct for DELETE — `/entities/{id}` is the right URL there

**Upstream (2026-10-03):** spec question - forge #105; provisional d5ed03c3.

**Update (2026-10-08) - REVERSED for D002_02_01_inc:** "the spec is silent" below is wrong. TS 104-176
§ 6.3.5 exempts a source's 404 as "not abnormal" for distributed **GET** only; "In the case of an
inclusive or redirect registration, … when updating the state of the distributed entity, an error
response is returned from one or more registered sources: 207 Multi Status" (also § 7.3.3.4). Develop's
207 is right; this branch takes it back, and coraine reports the source's 404 (207). D002_02_02_inc is
unaffected (the source deletes successfully). The idempotency argument goes to the spec instead
(spec-doubts #91). Raised by geolonia#32.
**Update (2026-10-08) - our position, raised with ETSI (spec-doubts #91):** "the spec is silent" below
is wrong - TS 104-176 § 6.3.5 exempts a source's 404 as "not abnormal" for distributed **GET** only, and
for an inclusive or redirect registration "when updating the state of the distributed entity, an error
response is returned from one or more registered sources: 207 Multi Status" (§ 7.3.3.4 the same), which
develop's test follows. We hold that the exemption was simply never extended to the other verbs: with a
registration on a **type** (no id), every source that does not hold entity X answers 404 to a forwarded
PATCH / DELETE / … - the normal case of a wide registration, not an error - and the operation, done
where X is, succeeded: 204. This branch keeps 204 (coraine answers 204) until ETSI decides.

**Hit:** Both tests do `Delete Entity` against an inclusive CSR
where one of the two legs (local or remote) is supposed to