From 5ff82a58ffa796a49494963f97092d1cffdbe3f0 Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Wed, 4 Sep 2024 10:41:26 +0200 Subject: [PATCH 01/17] feat: 1.6.1 for CSR create-retrieve-delete (33-35-36) --- .../035_01.robot | 4 --- .../{033_01_01.robot => 033_01.robot} | 21 +++++++++-- .../{033_01_03.robot => 033_11.robot} | 4 +-- .../{033_01_02.robot => 033_12.robot} | 20 +++++++---- ...source-registration-csourceProperty.jsonld | 4 --- ...ontext-source-registration-location.jsonld | 3 ++ .../context-source-registration-no-id.jsonld | 8 +---- ...source-registration-past-expiration.jsonld | 6 ---- ...source-registration-with-expiration.jsonld | 8 +---- ...gistration-with-mode-and-operations.jsonld | 36 +++++++++++++++++++ ...egistration-without-mode-operations.jsonld | 34 ++++++++++++++++++ .../context-source-registration.jsonld | 10 ++---- ...t-source-registration-expanded-format.json | 29 ++------------- .../context-source-registration.json | 8 ++--- 14 files changed, 115 insertions(+), 80 deletions(-) rename TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/{033_01_01.robot => 033_01.robot} (66%) rename TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/{033_01_03.robot => 033_11.robot} (93%) rename TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/{033_01_02.robot => 033_12.robot} (71%) create mode 100644 data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld create mode 100644 data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 08bdca8a7..d8db41e78 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -7,7 +7,6 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Setup Initial Context Source Registrations -Test Teardown Delete Created Context Source Registrations *** Variables *** @@ -37,6 +36,3 @@ Setup Initial Context Source Registrations ${create_response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${registration_id} - -Delete Created Context Source Registrations - Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot similarity index 66% rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot index ac196405b..ff1f69a68 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Teardown Delete Created Context Source Registrations +Test Template Create Context Source Registration *** Variables *** @@ -16,14 +17,30 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** 033_01_01 Create Context Source Registration With Specific Date Expiration Date + [Tags] csr-create 5_9_2 since_v1.6.1 + csourceRegistrations/context-source-registration-with-expiration.jsonld +033_01_02 Create Context Source Registration That Never Expires + [Tags] csr-create 5_9_2 since_v1.6.1 + csourceRegistrations/context-source-registration.jsonld +033_01_03 Create Context Source Registration With Non Default Mode And Operations + [Tags] csr-create 5_9_2 since_v1.6.1 + csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld +033_01_04 Create Context Source Registration With Location + [Tags] csr-create 5_9_2 since_v1.6.1 + csourceRegistrations/context-source-registration-location.jsonld + + +*** Keywords *** +Create Context Source Registration [Documentation] Check that one can create a context source registration with specific ID and expiration date - [Tags] csr-create 5_9_2 + [Arguments] ${registration_payload_file_path} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} ${response1}= Retrieve Context Source Registration ... context_source_registration_id=${registration_id} ... context=${ngsild_test_suite_context} @@ -31,7 +48,5 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ${ignored_attributes}= Create List ${status_regex_expr} Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} - -*** Keywords *** Delete Created Context Source Registrations Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot similarity index 93% rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot index 55d7e7938..ca26cbf61 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot @@ -15,9 +15,9 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_01_03 Create Context Source Registration Without Specifying an ID +033_11 Create Context Source Registration Without Specifying an ID [Documentation] Check that one can create a context source registration without specifying an ID - [Tags] csr-create 5_9_2 + [Tags] csr-create 5_9_2 since_v1.6.1 ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot similarity index 71% rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot index 236dc7e6f..cc7887308 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that one can create a context source registration that never expires +Documentation Check that one can create a context source registration without default mode and operations Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -11,17 +11,19 @@ Suite Teardown Delete Created Context Source Registrations *** Variables *** ${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration.jsonld +${registration_payload_file_path}= csourceRegistrations/context-source-registration-without-mode-operations.jsonld *** Test Cases *** -033_01_02 Create Context Source Registration That Never Expires - [Documentation] Check that one can create a context source registration that never expires - [Tags] csr-create 5_9_2 +033_12 Create Context Source Registration Without Mode And Operation + [Documentation] Check that one can create a context source registration without mode and operations + [Tags] csr-create 5_9_2 since_v1.6.1 ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} + ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${registration_id} ${response.headers} @@ -29,8 +31,12 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... context_source_registration_id=${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} + + ${ignored_attributes}= Create List ${status_regex_expr} mode operations + ${expected_payload}= Add Object To Json ${registration_payload} $.mode inclusive + ${operations}= Create List federationOps + ${expected_payload}= Add Object To Json ${expected_payload} $.operations ${operations} + Check Created Resource Set To ${expected_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld b/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld index a76f1967c..63bbdf425 100644 --- a/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld +++ b/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld @@ -10,10 +10,6 @@ ] } ], - "location":{ - "type":"Point", - "coordinates":[-8.521,41.2] - }, "endpoint":"http://my.csource.org:1026", "csourceProperty1": "aValue", "csourceProperty2": "anotherValue", diff --git a/data/csourceRegistrations/context-source-registration-location.jsonld b/data/csourceRegistrations/context-source-registration-location.jsonld index a5603e7b8..1f49d2885 100644 --- a/data/csourceRegistrations/context-source-registration-location.jsonld +++ b/data/csourceRegistrations/context-source-registration-location.jsonld @@ -14,8 +14,11 @@ "type":"Point", "coordinates":[-8.521,41.2] }, + "mode": "inclusive", + "operations": ["federationOps"], "endpoint":"http://my.csource.org:1026", "@context":[ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] + } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-no-id.jsonld b/data/csourceRegistrations/context-source-registration-no-id.jsonld index 484ed252c..0361c4954 100644 --- a/data/csourceRegistrations/context-source-registration-no-id.jsonld +++ b/data/csourceRegistrations/context-source-registration-no-id.jsonld @@ -26,13 +26,7 @@ "relationshipNames": ["isNextToBuilding"] } ], - "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - }, + "endpoint": "http://my.csource.org:1026", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] diff --git a/data/csourceRegistrations/context-source-registration-past-expiration.jsonld b/data/csourceRegistrations/context-source-registration-past-expiration.jsonld index 6078f7b0d..f3c7395d9 100644 --- a/data/csourceRegistrations/context-source-registration-past-expiration.jsonld +++ b/data/csourceRegistrations/context-source-registration-past-expiration.jsonld @@ -28,12 +28,6 @@ } ], "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - }, "expiresAt": " 2018-11-29T14:53:15Z", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" diff --git a/data/csourceRegistrations/context-source-registration-with-expiration.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration.jsonld index 0dbf966b7..30c64748e 100644 --- a/data/csourceRegistrations/context-source-registration-with-expiration.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-expiration.jsonld @@ -27,13 +27,7 @@ "relationshipNames": ["isNextToBuilding"] } ], - "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - }, + "endpoint": "http://my.csource.org:1026", "expiresAt": "2025-11-29T14:53:15Z", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" diff --git a/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld b/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld new file mode 100644 index 000000000..7d8cf9373 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld @@ -0,0 +1,36 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "mode": "exclusive", + "operations": ["queryEntity","queryTemporal","updateOps"], + "endpoint": "http://my.csource.org:1026", + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld b/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld new file mode 100644 index 000000000..264253325 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld @@ -0,0 +1,34 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "id": "urn:ngsi-ld:Vehicle:A456", + "type": "Vehicle" + } + ], + "propertyNames": ["brandName","speed"], + "relationshipNames": ["isParked"] + }, + { + "entities": [ + { + "idPattern": ".*downtown$", + "type": "OffStreetParking" + }, + { + "idPattern": ".*47$", + "type": "OffStreetParking" + } + ], + "propertyNames": ["availableSpotNumber","totalSpotNumber"], + "relationshipNames": ["isNextToBuilding"] + } + ], + "endpoint": "http://my.csource.org:1026", + "@context": [ + "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration.jsonld b/data/csourceRegistrations/context-source-registration.jsonld index d24b35fd8..f19fee30b 100644 --- a/data/csourceRegistrations/context-source-registration.jsonld +++ b/data/csourceRegistrations/context-source-registration.jsonld @@ -27,13 +27,9 @@ "relationshipNames": ["isNextToBuilding"] } ], - "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - }, + "mode": "inclusive", + "operations": ["federationOps"], + "endpoint": "http://my.csource.org:1026", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] diff --git a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json index c557935b3..03e4a0d1a 100644 --- a/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json +++ b/data/csourceRegistrations/expectations/context-source-registration-expanded-format.json @@ -38,31 +38,6 @@ ] } ], - "location": { - "type": "Polygon", - "coordinates": [ - [ - [ - 100.0, - 0.0 - ], - [ - 101.0, - 0.0 - ], - [ - 101.0, - 1.0 - ], - [ - 100.0, - 1.0 - ], - [ - 100.0, - 0.0 - ] - ] - ] - } + "mode": "inclusive", + "operations": ["federationOps"] } diff --git a/data/csourceRegistrations/expectations/context-source-registration.json b/data/csourceRegistrations/expectations/context-source-registration.json index a534ebc79..fdc4541e1 100644 --- a/data/csourceRegistrations/expectations/context-source-registration.json +++ b/data/csourceRegistrations/expectations/context-source-registration.json @@ -28,10 +28,6 @@ } ], "endpoint": "http://my.csource.org:1026", - "location": { - "type": "Polygon", - "coordinates": [ - [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], - [100.0, 1.0], [100.0, 0.0]] ] - } + "mode": "inclusive", + "operations": ["federationOps"] } \ No newline at end of file -- GitLab From 022157932b5aa9a75e074586d4be7c04ef45d47b Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Mon, 9 Dec 2024 15:05:21 +0100 Subject: [PATCH 02/17] fix: PR comments + some errors in 033 test --- .../RegisterContextSource/033_01.robot | 19 ++++++++------ .../RegisterContextSource/033_02.robot | 8 +++--- .../RegisterContextSource/033_11.robot | 6 +++-- .../RegisterContextSource/033_12.robot | 7 ++---- ...gistration-with-mode-and-operations.jsonld | 2 +- ...egistration-without-mode-operations.jsonld | 2 +- resources/AssertionUtils.resource | 25 +++++++++++++------ 7 files changed, 42 insertions(+), 27 deletions(-) diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot index ff1f69a68..bae8e85fd 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot @@ -15,29 +15,29 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: ${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration.jsonld -*** Test Cases *** +*** Test Cases *** FILENAME HAS_MODE 033_01_01 Create Context Source Registration With Specific Date Expiration Date - [Tags] csr-create 5_9_2 since_v1.6.1 + [Tags] csr-create 5_9_2 csourceRegistrations/context-source-registration-with-expiration.jsonld 033_01_02 Create Context Source Registration That Never Expires - [Tags] csr-create 5_9_2 since_v1.6.1 + [Tags] csr-create 5_9_2 csourceRegistrations/context-source-registration.jsonld 033_01_03 Create Context Source Registration With Non Default Mode And Operations [Tags] csr-create 5_9_2 since_v1.6.1 - csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld + csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld ${True} 033_01_04 Create Context Source Registration With Location - [Tags] csr-create 5_9_2 since_v1.6.1 + [Tags] csr-create 5_9_2 csourceRegistrations/context-source-registration-location.jsonld *** Keywords *** Create Context Source Registration [Documentation] Check that one can create a context source registration with specific ID and expiration date - [Arguments] ${registration_payload_file_path} + [Arguments] ${registration_payload_file_path} ${has_mode}=${False} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${registration_payload}= Update Value To JSON ${payload} $.id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${registration_id} ${response.headers} @@ -46,6 +46,11 @@ Create Context Source Registration ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} ${ignored_attributes}= Create List ${status_regex_expr} + + IF ${has_mode} == ${False} + Append To List ${ignored_attributes} mode operations + END + Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} Delete Created Context Source Registrations diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot index b68aee121..bd0005ec1 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot @@ -13,12 +13,12 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_02_01 Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file +033_02_01 Create a context source registration with invalid content + [Documentation] Check that one cannot create a context source with invalid content [Tags] csr-create 5_9_2 - ${subscription_payload}= Get File ${EXECDIR}/data/${registration_payload_file_path} + ${csr_payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration - ... ${subscription_payload} + ... ${csr_payload} Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot index ca26cbf61..7558a3519 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot @@ -29,8 +29,10 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... context_source_registration_id=${registration_id} ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} + Check Response Body Containing Context Source Registration element + ... ${registration_payload_file_path} + ... ${registration_id} + ... ${response1.json()} *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot index cc7887308..1d63c8d13 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot @@ -32,11 +32,8 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi ... context=${ngsild_test_suite_context} ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} mode operations - ${expected_payload}= Add Object To Json ${registration_payload} $.mode inclusive - ${operations}= Create List federationOps - ${expected_payload}= Add Object To Json ${expected_payload} $.operations ${operations} - Check Created Resource Set To ${expected_payload} ${response1.json()} ${ignored_attributes} + ${ignored_attributes}= Create List ${status_regex_expr} mode operations timesSent timesFailed + Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} *** Keywords *** diff --git a/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld b/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld index 7d8cf9373..27f2ab169 100644 --- a/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld +++ b/data/csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld @@ -31,6 +31,6 @@ "operations": ["queryEntity","queryTemporal","updateOps"], "endpoint": "http://my.csource.org:1026", "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld b/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld index 264253325..cc9fb6f00 100644 --- a/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld +++ b/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld @@ -29,6 +29,6 @@ ], "endpoint": "http://my.csource.org:1026", "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 8181cd509..ed4f1f629 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -21,6 +21,7 @@ ${lastNotification_regex_expr}= root\\['lastNotification'\\] ${timesFailed_regex_expr}= root\\['timesFailed'\\] ${timesSent_regex_expr}= root\\['timesSent'\\] ${is_active_expr}= root\\['isActive'\\] +${context_source_ignored_regex_expr}= root\\['@context'\\] *** Keywords *** @@ -305,14 +306,24 @@ Check Response Body Containing Number Of Entities Check Response Body Containing Context Source Registration element [Arguments] ${expectation_filename} ${context_source_registration_id} ${response_body} - ${context_source_registration_payload}= Load JSON From File ${EXECDIR}/data/${expectation_filename} - ${context_source_registration}= Update Value To JSON - ... ${context_source_registration_payload} - ... $.id - ... ${context_source_registration_id} - ${ignored_keys}= Create List ${context_regex_expr} + ${expectation_json}= Load JSON From File ${EXECDIR}/data/${expectation_filename} + + ${id_dict}= Create Dictionary id=${context_source_registration_id} + ${expectation_json_with_id}= Add Object To JSON ${expectation_json} $ ${id_dict} + + Log To Console context_source_registration_id + Log To Console ${context_source_registration_id} + Log To Console ${context_source_registration_id} + Log To Console ${context_source_registration_id} + Log To Console ${context_source_registration_id} + + Log To Console expectation_json_with_id + Log To Console ${expectation_json_with_id} + Log To Console response_body + Log To Console ${response_body} + ${ignored_keys}= Create List ${context_regex_expr} mode operations ${comparison_result}= Compare Dictionaries Ignoring Keys - ... ${context_source_registration} + ... ${expectation_json_with_id} ... ${response_body} ... ${ignored_keys} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} -- GitLab From c7167bc12077e9f977a32fd69f57ba391149a66b Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Mon, 9 Dec 2024 15:29:02 +0100 Subject: [PATCH 03/17] fix: PR comments --- .../RegisterContextSource/033_01.robot | 12 +++--- .../RegisterContextSource/033_11.robot | 2 +- .../RegisterContextSource/033_12.robot | 41 ------------------- ...ontext-source-registration-location.jsonld | 2 - ...egistration-without-mode-operations.jsonld | 34 --------------- .../context-source-registration.jsonld | 2 - resources/AssertionUtils.resource | 10 ----- 7 files changed, 7 insertions(+), 96 deletions(-) delete mode 100644 TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot delete mode 100644 data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot index bae8e85fd..75e200bec 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot @@ -16,18 +16,18 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** FILENAME HAS_MODE -033_01_01 Create Context Source Registration With Specific Date Expiration Date - [Tags] csr-create 5_9_2 - csourceRegistrations/context-source-registration-with-expiration.jsonld -033_01_02 Create Context Source Registration That Never Expires +033_01_01 Create Context Source Registration Without Mode And Operation [Tags] csr-create 5_9_2 csourceRegistrations/context-source-registration.jsonld -033_01_03 Create Context Source Registration With Non Default Mode And Operations +033_01_02 Create Context Source Registration With Non Default Mode And Operations [Tags] csr-create 5_9_2 since_v1.6.1 csourceRegistrations/context-source-registration-with-mode-and-operations.jsonld ${True} -033_01_04 Create Context Source Registration With Location +033_01_03 Create Context Source Registration With Location [Tags] csr-create 5_9_2 csourceRegistrations/context-source-registration-location.jsonld +033_01_04 Create Context Source Registration With Specific Date Expiration Date + [Tags] csr-create 5_9_2 + csourceRegistrations/context-source-registration-with-expiration.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot index 7558a3519..43f81eac0 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot @@ -17,7 +17,7 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** 033_11 Create Context Source Registration Without Specifying an ID [Documentation] Check that one can create a context source registration without specifying an ID - [Tags] csr-create 5_9_2 since_v1.6.1 + [Tags] csr-create 5_9_2 ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration With Return ${payload} Check Response Status Code 201 ${response.status_code} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot deleted file mode 100644 index 1d63c8d13..000000000 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_12.robot +++ /dev/null @@ -1,41 +0,0 @@ -*** Settings *** -Documentation Check that one can create a context source registration without default mode and operations - -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Teardown Delete Created Context Source Registrations - - -*** Variables *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration-without-mode-operations.jsonld - - -*** Test Cases *** -033_12 Create Context Source Registration Without Mode And Operation - [Documentation] Check that one can create a context source registration without mode and operations - [Tags] csr-create 5_9_2 since_v1.6.1 - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} - Set Suite Variable ${registration_id} - ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - - ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - Check Response Headers Containing URI set to ${registration_id} ${response.headers} - ${response1}= Retrieve Context Source Registration - ... context_source_registration_id=${registration_id} - ... context=${ngsild_test_suite_context} - ... accept=${CONTENT_TYPE_LD_JSON} - - ${ignored_attributes}= Create List ${status_regex_expr} mode operations timesSent timesFailed - Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes} - - -*** Keywords *** -Delete Created Context Source Registrations - Delete Context Source Registration ${registration_id} diff --git a/data/csourceRegistrations/context-source-registration-location.jsonld b/data/csourceRegistrations/context-source-registration-location.jsonld index 1f49d2885..0c2cb3e02 100644 --- a/data/csourceRegistrations/context-source-registration-location.jsonld +++ b/data/csourceRegistrations/context-source-registration-location.jsonld @@ -14,8 +14,6 @@ "type":"Point", "coordinates":[-8.521,41.2] }, - "mode": "inclusive", - "operations": ["federationOps"], "endpoint":"http://my.csource.org:1026", "@context":[ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" diff --git a/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld b/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld deleted file mode 100644 index cc9fb6f00..000000000 --- a/data/csourceRegistrations/context-source-registration-without-mode-operations.jsonld +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", - "type": "ContextSourceRegistration", - "information": [ - { - "entities": [ - { - "id": "urn:ngsi-ld:Vehicle:A456", - "type": "Vehicle" - } - ], - "propertyNames": ["brandName","speed"], - "relationshipNames": ["isParked"] - }, - { - "entities": [ - { - "idPattern": ".*downtown$", - "type": "OffStreetParking" - }, - { - "idPattern": ".*47$", - "type": "OffStreetParking" - } - ], - "propertyNames": ["availableSpotNumber","totalSpotNumber"], - "relationshipNames": ["isNextToBuilding"] - } - ], - "endpoint": "http://my.csource.org:1026", - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] -} \ No newline at end of file diff --git a/data/csourceRegistrations/context-source-registration.jsonld b/data/csourceRegistrations/context-source-registration.jsonld index f19fee30b..49ab16e12 100644 --- a/data/csourceRegistrations/context-source-registration.jsonld +++ b/data/csourceRegistrations/context-source-registration.jsonld @@ -27,8 +27,6 @@ "relationshipNames": ["isNextToBuilding"] } ], - "mode": "inclusive", - "operations": ["federationOps"], "endpoint": "http://my.csource.org:1026", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index ed4f1f629..477856e19 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -311,16 +311,6 @@ Check Response Body Containing Context Source Registration element ${id_dict}= Create Dictionary id=${context_source_registration_id} ${expectation_json_with_id}= Add Object To JSON ${expectation_json} $ ${id_dict} - Log To Console context_source_registration_id - Log To Console ${context_source_registration_id} - Log To Console ${context_source_registration_id} - Log To Console ${context_source_registration_id} - Log To Console ${context_source_registration_id} - - Log To Console expectation_json_with_id - Log To Console ${expectation_json_with_id} - Log To Console response_body - Log To Console ${response_body} ${ignored_keys}= Create List ${context_regex_expr} mode operations ${comparison_result}= Compare Dictionaries Ignoring Keys ... ${expectation_json_with_id} -- GitLab From f20410a1f73195a258086d51f485e099121b869e Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Thu, 27 Feb 2025 09:47:02 +0100 Subject: [PATCH 04/17] feat(wip): bootstrap mock support for dist ops --- .../Entities/CreateEntity/D001_01_inc.robot | 32 +++++++++++++------ .../ContextSourceRegistration.resource | 7 ++-- resources/MockServerUtils.resource | 3 ++ 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index c12ddea75..5f1128765 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to create 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 create entities on both Context Broker and Context Source Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity Id And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Setup Entity Id And Registration +Test Teardown Delete Created Entities And Registration *** Variables *** @@ -18,13 +19,28 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D001_01_inc Create Entity On Both Context Broker and Context Source + [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration, this is created on the Context Source too [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 - [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration, this is created on the Context Source too + + 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} + # Works after adding these two lines in venv/lib/python3.12/site-packages/HttpCtrl/http_handler.py + # at line 86-87: + # request = Request(host, port, method, self.path, self.headers, body) + # RequestStorage().push(request) + Wait for redirected request + + ${request_payload}= Get Request Body + ${payload}= Evaluate json.loads('''${request_payload}''') json + Log ${payload} + ${request_headers}= Get Request Headers + Log ${request_headers} + @{entities_id}= Create List ${entity_id} ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_query.status_code} @@ -40,17 +56,15 @@ Setup Entity Id And Registration ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 1a9ce76f2..2c0a0dd13 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -17,12 +17,13 @@ ${ERROR_TYPE_BAD_REQUEST_DATA} https://uri.etsi.org/ngsi-ld/err ${ERROR_TYPE_RESOURCE_NOT_FOUND} https://uri.etsi.org/ngsi-ld/errors/ResourceNotFound ${response} ${EMPTY} +${context_source_url} http://${context_source_host}:${context_source_port} *** Keywords *** Prepare Context Source Registration From File [Arguments] ${id} ${registration_file} ${entity_id}=${EMPTY} ${mode}=${EMPTY} - + ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} ${registration_payload}= Update Value To JSON ... ${payload} @@ -31,7 +32,7 @@ Prepare Context Source Registration From File ${registration_payload}= Update Value To JSON ... ${registration_payload} ... $..endpoint - ... ${context_source_endpoint} + ... ${context_source_url} IF '${entity_id}' != '' ${dict}= Create Dictionary id=${entity_id} ${registration_payload}= Add Object To JSON @@ -39,7 +40,7 @@ Prepare Context Source Registration From File ... $..entities[*] ... ${dict} END - IF '${mode}' != '' + IF '${mode}' != '' ${dict}= Create Dictionary mode=${mode} ${registration_payload}= Add Object To JSON ... ${registration_payload} diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 82ef9dc0b..558f5946e 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -19,6 +19,9 @@ Wait for redirected request Wait For Request ${timeout} Reply By 200 +Answer to Create Entity + Set Stub Reply POST /ngsi-ld/v1/entities 201 + Stop Context Source Mock Server # Terminate HTTP Server Stop Server -- GitLab From f11bbf6f367ec434cc263576904eab75261455ca Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Mon, 28 Apr 2025 13:43:06 +0200 Subject: [PATCH 05/17] added new features in resources --- resources/ApiUtils/ContextInformationConsumption.resource | 4 ++-- resources/ApiUtils/ContextSourceRegistration.resource | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index c240364dc..3815e4c66 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -211,7 +211,7 @@ Retrieve Attributes RETURN ${response} Retrieve Entity by Id - [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${options}=${EMPTY} + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${base_url}=${url} ${options}=${EMPTY} ${headers}= Create Dictionary &{params}= Create Dictionary ${options_length}= Get Length ${options} @@ -226,7 +226,7 @@ Retrieve Entity by Id Set To Dictionary ${params} options=${options} END ${response}= GET - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${base_url}/${ENTITIES_ENDPOINT_PATH}${id} ... headers=${headers} ... params=${params} ... expected_status=any diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 2c0a0dd13..b8737ba53 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -22,7 +22,7 @@ ${context_source_url} http://${context_source_host}:${ *** Keywords *** Prepare Context Source Registration From File - [Arguments] ${id} ${registration_file} ${entity_id}=${EMPTY} ${mode}=${EMPTY} + [Arguments] ${id} ${registration_file} ${entity_id}=${EMPTY} ${mode}=${EMPTY} ${endpoint}=${EMPTY} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} ${registration_payload}= Update Value To JSON @@ -32,7 +32,7 @@ Prepare Context Source Registration From File ${registration_payload}= Update Value To JSON ... ${registration_payload} ... $..endpoint - ... ${context_source_url} + ... ${context_source_url}${endpoint} IF '${entity_id}' != '' ${dict}= Create Dictionary id=${entity_id} ${registration_payload}= Add Object To JSON -- GitLab From cec568689051576ef9ca4ac4dc4a01ea52bfa1ba Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Mon, 28 Apr 2025 13:45:10 +0200 Subject: [PATCH 06/17] updated test cases --- .../Entity/QueryEntities/D011_01_01_inc.robot | 25 +++++++++---- .../Entity/QueryEntities/D011_01_02_inc.robot | 13 ++++--- .../Entity/RetrieveEntity/D010_01_inc.robot | 27 ++++++++++---- .../Entity/RetrieveEntity/D010_02_inc.robot | 13 ++++--- .../Entities/CreateEntity/D001_01_inc.robot | 20 ++++------ .../Entities/CreateEntity/D001_02_inc.robot | 13 +++---- .../CreateEntity/D001_03_01_inc.robot | 26 +++++++++---- .../CreateEntity/D001_03_02_inc.robot | 25 ++++++------- .../CreateEntity/D001_03_03_inc.robot | 16 ++++---- .../Entities/DeleteEntity/D002_01_inc.robot | 17 +++++---- .../DeleteEntity/D002_02_01_inc.robot | 13 +++++-- .../DeleteEntity/D002_02_02_inc.robot | 16 ++++---- .../UpdateEntityAttributes/D004_01_inc.robot | 37 +++++++++++++------ 13 files changed, 153 insertions(+), 108 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot index b6304f16e..b1732c42a 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration @@ -20,19 +21,27 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D011_01_01_inc Query The Context Broker With Type - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 [Documentation] Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets returned - @{entities_id}= Create List ${entity_id} + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context} + + Wait for redirected request + + ${received_request}= Get Request Url + Log To Console ${received_request} + ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities?type=Vehicle + Should Be True ${stub_count} > 0 Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + # @{entities_id}= Create List ${entity_id} + # Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} *** Keywords *** Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} + # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} + # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -41,11 +50,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server Delete Created Entity And Registration Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - + # Delete Entity By Id ${entity_id} base_url=${remote_url} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot index bf6e9b350..956cf95b7 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration @@ -31,8 +32,8 @@ D011_01_02_inc Query The Context Broker With Type And Missing Attribute Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} + # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} + # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -41,11 +42,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server + Delete Created Entity And Registration - Delete Entity By Id ${entity_id} base_url=${remote_url} + # Delete Entity By Id ${entity_id} base_url=${remote_url} Delete Context Source Registration ${registration_id} - - \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot index 86da79b45..749032872 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot @@ -7,30 +7,39 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** D010_01_inc Retrieve entity on a Context Source from the Context Broker - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1 [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, entity gets returned + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1 + + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} + + Wait for redirected request + + ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} > 0 + Check Response Status Code 200 ${response.status_code} - Check JSON Value In Response Body ['id'] ${entity_id} ${response.json()} *** Keywords *** Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} + # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} + # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -39,9 +48,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server + Delete Created Entity And Registration - Delete Entity By Id ${entity_id} base_url=${remote_url} - Delete Context Source Registration ${registration_id} \ No newline at end of file + Delete Context Source Registration ${registration_id} + # Delete Entity By Id ${entity_id} base_url=${remote_url} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot index 47f01248e..d69f26562 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration @@ -29,8 +30,8 @@ D010_02_inc Retrieve entity on a Context Source from the Context Broker with loc Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} + # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} + # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -39,9 +40,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server + Delete Created Entity And Registration - Delete Entity By Id ${entity_id} base_url=${remote_url} - Delete Context Source Registration ${registration_id} \ No newline at end of file + # Delete Entity By Id ${entity_id} base_url=${remote_url} + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index 5f1128765..2cf7ac7d9 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot @@ -29,10 +29,6 @@ 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} - # Works after adding these two lines in venv/lib/python3.12/site-packages/HttpCtrl/http_handler.py - # at line 86-87: - # request = Request(host, port, method, self.path, self.headers, body) - # RequestStorage().push(request) Wait for redirected request ${request_payload}= Get Request Body @@ -42,13 +38,13 @@ D001_01_inc Create Entity On Both Context Broker and Context Source Log ${request_headers} @{entities_id}= Create List ${entity_id} + ${payload_list} Evaluate [$payload] + Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} + ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_query.status_code} Check Response Body Containing Entities URIS set to ${entities_id} ${response_query.json()} - ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - Check Response Body Containing Entities URIS set to ${entities_id} ${response_query_remote.json()} - - + *** Keywords *** Setup Entity Id And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -60,11 +56,11 @@ Setup Entity Id And Registration ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} - ${response1}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response1.status_code} + ${response}= Create Context Source Registration With Return ${registration_payload} + Check Response Status Code 201 ${response.status_code} + Start Context Source Mock Server - Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot index 8b8199002..944f61323 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Initial Context Source Registration Test Teardown Delete Created Registration @@ -21,18 +22,16 @@ ${context_source_registration_payload_file_path} csourceRegistrations/con *** Test Cases *** D001_02_inc Request to create an entity with a malformed id on both Context Broker and Context Source + [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on 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_3 - [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on the Context Source + ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 400 ${response.status_code} + Wait For No Request timeout=5 ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_query.status_code} Should Be Empty ${response_query.json()} - ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - Check Response Status Code 200 ${response_query_remote.status_code} - Should Be Empty ${response_query_remote.json()} - *** Keywords *** Setup Initial Context Source Registration @@ -43,8 +42,8 @@ Setup Initial Context Source Registration ... ${context_source_registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Registration Delete Context Source Registration ${context_source_registration_id} - - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot index 9f1be5172..c69971552 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Local And Registration Test Teardown Delete Created Entities And Registration @@ -20,17 +21,28 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D001_03_01_inc Create entity already existing locally on a 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_3 [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists locally, this raises an error on the Context Broker but is created correctly on 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_3 + + Set Stub Reply POST /ngsi-ld/v1/entities 201 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']} + ${length}= Get Length ${response.json()['errors']} + Should Be Equal As Integers ${length} 1 - @{entities_id}= Create List ${entity_id} - ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - Check Response Body Containing Entities URIS set to ${entities_id} ${response_query_remote.json()} + Wait for redirected request + ${request_payload}= Get Request Body + ${payload}= Evaluate json.loads('''${request_payload}''') json + Log ${payload} + ${request_headers}= Get Request Headers + Log ${request_headers} + + @{entities_id}= Create List ${entity_id} + ${payload_list} Evaluate [$payload] + Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} *** Keywords *** Setup Entity On Local And Registration @@ -47,11 +59,9 @@ Setup Entity On Local And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot index fdbb41176..d1491ed61 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an entity on a Context Broker and on a Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker +Documentation Verify that, when one has an entity on both Context Broker and Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entities And Registration Test Teardown Delete Created Entities And Registration @@ -20,24 +21,22 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D001_03_02_inc Create entity already existing 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_1 6_3_3 [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists both locally and remotely, this raises an error 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_1 6_3_3 + + Set Stub Reply POST /ngsi-ld/v1/entities 409 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} - - ${length}= Get Length ${response.json()['errors']} - Should Be Equal As Integers ${length} 2 - Should Be Empty ${response.json()['success']} + + Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']} + Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][1]['error']} *** Keywords *** Setup Entities And Registration - ${entity_id}= Generate Random Entity Id ${entity_id_prefix} + ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -47,11 +46,9 @@ Setup Entities And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot index 8b3401495..5295d55cd 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entities And Registration @@ -20,24 +21,23 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D001_03_03_inc Create entity already existing remotely on the Context Broker - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 6_3_3 [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists remotely, this raises an error on the Context Source, but it works just fine on the Context Broker + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 6_3_3 + + Set Stub Reply POST /ngsi-ld/v1/entities 409 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} - Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']} @{entities_id}= Create List ${entity_id} ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} Check Response Body Containing Entities URIS set to ${entities_id} ${response_query.json()} + *** Keywords *** Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} - ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -47,11 +47,9 @@ Setup Entity On Remote And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot index 585956817..5a65460b5 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entities And Registration Test Teardown Delete Created Entities And Registration @@ -20,12 +21,16 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D002_01_inc Delete Entities 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_6 [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities 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_6 + + Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id} 204 ${response}= Delete Entity by Id ${entity_id} Check Response Status Code 204 ${response.status_code} - ${response_retrieve}= Retrieve Entity by Id ${entity_id} + ${stub_count}= Get Stub Count DELETE /ngsi-ld/v1/entities/${entity_id} + Should Be True ${stub_count} > 0 + ${response_retrieve}= Retrieve Entity by Id ${entity_id} local=true Check Response Status Code 404 ${response_retrieve.status_code} *** Keywords *** @@ -34,8 +39,6 @@ Setup Entities And Registration Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -45,11 +48,9 @@ Setup Entities And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entities And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Delete Entity By Id ${entity_id} ${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot index 617b28429..021add0ae 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Local And Registration Test Teardown Delete Created Entity And Registration @@ -20,12 +21,17 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D002_02_01_inc Delete Entity On The Context Broker - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_6 6_3_3 [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 + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 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 by Id ${entity_id} Check Response Status Code 207 ${response.status_code} Check JSON Value In Response Body ['status'] 404 ${response.json()['errors'][0]['error']} + ${response_retrieve}= Retrieve Entity by Id ${entity_id} local=true + Check Response Status Code 404 ${response_retrieve.status_code} + *** Keywords *** Setup Entity On Local And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -41,10 +47,9 @@ Setup Entity On Local And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entity And Registration Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - - - \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot index f9dffb0ea..122141340 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration @@ -20,18 +21,21 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D002_02_02_inc Delete Entity On a Context Source - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_6 6_3_3 [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_6 6_3_3 + + Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id} 204 ${response}= Delete Entity by Id ${entity_id} Check Response Status Code 207 ${response.status_code} + Check JSON Value In Response Body ['status'] 404 ${response.json()['errors'][0]['error']} + ${length}= Get Length ${response.json()['errors']} + Should Be Equal As Integers ${length} 1 *** Keywords *** Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -41,10 +45,8 @@ Setup Entity On Remote And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server Delete Created Entity And Registration Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot index 72117cb75..6b0fc2dcb 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource Test Setup Setup Entity On Remote And Registration Test Teardown Delete Created Entity And Registration @@ -21,41 +22,53 @@ ${fragment_filename} vehicle-brandname-fragment.jsonld *** Test Cases *** D004_01_inc Query The Context Broker With Type - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 [Documentation] Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 + Set Stub Reply PATCH /ngsi-ld/v1/entities/${entity_id}/attrs/ 204 ${response}= Update Entity Attributes ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} - Check Response Status Code 204 ${response.status_code} + + Wait for redirected request + Check Response Status Code 204 ${response.status_code} + ${stub_count}= Get Stub Count PATCH /ngsi-ld/v1/entities/${entity_id}/attrs/ + Should Be True ${stub_count} > 0 + + ${request_payload}= Get Request Body + ${payload}= Evaluate json.loads('''${request_payload}''') json + Log ${payload} + ${request_headers}= Get Request Headers + Log ${request_headers} + @{entities_id}= Create List ${entity_id} - ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - Check Response Status Code 200 ${response_query_remote.status_code} - Check Response Body Containing Entities URIS set to ${entities_id} ${response_query_remote.json()} + # ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} + # Check Response Status Code 200 ${response_query_remote.status_code} + ${payload_list} Evaluate [$payload] + Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} *** Keywords *** Setup Entity On Remote And Registration ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} + # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} + # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server Delete Created Entity And Registration Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - - \ No newline at end of file + # Delete Entity By Id ${entity_id} base_url=${remote_url} + Stop Context Source Mock Server \ No newline at end of file -- GitLab From a8b5cc003f8b413a1d016174d1e4285c413e418b Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Tue, 6 May 2025 13:21:28 +0200 Subject: [PATCH 07/17] added new data --- ...istration-vehicle-complete-auxiliary.jsonld | 18 ++++++++++++++++++ .../vehicle-brandname-complete-fragment.jsonld | 7 +++++++ .../vehicle-simple-attributes-second.json | 17 +++++++++++++++++ data/entities/vehicle-simple-attributes.json | 6 +++++- 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-brandname-complete-fragment.jsonld create mode 100644 data/entities/vehicle-simple-attributes-second.json diff --git a/data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld new file mode 100644 index 000000000..2967d8864 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Vehicle" + } + ] + } + ], + "endpoint": "http://my.csource.org:1026", + "mode": "auxiliary", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/vehicle-brandname-complete-fragment.jsonld b/data/entities/fragmentEntities/vehicle-brandname-complete-fragment.jsonld new file mode 100644 index 000000000..2abdf96e9 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-brandname-complete-fragment.jsonld @@ -0,0 +1,7 @@ +{ + "brandname": { + "type": "Property", + "value": "BMW" + }, + "@context": "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" +} \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes-second.json b/data/entities/vehicle-simple-attributes-second.json new file mode 100644 index 000000000..abe88009a --- /dev/null +++ b/data/entities/vehicle-simple-attributes-second.json @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "BMW" + }, + "isParked2": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:Downtown2", + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Alice" + } + } +} \ No newline at end of file diff --git a/data/entities/vehicle-simple-attributes.json b/data/entities/vehicle-simple-attributes.json index 9825fa9f6..729e5f34e 100644 --- a/data/entities/vehicle-simple-attributes.json +++ b/data/entities/vehicle-simple-attributes.json @@ -8,6 +8,10 @@ "isParked": { "type": "Relationship", "object": "urn:ngsi-ld:OffStreetParking:Downtown1", - "observedAt": "2017-07-29T12:00:04Z" + "observedAt": "2017-07-29T12:00:04Z", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + } } } \ No newline at end of file -- GitLab From f542dfc9e9648a8220ca0141680e3f5a8592d9f5 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Tue, 6 May 2025 13:23:27 +0200 Subject: [PATCH 08/17] fixed an error in AssertionUtils --- resources/AssertionUtils.resource | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 477856e19..318342466 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -109,7 +109,7 @@ Check Response Headers ID Not Empty Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} ${response_body} ${expected_attribute_value}=${EMPTY} Should Not Be Empty ${response_body['${expected_attribute_name}']} - IF '${expected_attribute_value}'!='' + IF ${expected_attribute_value}!='' Should Be Equal ${response_body['${expected_attribute_name}']} ${expected_attribute_value} END -- GitLab From c8c17ee94b15e1895fd639c27acc47880505cafa Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Tue, 6 May 2025 13:25:47 +0200 Subject: [PATCH 09/17] Modified distributed operations tests --- .../Entity/QueryEntities/D011_01_01_inc.robot | 29 +++++++------------ .../Entity/QueryEntities/D011_01_02_inc.robot | 16 +++++----- .../Entity/QueryEntities/D011_01_03_inc.robot | 28 +++++++++--------- .../Entity/QueryEntities/D011_01_04_inc.robot | 25 ++++++++-------- .../Entity/QueryEntities/D011_01_05_inc.robot | 25 +++++++++------- .../Entity/QueryEntities/D011_02_inc.robot | 21 +++++++------- .../Entity/RetrieveEntity/D010_01_inc.robot | 19 ++++-------- .../Entity/RetrieveEntity/D010_02_inc.robot | 16 +++++----- .../Entities/CreateEntity/D001_01_inc.robot | 17 ++++------- .../Entities/CreateEntity/D001_02_inc.robot | 9 +++--- .../CreateEntity/D001_03_01_inc.robot | 17 ++++------- .../CreateEntity/D001_03_02_inc.robot | 9 +++--- .../CreateEntity/D001_03_03_inc.robot | 9 +++--- .../Entities/DeleteEntity/D002_01_inc.robot | 9 +++--- .../DeleteEntity/D002_02_01_inc.robot | 9 +++--- .../DeleteEntity/D002_02_02_inc.robot | 9 +++--- .../UpdateEntityAttributes/D004_01_inc.robot | 24 +++++---------- 17 files changed, 123 insertions(+), 168 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot index b1732c42a..350e5fbd0 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot @@ -9,13 +9,13 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld @@ -23,25 +23,18 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D011_01_01_inc Query The Context Broker With Type [Documentation] Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets returned [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 - Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context} - Wait for redirected request - - ${received_request}= Get Request Url - Log To Console ${received_request} - ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities?type=Vehicle - Should Be True ${stub_count} > 0 Check Response Status Code 200 ${response.status_code} - # @{entities_id}= Create List ${entity_id} - # Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + @{entities_id}= Create List ${entity_id} + Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -53,8 +46,6 @@ Setup Entity On Remote And Registration Start Context Source Mock Server -Delete Created Entity And Registration +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - # Delete Entity By Id ${entity_id} base_url=${remote_url} - Stop Context Source Mock Server - \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot index 956cf95b7..3ab077642 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -21,19 +21,20 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D011_01_02_inc Query The Context Broker With Type And Missing Attribute - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 [Documentation] Check that if one queries for type and an attribute that is missing, no entity gets returned + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} ${response}= Query Entities entity_types=Vehicle attrs=speed context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -46,7 +47,6 @@ Setup Entity On Remote And Registration -Delete Created Entity And Registration - # Delete Entity By Id ${entity_id} base_url=${remote_url} +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot index 5723af41f..b4677e0dd 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot @@ -7,29 +7,33 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${entity_payload_filename} vehicle-simple-attributes.jsonld -${entity_payload_filename2} vehicle-simple-attributes-second.jsonld +${entity_payload_filename2} vehicle-simple-attributes-second.json ${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-entities.jsonld *** Test Cases *** D011_01_03_inc Query The Context Broker With Type and Attribute - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 [Documentation] Check that if one queries for attribute present in an entity on a Context Source, only that entity gets returned - @{entities_id}= Create List ${second_entity_id} + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 + ${entity_body}= Load Entity ${entity_payload_filename2} ${second_entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} + ${response}= Query Entities entity_types=Vehicle attrs=isParked2 context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + @{entities_id}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} *** Keywords *** -Create Entities With Different Payloads And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${first_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${first_entity_id} ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} @@ -37,8 +41,6 @@ Create Entities With Different Payloads And Registration ${second_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${second_entity_id} - ${response1}= Create Entity ${entity_payload_filename2} ${second_entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response1.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -47,12 +49,10 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response2.status_code} - + Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${first_entity_id} - Delete Entity By Id ${second_entity_id} base_url=${remote_url} - - + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot index ba74cf0b2..5b65606ea 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot @@ -7,31 +7,33 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-attributes-second.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** D011_01_04_inc Query The Context Broker With Type and Attribute In Neither - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 [Documentation] Check that if one queries for attribute present in neither of the entities, neither of them gets returned + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 + ${entity_body}= Load Entity ${entity_payload_filename} ${first_entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} + ${response}= Query Entities entity_types=Vehicle attrs=speed context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} *** Keywords *** -Create Entities With Different Payloads And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${first_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${second_entity_id} @@ -45,12 +47,11 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response2.status_code} - + Start Context Source Mock Server -Delete Created Entities And Registration + +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Delete Entity By Id ${first_entity_id} base_url=${remote_url} Delete Entity By Id ${second_entity_id} - - + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot index 6ede4defa..082ac614f 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot @@ -7,21 +7,25 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-different-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** D011_01_05_inc Query The Context Broker With Type - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 [Documentation] Check that entities on the Context Broker and Context Source with the same id get merged and returned as one entity + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-auxiliary 4_3_6_2 5_7_2 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} + @{entities_id}= Create List ${entity_id} ${expected}= Load JSON From File ${EXECDIR}/data/entities/${entity_payload_filename} ${expected2}= Load JSON From File ${EXECDIR}/data/entities/${entity_payload_filename2} @@ -36,11 +40,9 @@ D011_01_05_inc Query The Context Broker With Type *** Keywords *** -Create Entities With Different Payloads And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ${entity_payload_filename2} ${entity_id} Check Response Status Code 201 ${response.status_code} @@ -52,11 +54,12 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server -Delete Created Entities And Registration + +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} Delete Entity By Id ${entity_id} - + Stop Context Source Mock Server + diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot index c76a0dcc4..a7ab42c9f 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -20,18 +21,18 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** D011_02_inc Query The Context Broker With Local Flag - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 6_3_18 [Documentation] Check that if one queries with the local flag, no entity from Context Source gets returned + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 6_3_18 + ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} + Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body} ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context} local=true Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -40,11 +41,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} - + Start Context Source Mock Server -Delete Created Entity And Registration - Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot index 749032872..37cf39262 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: @@ -22,24 +22,16 @@ ${registration_payload_file_path} csourceRegistrations/context-source-re D010_01_inc Retrieve entity on a Context Source from the Context Broker [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, entity gets returned [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1 - ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id} Set Stub Reply GET /ngsi-ld/v1/entities/${entity_id} 200 ${entity_body} ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} - - Wait for redirected request - - ${stub_count}= Get Stub Count GET /ngsi-ld/v1/entities/${entity_id} - Should Be True ${stub_count} > 0 Check Response Status Code 200 ${response.status_code} *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -52,7 +44,6 @@ Setup Entity On Remote And Registration -Delete Created Entity And Registration +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - # Delete Entity By Id ${entity_id} base_url=${remote_url} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot index d69f26562..fd7850e30 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot @@ -9,29 +9,28 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** D010_02_inc Retrieve entity on a Context Source from the Context Broker with local flag - [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1 6_3_18 [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker with local flag, entity not found error is raised + [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1 6_3_18 ${response}= Retrieve Entity By Id ${entity_id} context=${ngsild_test_suite_context} local=true + + Wait For No Request Check Response Status Code 404 ${response.status_code} *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -44,7 +43,6 @@ Setup Entity On Remote And Registration -Delete Created Entity And Registration - # Delete Entity By Id ${entity_id} base_url=${remote_url} +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index 2cf7ac7d9..9c903c00c 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity Id And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Setup Entity Id And Registration And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -24,21 +24,14 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D001_01_inc Create Entity On Both Context Broker and Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration, this is created on the Context Source too [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 - 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} Wait for redirected request - ${request_payload}= Get Request Body - ${payload}= Evaluate json.loads('''${request_payload}''') json - Log ${payload} - ${request_headers}= Get Request Headers - Log ${request_headers} - + ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json @{entities_id}= Create List ${entity_id} - ${payload_list} Evaluate [$payload] Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} @@ -46,7 +39,7 @@ D001_01_inc Create Entity On Both Context Broker and Context Source Check Response Body Containing Entities URIS set to ${entities_id} ${response_query.json()} *** Keywords *** -Setup Entity Id And Registration +Setup Entity Id And Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} @@ -60,7 +53,7 @@ Setup Entity Id And Registration Check Response Status Code 201 ${response.status_code} Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot index 944f61323..a7acf268d 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Initial Context Source Registration -Test Teardown Delete Created Registration +Test Setup Setup Initial Context Source Registration And Start Context Source Mock Server +Test Teardown Delete Created Registration And Stop Context Source Mock Server *** Variables *** @@ -24,7 +24,6 @@ ${context_source_registration_payload_file_path} csourceRegistrations/con D001_02_inc Request to create an entity with a malformed id on both Context Broker and Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on 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_3 - ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 400 ${response.status_code} @@ -34,7 +33,7 @@ D001_02_inc Request to create an entity with a malformed id on both Context Brok Should Be Empty ${response_query.json()} *** Keywords *** -Setup Initial Context Source Registration +Setup Initial Context Source Registration And Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${context_source_registration_id} ${registration_payload}= Prepare Context Source Registration From File @@ -44,6 +43,6 @@ Setup Initial Context Source Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Registration +Delete Created Registration And Stop Context Source Mock Server Delete Context Source Registration ${context_source_registration_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot index c69971552..524155a2a 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Local And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D001_03_01_inc Create entity already existing locally on a Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists locally, this raises an error on the Context Broker but is created correctly on 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_3 - Set Stub Reply POST /ngsi-ld/v1/entities 201 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} @@ -33,19 +32,13 @@ D001_03_01_inc Create entity already existing locally on a Context Source Should Be Equal As Integers ${length} 1 Wait for redirected request - ${request_payload}= Get Request Body - ${payload}= Evaluate json.loads('''${request_payload}''') json - Log ${payload} - ${request_headers}= Get Request Headers - Log ${request_headers} - + ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json @{entities_id}= Create List ${entity_id} - ${payload_list} Evaluate [$payload] Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} *** Keywords *** -Setup Entity On Local And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -61,7 +54,7 @@ Setup Entity On Local And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot index d1491ed61..e7ab3e37a 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entities And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D001_03_02_inc Create entity already existing on both Context Broker and Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists both locally and remotely, this raises an error 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_1 6_3_3 - Set Stub Reply POST /ngsi-ld/v1/entities 409 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} @@ -32,7 +31,7 @@ D001_03_02_inc Create entity already existing on both Context Broker and Context Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][1]['error']} *** Keywords *** -Setup Entities And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -48,7 +47,7 @@ Setup Entities And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot index 5295d55cd..18397409f 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D001_03_03_inc Create entity already existing remotely on the Context Broker [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists remotely, this raises an error on the Context Source, but it works just fine on the Context Broker [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 6_3_3 - Set Stub Reply POST /ngsi-ld/v1/entities 409 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} @@ -35,7 +34,7 @@ D001_03_03_inc Create entity already existing remotely on the Context Broker *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} @@ -49,7 +48,7 @@ Setup Entity On Remote And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot index 5a65460b5..d77ea2b41 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entities And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D002_01_inc Delete 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 delete entities 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_6 - Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id} 204 ${response}= Delete Entity by Id ${entity_id} Check Response Status Code 204 ${response.status_code} @@ -34,7 +33,7 @@ D002_01_inc Delete Entities On Both Context Broker and Context Source Check Response Status Code 404 ${response_retrieve.status_code} *** Keywords *** -Setup Entities And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -50,7 +49,7 @@ Setup Entities And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot index 021add0ae..02df311b6 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Local And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi 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 [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 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 by Id ${entity_id} Check Response Status Code 207 ${response.status_code} @@ -33,7 +32,7 @@ D002_02_01_inc Delete Entity On The Context Broker Check Response Status Code 404 ${response_retrieve.status_code} *** Keywords *** -Setup Entity On Local And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -49,7 +48,7 @@ Setup Entity On Local And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entity And Registration +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot index 122141340..3f5c7fd93 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -23,7 +23,6 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi D002_02_02_inc Delete Entity On a Context Source [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_6 6_3_3 - Set Stub Reply DELETE /ngsi-ld/v1/entities/${entity_id} 204 ${response}= Delete Entity by Id ${entity_id} Check Response Status Code 207 ${response.status_code} @@ -33,7 +32,7 @@ D002_02_02_inc Delete Entity On a Context Source Should Be Equal As Integers ${length} 1 *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} @@ -47,6 +46,6 @@ Setup Entity On Remote And Registration Check Response Status Code 201 ${response1.status_code} Start Context Source Mock Server -Delete Created Entity And Registration +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Stop Context Source Mock Server \ No newline at end of file diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot index 6b0fc2dcb..c35a0dbcc 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -18,31 +18,24 @@ ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld -${fragment_filename} vehicle-brandname-fragment.jsonld +${fragment_filename} vehicle-brandname-complete-fragment.jsonld *** Test Cases *** D004_01_inc Query The Context Broker With Type [Documentation] Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 - Set Stub Reply PATCH /ngsi-ld/v1/entities/${entity_id}/attrs/ 204 + Set Stub Reply PATCH /ngsi-ld/v1/entities/${entity_id}/attrs 204 ${response}= Update Entity Attributes ... ${entity_id} ... ${fragment_filename} ... ${CONTENT_TYPE_LD_JSON} Wait for redirected request - Check Response Status Code 204 ${response.status_code} + Check Response Status Code 207 ${response.status_code} ${stub_count}= Get Stub Count PATCH /ngsi-ld/v1/entities/${entity_id}/attrs/ Should Be True ${stub_count} > 0 - ${request_payload}= Get Request Body - ${payload}= Evaluate json.loads('''${request_payload}''') json - Log ${payload} - ${request_headers}= Get Request Headers - Log ${request_headers} - - @{entities_id}= Create List ${entity_id} # ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} # Check Response Status Code 200 ${response_query_remote.status_code} @@ -51,11 +44,9 @@ D004_01_inc Query The Context Broker With Type *** Keywords *** -Setup Entity On Remote And Registration +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - # ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - # Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -68,7 +59,6 @@ Setup Entity On Remote And Registration Start Context Source Mock Server -Delete Created Entity And Registration +Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - # Delete Entity By Id ${entity_id} base_url=${remote_url} Stop Context Source Mock Server \ No newline at end of file -- GitLab From 172b17ef66b01119de6830a02a9b3e76e186cf15 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 7 May 2025 11:45:44 +0200 Subject: [PATCH 10/17] fix: doc generation failing on some Batch operations --- .../BatchEntities/MergeBatchOfEntities/057_03.robot | 13 +++++++------ .../UpdateBatchOfEntities/005_04.robot | 13 +++++++------ .../UpsertBatchOfEntities/004_06.robot | 13 +++++++------ doc/analysis/checks.py | 4 ++-- 4 files changed, 23 insertions(+), 20 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/MergeBatchOfEntities/057_03.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/MergeBatchOfEntities/057_03.robot index c710de27c..fad99abc2 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/MergeBatchOfEntities/057_03.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/MergeBatchOfEntities/057_03.robot @@ -22,13 +22,14 @@ Batch Merge Entity With Invalid Request Scenarios Check Response Status Code ${expected_status_code} ${response.status_code} IF '${expected_status_code}'=='400' Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + ... response_body=${response.json()} + ... type=${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element + ... response_body=${response.json()} ELSE Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()['errors'][0]['error']} - ... ${problem_type} + ... response_body=${response.json()['errors'][0]['error']} + ... type=${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element - ... ${response.json()['errors'][0]['error']} + ... response_body=${response.json()['errors'][0]['error']} END diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot index d37bed155..cf16eb7c8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/005_04.robot @@ -24,13 +24,14 @@ Batch Update Entity With Invalid Request Scenarios Check Response Status Code ${expected_status_code} ${response.status_code} IF '${expected_status_code}'=='400' Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + ... response_body=${response.json()} + ... type=${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element + ... response_body=${response.json()} ELSE Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()['errors'][0]['error']} - ... ${problem_type} + ... response_body=${response.json()['errors'][0]['error']} + ... type=${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element - ... ${response.json()['errors'][0]['error']} + ... response_body=${response.json()['errors'][0]['error']} END diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot index 19603ad2c..62173dde8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/004_06.robot @@ -24,13 +24,14 @@ Batch Upsert Entity With Invalid Request Scenarios Check Response Status Code ${expected_status_code} ${response.status_code} IF '${expected_status_code}'=='400' Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()} - ... ${problem_type} - Check Response Body Containing ProblemDetails Element Containing Title Element ${response.json()} + ... response_body=${response.json()} + ... type=${problem_type} + Check Response Body Containing ProblemDetails Element Containing Title Element + ... response_body=${response.json()} ELSE Check Response Body Containing ProblemDetails Element Containing Type Element set to - ... ${response.json()['errors'][0]['error']} - ... ${problem_type} + ... response_body=${response.json()['errors'][0]['error']} + ... type=${problem_type} Check Response Body Containing ProblemDetails Element Containing Title Element - ... ${response.json()['errors'][0]['error']} + ... response_body=${response.json()['errors'][0]['error']} END diff --git a/doc/analysis/checks.py b/doc/analysis/checks.py index 792718ffa..03a01ec15 100644 --- a/doc/analysis/checks.py +++ b/doc/analysis/checks.py @@ -166,8 +166,8 @@ class Checks: 'position': [0, 1] }, 'Check Response Body Containing ProblemDetails Element Containing Type Element set to': { - 'params': ['type'], - 'position': [1] + 'params': ['response_body', 'type'], + 'position': [0, 1] }, 'Check Response Body Containing ProblemDetails Element': { 'params': ['problem_type'], -- GitLab From 14b6fef6f107206d67f002e00ca805912735a6f7 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 7 May 2025 11:52:37 +0200 Subject: [PATCH 11/17] fix: misc doc generation errors --- .../Entity/RetrieveEntity/018_04.robot | 4 ++-- .../Provision/AddContext/050_04.robot | 21 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot index 2a68aebe8..2d54419c2 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_04.robot @@ -6,7 +6,7 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Setup Create Entity +Test Setup Create Initial Entity Test Teardown Delete Created Entity @@ -35,7 +35,7 @@ ${options_parameter}= keyValues *** Keywords *** -Create Entity +Create Initial Entity ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} ${create_response}= Create Entity Selecting Content Type diff --git a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot index 7e6f300c1..b6f2132c8 100644 --- a/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot +++ b/TP/NGSI-LD/jsonldContext/Provision/AddContext/050_04.robot @@ -1,22 +1,22 @@ *** Settings *** Documentation Check that one can add a hosted @context with list of URIs and each of them are cached @coxtexts -Variables ${EXECDIR}/resources/variables.py + +Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/HttpUtils.resource - Test Teardown Delete Initial @context *** Variables *** -${filename_list}= @context-cached-valid.json -${entity_filename}= building-simple-attributes.json -${reason_201}= Created -${reason_204}= No Content +${filename_list}= @context-cached-valid.json +${entity_filename}= building-simple-attributes.json +${reason_201}= Created +${reason_204}= No Content ${building_id_prefix}= urn:ngsi-ld:Building: -${content_type}= application/json +${content_type}= application/json *** Test Cases *** @@ -40,14 +40,13 @@ ${content_type}= application/json ${response_serve}= Serve a @context ${uri} true Check Response Kind set to ${response_serve.json()} Hosted ${entity_id}= Generate Random Entity Id ${building_id_prefix} - ${response}= Create Entity Selecting Content Type + Create Entity Selecting Content Type ... ${entity_filename} ... ${entity_id} ... ${content_type} ... ${url}${uri} - - - ${response}= Delete Entity By Id ${entity_id} + + Delete Entity By Id ${entity_id} # Need to check that each of the URIs are Cached @contexts Check Cached @Contexts ${filename_list} -- GitLab From 36fff913bfdfb1e48d502fd2e22f0b9a0c5805f0 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 20 May 2025 14:52:20 +0200 Subject: [PATCH 12/17] chore: apply Robotidy to all Robot files --- .../Entity/QueryEntities/019_02_05.robot | 23 ++++++------ .../Entity/QueryEntities/019_05.robot | 19 +++++----- .../Entity/QueryEntities/D011_01_01_inc.robot | 8 +++-- .../Entity/QueryEntities/D011_01_02_inc.robot | 7 ++-- .../Entity/QueryEntities/D011_01_03_inc.robot | 7 ++-- .../Entity/QueryEntities/D011_01_04_inc.robot | 6 ++-- .../Entity/QueryEntities/D011_01_05_inc.robot | 14 ++++---- .../Entity/QueryEntities/D011_02_inc.robot | 8 +++-- .../Entity/RetrieveEntity/D010_01_inc.robot | 7 ++-- .../Entity/RetrieveEntity/D010_02_inc.robot | 7 ++-- .../Entities/CreateEntity/D001_01_inc.robot | 2 +- .../Entities/CreateEntity/D001_02_inc.robot | 17 ++++----- .../CreateEntity/D001_03_01_inc.robot | 9 ++--- .../CreateEntity/D001_03_02_inc.robot | 6 ++-- .../CreateEntity/D001_03_03_inc.robot | 7 ++-- .../Entities/DeleteEntity/D002_01_inc.robot | 6 ++-- .../DeleteEntity/D002_02_01_inc.robot | 5 +-- .../DeleteEntity/D002_02_02_inc.robot | 8 +++-- .../UpdateEntityAttributes/D004_01_inc.robot | 5 +-- .../Consumption/ListContexts/052_01.robot | 2 +- .../Consumption/ListContexts/052_02.robot | 1 - .../Consumption/ListContexts/052_03.robot | 1 - .../Consumption/ListContexts/052_05.robot | 8 ++--- .../Consumption/ListContexts/052_06.robot | 13 ++++--- .../Consumption/ListContexts/052_07.robot | 15 ++++---- .../Consumption/ServeContext/053_03.robot | 8 ++--- .../Consumption/ServeContext/053_05.robot | 4 +-- .../Consumption/ServeContext/053_06.robot | 2 +- .../Consumption/ServeContext/053_07.robot | 1 - .../Consumption/ServeContext/053_08.robot | 4 +-- .../Provision/DeleteContext/051_03.robot | 14 ++++---- .../Provision/DeleteContext/051_05.robot | 2 +- .../Provision/DeleteContext/051_06.robot | 2 -- .../ContextInformationConsumption.resource | 9 +++-- resources/AssertionUtils.resource | 36 +++++++++++-------- 35 files changed, 165 insertions(+), 128 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot index 4cb62831e..15295a0b3 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_02_05.robot @@ -11,15 +11,15 @@ Suite Teardown Delete Entities *** Variables *** -${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: -${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: -${vehicle_filename}= vehicle-simple-attributes.jsonld -${parking_filename}= parking-simple-attributes.jsonld -${expectation_filename_alt2}= vehicle-parking-019-02-05.alternative2.geojson -${expectation_filename_alt1}= vehicle-parking-019-02-05.alternative.geojson -${expectation_filename}= vehicle-parking-019-02-05.geojson -${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle -${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${parking_id_prefix}= urn:ngsi-ld:OffStreetParking: +${vehicle_filename}= vehicle-simple-attributes.jsonld +${parking_filename}= parking-simple-attributes.jsonld +${expectation_filename_alt2}= vehicle-parking-019-02-05.alternative2.geojson +${expectation_filename_alt1}= vehicle-parking-019-02-05.alternative.geojson +${expectation_filename}= vehicle-parking-019-02-05.geojson +${vehicle_entity_type}= https://ngsi-ld-test-suite/context#Vehicle +${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking *** Test Cases *** @@ -34,7 +34,10 @@ ${parking_entity_type}= https://ngsi-ld-test-suite/context#OffStreetParking ... accept=${CONTENT_TYPE_GEOJSON} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${alternatives}= Create List ${expectation_filename} ${expectation_filename_alt1} ${expectation_filename_alt2} + ${alternatives}= Create List + ... ${expectation_filename} + ... ${expectation_filename_alt1} + ... ${expectation_filename_alt2} Check Body With Alternatives ... response_body=${response.json()} ... alternatives=${alternatives} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot index 80a94e3dc..03bcf9d1c 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_05.robot @@ -11,12 +11,12 @@ Suite Teardown Delete Entities *** Variables *** -${building_id_prefix}= urn:ngsi-ld:Building: -${filename}= building-location-attribute.jsonld -${expectation_filename}= two-buildings-location-attribute-normalized-019-05.geojson -${expectation_filename_alt1}= two-buildings-location-attribute-normalized-019-05.alternative.geojson -${expectation_filename_alt2}= two-buildings-location-attribute-normalized-019-05.alternative2.geojson -${entity_type}= https://ngsi-ld-test-suite/context#Building +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-location-attribute.jsonld +${expectation_filename}= two-buildings-location-attribute-normalized-019-05.geojson +${expectation_filename_alt1}= two-buildings-location-attribute-normalized-019-05.alternative.geojson +${expectation_filename_alt2}= two-buildings-location-attribute-normalized-019-05.alternative2.geojson +${entity_type}= https://ngsi-ld-test-suite/context#Building *** Test Cases *** @@ -32,13 +32,16 @@ ${entity_type}= https://ngsi-ld-test-suite/context#Building ... accept=${CONTENT_TYPE_GEOJSON} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${alternatives}= Create List ${expectation_filename} ${expectation_filename_alt1} ${expectation_filename_alt2} + ${alternatives}= Create List + ... ${expectation_filename} + ... ${expectation_filename_alt1} + ... ${expectation_filename_alt2} Check Body With Alternatives ... response_body=${response.json()} ... alternatives=${alternatives} + *** Keywords *** Create Initial Entities ${first_entity_id}= Catenate ${building_id_prefix}019-05-01 diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot index 350e5fbd0..fe302ca3c 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D011_01_01_inc Query The Context Broker With Type [Documentation] Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets returned @@ -31,6 +32,7 @@ D011_01_01_inc Query The Context Broker With Type @{entities_id}= Create List ${entity_id} Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} + *** Keywords *** Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -38,7 +40,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} @@ -48,4 +50,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot index 3ab077642..699a6f1f5 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D011_01_02_inc Query The Context Broker With Type And Missing Attribute [Documentation] Check that if one queries for type and an attribute that is missing, no entity gets returned @@ -30,7 +31,7 @@ D011_01_02_inc Query The Context Broker With Type And Missing Attribute Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} - + *** Keywords *** Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -38,7 +39,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot index b4677e0dd..533c80622 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename2} vehicle-simple-attributes-second.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-entities.jsonld + *** Test Cases *** D011_01_03_inc Query The Context Broker With Type and Attribute [Documentation] Check that if one queries for attribute present in an entity on a Context Source, only that entity gets returned @@ -30,7 +31,7 @@ D011_01_03_inc Query The Context Broker With Type and Attribute Check Response Status Code 200 ${response.status_code} @{entities_id}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} - + *** Keywords *** Create Entity And Registration On The Context Broker And Start Context Source Mock Server @@ -44,7 +45,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot index 5b65606ea..f08c029c7 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename2} vehicle-simple-attributes-second.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D011_01_04_inc Query The Context Broker With Type and Attribute In Neither [Documentation] Check that if one queries for attribute present in neither of the entities, neither of them gets returned @@ -30,6 +31,7 @@ D011_01_04_inc Query The Context Broker With Type and Attribute In Neither Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} + *** Keywords *** Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${first_entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -42,7 +44,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot index 082ac614f..c072bcc77 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, entities with same id on the Context Broker and on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker, entities with same id on the Context Broker and on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename2} vehicle-simple-different-attributes.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D011_01_05_inc Query The Context Broker With Type [Documentation] Check that entities on the Context Broker and Context Source with the same id get merged and returned as one entity @@ -32,11 +33,10 @@ D011_01_05_inc Query The Context Broker With Type ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entities URIS set to ${entities_id} ${response.json()} - Should Have Value In Json ${response.json()[0]} $.brandName - Should Have Value In Json ${response.json()[0]} $.speed - Should Have Value In Json ${response.json()[0]} $.isParked - Should Have Value In Json ${response.json()[0]} $.isParked2 - + Should Have Value In Json ${response.json()[0]} $.brandName + Should Have Value In Json ${response.json()[0]} $.speed + Should Have Value In Json ${response.json()[0]} $.isParked + Should Have Value In Json ${response.json()[0]} $.isParked2 *** Keywords *** @@ -49,7 +49,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot index a7ab42c9f..b9bb9706d 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker with local flag entity not found error is raised +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker with local flag entity not found error is raised Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D011_02_inc Query The Context Broker With Local Flag [Documentation] Check that if one queries with the local flag, no entity from Context Source gets returned @@ -29,6 +30,7 @@ D011_02_inc Query The Context Broker With Local Flag Check Response Status Code 200 ${response.status_code} Should Be Empty ${response.json()} + *** Keywords *** Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -36,7 +38,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} @@ -48,4 +50,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Stop Context Source Mock Server - \ No newline at end of file + diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot index 37cf39262..d4932d876 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker the request gets forwarded to the Context Source correctly +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker the request gets forwarded to the Context Source correctly Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -28,6 +28,7 @@ D010_01_inc Retrieve entity on a Context Source from the Context Broker Check Response Status Code 200 ${response.status_code} + *** Keywords *** Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -35,7 +36,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} @@ -46,4 +47,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot index fd7850e30..164ad1a7e 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker with local flag entity not found error is raised +Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker with local flag entity not found error is raised Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -17,6 +17,7 @@ ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld + *** Test Cases *** D010_02_inc Retrieve entity on a Context Source from the Context Broker with local flag [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker with local flag, entity not found error is raised @@ -34,7 +35,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} @@ -45,4 +46,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index 9c903c00c..9c387a4a4 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot @@ -56,4 +56,4 @@ Setup Entity Id And Registration And Start Context Source Mock Server Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot index a7acf268d..95c8dd7be 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on the Context Source +Documentation Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on the Context Source Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -14,11 +14,12 @@ Test Teardown Delete Created Registration And Stop Context Source Mock Serv *** Variables *** -${entity_id} InvalidUriExample -${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld -${registration_id_prefix} urn:ngsi-ld:Registration: -${context_source_registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${entity_id} InvalidUriExample +${entity_id_prefix} urn:ngsi-ld:Vehicle: +${entity_payload_filename} vehicle-simple-attributes.jsonld +${registration_id_prefix} urn:ngsi-ld:Registration: +${context_source_registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D001_02_inc Request to create an entity with a malformed id on both Context Broker and Context Source @@ -36,7 +37,7 @@ D001_02_inc Request to create an entity with a malformed id on both Context Brok Setup Initial Context Source Registration And Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${context_source_registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${context_source_registration_id} ... ${context_source_registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} @@ -45,4 +46,4 @@ Setup Initial Context Source Registration And Start Context Source Mock Server Delete Created Registration And Stop Context Source Mock Server Delete Context Source Registration ${context_source_registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot index 524155a2a..05f5297f8 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an entity and an inclusive registration on a Context Broker, one is able to create that entity on a Context Source from the Context Broker but gets an error for the Context Broker +Documentation Verify that, when one has an entity and an inclusive registration on a Context Broker, one is able to create that entity on a Context Source from the Context Broker but gets an error for the Context Broker Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D001_03_01_inc Create entity already existing locally on a Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists locally, this raises an error on the Context Broker but is created correctly on the Context Source @@ -26,7 +27,7 @@ D001_03_01_inc Create entity already existing locally on a Context Source Set Stub Reply POST /ngsi-ld/v1/entities 201 ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 207 ${response.status_code} - + Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']} ${length}= Get Length ${response.json()['errors']} Should Be Equal As Integers ${length} 1 @@ -46,7 +47,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} @@ -57,4 +58,4 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot index e7ab3e37a..330000fd3 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D001_03_02_inc Create entity already existing on both Context Broker and Context Source [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists both locally and remotely, this raises an error on both Context Broker and Context Source @@ -30,6 +31,7 @@ D001_03_02_inc Create entity already existing on both Context Broker and Context Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']} Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][1]['error']} + *** Keywords *** Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -39,7 +41,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} @@ -50,4 +52,4 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot index 18397409f..623df13a6 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an entity on a Context Source and an inclusive registration on a Context Broker, one is not able to create that entity on the Context Source from the Context Broker but one is able to create it on the Context Broker +Documentation Verify that, when one has an entity on a Context Source and an inclusive registration on a Context Broker, one is not able to create that entity on the Context Source from the Context Broker but one is able to create it on the Context Broker Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D001_03_03_inc Create entity already existing remotely on the Context Broker [Documentation] Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists remotely, this raises an error on the Context Source, but it works just fine on the Context Broker @@ -40,7 +41,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} @@ -51,4 +52,4 @@ Setup Registration And Start Context Source Mock Server Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot index d77ea2b41..618f67cab 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to delete 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 delete entities on both Context Broker and Context Source Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D002_01_inc Delete 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 delete entities on both Context Broker and Context Source @@ -32,6 +33,7 @@ D002_01_inc Delete Entities On Both Context Broker and Context Source ${response_retrieve}= Retrieve Entity by Id ${entity_id} local=true Check Response Status Code 404 ${response_retrieve.status_code} + *** Keywords *** Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -41,7 +43,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot index 02df311b6..9ce0ac232 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -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 entities locally and should get a BatchOperationResult structure Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** 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 @@ -40,7 +41,7 @@ Create Entity And Registration On The Context Broker And Start Context Source Mo ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot index 3f5c7fd93..916a11a3a 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure +Documentation Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -19,6 +19,7 @@ ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld + *** Test Cases *** D002_02_02_inc Delete Entity On a Context Source [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure @@ -31,6 +32,7 @@ D002_02_02_inc Delete Entity On a Context Source ${length}= Get Length ${response.json()['errors']} Should Be Equal As Integers ${length} 1 + *** Keywords *** Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} @@ -38,7 +40,7 @@ Setup Registration And Start Context Source Mock Server ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} - ${registration_payload}= Prepare Context Source Registration From File + ${registration_payload}= Prepare Context Source Registration From File ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} @@ -48,4 +50,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot index c35a0dbcc..873fcbb1c 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to update entities on a Context Source +Documentation Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to update entities on a Context Source Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -20,6 +20,7 @@ ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld ${fragment_filename} vehicle-brandname-complete-fragment.jsonld + *** Test Cases *** D004_01_inc Query The Context Broker With Type [Documentation] Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too @@ -61,4 +62,4 @@ Setup Registration And Start Context Source Mock Server Delete Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Stop Context Source Mock Server \ No newline at end of file + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot index 2cb2cb0a9..f4623001f 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_01.robot @@ -45,7 +45,7 @@ List @contexts with no previous created @context [Documentation] Check that one can list @contexts [Arguments] ${details} ${kind} ${response}= List @contexts ${details} ${kind} - ${empty_array}= Create List + ${empty_array}= Create List Check Response Status Code 200 ${response.status_code} Check Response Reason set to ${response.reason} ${reason_200} Check Context Response Body Containing a list of identifiers diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot index 30d4212eb..4bfc1a96e 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_02.robot @@ -31,7 +31,6 @@ ${reason_204}= No Content false Hosted - *** Keywords *** Create Initial @context ${response}= Add a new @context ${first_filename} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot index 1e722849d..99f322b6f 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_03.robot @@ -33,7 +33,6 @@ ${reason_204}= No Content false Hosted - *** Keywords *** Create Initial set of @contexts ${response}= Add a new @context ${first_filename} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot index 34e9c3385..26001b80c 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_05.robot @@ -25,11 +25,11 @@ ${reason_204}= No Content 052_05_02 List @contexts with details set to true and kind set to hosted and with previously several add @contexts [Tags] ctx-list 5_13_3 since_v1.5.1 true Hosted -#move to new tests this doesn't work like this. cached need to run differently -#052_05_03 List @contexts with details set to true and kind set to cached abd with previously several add @contexts +# move to new tests this doesn't work like this. cached need to run differently +# 052_05_03 List @contexts with details set to true and kind set to cached abd with previously several add @contexts # [Tags] ctx-list 5_13_3 since_v1.5.1 # true Cached -#052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts +# 052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts # [Tags] ctx-list 5_13_3 since_v1.5.1 # true ImplicitlyCreated @@ -50,7 +50,7 @@ Create Initial set of @contexts Check Response Status Code 201 ${response.status_code} ${third_uri}= Fetch Id From Response Location Header ${response.headers} Set Suite Variable ${third_uri} - + @{uris}= Create List Append To List ${uris} ${first_uri} Append To List ${uris} ${second_uri} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot index 4a5431c62..0c4e0db5c 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_06.robot @@ -52,9 +52,13 @@ List @contexts with no previous created @context Check Response Status Code 200 ${response.status_code} Check Response Reason set to ${response.reason} ${reason_200} - + IF '${kind}' == 'Hosted' - ${entryFound}= Run Keyword And Return Status Check Context Response Body Containing a list of identifiers ${response.json()} ${list_contexts} ${kind} + ${entryFound}= Run Keyword And Return Status + ... Check Context Response Body Containing a list of identifiers + ... ${response.json()} + ... ${list_contexts} + ... ${kind} Should Not Be True ${entryFound} ELSE IF '${kind}' == 'ImplicitlyCreated' ${tmp}= Create List ${implicit_id} @@ -69,7 +73,6 @@ List @contexts with no previous created @context ... ${kind} END - Create initial ImplicitlyCreated @context ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${subscription_payload_file_path} @@ -93,9 +96,9 @@ Create initial ImplicitlyCreated @context Set Suite Variable ${list_contexts} ${response}= Serve a @context ${implicit_id} Check Response Status Code 200 ${response.status_code} - + ${data}= Set Variable ${response.json()} - + Check Context Response Body Containing numberOfHits value ${data} 1 Delete Initial @context Data diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_07.robot b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_07.robot index 5691abea7..61993134c 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_07.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ListContexts/052_07.robot @@ -12,18 +12,19 @@ Test Template List @contexts with several previous created @context *** Variables *** -${entity_filename}= building-simple-attributes.json -${contextUri}= https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld -${reason_200}= OK -${reason_204}= No Content +${entity_filename}= building-simple-attributes.json +${contextUri}= https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld +${reason_200}= OK +${reason_204}= No Content ${building_id_prefix}= urn:ngsi-ld:Building: -${content_type}= application/json +${content_type}= application/json + *** Test Cases *** DETAILS KIND 052_07_01 List @contexts with details set to true and kind set to cached and with previously several add @contexts [Tags] ctx-list 5_13_3 since_v1.5.1 true Cached -#052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts +# 052_05_04 List @contexts with details set to true and kind set to implicitlycreated and with previously several add @contexts # [Tags] ctx-list 5_13_3 since_v1.5.1 # true ImplicitlyCreated @@ -37,7 +38,7 @@ Create Initial Cached @context from entity ... ${entity_id} ... ${content_type} ... ${contextUri} - + Check Response Status Code 201 ${response.status_code} List @contexts with several previous created @context diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot index 74c5b3a97..7b0987755 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_03.robot @@ -22,12 +22,12 @@ ${reason_422}= Unprocessable Content 053_03_01 Serve a @contexts with a wrong id and correct details [Tags] ctx-serve 5_13_4 since_v1.5.1 wrong_id_context true 404 ${reason_404} ${ERROR_TYPE_RESOURCE_NOT_FOUND} -#Deactivated because of boolean parsing -#053_03_02 Serve a @contexts with a valid id and incorrect details +# Deactivated because of boolean parsing +# 053_03_02 Serve a @contexts with a valid id and incorrect details # [Tags] ctx-serve 5_13_4 since_v1.5.1 # ${uri} other 400 ${reason_400} ${ERROR_TYPE_BAD_REQUEST_DATA} -#Why exactly should this produce a 422? -#053_03_03 Serve a Cached @contexts with details set to false +# Why exactly should this produce a 422? +# 053_03_03 Serve a Cached @contexts with details set to false # [Tags] ctx-serve 5_13_4 since_v1.5.1 # ${cached_id} false 422 ${reason_422} ${ERROR_OPERATION_NOT_SUPPORTED} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot index 285e7823f..45bf249cd 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_05.robot @@ -29,7 +29,7 @@ ${reason_200}= OK 053_05_01 Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true [Documentation] Check that the context served by a context server is still in the broker after a ERROR_TYPE_LD_CONTEXT_NOT_AVAILABLE with details=true [Tags] ctx-serve 5_13_4 since_v1.5.1 - ${response}= List @contexts ${TRUE} + ${response}= List @contexts ${TRUE} Log ${response} ${response}= Serve a @context ... contextId=${uri} @@ -62,7 +62,7 @@ Create Initial @context condition from an external server Log Waiting 3 seconds to continue... Sleep 3s - ${response}= List @contexts ${TRUE} + ${response}= List @contexts ${TRUE} Log ${response} ${response}= Serve a @context ${uri} true Check Response Status Code 200 ${response.status_code} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot index 6d56fd3a5..d93da4623 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_06.robot @@ -50,7 +50,7 @@ Create Initial @context condition from an external server ${first_existing_entity_id}= Generate Random Entity Id ${testing_id_prefix} Set Global Variable ${first_existing_entity_id} - #${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} + # ${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} Set Global Variable ${uri} Create Entity selecting @context ${entityfile} ${uri} ${first_existing_entity_id} diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot index cda21ba2e..2f57ab049 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_07.robot @@ -60,7 +60,6 @@ Create initial ImplicitlyCreated @context ... ${subscription_payload_file_path} ... ${CONTENT_TYPE_LD_JSON} - ${response}= Retrieve Subscription ${subscription_id} ${data}= Set Variable ${response.json()} ${implicit_id}= Get From Dictionary ${response.json()} jsonldContext diff --git a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot index fcbfe7ae7..07555bc58 100644 --- a/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot +++ b/TP/NGSI-LD/jsonldContext/Consumption/ServeContext/053_08.robot @@ -62,13 +62,11 @@ Create initial ImplicitlyCreated @context ${implicit_id_full}= Get From Dictionary ${response.json()} jsonldContext ${implicit_id}= Evaluate '${implicit_id_full}'.split('/')[-1] Set Global Variable ${implicit_id} - Set Global Variable ${implicit_id_full} + Set Global Variable ${implicit_id_full} Set Suite Variable ${subscription_id} Set Suite Variable ${list_contexts} Check Context Response Body Containing numberOfHits value ${data} 0 - - Delete Initial @context Data Delete Subscription ${subscription_id} FOR ${uri} IN @{list_contexts} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot index a15776d91..1e7ab985e 100644 --- a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_03.robot @@ -1,6 +1,7 @@ *** Settings *** Documentation Check that one can delete a previous created cached @context without reload param -Variables ${EXECDIR}/resources/variables.py + +Variables ${EXECDIR}/resources/variables.py Resource ${EXECDIR}/resources/ApiUtils/jsonldContext.resource Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource Resource ${EXECDIR}/resources/AssertionUtils.resource @@ -11,11 +12,11 @@ Test Teardown Delete Initial @context *** Variables *** -${filename}= @context-cached-one-valid.json -${entity_filename}= building-simple-attributes.json +${filename}= @context-cached-one-valid.json +${entity_filename}= building-simple-attributes.json ${building_id_prefix}= urn:ngsi-ld:Building: -${content_type}= application/json -${reason_204}= No Content +${content_type}= application/json +${reason_204}= No Content *** Test Cases *** @@ -45,8 +46,7 @@ Create Initial cached @context ... ${entity_id} ... ${content_type} ... ${url}${uri} - - + ${response}= Delete Entity By Id ${entity_id} ${response}= Serve a @context ${contextId} true Check Response Kind set to ${response.json()} Cached diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot index 6b64dabec..c63d2aff0 100644 --- a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_05.robot @@ -42,7 +42,7 @@ ${uri} /api/v1/context.jsonld Create Initial @context condition from an external server Start @context Local Server - #${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} + # ${uri}= Catenate http://${context_server_host}:${context_server_port}${uri} Set Global Variable ${uri} Create Entity selecting @context ${entityfile} ${uri} diff --git a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot index 5a1da7857..9545f14ae 100644 --- a/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot +++ b/TP/NGSI-LD/jsonldContext/Provision/DeleteContext/051_06.robot @@ -55,8 +55,6 @@ Create initial ImplicitlyCreated @context Set Suite Variable ${list_contexts} Check Context Response Body Containing numberOfHits value ${data} 0 - - Delete Initial @context Data Delete Subscription ${subscription_id} FOR ${uri} IN @{list_contexts} diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 3815e4c66..667688c48 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -211,7 +211,12 @@ Retrieve Attributes RETURN ${response} Retrieve Entity by Id - [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${base_url}=${url} ${options}=${EMPTY} + [Arguments] + ... ${id} + ... ${accept}=${CONTENT_TYPE_LD_JSON} + ... ${context}=${EMPTY} + ... ${local}=${EMPTY} + ... ${options}=${EMPTY} ${headers}= Create Dictionary &{params}= Create Dictionary ${options_length}= Get Length ${options} @@ -221,7 +226,7 @@ Retrieve Entity by Id ... ${headers} ... Link=<${context}>; rel="http://www.w3.org/ns/json-ld#context";type="application/ld+json" END - IF '${local}'!='' Set To Dictionary ${params} local=${local} + IF '${local}'!='' Set To Dictionary ${params} local=${local} IF ${options_length}>0 Set To Dictionary ${params} options=${options} END diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 318342466..e8ca1df15 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -667,7 +667,7 @@ Check Context Response Body Containing a list of identifiers ${found}= Set Variable ${TRUE} IF ${details} FOR ${index} ${uri_context} IN ENUMERATE @{list_contexts} - ${found}= Set Variable ${FALSE} + ${found}= Set Variable ${FALSE} FOR ${index2} ${respObj} IN ENUMERATE @{response_body} ${uri}= Evaluate urllib.parse.unquote("${respObj['URL']}") modules=urllib ${entryFound}= Run Keyword And Return Status Should End With ${uri} ${uri_context} @@ -678,7 +678,7 @@ Check Context Response Body Containing a list of identifiers Check Response Body Might Contain Optional Fields ${respObj} numberOfHits Check Response Body Might Contain Optional Fields ${respObj} extraInfo END - ${found}= Set Variable ${TRUE} + ${found}= Set Variable ${TRUE} BREAK END END @@ -686,12 +686,12 @@ Check Context Response Body Containing a list of identifiers END ELSE FOR ${index} ${uri_context} IN ENUMERATE @{list_contexts} - ${found}= Set Variable ${FALSE} + ${found}= Set Variable ${FALSE} FOR ${index2} ${respObj} IN ENUMERATE @{response_body} ${uri}= Evaluate urllib.parse.unquote("${respObj}") modules=urllib ${entryFound}= Run Keyword And Return Status Should End With ${uri} ${uri_context} IF ${entryFound} - ${found}= Set Variable ${TRUE} + ${found}= Set Variable ${TRUE} BREAK END END @@ -700,7 +700,6 @@ Check Context Response Body Containing a list of identifiers Should Be True ${found} END - Check Context Response Body Containing a list with several URLs [Arguments] ${response_body} ${expected_length} ${list_contexts} @@ -735,8 +734,16 @@ Check Cached @Contexts Check Context Detailed Information Keys [Arguments] ${my_dict} - - ${expected_keys}= Create List URL localId kind createdAt lastUsage numberOfHits extraInfo body expiresAt + ${expected_keys}= Create List + ... URL + ... localId + ... kind + ... createdAt + ... lastUsage + ... numberOfHits + ... extraInfo + ... body + ... expiresAt ${actual_keys}= Get Dictionary Keys ${my_dict} FOR ${key} IN @{expected_keys} @@ -818,11 +825,12 @@ Check Message Field Equal Check Body With Alternatives [Arguments] ${response_body} ${alternatives} - ${result}= Set Variable ${False} - FOR ${alternative} IN @{alternatives} - ${result}= Run Keyword And Return Status Check Response Body Content expectation_filename=${alternative} response_body=${response_body} - IF ${result} - BREAK - END + ${result}= Set Variable ${False} + FOR ${alternative} IN @{alternatives} + ${result}= Run Keyword And Return Status + ... Check Response Body Content + ... expectation_filename=${alternative} + ... response_body=${response_body} + IF ${result} BREAK END - Should Be True ${result} \ No newline at end of file + Should Be True ${result} -- GitLab From 2a97ce2e6b83ceb24620639047bebc7328d8edc3 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Mon, 28 Apr 2025 13:43:06 +0200 Subject: [PATCH 13/17] added new features in resources --- resources/ApiUtils/ContextInformationConsumption.resource | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 667688c48..1e335c8d2 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -211,12 +211,7 @@ Retrieve Attributes RETURN ${response} Retrieve Entity by Id - [Arguments] - ... ${id} - ... ${accept}=${CONTENT_TYPE_LD_JSON} - ... ${context}=${EMPTY} - ... ${local}=${EMPTY} - ... ${options}=${EMPTY} + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${base_url}=${url} ${options}=${EMPTY} ${headers}= Create Dictionary &{params}= Create Dictionary ${options_length}= Get Length ${options} -- GitLab From 356c4b6189aacb7ac127368e11457410b20d1ba4 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Mon, 28 Apr 2025 13:45:10 +0200 Subject: [PATCH 14/17] updated test cases --- .../Provision/Entities/CreateEntity/D001_01_inc.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index 9c387a4a4..9c903c00c 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot @@ -56,4 +56,4 @@ Setup Entity Id And Registration And Start Context Source Mock Server Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${entity_id} - Stop Context Source Mock Server + Stop Context Source Mock Server \ No newline at end of file -- GitLab From 9c7716205a0ddda00da8a7796861b952c4d41dc6 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Thu, 22 May 2025 17:41:50 +0200 Subject: [PATCH 15/17] removed unused remote broker features --- .../UpdateEntityAttributes/D004_01_inc.robot | 2 -- doc/analysis/parseapiutilsfile.py | 5 +---- resources/ApiUtils/ContextInformationConsumption.resource | 7 +++---- resources/ApiUtils/ContextInformationProvision.resource | 8 ++++---- resources/variables.py | 4 ---- 5 files changed, 8 insertions(+), 18 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot index 6c9228727..dba120eb1 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot @@ -39,8 +39,6 @@ D004_01_inc Query The Context Broker With Type Should Be True ${stub_count} > 0 @{entities_id}= Create List ${entity_id} - # ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - # Check Response Status Code 200 ${response_query_remote.status_code} ${payload_list} Evaluate [$payload] Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list} diff --git a/doc/analysis/parseapiutilsfile.py b/doc/analysis/parseapiutilsfile.py index de7ca3897..ca60c53b9 100644 --- a/doc/analysis/parseapiutilsfile.py +++ b/doc/analysis/parseapiutilsfile.py @@ -44,10 +44,7 @@ class ParseApiUtilsFile: if 'response' in url: url = [x for x in url.split(' ') if 'url' in x][0] - if 'base_url' not in url: - regex = r"\s*\.*\s*url=\$\{url\}\/(.*)" - else: - regex = r"\s*\.*\s*url=\$\{base_url\}\/(.*)" + regex = r"\s*\.*\s*url=\$\{url\}\/(.*)" match = re.match(pattern=regex, string=url) if match: diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 1e335c8d2..1aecf15bb 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -26,7 +26,6 @@ ${response} ${EMPTY} *** Keywords *** Query Entities [Arguments] - ... ${base_url}=${url} ... ${entity_ids}=${EMPTY} ... ${entity_types}=${EMPTY} ... ${accept}=${EMPTY} @@ -87,7 +86,7 @@ Query Entities IF '${q}'!='' Set To Dictionary ${params} q=${q} IF '${local}'!='' Set To Dictionary ${params} local=${local} ${response}= GET - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -211,7 +210,7 @@ Retrieve Attributes RETURN ${response} Retrieve Entity by Id - [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${base_url}=${url} ${options}=${EMPTY} + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${options}=${EMPTY} ${headers}= Create Dictionary &{params}= Create Dictionary ${options_length}= Get Length ${options} @@ -226,7 +225,7 @@ Retrieve Entity by Id Set To Dictionary ${params} options=${options} END ${response}= GET - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} ... headers=${headers} ... params=${params} ... expected_status=any diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index defb0c4f1..41d3a7c06 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -151,12 +151,12 @@ Batch Upsert Entities RETURN ${response} Create Entity - [Arguments] ${filename} ${entity_id} ${base_url}=${url} + [Arguments] ${filename} ${entity_id} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... json=${entity} ... headers=${headers} ... expected_status=any @@ -238,9 +238,9 @@ Delete Entity Attributes RETURN ${response} Delete Entity by Id - [Arguments] ${id} ${base_url}=${url} + [Arguments] ${id} ${response}= DELETE - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} ... expected_status=any IF ${delete_temporal_on_core_delete} Delete Temporal Representation Of Entity ${id} diff --git a/resources/variables.py b/resources/variables.py index f570a71ec..738576829 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -14,10 +14,6 @@ core_context = 'https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld # whether the Temporal Representation of an Entity should be deleted when an Entity is deleted delete_temporal_on_core_delete = True -#DistOps variables -remote_url = 'http://0.0.0.0:8081/ngsi-ld/v1' -context_source_endpoint = 'http://0.0.0.0:8081' - # GitHub repository details # github_owner = 'your_github_username' # github_broker_repo = 'context_broker_repository' -- GitLab From e5d2ed3f73440193c5ef005f4b8fb1b46069b574 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Fri, 23 May 2025 10:38:14 +0200 Subject: [PATCH 16/17] updated initial_setup.py --- .../Entities/CreateEntity/D001_02_inc.robot | 4 +- doc/analysis/initial_setup.py | 57 +++++-------------- 2 files changed, 15 insertions(+), 46 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot index 95c8dd7be..f834d9b98 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot @@ -9,7 +9,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Initial Context Source Registration And Start Context Source Mock Server +Test Setup Setup Registration And Start Context Source Mock Server Test Teardown Delete Created Registration And Stop Context Source Mock Server @@ -34,7 +34,7 @@ D001_02_inc Request to create an entity with a malformed id on both Context Brok Should Be Empty ${response_query.json()} *** Keywords *** -Setup Initial Context Source Registration And Start Context Source Mock Server +Setup Registration And Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${context_source_registration_id} ${registration_payload}= Prepare Context Source Registration From File diff --git a/doc/analysis/initial_setup.py b/doc/analysis/initial_setup.py index 90519e90e..019d1a0a7 100644 --- a/doc/analysis/initial_setup.py +++ b/doc/analysis/initial_setup.py @@ -42,12 +42,10 @@ class InitialSetup: 'Create Initial hosted @context': InitialSetup.create_hosted_context(), 'Create Initial @context condition from an external server': InitialSetup.create_from_external_server(), 'Delete core context and reload it': InitialSetup.delete_core_context(), - 'Setup Entities And Registration': InitialSetup.init_entities_and_csr(), - 'Setup Entity Id And Registration': InitialSetup.init_eid_and_csr(), - 'Setup Entity On Remote And Registration': InitialSetup.init_remote_entity_and_csr(), - 'Setup Entity On Local And Registration': InitialSetup.init_local_entity_and_csr(), - 'Create Entities With Different Payloads And Registration': InitialSetup.init_diff_entities_and_csr(), - 'Create Initial Cached @context from entity': InitialSetup.init_cached_conctext() + 'Setup Entity Id And Registration And Start Context Source Mock Server': InitialSetup.init_eid_and_csr_and_ms(), + 'Setup Registration And Start Context Source Mock Server': InitialSetup.init_csr_and_ms(), + 'Create Entity And Registration On The Context Broker And Start Context Source Mock Server': InitialSetup.init_local_entity_and_csr_and_ms(), + 'Create Initial Cached @context from entity': InitialSetup.init_cached_context() } self.folder_test_suites = dirname(dirname(dirname(__file__))) @@ -225,7 +223,7 @@ class InitialSetup: return data @staticmethod - def init_cached_conctext(): + def init_cached_context(): data = '''with { the SUT containing a cached context from creating an entity. }''' @@ -274,44 +272,30 @@ class InitialSetup: return data @staticmethod - def init_entities_and_csr() -> str: - data = '''with { - the SUT being in the "initial state" and - the SUT containing an initial Entity ${entity} on both the Context Broker and Context Source - with an id set to ${entity_id} - and payload set to ${entity_payload_filename} - and the SUT containing a Context Source Registration - with id equal to ${registration_id} - and payload set to ${registration_payload_file_path} -}''' - return data - - @staticmethod - def init_eid_and_csr() -> str: + def init_eid_and_csr_and_ms() -> str: data = '''with { the SUT being in the "initial state" and the SUT containing an initial Entity id set to ${entity_id} and the SUT containing a Context Source Registration with id equal to ${registration_id} and payload set to ${registration_payload_file_path} + and the SUT containing a Context Source Mock Server }''' return data @staticmethod - def init_remote_entity_and_csr() -> str: + def init_csr_and_ms() -> str: data = '''with { the SUT being in the "initial state" and - the SUT containing an initial Entity ${entity} on the Context Source - with an id set to ${entity_id} - and payload set to ${entity_payload_filename} - and the SUT containing a Context Source Registration + the SUT containing a Context Source Registration with id equal to ${registration_id} and payload set to ${registration_payload_file_path} + and the SUT containing a Context Source Mock Server }''' return data - + @staticmethod - def init_local_entity_and_csr() -> str: + def init_local_entity_and_csr_and_ms() -> str: data = '''with { the SUT being in the "initial state" and the SUT containing an initial Entity ${entity} on the Context Broker @@ -320,25 +304,10 @@ class InitialSetup: and the SUT containing a Context Source Registration with id equal to ${registration_id} and payload set to ${registration_payload_file_path} + and the SUT containing a Context Source Mock Server }''' return data - @staticmethod - def init_diff_entities_and_csr() -> str: - data = '''with { - the SUT being in the "initial state" and - the SUT containing an initial Entity ${entity} on the Context Broker - with an id set to ${entity_id} - and payload set to ${entity_payload_filename} - and the SUT containing an initial Entity ${entity} on the Context Source - with an id set to ${entity_id} - and payload set to ${entity_payload_filename2} - and the SUT containing a Context Source Registration - with id equal to ${registration_id} - and payload set to ${registration_payload_file_path} -}''' - return data - def get_property_values(self, root_folder: str, property_name: str) -> [str, str]: robot_files_without_setup = list() robot_files_with_setup = list() -- GitLab From e4975eeee32f922e979cdf432dc2797d9eb62c42 Mon Sep 17 00:00:00 2001 From: Andrea Il Grande Date: Fri, 23 May 2025 10:39:21 +0200 Subject: [PATCH 17/17] replaced files in doc folder --- .../Consumption/063_01_inc.json | 38 --------------- .../Consumption/063_02_inc.json | 38 --------------- .../Consumption/064_02_inc.json | 38 --------------- .../Consumption/D010_01_inc.json | 44 ++++++++++++++++++ .../Consumption/D010_02_inc.json | 46 +++++++++++++++++++ ...064_01_01_inc.json => D011_01_01_inc.json} | 26 +++++++---- ...064_01_02_inc.json => D011_01_02_inc.json} | 26 +++++++---- ...064_01_03_inc.json => D011_01_03_inc.json} | 26 +++++++---- ...064_01_04_inc.json => D011_01_04_inc.json} | 26 +++++++---- ...064_01_05_inc.json => D011_01_05_inc.json} | 28 ++++++----- .../Consumption/D011_02_inc.json | 46 +++++++++++++++++++ .../Provision/054_03_02_inc.json | 38 --------------- .../Provision/055_01_inc.json | 38 --------------- .../{054_01_inc.json => D001_01_inc.json} | 26 +++++++---- .../{054_02_inc.json => D001_02_inc.json} | 30 +++++++----- ...054_03_01_inc.json => D001_03_01_inc.json} | 30 +++++++----- .../Provision/D001_03_02_inc.json | 46 +++++++++++++++++++ ...054_03_03_inc.json => D001_03_03_inc.json} | 30 +++++++----- .../Provision/D002_01_inc.json | 44 ++++++++++++++++++ ...055_02_01_inc.json => D002_02_01_inc.json} | 30 +++++++----- ...055_02_02_inc.json => D002_02_02_inc.json} | 30 +++++++----- .../{057_01_inc.json => D004_01_inc.json} | 26 +++++++---- 22 files changed, 434 insertions(+), 316 deletions(-) delete mode 100644 doc/files/DistributedOperations/Consumption/063_01_inc.json delete mode 100644 doc/files/DistributedOperations/Consumption/063_02_inc.json delete mode 100644 doc/files/DistributedOperations/Consumption/064_02_inc.json create mode 100644 doc/files/DistributedOperations/Consumption/D010_01_inc.json create mode 100644 doc/files/DistributedOperations/Consumption/D010_02_inc.json rename doc/files/DistributedOperations/Consumption/{064_01_01_inc.json => D011_01_01_inc.json} (51%) rename doc/files/DistributedOperations/Consumption/{064_01_02_inc.json => D011_01_02_inc.json} (50%) rename doc/files/DistributedOperations/Consumption/{064_01_03_inc.json => D011_01_03_inc.json} (53%) rename doc/files/DistributedOperations/Consumption/{064_01_04_inc.json => D011_01_04_inc.json} (53%) rename doc/files/DistributedOperations/Consumption/{064_01_05_inc.json => D011_01_05_inc.json} (53%) create mode 100644 doc/files/DistributedOperations/Consumption/D011_02_inc.json delete mode 100644 doc/files/DistributedOperations/Provision/054_03_02_inc.json delete mode 100644 doc/files/DistributedOperations/Provision/055_01_inc.json rename doc/files/DistributedOperations/Provision/{054_01_inc.json => D001_01_inc.json} (56%) rename doc/files/DistributedOperations/Provision/{054_02_inc.json => D001_02_inc.json} (50%) rename doc/files/DistributedOperations/Provision/{054_03_01_inc.json => D001_03_01_inc.json} (59%) create mode 100644 doc/files/DistributedOperations/Provision/D001_03_02_inc.json rename doc/files/DistributedOperations/Provision/{054_03_03_inc.json => D001_03_03_inc.json} (51%) create mode 100644 doc/files/DistributedOperations/Provision/D002_01_inc.json rename doc/files/DistributedOperations/Provision/{055_02_01_inc.json => D002_02_01_inc.json} (59%) rename doc/files/DistributedOperations/Provision/{055_02_02_inc.json => D002_02_02_inc.json} (50%) rename doc/files/DistributedOperations/Provision/{057_01_inc.json => D004_01_inc.json} (52%) diff --git a/doc/files/DistributedOperations/Consumption/063_01_inc.json b/doc/files/DistributedOperations/Consumption/063_01_inc.json deleted file mode 100644 index 6d396151d..000000000 --- a/doc/files/DistributedOperations/Consumption/063_01_inc.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/063_01_Inc", - "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker the request gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.1", - "config_id": "", - "parent_release": "v1.6.1", - "clauses": [ - "5.7.1" - ], - "pics_selection": "", - "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" - ], - "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", - "test_cases": [ - { - "name": "063_01_inc Retrieve entity on a Context Source from the Context Broker", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/063_01_inc", - "doc": "Check that if one retrieves entity living on a Context Source from a Context Broker, entity gets returned", - "tags": [ - "5_7_1", - "additive-inclusive", - "dist-ops", - "since_v1.6.1" - ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", - "template": null, - "http_verb": "GET", - "endpoint": "entities/{id}" - } - ], - "permutations": [], - "robotpath": "DistributedOperations/Consumption/Entity/RetrieveEntity", - "robotfile": "063_01_inc" -} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/063_02_inc.json b/doc/files/DistributedOperations/Consumption/063_02_inc.json deleted file mode 100644 index fb33d887a..000000000 --- a/doc/files/DistributedOperations/Consumption/063_02_inc.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/063_02_Inc", - "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker with local flag entity not found error is raised", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.1", - "config_id": "", - "parent_release": "v1.6.1", - "clauses": [ - "5.7.1" - ], - "pics_selection": "", - "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" - ], - "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", - "test_cases": [ - { - "name": "063_02_inc Retrieve entity on a Context Source from the Context Broker with local flag", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/063_02_inc", - "doc": "Check that if one retrieves entity living on a Context Source from a Context Broker with local flag, entity not found error is raised", - "tags": [ - "5_7_1", - "additive-inclusive", - "dist-ops", - "since_v1.6.1" - ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", - "template": null, - "http_verb": "GET", - "endpoint": "entities/{id}" - } - ], - "permutations": [], - "robotpath": "DistributedOperations/Consumption/Entity/RetrieveEntity", - "robotfile": "063_02_inc" -} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_02_inc.json b/doc/files/DistributedOperations/Consumption/064_02_inc.json deleted file mode 100644 index 3b7f825e4..000000000 --- a/doc/files/DistributedOperations/Consumption/064_02_inc.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_02_Inc", - "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker with local flag entity not found error is raised", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", - "config_id": "", - "parent_release": "v1.6.1", - "clauses": [ - "5.7.2" - ], - "pics_selection": "", - "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" - ], - "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", - "test_cases": [ - { - "name": "064_02_inc Query The Context Broker With Local Flag", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_02_inc", - "doc": "Check that if one queries with the local flag, no entity from Context Source gets returned", - "tags": [ - "5_7_2", - "additive-inclusive", - "dist-ops", - "since_v1.6.1" - ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", - "template": null, - "http_verb": "GET", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_02_inc" -} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/D010_01_inc.json b/doc/files/DistributedOperations/Consumption/D010_01_inc.json new file mode 100644 index 000000000..c138ca79d --- /dev/null +++ b/doc/files/DistributedOperations/Consumption/D010_01_inc.json @@ -0,0 +1,44 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D010_01_inc", + "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker the request gets forwarded to the Context Source correctly", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.1", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.7.1" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D010_01_inc Retrieve entity on a Context Source from the Context Broker", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D010_01_inc", + "doc": "Check that if one retrieves entity living on a Context Source from a Context Broker, entity gets returned", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_7_1", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Consumption/Entity/RetrieveEntity", + "robotfile": "D010_01_inc", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/D010_02_inc.json b/doc/files/DistributedOperations/Consumption/D010_02_inc.json new file mode 100644 index 000000000..f0f9d6f07 --- /dev/null +++ b/doc/files/DistributedOperations/Consumption/D010_02_inc.json @@ -0,0 +1,46 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D010_02_inc", + "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one retrieves entity from the Context Broker with local flag entity not found error is raised", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.1, 6.3.18", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.7.1", + "6.3.18" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D010_02_inc Retrieve entity on a Context Source from the Context Broker with local flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D010_02_inc", + "doc": "Check that if one retrieves entity living on a Context Source from a Context Broker with local flag, entity not found error is raised", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_7_1", + "6_3_18", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Consumption/Entity/RetrieveEntity", + "robotfile": "D010_02_inc", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_01_01_inc.json b/doc/files/DistributedOperations/Consumption/D011_01_01_inc.json similarity index 51% rename from doc/files/DistributedOperations/Consumption/064_01_01_inc.json rename to doc/files/DistributedOperations/Consumption/D011_01_01_inc.json index 66d938f90..8c8de7c8d 100644 --- a/doc/files/DistributedOperations/Consumption/064_01_01_inc.json +++ b/doc/files/DistributedOperations/Consumption/D011_01_01_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_01_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_01_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.7.2" ], "pics_selection": "", "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "064_01_01_inc Query The Context Broker With Type", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_01_inc", + "name": "D011_01_01_inc Query The Context Broker With Type", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_01_inc", "doc": "Check that if one queries the Context Broker for type, entity with matching type on a Context Source gets returned", "tags": [ + "4_3_3", + "4_3_6_2", "5_7_2", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", "template": null, "http_verb": "GET", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_01_01_inc" + "robotfile": "D011_01_01_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_01_02_inc.json b/doc/files/DistributedOperations/Consumption/D011_01_02_inc.json similarity index 50% rename from doc/files/DistributedOperations/Consumption/064_01_02_inc.json rename to doc/files/DistributedOperations/Consumption/D011_01_02_inc.json index 61972f981..c018505ff 100644 --- a/doc/files/DistributedOperations/Consumption/064_01_02_inc.json +++ b/doc/files/DistributedOperations/Consumption/D011_01_02_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_02_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_02_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.7.2" ], "pics_selection": "", "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "064_01_02_inc Query The Context Broker With Type And Missing Attribute", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_02_inc", + "name": "D011_01_02_inc Query The Context Broker With Type And Missing Attribute", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_02_inc", "doc": "Check that if one queries for type and an attribute that is missing, no entity gets returned", "tags": [ + "4_3_3", + "4_3_6_2", "5_7_2", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", "template": null, "http_verb": "GET", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_01_02_inc" + "robotfile": "D011_01_02_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_01_03_inc.json b/doc/files/DistributedOperations/Consumption/D011_01_03_inc.json similarity index 53% rename from doc/files/DistributedOperations/Consumption/064_01_03_inc.json rename to doc/files/DistributedOperations/Consumption/D011_01_03_inc.json index d6c747495..e8b207d5e 100644 --- a/doc/files/DistributedOperations/Consumption/064_01_03_inc.json +++ b/doc/files/DistributedOperations/Consumption/D011_01_03_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_03_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_03_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.7.2" ], "pics_selection": "", "keywords": [ - "Create Entities With Different Payloads And Registration", - "Delete Created Entities And Registration" + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename2}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "064_01_03_inc Query The Context Broker With Type and Attribute", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_03_inc", + "name": "D011_01_03_inc Query The Context Broker With Type and Attribute", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_03_inc", "doc": "Check that if one queries for attribute present in an entity on a Context Source, only that entity gets returned", "tags": [ + "4_3_3", + "4_3_6_2", "5_7_2", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Create Entities With Different Payloads And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "GET", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_01_03_inc" + "robotfile": "D011_01_03_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_01_04_inc.json b/doc/files/DistributedOperations/Consumption/D011_01_04_inc.json similarity index 53% rename from doc/files/DistributedOperations/Consumption/064_01_04_inc.json rename to doc/files/DistributedOperations/Consumption/D011_01_04_inc.json index 5603e16f6..c11bf4c8f 100644 --- a/doc/files/DistributedOperations/Consumption/064_01_04_inc.json +++ b/doc/files/DistributedOperations/Consumption/D011_01_04_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_04_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_04_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one entity on it and another on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.7.2" ], "pics_selection": "", "keywords": [ - "Create Entities With Different Payloads And Registration", - "Delete Created Entities And Registration" + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename2}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "064_01_04_inc Query The Context Broker With Type and Attribute In Neither", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_04_inc", + "name": "D011_01_04_inc Query The Context Broker With Type and Attribute In Neither", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_04_inc", "doc": "Check that if one queries for attribute present in neither of the entities, neither of them gets returned", "tags": [ + "4_3_3", + "4_3_6_2", "5_7_2", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Create Entities With Different Payloads And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "GET", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_01_04_inc" + "robotfile": "D011_01_04_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/064_01_05_inc.json b/doc/files/DistributedOperations/Consumption/D011_01_05_inc.json similarity index 53% rename from doc/files/DistributedOperations/Consumption/064_01_05_inc.json rename to doc/files/DistributedOperations/Consumption/D011_01_05_inc.json index 58611d3fa..1d86e0096 100644 --- a/doc/files/DistributedOperations/Consumption/064_01_05_inc.json +++ b/doc/files/DistributedOperations/Consumption/D011_01_05_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_05_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_05_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, entities with same id on the Context Broker and on a Context Source, if one queries the Context Broker the query gets forwarded to the Context Source correctly", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.7.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.7.2" ], "pics_selection": "", "keywords": [ - "Create Entities With Different Payloads And Registration", - "Delete Created Entities And Registration" + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename2}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "064_01_05_inc Query The Context Broker With Type", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/064_01_05_inc", + "name": "D011_01_05_inc Query The Context Broker With Type", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_01_05_inc", "doc": "Check that entities on the Context Broker and Context Source with the same id get merged and returned as one entity", "tags": [ + "4_3_3", + "4_3_6_2", "5_7_2", - "additive-inclusive", + "additive-auxiliary", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Create Entities With Different Payloads And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "GET", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", - "robotfile": "064_01_05_inc" + "robotfile": "D011_01_05_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Consumption/D011_02_inc.json b/doc/files/DistributedOperations/Consumption/D011_02_inc.json new file mode 100644 index 000000000..b383518cb --- /dev/null +++ b/doc/files/DistributedOperations/Consumption/D011_02_inc.json @@ -0,0 +1,46 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_02_inc", + "test_objective": "Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, if one queries the Context Broker with local flag entity not found error is raised", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.7.2, 6.3.18", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.7.2", + "6.3.18" + ], + "pics_selection": "", + "keywords": [ + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D011_02_inc Query The Context Broker With Local Flag", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Cons/E/D011_02_inc", + "doc": "Check that if one queries with the local flag, no entity from Context Source gets returned", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_7_2", + "6_3_18", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Consumption/Entity/QueryEntities", + "robotfile": "D011_02_inc", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/054_03_02_inc.json b/doc/files/DistributedOperations/Provision/054_03_02_inc.json deleted file mode 100644 index e6bc1a5db..000000000 --- a/doc/files/DistributedOperations/Provision/054_03_02_inc.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_02_Inc", - "test_objective": "Verify that, when one has an entity on a Context Broker and on a Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.1", - "config_id": "", - "parent_release": "v1.6.1", - "clauses": [ - "5.6.1" - ], - "pics_selection": "", - "keywords": [ - "Setup Entities And Registration", - "Delete Created Entities And Registration" - ], - "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on both the Context Broker and Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", - "test_cases": [ - { - "name": "054_03_02_inc Create entity already existing on both Context Broker and Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_02_inc", - "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists both locally and remotely, this raises an error on both Context Broker and Context Source", - "tags": [ - "5_6_1", - "additive-inclusive", - "dist-ops", - "since_v1.6.1" - ], - "setup": "Setup Entities And Registration", - "teardown": "Delete Created Entities And Registration", - "template": null, - "http_verb": "POST", - "endpoint": "entities/" - } - ], - "permutations": [], - "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", - "robotfile": "054_03_02_inc" -} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/055_01_inc.json b/doc/files/DistributedOperations/Provision/055_01_inc.json deleted file mode 100644 index 8384ab7bd..000000000 --- a/doc/files/DistributedOperations/Provision/055_01_inc.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_01_Inc", - "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on both Context Broker and Context Source", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.6", - "config_id": "", - "parent_release": "v1.6.1", - "clauses": [ - "5.6.6" - ], - "pics_selection": "", - "keywords": [ - "Setup Entities And Registration", - "Delete Created Entities And Registration" - ], - "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on both the Context Broker and Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", - "test_cases": [ - { - "name": "055_01_inc Delete Entities On Both Context Broker and Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_01_inc", - "doc": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on both Context Broker and Context Source", - "tags": [ - "5_6_6", - "additive-inclusive", - "dist-ops", - "since_v1.6.1" - ], - "setup": "Setup Entities And Registration", - "teardown": "Delete Created Entities And Registration", - "template": null, - "http_verb": "DELETE", - "endpoint": "entities/{id}" - } - ], - "permutations": [], - "robotpath": "DistributedOperations/Provision/Entities/DeleteEntity", - "robotfile": "055_01_inc" -} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/054_01_inc.json b/doc/files/DistributedOperations/Provision/D001_01_inc.json similarity index 56% rename from doc/files/DistributedOperations/Provision/054_01_inc.json rename to doc/files/DistributedOperations/Provision/D001_01_inc.json index 7b1d732a6..3e8333940 100644 --- a/doc/files/DistributedOperations/Provision/054_01_inc.json +++ b/doc/files/DistributedOperations/Provision/D001_01_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_01_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_01_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one is able to create entities on both Context Broker and Context Source", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.1", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.1", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.6.1" ], "pics_selection": "", "keywords": [ - "Setup Entity Id And Registration", - "Delete Created Entities And Registration" + "Setup Entity Id And Registration And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity id set to ${entity_id}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity id set to ${entity_id}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "054_01_inc Create Entity On Both Context Broker and Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_01_inc", + "name": "D001_01_inc Create Entity On Both Context Broker and Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_01_inc", "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration, this is created on the Context Source too", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_1", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity Id And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Setup Entity Id And Registration And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "POST", "endpoint": "entities/" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", - "robotfile": "054_01_inc" + "robotfile": "D001_01_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/054_02_inc.json b/doc/files/DistributedOperations/Provision/D001_02_inc.json similarity index 50% rename from doc/files/DistributedOperations/Provision/054_02_inc.json rename to doc/files/DistributedOperations/Provision/D001_02_inc.json index 1d88164b0..01d327da6 100644 --- a/doc/files/DistributedOperations/Provision/054_02_inc.json +++ b/doc/files/DistributedOperations/Provision/D001_02_inc.json @@ -1,32 +1,39 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_02_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_02_inc", "test_objective": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on the Context Source", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.1", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.1, 6.3.3", "config_id": "", "parent_release": "v1.6.1", "clauses": [ - "5.6.1" + "4.3.3", + "4.3.6.2", + "5.6.1", + "6.3.3" ], "pics_selection": "", "keywords": [ - "Setup Initial Context Source Registration", - "Delete Created Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Created Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT contains a Context Source Registration \n with id equal to ${context_source_registration_id}\n and payload set to ${context_source_registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "054_02_inc Request to create an entity with a malformed id on both Context Broker and Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_02_inc", + "name": "D001_02_inc Request to create an entity with a malformed id on both Context Broker and Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_02_inc", "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration but is malformed, this is created neither on the Context Broker nor on the Context Source", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_1", + "6_3_3", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Initial Context Source Registration", - "teardown": "Delete Created Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Created Registration And Stop Context Source Mock Server", "template": null, "http_verb": "POST", "endpoint": "entities/" @@ -34,5 +41,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", - "robotfile": "054_02_inc" + "robotfile": "D001_02_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/054_03_01_inc.json b/doc/files/DistributedOperations/Provision/D001_03_01_inc.json similarity index 59% rename from doc/files/DistributedOperations/Provision/054_03_01_inc.json rename to doc/files/DistributedOperations/Provision/D001_03_01_inc.json index deb256379..f9b8d3596 100644 --- a/doc/files/DistributedOperations/Provision/054_03_01_inc.json +++ b/doc/files/DistributedOperations/Provision/D001_03_01_inc.json @@ -1,32 +1,39 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_01_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_01_inc", "test_objective": "Verify that, when one has an entity and an inclusive registration on a Context Broker, one is able to create that entity on a Context Source from the Context Broker but gets an error for the Context Broker", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.1", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.1, 6.3.3", "config_id": "", "parent_release": "v1.6.1", "clauses": [ - "5.6.1" + "4.3.3", + "4.3.6.2", + "5.6.1", + "6.3.3" ], "pics_selection": "", "keywords": [ - "Setup Entity On Local And Registration", - "Delete Created Entities And Registration" + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "054_03_01_inc Create entity already existing locally on a Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_01_inc", + "name": "D001_03_01_inc Create entity already existing locally on a Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_01_inc", "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists locally, this raises an error on the Context Broker but is created correctly on the Context Source", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_1", + "6_3_3", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Local And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "POST", "endpoint": "entities/" @@ -34,5 +41,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", - "robotfile": "054_03_01_inc" + "robotfile": "D001_03_01_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D001_03_02_inc.json b/doc/files/DistributedOperations/Provision/D001_03_02_inc.json new file mode 100644 index 000000000..2a8e0cb96 --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D001_03_02_inc.json @@ -0,0 +1,46 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_02_inc", + "test_objective": "Verify that, when one has an entity on both Context Broker and Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.1, 6.3.3", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.1", + "6.3.3" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D001_03_02_inc Create entity already existing on both Context Broker and Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_02_inc", + "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists both locally and remotely, this raises an error on both Context Broker and Context Source", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_1", + "6_3_3", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", + "robotfile": "D001_03_02_inc", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/054_03_03_inc.json b/doc/files/DistributedOperations/Provision/D001_03_03_inc.json similarity index 51% rename from doc/files/DistributedOperations/Provision/054_03_03_inc.json rename to doc/files/DistributedOperations/Provision/D001_03_03_inc.json index 6ed309934..b13f0b892 100644 --- a/doc/files/DistributedOperations/Provision/054_03_03_inc.json +++ b/doc/files/DistributedOperations/Provision/D001_03_03_inc.json @@ -1,32 +1,39 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_03_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_03_inc", "test_objective": "Verify that, when one has an entity on a Context Source and an inclusive registration on a Context Broker, one is not able to create that entity on the Context Source from the Context Broker but one is able to create it on the Context Broker", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.1", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.1, 6.3.3", "config_id": "", "parent_release": "v1.6.1", "clauses": [ - "5.6.1" + "4.3.3", + "4.3.6.2", + "5.6.1", + "6.3.3" ], "pics_selection": "", "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entities And Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "054_03_03_inc Create entity already existing remotely on the Context Broker", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/054_03_03_inc", + "name": "D001_03_03_inc Create entity already existing remotely on the Context Broker", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D001_03_03_inc", "doc": "Check that if one requests the Context Broker to create an entity that matches an inclusive registration and already exists remotely, this raises an error on the Context Source, but it works just fine on the Context Broker", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_1", + "6_3_3", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entities And Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", "template": null, "http_verb": "POST", "endpoint": "entities/" @@ -34,5 +41,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/CreateEntity", - "robotfile": "054_03_03_inc" + "robotfile": "D001_03_03_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/D002_01_inc.json b/doc/files/DistributedOperations/Provision/D002_01_inc.json new file mode 100644 index 000000000..3a01d9a8c --- /dev/null +++ b/doc/files/DistributedOperations/Provision/D002_01_inc.json @@ -0,0 +1,44 @@ +{ + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_01_inc", + "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on both Context Broker and Context Source", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.6", + "config_id": "", + "parent_release": "v1.6.1", + "clauses": [ + "4.3.3", + "4.3.6.2", + "5.6.6" + ], + "pics_selection": "", + "keywords": [ + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Created Entity And Registration And Stop Context Source Mock Server" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", + "test_cases": [ + { + "name": "D002_01_inc Delete Entities On Both Context Broker and Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_01_inc", + "doc": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on both Context Broker and Context Source", + "tags": [ + "4_3_3", + "4_3_6_2", + "5_6_6", + "additive-inclusive", + "cf_06", + "dist-ops", + "since_v1.6.1" + ], + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Created Entity And Registration And Stop Context Source Mock Server", + "template": null, + "http_verb": "DELETE", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "DistributedOperations/Provision/Entities/DeleteEntity", + "robotfile": "D002_01_inc", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/055_02_01_inc.json b/doc/files/DistributedOperations/Provision/D002_02_01_inc.json similarity index 59% rename from doc/files/DistributedOperations/Provision/055_02_01_inc.json rename to doc/files/DistributedOperations/Provision/D002_02_01_inc.json index 782e6ae81..6f6c8d78e 100644 --- a/doc/files/DistributedOperations/Provision/055_02_01_inc.json +++ b/doc/files/DistributedOperations/Provision/D002_02_01_inc.json @@ -1,32 +1,39 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_02_01_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_02_01_inc", "test_objective": "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", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.6", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.6, 6.3.3", "config_id": "", "parent_release": "v1.6.1", "clauses": [ - "5.6.6" + "4.3.3", + "4.3.6.2", + "5.6.6", + "6.3.3" ], "pics_selection": "", "keywords": [ - "Setup Entity On Local And Registration", - "Delete Created Entity And Registration" + "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Broker\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "055_02_01_inc Delete Entity On The Context Broker", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_02_01_inc", + "name": "D002_02_01_inc Delete Entity On The Context Broker", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_02_01_inc", "doc": "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", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_6", + "6_3_3", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Local And Registration", - "teardown": "Delete Created Entity And Registration", + "setup": "Create Entity And Registration On The Context Broker And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", "template": null, "http_verb": "DELETE", "endpoint": "entities/{id}" @@ -34,5 +41,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/DeleteEntity", - "robotfile": "055_02_01_inc" + "robotfile": "D002_02_01_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/055_02_02_inc.json b/doc/files/DistributedOperations/Provision/D002_02_02_inc.json similarity index 50% rename from doc/files/DistributedOperations/Provision/055_02_02_inc.json rename to doc/files/DistributedOperations/Provision/D002_02_02_inc.json index bc25df406..2fae7fa1b 100644 --- a/doc/files/DistributedOperations/Provision/055_02_02_inc.json +++ b/doc/files/DistributedOperations/Provision/D002_02_02_inc.json @@ -1,32 +1,39 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_02_02_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_02_02_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.6", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.6, 6.3.3", "config_id": "", "parent_release": "v1.6.1", "clauses": [ - "5.6.6" + "4.3.3", + "4.3.6.2", + "5.6.6", + "6.3.3" ], "pics_selection": "", "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "055_02_02_inc Delete Entity On a Context Source", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/055_02_02_inc", + "name": "D002_02_02_inc Delete Entity On a Context Source", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/E/D002_02_02_inc", "doc": "Verify that, when one has an inclusive registration on a Context Broker, one is able to delete entities on a Context Source and should get a BatchOperationResult structure", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_6", + "6_3_3", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", "template": null, "http_verb": "DELETE", "endpoint": "entities/{id}" @@ -34,5 +41,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/Entities/DeleteEntity", - "robotfile": "055_02_02_inc" + "robotfile": "D002_02_02_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file diff --git a/doc/files/DistributedOperations/Provision/057_01_inc.json b/doc/files/DistributedOperations/Provision/D004_01_inc.json similarity index 52% rename from doc/files/DistributedOperations/Provision/057_01_inc.json rename to doc/files/DistributedOperations/Provision/D004_01_inc.json index e1379fe91..e65df58a2 100644 --- a/doc/files/DistributedOperations/Provision/057_01_inc.json +++ b/doc/files/DistributedOperations/Provision/D004_01_inc.json @@ -1,32 +1,37 @@ { - "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/EA/057_01_Inc", + "tp_id": "TP/NGSI-LD/DistributedOperations/Prov/EA/D004_01_inc", "test_objective": "Verify that, when one has an inclusive registration on a Context Broker with redirectionOps, one is able to update entities on a Context Source", - "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.6.2", + "reference": "ETSI GS CIM 009 V1.6.1 [], clauses 4.3.3, 4.3.6.2, 5.6.2", "config_id": "", "parent_release": "v1.6.1", "clauses": [ + "4.3.3", + "4.3.6.2", "5.6.2" ], "pics_selection": "", "keywords": [ - "Setup Entity On Remote And Registration", - "Delete Created Entity And Registration" + "Setup Registration And Start Context Source Mock Server", + "Delete Registration And Stop Context Source Mock Server" ], "teardown": "None", - "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} on the Context Source\n with an id set to ${entity_id}\n and payload set to ${entity_payload_filename}\n and the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n}", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing a Context Source Registration \n with id equal to ${registration_id}\n and payload set to ${registration_payload_file_path}\n and the SUT containing a Context Source Mock Server\n}", "test_cases": [ { - "name": "057_01_inc Query The Context Broker With Type", - "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/EA/057_01_inc", + "name": "D004_01_inc Query The Context Broker With Type", + "permutation_tp_id": "TP/NGSI-LD/DistributedOperations/Prov/EA/D004_01_inc", "doc": "Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too", "tags": [ + "4_3_3", + "4_3_6_2", "5_6_2", "additive-inclusive", + "cf_06", "dist-ops", "since_v1.6.1" ], - "setup": "Setup Entity On Remote And Registration", - "teardown": "Delete Created Entity And Registration", + "setup": "Setup Registration And Start Context Source Mock Server", + "teardown": "Delete Registration And Stop Context Source Mock Server", "template": null, "http_verb": "PATCH", "endpoint": "entities/{entityId}/attrs/{attributeId}" @@ -34,5 +39,6 @@ ], "permutations": [], "robotpath": "DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes", - "robotfile": "057_01_inc" + "robotfile": "D004_01_inc", + "error_while_autogenerating": "no error" } \ No newline at end of file -- GitLab