Commit 604d111b authored by Daniel Kastl's avatar Daniel Kastl Committed by kzangeli
Browse files

fix(D001_01_inc): allow createEntity, and wait for the forwarded request

D001_01_inc checks that a create is forwarded to the context source of an
inclusive registration. Two things stop it:

- The registration file has no "operations". The default is
  federationOps (clause 4.20), which does not include createEntity. So
  a broker must not forward the create (clause 5.6.1 forwards to an
  inclusive registration only when it supports the operation).
- The test calls Get Request Body without Wait For Request. The mock
  only has a request to read after Wait For Request, so the keyword
  fails with "'NoneType' object has no attribute 'get_body'".

Register the source with operations ["createEntity"], and call
Wait For Request before Get Request Body.

(cherry picked from commit 3aa9099d84c23dd0d7a5f40d06758a210699c35e)
parent 2a6da2e0
Loading
Loading
Loading
Loading
+3 −0
Changes for TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ D001_01_inc Create Entity On Both Context Broker And Context Source
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
    Check Response Status Code    201    ${response.status_code}

    Wait For Request
    ${request_payload}=    Get Request Body
    ${payload_list}=    Evaluate    [json.loads('''${request_payload}''')]    json
    @{entities_id}=    Create List    ${entity_id}
@@ -44,10 +45,12 @@ Setup Entity Id And Registration And Start Context Source Mock Server

    ${registration_id}=    Generate Random CSR Id
    Set Suite Variable    ${registration_id}
    ${operations}=    Create List    createEntity
    ${registration_payload}=    Prepare Context Source Registration From File
    ...    ${registration_id}
    ...    ${registration_payload_file_path}
    ...    entity_id=${entity_id}
    ...    operations=${operations}
    ${response}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response.status_code}