Commit 840e6348 authored by Ken Zangelin's avatar Ken Zangelin
Browse files

fix(distops): D018_01 loop detection on a redirect registration, where 508 is the answer

TS 104-176 clause 6.3.5: 508 Loop Detected is the answer for a single exclusive or redirect source. D018_01
now registers its loop as redirect, so the expected 508 follows from the spec.
parent f389b3c7
Loading
Loading
Loading
Loading
+9 −4
Changes for TP/NGSI-LD/DistributedOperations/LoopDetection/D018_01.robot: 9 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -24,10 +24,15 @@ D018_01 Loop Detection With Via Header
    [Documentation]    Verify that a loop is detected when the Via header contains the broker's identifier.
    [Tags]    since_v1.8.1    dist-ops    core_4_3_3    cf_04    core_10_2_8    http_6_4_11

    # The inclusive registration forwards the create to the mock; that forward
    # The redirect registration forwards the create to the mock; that forward
    # must be answered so the operation returns 201 (cf. sibling D018_02, which
    # stubs the same reply). Without it a broker that surfaces the unanswered
    # forward as a partial success returns 207 and the test fails at setup.
    # stubs the same reply). 508 Loop Detected is defined (TS 104-176 § 6.3.5)
    # only for an exclusive/redirect single-source registration that resolves
    # back onto the broker — for an inclusive registration the data is held
    # locally and a loop merely suppresses the forward, so the registration
    # used here must be exclusive/redirect for the 508 assertion to be
    # spec-correct. Redirect is used because this fixture carries entities only
    # (no property/relationship names), which an exclusive registration requires.
    Set Stub Reply    POST    /ngsi-ld/v1/entities    201
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
    Check Response Status Code    201    ${response.status_code}
@@ -52,7 +57,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id=${entity_id}
    ...    mode=inclusive
    ...    mode=redirect
    ${response}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response.status_code}