Commit 48916843 authored by kzangeli's avatar kzangeli
Browse files

fix: test-suite bugs in D001_04_inc, D002_01_red, D017_01_*, 053_06

Four test-side fixes that were blocking the affected tests from
executing against a spec-strict NGSI-LD broker, plus a catalog of
known test-suite-side issues.

- D001_04_inc: rename 'Generate Random Vehice Id' (typo) to the
  actual keyword 'Generate Random Vehicle Entity Id' from
  Common.resource. (doubt #30)

- 053_06_01: build the context id as a full URL via Catenate of
  host + port + path before passing it to subsequent keywords.
  Section 5.13 requires context ids to be URIs (scheme://host/...

),
  not bare paths. (doubt #33)

- D017_01_inc / D017_01_red / D017_01_exc: fix the URL join in the
  Purge Entities keyword (ContextInformationConsumption.resource) —
  add the missing '/' separator between \${final_url} and
  \${ENTITIES_ENDPOINT_PATH} to match every other keyword in the
  same file. The bug produced URLs like '/ngsi-ld/v1entities/?...'
  which returned 404. (doubt #65)

- D002_01_red: drop the entity id from the POST stub URLs.
  Section 5.6.1 places Create Entity at POST /entities (with the
  entity id in the body), not at POST /entities/{id}; the broker
  forwards to the bare /entities URL, so HttpCtrl stubs registered
  with the id suffix never matched. (doubt #66)

Drop the swbroker_known_bad tag from the five now-passing tests;
this triage tag is moving into testsuite-doubts.md instead.

Import testsuite-doubts.md at the repo root — a catalog of
test-suite-side issues encountered while running the suite against
a spec-strict broker. Resolved entries carry a Status line pointing
at the fixing MR.

Co-Authored-By: default avatarClaude Opus 4.7 (1M context) <noreply@anthropic.com>
parent b51e61e2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
*** Test Cases ***
D001_04_inc Create Entity With Local Flag
    [Documentation]    Verify that, when one has an inclusive registration on a Context Broker, one is able to create an entity with local flag and the operation should not be forwarded to the Context Source
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_6_1    6_3_18    swbroker_known_bad
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_6_1    6_3_18
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}    local=true
    Check Response Status Code    201    ${response.status_code}

@@ -31,7 +31,7 @@ D001_04_inc Create Entity With Local Flag

*** Keywords ***
Setup Entity Id And Registration And Start Context Source Mock Server
    ${entity_id}=    Generate Random Vehice Id
    ${entity_id}=    Generate Random Vehicle Entity Id
    Set Suite Variable    ${entity_id}

    ${registration_id}=    Generate Random CSR Id
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ D002_01_red Delete Entities On Both Context Sources
    [Documentation]    Verify that, when one has a redirect registration on a Context Broker, one is able to delete entities on both Context Sources
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxied-redirect    4_3_6_3    5_6_6

    Set Stub Reply  POST    /broker1/ngsi-ld/v1/entities/${entity_id}    201
    Set Stub Reply  POST    /broker2/ngsi-ld/v1/entities/${entity_id2}    201
    Set Stub Reply  POST    /broker1/ngsi-ld/v1/entities    201
    Set Stub Reply  POST    /broker2/ngsi-ld/v1/entities    201

    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
    Check Response Status Code    201    ${response.status_code}
+1 −1
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
*** Test Cases ***
D017_01_exc Purge Entities On Both Context Broker And Context Source
    [Documentation]    Verify that, when one has an exclusive registration on a Context Broker, one is able to purge entities based on type on both Context Broker and Context Source
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxy-exclusive    4_3_6_3    5_6_21    swbroker_known_bad
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxy-exclusive    4_3_6_3    5_6_21

    Set Stub Reply    POST    /broker1/ngsi-ld/v1/entities    201
    ${speed_entity}=    Create Entity    ${speed_entity_filename}    ${entity_id}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
*** Test Cases ***
D017_01_inc Purge Entities On Both Context Broker And Context Source
    [Documentation]    Verify that, when one has an inclusive registration on a Context Broker, one is able to purge entities based on type on both Context Broker and Context Source
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_6_21    swbroker_known_bad
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    additive-inclusive    4_3_6_2    5_6_21

    Set Stub Reply    DELETE    /ngsi-ld/v1/entities?type=Vehicle    204
    ${response}=    Purge Entities    entity_types=Vehicle    context=${ngsild_test_suite_context}
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
*** Test Cases ***
D017_01_red Purge Entities On The Context Source
    [Documentation]    Verify that, when one has a redirect registration on a Context Broker, one is able to purge entities based on type on the Context Source
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxy-redirect    4_3_6_3    5_6_21    swbroker_known_bad
    [Tags]    since_v1.6.1    dist-ops    4_3_3    cf_06    proxy-redirect    4_3_6_3    5_6_21

    Set Stub Reply    POST    /broker1/ngsi-ld/v1/entities    201
    Set Stub Reply    POST    /broker2/ngsi-ld/v1/entities    201
Loading