diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot
index 4ed72f2b9c01c6c9ad2616d715f4dd12f9380af0..f56d83447c88b78ceb6997d87ebab93bbc774238 100644
--- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot
+++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_07.robot
@@ -1,5 +1,5 @@
*** Settings ***
-Documentation If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.
+Documentation If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it shall contain the total number of matching results.
Resource ${EXECDIR}/resources/ApiUtils/Common.resource
Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
@@ -30,7 +30,7 @@ ${airQualityLevel}= airQualityLevel==6
*** Keywords ***
Query Entities With Count
- [Documentation] If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it must contain the total number of matching results.
+ [Documentation] If the count parameter is set to true the special HTTP header NGSILD-Results-Count is set in the response and it shall contain the total number of matching results.
[Arguments] ${q} ${expected_status_code} ${expected_count}
${response}= Query Entities
... entity_types=${entity_type}
diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot
index 2b746db62c403712d955b5d968eed06af5fb1b13..009a86f59f5b72015f17b402a184ce8b8e0ec18e 100644
--- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot
+++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot
@@ -8,7 +8,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 ***
@@ -38,6 +37,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 60%
rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot
rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot
index 359511209552c0b386615e1320510107d92b2446..1d2620922919bdd7e6e4a18849269267ba198191 100644
--- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot
+++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot
@@ -8,31 +8,50 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource ${EXECDIR}/resources/JsonUtils.resource
Suite Teardown Delete Created Context Source Registrations
+Test Template Create Context Source Registration
*** Variables ***
${registration_payload_file_path}= csourceRegistrations/context-source-registration-with-expiration.jsonld
-*** Test Cases ***
-033_01_01 Create Context Source Registration With Specific Date Expiration Date
- [Documentation] Check that one can create a context source registration with specific ID and expiration date
+*** Test Cases *** FILENAME HAS_MODE
+033_01_01 Create Context Source Registration Without Mode And Operation
+ [Tags] csr-create 5_9_2
+ csourceRegistrations/context-source-registration.jsonld
+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_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 ***
+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} ${has_mode}=${False}
${registration_id}= Generate Random CSR Id
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 Body Is Empty ${response}
+ 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}
- Check Created Resource Set To ${registration_payload} ${response1.json()} ${ignored_attributes}
+ IF ${has_mode} == ${False}
+ Append To List ${ignored_attributes} mode operations
+ END
+
+ 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_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot
deleted file mode 100644
index f3d822c9a691baeaf6f1de89cf61150c5f43dc26..0000000000000000000000000000000000000000
--- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot
+++ /dev/null
@@ -1,39 +0,0 @@
-*** Settings ***
-Documentation Check that one can create a context source registration that never expires
-
-Resource ${EXECDIR}/resources/ApiUtils/Common.resource
-Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
-Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
-Resource ${EXECDIR}/resources/AssertionUtils.resource
-Resource ${EXECDIR}/resources/JsonUtils.resource
-
-Suite Teardown Delete Created Context Source Registrations
-
-
-*** Variables ***
-${registration_payload_file_path}= csourceRegistrations/context-source-registration.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
- ${registration_id}= Generate Random CSR Id
- 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 Body Is Empty ${response}
- 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}
- 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_02.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot
index 03cfae80265def475e4619229ceb35a19614f1fb..72e3ce602ebaa1836f0b2918893f5c331b690700 100644
--- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot
+++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot
@@ -12,12 +12,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_01_03.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot
similarity index 87%
rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot
rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot
index 4cbc3f27c30e5063ed45e6b55216f4a072fd12af..58db60a0ca4216cbc8a3f28824cda749010d1f3d 100644
--- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot
+++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot
@@ -14,7 +14,7 @@ ${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
${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path}
@@ -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/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot
index 9a0b6e1eb22d7b00b111e33ea8079df56aac3df4..b9b50f51d0d39a95164f3ab1bd12beb78212172f 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
@@ -8,13 +8,16 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
-${entity_payload_filename} vehicle-simple-attributes.jsonld
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${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
@@ -22,18 +25,19 @@ ${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
- @{entities_id}= Create List ${entity_id}
+ ${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}
+
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()}
*** Keywords ***
-Setup Entity On Remote And Registration
+Setup Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -42,7 +46,8 @@ 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 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
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 61e6adebf36242c584237b24e9505e1ab2bcb49f..b02fa39aa777e6957efd8aebb3cb6e9875633b50 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
@@ -22,17 +23,18 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
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
[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
+SSetup Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -41,7 +43,8 @@ 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 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 66fecce4ea3175aa0fb7372c54efdc06ae0c9c06..63352591d1c15db2a6d433565b240c0473714a5c 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
@@ -8,29 +8,34 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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_payload_filename} vehicle-simple-attributes.jsonld
-${entity_payload_filename2} vehicle-simple-attributes-second.jsonld
-${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.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-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
[Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2
- @{entities_id}= Create List ${second_entity_id}
+ ${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 Vehicle Entity Id
Set Suite Variable ${first_entity_id}
${response}= Create Entity ${entity_payload_filename} ${first_entity_id}
@@ -38,8 +43,6 @@ Create Entities With Different Payloads And Registration
${second_entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -48,8 +51,9 @@ 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 005cd4881dc6d322500ec8f3732393da2d1850cd..d3c67fe2222fdc888b6f06ebd5fc31ecf34ab12d 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
@@ -8,13 +8,15 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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_payload_filename} vehicle-simple-attributes.jsonld
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${entity_payload_filename} vehicle-simple-attributes.json
${entity_payload_filename2} vehicle-simple-attributes-second.jsonld
${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld
@@ -23,17 +25,18 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
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
[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 Vehicle Entity Id
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 Vehicle Entity Id
Set Suite Variable ${second_entity_id}
@@ -47,8 +50,9 @@ 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 857d349dd8c5d3b88c59dfdaac7962d3c660fb3e..0b8a1cc25ece088c55fdb669a1c81636d7163616 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
@@ -8,13 +8,15 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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_payload_filename} vehicle-simple-attributes.jsonld
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${entity_payload_filename} vehicle-simple-attributes.json
${entity_payload_filename2} vehicle-simple-different-attributes.jsonld
${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld
@@ -22,7 +24,10 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
*** 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
- [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2
+ [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 +41,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 Vehicle Entity Id
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,8 +55,9 @@ 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_01_aux.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_aux.robot
new file mode 100644
index 0000000000000000000000000000000000000000..1940e0ed0aa8ec5e956d469f8ff631bd32caa035
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_aux.robot
@@ -0,0 +1,65 @@
+*** Settings ***
+Documentation Verify that when an auxiliary registration exists on a Context Broker and an entity with the same ID exists both locally in the Context Broker and remotely in the Context Source with different attributes, a query request to the Context Broker is correctly forwarded to the Context Source, and the response includes the local entity enriched with additional, non-conflicting attributes from the Context Source
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+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.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
+${fragment_filename} vehicle-brandname-fragment.json
+${expected_attribute} brandName
+
+
+*** Test Cases ***
+D011_01_aux Query entities that exists on both the Context Source and the Context Broker from the Context Broker
+ [Documentation] Check that if one queries the Context Broker for type, entities get merged correctly
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-auxiliary 4_3_6_2 5_7_1
+ ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id}
+ ${entity_fragment}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename}
+ Set Stub Reply GET /ngsi-ld/v1/entities?type=Vehicle 200 ${entity_body}
+ ${response}= Query Entities entity_types=Vehicle context=${ngsild_test_suite_context}
+
+ Check Response Status Code 200 ${response.status_code}
+ Check Response Body Containing an Attribute set to
+ ... ${expected_attribute}
+ ... ${response.json()[0]}
+ ... ${entity_fragment}
+ Should Have Value In Json ${response.json()[0]} $.isParked
+ Should Have Value In Json ${response.json()[0]} $.isParked2
+
+
+*** Keywords ***
+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_filename2} ${entity_id}
+ 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_id}
+ ... ${registration_payload_file_path}
+ ... mode=auxiliary
+ ${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 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/Consumption/Entity/QueryEntities/D011_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot
index 16e71d60570e72a1685034f8998f0d4bb45cdb80..24d97ab0188dde4a1d18f5b0a9edc09e3e905888 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
@@ -22,17 +23,17 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
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
[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 Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -41,7 +42,8 @@ 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 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
diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_inc.robot
new file mode 100644
index 0000000000000000000000000000000000000000..4b424bf5fc5d1fdd69d9b221e1b6c98c56f1a59f
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_03_inc.robot
@@ -0,0 +1,62 @@
+*** 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 request gets forwarded to the Context Source correctly using the appropriate operation
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type
+Test Teardown Delete Registration And Stop Context Source Mock Server
+
+
+*** Variables ***
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${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_03_01_inc Query The Context Broker By Id using the queryEntity operation
+ [Documentation] Check that if one queries the Context Broker for type, and the registration only allows the queryEntity operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2
+ [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type
+ queryEntity GET /ngsi-ld/v1/entities?type=Vehicle
+
+D011_03_02_inc Query The Context Broker By Id using the queryBatch operation
+ [Documentation] Check that if one queries the Context Broker for type, and the registration only allows the queryBatch operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2
+ [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type
+ queryBatch POST /ngsi-ld/v1/entityOperations/query
+
+*** Keywords ***
+Setup Registration, Context Source Mock Server And Query The Context Broker With Type
+ [Arguments] ${operation} ${method} ${url}
+ ${entity_id}= Generate Random Entity Id ${entity_id_prefix}
+
+ ${registration_id}= Generate Random Entity Id ${registration_id_prefix}
+ Set Suite Variable ${registration_id}
+ ${operations}= Create List ${operation}
+ ${registration_payload}= Prepare Context Source Registration From File
+ ... ${registration_id}
+ ... ${registration_payload_file_path}
+ ... operations=${operations}
+ ${response1}= Create Context Source Registration With Return ${registration_payload}
+ Check Response Status Code 201 ${response1.status_code}
+ Start Context Source Mock Server
+
+ ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id}
+ Set Stub Reply ${method} ${url} 200 ${entity_body}
+ @{entities_id}= Create List ${entity_id}
+ ${response}= Query Entities entity_ids=${entities_id} 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()}
+
+
+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/QueryEntities/D011_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_04_inc.robot
new file mode 100644
index 0000000000000000000000000000000000000000..aff7cc1a7971bb093b83ee2fb58e004f48246c1a
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_04_inc.robot
@@ -0,0 +1,65 @@
+*** 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 Via Post the request gets forwarded to the Context Source correctly using the appropriate operation
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+Test Template Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST
+Test Teardown Delete Registration And Stop Context Source Mock Server
+
+
+*** Variables ***
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${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_04_01_inc Query The Context Broker By Id Via POST using the queryBatch operation
+ [Documentation] Check that if one queries the Context Broker for type via POST, and the registration only allows the queryBatch operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 6_23_3
+ [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST
+ queryBatch POST /ngsi-ld/v1/entityOperations/query
+
+D011_04_02_inc Query The Context Broker By Id Via POST using the queryEntity operation
+ [Documentation] Check that if one queries the Context Broker for type via POST, and the registration only allows the queryEntity operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_2 6_23_3
+ [Template] Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST
+ queryEntity GET /ngsi-ld/v1/entities?type=Vehicle
+
+*** Keywords ***
+Setup Registration, Context Source Mock Server And Query The Context Broker With Type Via POST
+ [Arguments] ${operation} ${method} ${url}
+ ${entity_id}= Generate Random Entity Id ${entity_id_prefix}
+
+ ${registration_id}= Generate Random Entity Id ${registration_id_prefix}
+ Set Suite Variable ${registration_id}
+ ${operations}= Create List ${operation}
+ ${registration_payload}= Prepare Context Source Registration From File
+ ... ${registration_id}
+ ... ${registration_payload_file_path}
+ ... operations=${operations}
+ ${response1}= Create Context Source Registration With Return ${registration_payload}
+ Check Response Status Code 201 ${response1.status_code}
+ Start Context Source Mock Server
+
+ ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id}
+ Set Stub Reply ${method} ${url} 200 ${entity_body}
+ &{entities}= Create Dictionary
+ Set To Dictionary ${entities} id=${entity_id}
+ @{entities}= Create List ${entities}
+ ${response}= Query Entities Via POST entities=${entities} context=${ngsild_test_suite_context}
+
+ 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()}
+
+
+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_aux.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot
new file mode 100644
index 0000000000000000000000000000000000000000..1339a0a3494a2989526be81ebb31456bc900b9e8
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_aux.robot
@@ -0,0 +1,65 @@
+*** Settings ***
+Documentation Verify that when an auxiliary registration exists on a Context Broker and an entity with the same ID exists both locally in the Context Broker and remotely in the Context Source with different attributes, a retrieval request to the Context Broker is correctly forwarded to the Context Source, and the response includes the local entity enriched with additional, non-conflicting attributes from the Context Source
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+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.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
+${fragment_filename} vehicle-brandname-fragment.json
+${expected_attribute} brandName
+
+
+*** Test Cases ***
+D010_01_aux Retrieve entity that exists on both the Context Source and the Context Broker from the Context Broker
+ [Documentation] Check that if one retrieves entity living on on both the Context Broker and a Context Source, entities get merged correctly
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-auxiliary 4_3_6_2 5_7_1
+ ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id}
+ ${entity_fragment}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename}
+ 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}
+
+ Check Response Status Code 200 ${response.status_code}
+ Check Response Body Containing an Attribute set to
+ ... ${expected_attribute}
+ ... ${response.json()}
+ ... ${entity_fragment}
+ Should Have Value In Json ${response.json()} $.isParked
+ Should Have Value In Json ${response.json()} $.isParked2
+
+
+*** Keywords ***
+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_filename2} ${entity_id}
+ 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_id}
+ ... ${registration_payload_file_path}
+ ... mode=auxiliary
+ ${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 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/Consumption/Entity/RetrieveEntity/D010_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot
index 3e33837ee4d28adbc3ca7cc302f9b95ecd6f54f5..925dc71416bfd96a0ff63a5ab780b9911d25931d 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
@@ -8,13 +8,16 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
-${entity_payload_filename} vehicle-simple-attributes.jsonld
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${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
@@ -22,17 +25,17 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
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}
+
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
+Setup Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -41,7 +44,8 @@ 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 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/RetrieveEntity/D010_02_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot
index 240c05c55adb64981165d50efb96c4b7ae74e3a7..6832b3e593ddc236fc0e5979c3a6aa70402d746e 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
@@ -8,13 +8,15 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
-${entity_payload_filename} vehicle-simple-attributes.jsonld
+${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
@@ -23,15 +25,15 @@ D010_02_inc Retrieve entity on a Context Source from the Context Broker with loc
[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 Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -40,7 +42,8 @@ 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 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/RetrieveEntity/D010_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_inc.robot
new file mode 100644
index 0000000000000000000000000000000000000000..de7bf5494b02943ded3c8fa4a6da9c161b5fb6d3
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_03_inc.robot
@@ -0,0 +1,69 @@
+*** Settings ***
+Documentation Verify that, when one has an inclusive registration on a Context Broker and an entity only on a Context Source, a retrieval request to the Context Broker the request is forwarded correcty to the Context Source using the appropriate operation
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+Test Template Setup Registration, Context Source Mock Server And Retrieve Entity
+Test Teardown Delete Registration And Stop Context Source Mock Server
+
+
+*** Variables ***
+${entity_id_prefix} urn:ngsi-ld:Vehicle:
+${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_03_01_inc Retrieve Entity By Id using the retrieveEntity operation
+ [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the retrieveEntity operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1
+ [Template] Setup Registration, Context Source Mock Server And Retrieve Entity
+ retrieveEntity GET /ngsi-ld/v1/entities/
+
+D010_03_02_inc Retrieve Entity By Id using the queryEntity operation
+ [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the queryEntity operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1
+ [Template] Setup Registration, Context Source Mock Server And Retrieve Entity
+ queryEntity GET /ngsi-ld/v1/entities?type=Vehicle
+D010_03_03_inc Retrieve Entity By Id using the queryBatch operation
+ [Documentation] Check that if one retrieves entity living on a Context Source from a Context Broker, and the registration only allows the queryBatch operation, the request is forwarded as expected
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_7_1
+ [Template] Setup Registration, Context Source Mock Server And Retrieve Entity
+ queryBatch POST /ngsi-ld/v1/entityOperations/query
+
+*** Keywords ***
+Setup Registration, Context Source Mock Server And Retrieve Entity
+ [Arguments] ${operation} ${method} ${url}
+ ${entity_id}= Generate Random Entity Id ${entity_id_prefix}
+
+ IF '${operation}' == 'retrieveEntity'
+ ${url}= Set Variable ${url}${entity_id}
+ END
+
+ ${registration_id}= Generate Random Entity Id ${registration_id_prefix}
+ Set Suite Variable ${registration_id}
+ ${operations}= Create List ${operation}
+ ${registration_payload}= Prepare Context Source Registration From File
+ ... ${registration_id}
+ ... ${registration_payload_file_path}
+ ... operations=${operations}
+ ${response1}= Create Context Source Registration With Return ${registration_payload}
+ Check Response Status Code 201 ${response1.status_code}
+ Start Context Source Mock Server
+
+ ${entity_body}= Load Entity ${entity_payload_filename} ${entity_id}
+ Set Stub Reply ${method} ${url} 200 ${entity_body}
+ ${response}= Retrieve Entity by Id ${entity_id} context=${ngsild_test_suite_context}
+
+ Check Response Status Code 200 ${response.status_code}
+
+
+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 9c242aaf4c433ae784bf65ca9859ee5f2b2781c6..76441a296bc4b32ede8c08dc9cfa484cf39db5ef 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 And Start Context Source Mock Server
+Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server
*** Variables ***
@@ -22,19 +23,23 @@ ${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_list}= Evaluate [json.loads('''${request_payload}''')] json
@{entities_id}= Create List ${entity_id}
+ 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
+Setup Entity Id And Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
Set Suite Variable ${entity_id}
@@ -44,10 +49,12 @@ 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 Created Entity And Registration And Stop Context Source Mock Server
Delete Context Source Registration ${registration_id}
Delete Entity By Id ${entity_id}
- Delete Entity By Id ${entity_id} base_url=${remote_url}
+ 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 aa6822582d408aef24721c435da2b314d37a6d39..77f0289c755fd37b5d51dd3bf94c6e270b661cbd 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+Test Setup Setup Registration And Start Context Source Mock Server
+Test Teardown Delete Created Registration And Stop Context Source Mock Server
*** Variables ***
@@ -26,16 +27,14 @@ D001_02_inc Request to create an entity with a malformed id on both Context Brok
${response}= Create Entity ${entity_payload_filename} ${entity_id}
Check Response Status Code 400 ${response.status_code}
+ Wait For No Request
${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
+Setup Registration And Start Context Source Mock Server
${context_source_registration_id}= Generate Random CSR Id
Set Suite Variable ${context_source_registration_id}
${registration_payload}= Prepare Context Source Registration From File
@@ -43,6 +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 Created Registration And Stop Context Source Mock Server
Delete Context Source Registration ${context_source_registration_id}
+ 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 3a46a3e7a7bedfd3e582cd1f3468db327e802c31..6ebb17f36bf2fcadb9be44bce9e13bf889f20bec 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+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 ***
@@ -22,18 +23,23 @@ ${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}
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
+ Wait for redirected request
+ ${request_payload}= Get Request Body
+ ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json
@{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()}
+ 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 Vehicle Entity Id
Set Suite Variable ${entity_id}
${response}= Create Entity ${entity_payload_filename} ${entity_id}
@@ -47,8 +53,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 Created Entity And Registration And Stop Context Source Mock Server
Delete Context Source Registration ${registration_id}
Delete Entity By Id ${entity_id}
- Delete Entity By Id ${entity_id} base_url=${remote_url}
+ 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 8df22d6fa4edecb36abd65081ffcf8117cdb224f..7e15a599a91f078d08d0b865b407c073753de039 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/Common.resource
Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+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 ***
@@ -22,22 +23,20 @@ ${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}
- ${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
+Create Entity And Registration On The Context Broker And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -47,8 +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 Created Entity And Registration And Stop Context Source Mock Server
Delete Context Source Registration ${registration_id}
Delete Entity By Id ${entity_id}
- Delete Entity By Id ${entity_id} base_url=${remote_url}
+ 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 44f6b4d6fa3208ce8e05b622f2992ff54b2a27de..4b1f825a722b930615300bd6af2563348e7f7115 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+Test Setup Setup Registration And Start Context Source Mock Server
+Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server
*** Variables ***
@@ -22,9 +23,9 @@ ${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}
-
Check JSON Value In Response Body ['status'] 409 ${response.json()['errors'][0]['error']}
@{entities_id}= Create List ${entity_id}
@@ -33,11 +34,9 @@ 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 Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -47,8 +46,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 Created Entity And Registration And Stop Context Source Mock Server
Delete Context Source Registration ${registration_id}
Delete Entity By Id ${entity_id}
- Delete Entity By Id ${entity_id} base_url=${remote_url}
+ Stop Context Source Mock Server
diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot
new file mode 100644
index 0000000000000000000000000000000000000000..48c411139bcf0e62ea7468d582e8f2683aa29a16
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot
@@ -0,0 +1,51 @@
+*** Settings ***
+Documentation Verify that when an entity creation request is made to the Context Broker with the local parameter, the request is not forwarded to the Context Source, and the entity is created only on the Context Broker
+
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+Suite 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 ***
+${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
+
+*** Test Cases ***
+D001_04_inc Create Entity With Local Flag
+ [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to create an entity with local flag and the operation should not be forwarded to the Context Source
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_1 6_3_18
+ ${response}= Create Entity ${entity_payload_filename} ${entity_id} local=true
+ Check Response Status Code 201 ${response.status_code}
+
+ Wait For No Request
+
+*** Keywords ***
+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}
+
+ ${registration_id}= Generate Random Entity Id ${registration_id_prefix}
+ Set Suite Variable ${registration_id}
+ ${registration_payload}= Prepare Context Source Registration From File
+ ... ${registration_id}
+ ... ${registration_payload_file_path}
+ ... entity_id=${entity_id}
+ ${response}= Create Context Source Registration With Return ${registration_payload}
+ Check Response Status Code 201 ${response.status_code}
+
+ 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
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 afe32c1492406215b58f62cd29813fd089196e0e..a11ba945e2a2c314549a3df4f01363ab264f55ec 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+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 ***
@@ -22,21 +23,22 @@ ${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}
- ${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 ***
-Setup Entities And Registration
+Create Entity And Registration On The Context Broker And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -46,8 +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 Created Entity And Registration And Stop Context Source Mock Server
Delete Context Source Registration ${registration_id}
Delete Entity By Id ${entity_id}
- Delete Entity By Id ${entity_id} ${remote_url}
+ 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 788314e82ceb487d57add49d5c4a3a6fee714c5e..da6783b9ff6b2d2e61194ebd40d8e3ff83bfea53 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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
+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 ***
@@ -22,13 +23,17 @@ ${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}
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
+Create Entity And Registration On The Context Broker And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
Set Suite Variable ${entity_id}
${response}= Create Entity ${entity_payload_filename} ${entity_id}
@@ -42,7 +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 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 4bb8865961cf56cf5df609e48a8e47c9cc540d3c..6f9e10288cda95b0ca8b3a5a7c9270789cc40c9e 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
@@ -8,9 +8,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
@@ -22,17 +23,19 @@ ${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}
+
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
+Setup Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -42,7 +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 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
diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_03_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_03_inc.robot
new file mode 100644
index 0000000000000000000000000000000000000000..d33d88ee1b8abcdcfe98f776466b58e76b8503c7
--- /dev/null
+++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_03_inc.robot
@@ -0,0 +1,49 @@
+*** Settings ***
+
+Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource
+Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource
+Resource ${EXECDIR}/resources/AssertionUtils.resource
+Resource ${EXECDIR}/resources/JsonUtils.resource
+Resource ${EXECDIR}/resources/MockServerUtils.resource
+
+Suite Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server
+Suite 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
+${registration_id_prefix} urn:ngsi-ld:Registration:
+${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld
+
+*** Test Cases ***
+D002_03_inc Delete Entity With Local Flag
+ [Documentation] Verify that, when one has an inclusive registration on a Context Broker, one is able to delete an entity with local flag and the operation should not be forwarded to the Context Source
+ [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_6 6_3_18
+ ${response}= Delete Entity by Id ${entity_id} local=true
+ Check Response Status Code 204 ${response.status_code}
+
+ Wait For No Request
+
+*** Keywords ***
+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}
+ 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_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 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/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot
index f92d7d7c5bf521d95e5229eec1a2e9cfc4b35a80..afce0d8e303a969c5d0e1a10ea425431ee90e1fe 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
@@ -8,15 +8,16 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resourc
Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.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 ***
${entity_payload_filename} vehicle-simple-attributes.jsonld
${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 ***
@@ -24,24 +25,26 @@ 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
${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 207 ${response.status_code}
+ ${stub_count}= Get Stub Count PATCH /ngsi-ld/v1/entities/${entity_id}/attrs/
+ 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}
- Check Response Body Containing Entities URIS set to ${entities_id} ${response_query_remote.json()}
+ ${payload_list}= Evaluate [$payload]
+ Check Response Body Containing Entities URIS set to ${entities_id} ${payload_list}
*** Keywords ***
-Setup Entity On Remote And Registration
+Setup Registration And Start Context Source Mock Server
${entity_id}= Generate Random Vehicle Entity Id
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 CSR Id
Set Suite Variable ${registration_id}
@@ -51,7 +54,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 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
diff --git a/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld b/data/csourceRegistrations/context-source-registration-csourceProperty.jsonld
index a76f1967cbf3761df68ad1fa0f1eeda5ed7663aa..63bbdf4259bbee776cbba0be5b54ad8db77dd151 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 a5603e7b82571b456458a8021ee882fe343a281b..0c2cb3e02cd2ba0321aa2f857c0c0020930608c0 100644
--- a/data/csourceRegistrations/context-source-registration-location.jsonld
+++ b/data/csourceRegistrations/context-source-registration-location.jsonld
@@ -18,4 +18,5 @@
"@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 484ed252cdf95a7ea63c23127513d7db8f89edf4..0361c4954f607b54bcfd4bf6dcd5e0a4dc76aaa1 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 6078f7b0da81cea9e55af6d22d1db1a0b8c82d67..f3c7395d9acff590d04a501d15d264449a5f4ff9 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-vehicle-complete-redirect.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-complete-redirect.jsonld
deleted file mode 100644
index c4f67054b9373451f476321f108e91c4dac3d72a..0000000000000000000000000000000000000000
--- a/data/csourceRegistrations/context-source-registration-vehicle-complete-redirect.jsonld
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID",
- "type": "ContextSourceRegistration",
- "information": [
- {
- "entities": [
- {
- "type": "Vehicle"
- }
- ],
- "propertyNames": [
- "brandName"
- ],
- "relationshipNames": [
- "isParked"
- ]
- }
- ],
- "endpoint": "http://my.csource.org:1026",
- "mode": "redirect",
- "@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-vehicle-complete.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-complete.jsonld
index 2c2d5b08431ac29817819b247aab10233a6564df..e608440d403895dfb2174a5c069e1553490fd1d2 100644
--- a/data/csourceRegistrations/context-source-registration-vehicle-complete.jsonld
+++ b/data/csourceRegistrations/context-source-registration-vehicle-complete.jsonld
@@ -7,12 +7,6 @@
{
"type": "Vehicle"
}
- ],
- "propertyNames": [
- "brandName"
- ],
- "relationshipNames": [
- "isParked"
]
}
],
diff --git a/data/csourceRegistrations/context-source-registration-with-expiration.jsonld b/data/csourceRegistrations/context-source-registration-with-expiration.jsonld
index 0dbf966b7a07721827dbf9b131d4b14ba7026dcd..30c64748eb064584efc850b2302c2536e75f653b 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 0000000000000000000000000000000000000000..27f2ab1691a9e4f4414cb6f542adcb5eb86eb6f5
--- /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://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 d24b35fd80a0409e072d6a9d02014d77bfe2b0f3..49ab16e120dd176cfb1ec0fc7c9056e7afda236a 100644
--- a/data/csourceRegistrations/context-source-registration.jsonld
+++ b/data/csourceRegistrations/context-source-registration.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",
"@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 c557935b32c73e5c7250b206b7aed5056684cedd..03e4a0d1ae5f15f9526c6b5b2c9aaf7f6583d1d0 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 a534ebc79efd2b876087d1a57917b21c67e5078d..fdc4541e1a0a46af6917217aeb8b0133d8126c7d 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
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 0000000000000000000000000000000000000000..2abdf96e98089de4cfaec8adab1b20031ad32891
--- /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 0000000000000000000000000000000000000000..abe88009a36adc5686483a6642c251d852b6553b
--- /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 9825fa9f6349b735ac5c030747501c03858c7185..729e5f34e9490029084b13e66dd3c7b3a7cb0b20 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
diff --git a/doc/analysis/initial_setup.py b/doc/analysis/initial_setup.py
index 90519e90e00c3236dc234ac833dd3d473abcaec5..019d1a0a76714aed5e4f5df4bef9da26b16f966b 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()
diff --git a/doc/analysis/parseapiutilsfile.py b/doc/analysis/parseapiutilsfile.py
index de7ca389705b43840cd18ee7796a48ebe1880047..ca60c53b955c116061091a34e05f79f04c8a35e3 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/doc/files/ContextSource/Registration/033_01.json b/doc/files/ContextSource/Registration/033_01.json
new file mode 100644
index 0000000000000000000000000000000000000000..fb9cfdc99bdaf84137de10282af40c0aa52d3668
--- /dev/null
+++ b/doc/files/ContextSource/Registration/033_01.json
@@ -0,0 +1,87 @@
+{
+ "tp_id": "TP/NGSI-LD/CS/CSR/033_01",
+ "test_objective": "Check that one can create a context source registration with specific ID and expiration date",
+ "reference": "ETSI GS CIM 009 V1.6.1 [], clause 5.9.2",
+ "config_id": "",
+ "parent_release": "v1.6.1",
+ "clauses": [
+ "5.9.2"
+ ],
+ "pics_selection": "",
+ "keywords": [
+ "Create Context Source Registration",
+ "Delete Created Context Source Registrations"
+ ],
+ "teardown": "Delete Created Context Source Registrations",
+ "initial_condition": "with {\n the SUT containing an initial state\n}",
+ "test_cases": [
+ {
+ "name": "033_01_01 Create Context Source Registration Without Mode And Operation",
+ "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_01",
+ "doc": "Check that one can create a context source registration with specific ID and expiration date",
+ "tags": [
+ "5_9_2",
+ "csr-create"
+ ],
+ "setup": null,
+ "teardown": null,
+ "template": "Create Context Source Registration",
+ "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 201 and\n Delete Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
+ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Create Context Source Registration with payload set to '${registration_payload}'\n}",
+ "http_verb": "DELETE",
+ "endpoint": "csourceRegistrations/{registration_id}"
+ },
+ {
+ "name": "033_01_02 Create Context Source Registration With Non Default Mode And Operations",
+ "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_02",
+ "doc": "Check that one can create a context source registration with specific ID and expiration date",
+ "tags": [
+ "5_9_2",
+ "csr-create",
+ "since_v1.6.1"
+ ],
+ "setup": null,
+ "teardown": null,
+ "template": "Create Context Source Registration",
+ "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 201 and\n Delete Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
+ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Create Context Source Registration with payload set to '${registration_payload}'\n}",
+ "http_verb": "DELETE",
+ "endpoint": "csourceRegistrations/{registration_id}"
+ },
+ {
+ "name": "033_01_03 Create Context Source Registration With Location",
+ "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_03",
+ "doc": "Check that one can create a context source registration with specific ID and expiration date",
+ "tags": [
+ "5_9_2",
+ "csr-create"
+ ],
+ "setup": null,
+ "teardown": null,
+ "template": "Create Context Source Registration",
+ "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 201 and\n Delete Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
+ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Create Context Source Registration with payload set to '${registration_payload}'\n}",
+ "http_verb": "DELETE",
+ "endpoint": "csourceRegistrations/{registration_id}"
+ },
+ {
+ "name": "033_01_04 Create Context Source Registration With Specific Date Expiration Date",
+ "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_04",
+ "doc": "Check that one can create a context source registration with specific ID and expiration date",
+ "tags": [
+ "5_9_2",
+ "csr-create"
+ ],
+ "setup": null,
+ "teardown": null,
+ "template": "Create Context Source Registration",
+ "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Context Source Registration With Return with Response Status Code set to 201 and\n Delete Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
+ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations/{registration_id}'\n method set to 'DELETE'\n Create Context Source Registration with payload set to '${registration_payload}'\n}",
+ "http_verb": "DELETE",
+ "endpoint": "csourceRegistrations/{registration_id}"
+ }
+ ],
+ "permutations": [],
+ "robotpath": "ContextSource/Registration/RegisterContextSource",
+ "robotfile": "033_01"
+}
\ No newline at end of file
diff --git a/doc/files/ContextSource/Registration/033_01_01.json b/doc/files/ContextSource/Registration/033_01_01.json
deleted file mode 100644
index 053574567f3309a73a00e408bf67bb3c96095220..0000000000000000000000000000000000000000
--- a/doc/files/ContextSource/Registration/033_01_01.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "tp_id": "TP/NGSI-LD/CS/CSR/033_01_01",
- "test_objective": "Check that you can create a context source registration with specific ID and expiration date",
- "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2",
- "config_id": "",
- "parent_release": "v1.3.1",
- "clauses": [
- "5.9.2"
- ],
- "pics_selection": "",
- "keywords": [
- "Delete Created Context Source Registrations"
- ],
- "teardown": "Delete Created Context Source Registrations",
- "initial_condition": "with {\n the SUT containing an initial state\n}",
- "test_cases": [
- {
- "name": "033_01_01 Create Context Source Registration With Specific Date Expiration Date",
- "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_01",
- "doc": "Check that you can create a context source registration with specific ID and expiration date",
- "tags": [
- "5_9_2",
- "csr-create"
- ],
- "setup": null,
- "teardown": null,
- "template": null,
- "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
- "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${registration_payload}'\n}",
- "http_verb": "POST",
- "endpoint": "csourceRegistrations"
- }
- ],
- "permutations": [],
- "robotpath": "ContextSource/Registration/RegisterContextSource",
- "robotfile": "033_01_01"
-}
\ No newline at end of file
diff --git a/doc/files/ContextSource/Registration/033_01_02.json b/doc/files/ContextSource/Registration/033_01_02.json
deleted file mode 100644
index e00e099399e47a53b0837bd527d6053b841c3286..0000000000000000000000000000000000000000
--- a/doc/files/ContextSource/Registration/033_01_02.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "tp_id": "TP/NGSI-LD/CS/CSR/033_01_02",
- "test_objective": "Check that you can create a context source registration that never expires",
- "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2",
- "config_id": "",
- "parent_release": "v1.3.1",
- "clauses": [
- "5.9.2"
- ],
- "pics_selection": "",
- "keywords": [
- "Delete Created Context Source Registrations"
- ],
- "teardown": "Delete Created Context Source Registrations",
- "initial_condition": "with {\n the SUT containing an initial state\n}",
- "test_cases": [
- {
- "name": "033_01_02 Create Context Source Registration That Never Expires",
- "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_02",
- "doc": "Check that you can create a context source registration that never expires",
- "tags": [
- "5_9_2",
- "csr-create"
- ],
- "setup": null,
- "teardown": null,
- "template": null,
- "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Create Context Source Registration With Return with Response Header: Location containing $${registration_id} and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
- "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${registration_payload}'\n}",
- "http_verb": "POST",
- "endpoint": "csourceRegistrations"
- }
- ],
- "permutations": [],
- "robotpath": "ContextSource/Registration/RegisterContextSource",
- "robotfile": "033_01_02"
-}
\ No newline at end of file
diff --git a/doc/files/ContextSource/Registration/033_01_03.json b/doc/files/ContextSource/Registration/033_01_03.json
deleted file mode 100644
index ea4a3ea25cd9106e560b79414481bf1c23c12493..0000000000000000000000000000000000000000
--- a/doc/files/ContextSource/Registration/033_01_03.json
+++ /dev/null
@@ -1,37 +0,0 @@
-{
- "tp_id": "TP/NGSI-LD/CS/CSR/033_01_03",
- "test_objective": "Check that you can create a context source registration without specifying an ID",
- "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.9.2",
- "config_id": "",
- "parent_release": "v1.3.1",
- "clauses": [
- "5.9.2"
- ],
- "pics_selection": "",
- "keywords": [
- "Delete Created Context Source Registrations"
- ],
- "teardown": "Delete Created Context Source Registrations",
- "initial_condition": "with {\n the SUT containing an initial state\n}",
- "test_cases": [
- {
- "name": "033_01_03 Create Context Source Registration Without Specifying an ID",
- "permutation_tp_id": "TP/NGSI-LD/CS/CSR/033_01_03",
- "doc": "Check that you can create a context source registration without specifying an ID",
- "tags": [
- "5_9_2",
- "csr-create"
- ],
- "setup": null,
- "teardown": null,
- "template": null,
- "then": "then {\n the SUT sends a valid Response for the operations:\n Create Context Source Registration With Return with Response Status Code set to 201 and\n Retrieve Context Source Registration with Check Created Resource Set To and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}",
- "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/csourceRegistrations'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: '${payload}'\n}",
- "http_verb": "POST",
- "endpoint": "csourceRegistrations"
- }
- ],
- "permutations": [],
- "robotpath": "ContextSource/Registration/RegisterContextSource",
- "robotfile": "033_01_03"
-}
\ No newline at end of file
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 6d396151dffc772f6717d6c1de5ad65e1007b405..0000000000000000000000000000000000000000
--- 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 fb33d887a731dda63488ed4c5e32bbf0804fbf6c..0000000000000000000000000000000000000000
--- 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 3b7f825e46031c8355e751f99b1e03517aa10ed4..0000000000000000000000000000000000000000
--- 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 0000000000000000000000000000000000000000..c138ca79d48a448f81620fa1f7fb2daf95dd971c
--- /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 0000000000000000000000000000000000000000..f0f9d6f0718d75a3e84a7858bcdb1c2155f40bb1
--- /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 66d938f9036f2d61276d2fe3593e108e12e41370..8c8de7c8dbc2499ccf21e4804c115ac85022e6b0 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 61972f9818dc73acfe41c06a65ac85ab7203b55e..c018505ff78c80eb8ff5ad9f89938a8fb956f4be 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 d6c74749584f47fa9c8f92d740075c2cf6d1f7db..e8b207d5e6bc1276007a682283760e1686ecec9b 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 5603e16f6274278f2f9377bcc4a42abc3105af7d..c11bf4c8ff6e582fddb800b923d69949f0fb0b1b 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 58611d3faf79dd92329448be9ff5b69656ef229d..1d86e0096bbd74df55b0e9d8f82b60f844f88fcd 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 0000000000000000000000000000000000000000..b383518cb8e777b66687ac195a568a9779af8aab
--- /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 e6bc1a5db442bb6c7870f4a29708f16375e9d883..0000000000000000000000000000000000000000
--- 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 8384ab7bd4bd0e224ba40f32f0b35dbd1c13f4c7..0000000000000000000000000000000000000000
--- 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 7b1d732a67386359de84d5d14ef1e1ddda5147f5..3e833394098d959a2088f8174d0fdb5b92a61c3e 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 1d88164b03216fb4e14e78b7bfec4b677082a3c2..01d327da6c756169167d91c0ca08db4227266365 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 deb256379f6f58a226342d294b70c1ccba7d7f71..f9b8d359615fea0a775990e7e24710ea03a20252 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 0000000000000000000000000000000000000000..2a8e0cb96ae21e8ec299fc6db43b5700c300eaa3
--- /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 6ed309934e27380ad68a36aa201d69e9260be6ca..b13f0b892cf550b21db2622d933d900ce22b631c 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 0000000000000000000000000000000000000000..3a01d9a8c0881e14b78001a2ce8fa59e66270e7f
--- /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 782e6ae8132383e6d2da64bda911019edde3802a..6f6c8d78e4ab0b9410383c38674a6e557624eab6 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 bc25df406ba677a42e27a2b3a131b23daf55b612..2fae7fa1bea0b5745eb39fa72f5d161c18d5c7ad 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 e1379fe91e26c59c1ff0b9f000c83114aaa7fd58..e65df58a28afa6d38e841cc3dfb924f3717647a3 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
diff --git a/doc/generateDocumentationData.py b/doc/generateDocumentationData.py
index b4451d382c67ff8b98f888dad051071ed9cf0146..f82decb692a772697af512b0d95dfb868d275d72 100644
--- a/doc/generateDocumentationData.py
+++ b/doc/generateDocumentationData.py
@@ -5,16 +5,19 @@ from os.path import dirname, exists
from os import makedirs, walk
-def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics: bool=False):
+def create_json_of_robotfile(
+ robot_file_to_be_processed: str, computestatistics: bool = False
+):
# TODO: ApiUtils.resource -> 'Delete Context Source Registration Subscription' added 'url=' as parameter
- folder_test_suites = dirname(dirname(__file__)).replace('\\', "/")
- folder_result_path = f'{folder_test_suites}/doc/results'
- result_file = f'{folder_result_path}/{robot_file_to_be_processed}.json'
- robot_path_to_be_processed, robot_file = find_robot_file(basedir=folder_test_suites,
- filename=robot_file_to_be_processed)
+ folder_test_suites = dirname(dirname(__file__)).replace("\\", "/")
+ folder_result_path = f"{folder_test_suites}/doc/results"
+ result_file = f"{folder_result_path}/{robot_file_to_be_processed}.json"
+ robot_path_to_be_processed, robot_file = find_robot_file(
+ basedir=folder_test_suites, filename=robot_file_to_be_processed
+ )
if robot_path_to_be_processed is None and robot_file is None:
- print(f'No robot file found with name: {robot_file_to_be_processed}')
+ print(f"No robot file found with name: {robot_file_to_be_processed}")
exit(1)
# Check that the folder '/results' exists and if not, create it
@@ -33,7 +36,7 @@ def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics:
info["error_while_parsing"] = True
info["error_while_autogenerating"] = str(e)
info["robotfile"] = robot_file_to_be_processed
- if(robot_path_to_be_processed.startswith("/")):
+ if robot_path_to_be_processed.startswith("/"):
robot_path_to_be_processed = robot_path_to_be_processed[1:]
info["robotpath"] = robot_path_to_be_processed
else:
@@ -41,17 +44,17 @@ def create_json_of_robotfile(robot_file_to_be_processed: str, computestatistics:
data.parse_robot()
info = data.get_info()
- with open(result_file, 'w') as fp:
+ with open(result_file, "w") as fp:
dump(obj=info, indent=2, fp=fp)
return info
def find_robot_file(basedir: str, filename: str):
- filename = f'{filename}.robot'
+ filename = f"{filename}.robot"
for root, dirs, files in walk(basedir):
if filename in files:
- return root.replace(f'{basedir}/TP/NGSI-LD', ''), f'{root}/{filename}'
+ return root.replace(f"{basedir}/TP/NGSI-LD", ""), f"{root}/{filename}"
return None, None
@@ -59,7 +62,18 @@ def find_robot_file(basedir: str, filename: str):
if __name__ == "__main__":
# Call with the folder below /TP/NGSI-LD which contains the robot file with name args[0]
args = argv[1:]
- robot_file_tbp = args[0]
- resulting_json = create_json_of_robotfile(robot_file_tbp)
+ if len(args) == 0:
+ tp_root_name = dirname(dirname(__file__)).replace("\\", "/")
+ robot_file_tbp = f"{tp_root_name}/TP/NGSI-LD/"
+ robot_file_tbp = robot_file_tbp.replace("\\", "/")
+ for root, dirs, files in walk(robot_file_tbp):
+ for file in files:
+ if file.endswith(".robot"):
+ filename = file.replace(".robot", "")
+ print(f"Generating json for {filename}")
+ create_json_of_robotfile(filename, computestatistics=True)
+ else:
+ robot_file_tbp = args[0]
+ resulting_json = create_json_of_robotfile(robot_file_tbp)
print("\nCorrectly exiting")
diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py
index 65e09e8d903f33b0c6fb15fba7b85896371b0671..1e680c45d2dcce6de5202f869f7645f8308df070 100644
--- a/doc/statisticsDocumentationData.py
+++ b/doc/statisticsDocumentationData.py
@@ -13,25 +13,39 @@ if __name__ == "__main__":
number_of_all_testcases = 0
number_of_successes = 0
ROBOT_FILE_EXTENSION = ".robot"
- BASE_URL_OF_FORGE = "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/blob/master/TP/NGSI-LD/"
+ BASE_URL_OF_FORGE = (
+ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/blob/master/TP/NGSI-LD/"
+ )
fullpath = basedir + "/TP/NGSI-LD"
+ excluded_dirs = [""]
for root, dirs, files in walk(fullpath):
+ if root == fullpath:
+ dirs[:] = [d for d in dirs if d not in excluded_dirs]
for filename in files:
if filename.endswith(ROBOT_FILE_EXTENSION):
number_of_all_testcases += 1
- name_of_test_case = filename[:-len(ROBOT_FILE_EXTENSION)]
+ name_of_test_case = filename[: -len(ROBOT_FILE_EXTENSION)]
json_of_test_case = create_json_of_robotfile(name_of_test_case, True)
statistics[name_of_test_case] = dict()
- strippedpath = root[len(fullpath)+1:]
+ strippedpath = root[len(fullpath) + 1 :]
statistics[name_of_test_case]["path"] = strippedpath
- if "error_while_parsing" in json_of_test_case and json_of_test_case["error_while_parsing"]:
+ if (
+ "error_while_parsing" in json_of_test_case
+ and json_of_test_case["error_while_parsing"]
+ ):
statistics[name_of_test_case]["failed"] = True
number_of_failures += 1
# we create a dummy entry in the "sub" test_cases, which has a "permutation_tp_id" equal to the
# robotfile. We do not forget to add a trailing slash that will be removed later, and a tail _XX
# which will allow matching from the googlesheet?
- json_of_test_case["test_cases"] = [{"permutation_tp_id": "/"+json_of_test_case["robotfile"]+"_XX"}]
+ json_of_test_case["test_cases"] = [
+ {
+ "permutation_tp_id": "/"
+ + json_of_test_case["robotfile"]
+ + "_XX"
+ }
+ ]
else:
statistics[name_of_test_case]["failed"] = False
number_of_successes += 1
@@ -40,12 +54,17 @@ if __name__ == "__main__":
# establish the right configuration
if json_of_test_case["robotpath"].startswith("ContextSource"):
json_of_test_case["config_id"] = "CF_05"
+ elif "cf_06" in json_of_test_case["test_cases"][0]["tags"]:
+ json_of_test_case["config_id"] = "CF_06"
else:
json_of_test_case["config_id"] = "CF_01"
# upgrade the version and add the reference in square brackets
- json_of_test_case["reference"] = (
- re.sub(r"V1.3.1 \[\]", "version 1.5.1 [1]", json_of_test_case["reference"]))
+ json_of_test_case["reference"] = re.sub(
+ r"V1\.[3-6]\.1 \[\]",
+ "V1.6.1 [1]",
+ json_of_test_case["reference"],
+ )
# now for each permutation inside this test case, create the permutation's correct parent_release
if "test_cases" in json_of_test_case:
@@ -54,30 +73,36 @@ if __name__ == "__main__":
# default parent release
parent_release = "v1.3.1"
for tag in permutation_body["tags"]:
- if tag.startswith('since_'):
- parts = tag.split('_')
+ if tag.startswith("since_"):
+ parts = tag.split("_")
# the suffix
parent_release = parts[-1]
- permutation_body["permutation_parent_release"] = parent_release
+ permutation_body["permutation_parent_release"] = (
+ parent_release
+ )
else:
- print("NO PERMUTATIONS in TESTCASE??? " + json_of_test_case["tp_id"])
+ print(
+ "NO PERMUTATIONS in TESTCASE??? "
+ + json_of_test_case["tp_id"]
+ )
exit(1)
testcases.append(json_of_test_case)
-
print()
print()
print()
print("THE FOLLOWING TESTCASES FAILED PARSING:")
for testcasename, testcaseresult in statistics.items():
if testcaseresult["failed"]:
- print(testcasename+" "+testcaseresult["path"])
-
- print(f"Out of {number_of_all_testcases} testcases, {number_of_failures} of them failed to be correctly parsed.")
+ print(testcasename + " " + testcaseresult["path"])
+
+ print(
+ f"Out of {number_of_all_testcases} testcases, {number_of_failures} of them failed to be correctly parsed."
+ )
testcases_file = join(basedir, "doc", "results", "testcases.json")
- with open(testcases_file, 'w') as fp:
+ with open(testcases_file, "w") as fp:
json.dump(obj=testcases, indent=2, fp=fp)
-
+
# determine the structure/schema of a successfully parsed testcase
permutation_template = {}
for testcase in testcases:
@@ -103,9 +128,13 @@ if __name__ == "__main__":
# everything that is a permutation_body inside the "sub" test_cases,
# shall rise on its own existenz and be joined with its permutation_metadata
for permutation_body in testcase["test_cases"]:
- permutation_body_template = {} # new object, not changing permutation_body
+ permutation_body_template = (
+ {}
+ ) # new object, not changing permutation_body
if "permutation_tp_id" in permutation_body:
- permutation_body_template["stripped_permutation_tp_id"] = "UNKNOWN"
+ permutation_body_template["stripped_permutation_tp_id"] = (
+ "UNKNOWN"
+ )
permutation_body_template["robotlink"] = "UNKNOWN"
for key, value in permutation_body.items():
if type(key) is str:
@@ -122,7 +151,10 @@ if __name__ == "__main__":
print("UNKNOWN BODY type")
exit(1)
# we use the unpacking python operator ** that strips the container dict from both
- permutation_template = {**permutation_metadata_template, **permutation_body_template}
+ permutation_template = {
+ **permutation_metadata_template,
+ **permutation_body_template,
+ }
else:
print("NO PERMUTATION TP ID")
exit(1)
@@ -131,7 +163,7 @@ if __name__ == "__main__":
exit(1)
if permutation_template != {}:
break
-
+
print()
print("Typical template:")
print(permutation_template)
@@ -148,8 +180,13 @@ if __name__ == "__main__":
permutation_metadata[key] = value
# start creating HTML link to robot file in repo
- fullurl = (BASE_URL_OF_FORGE + permutation_metadata["robotpath"] +
- "/" + permutation_metadata["robotfile"] + ROBOT_FILE_EXTENSION)
+ fullurl = (
+ BASE_URL_OF_FORGE
+ + permutation_metadata["robotpath"]
+ + "/"
+ + permutation_metadata["robotfile"]
+ + ROBOT_FILE_EXTENSION
+ )
if "test_cases" in testcase:
# everything that is a permutation_body inside the "sub" test_cases,
@@ -164,11 +201,18 @@ if __name__ == "__main__":
# print("::: "+ptpid)
# strip from beginning up to including the last "/"
- permutation_body["stripped_permutation_tp_id"] = ptpid[ptpid.rindex("/")+1:]
+ permutation_body["stripped_permutation_tp_id"] = ptpid[
+ ptpid.rindex("/") + 1 :
+ ]
# use the stripped_permutation_tp_id as text of the link
permutation_body["robotlink"] = (
- "" + permutation_body["stripped_permutation_tp_id"] + "")
+ ''
+ + permutation_body["stripped_permutation_tp_id"]
+ + ""
+ )
# So basically we append to the permutations a new dict that is the | union merge of the
# items of the template merged with the items of the concatenation of {**permutation_metadata,
@@ -195,5 +239,5 @@ if __name__ == "__main__":
exit(1)
permutations_file = join(basedir, "doc", "results", "permutations.json")
- with open(permutations_file, 'w') as fp:
+ with open(permutations_file, "w") as fp:
json.dump(obj=permutations, indent=2, fp=fp)
diff --git a/doc/tests/test_ContextSource_Registration.py b/doc/tests/test_ContextSource_Registration.py
index 3a9ddef3e9c5800c2c3f3c12ee4fe23f6dd637e3..4c8b7f91df252153750e1667e5df36c8c5810fdb 100644
--- a/doc/tests/test_ContextSource_Registration.py
+++ b/doc/tests/test_ContextSource_Registration.py
@@ -42,24 +42,10 @@ class TestCSRegistration(TestCase):
assert False, f'They are some difference between the expected and obtained dictionaries: \n {result}'
- def test_033_01_01(self):
- robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot'
- expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_01.json'
- difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_01.json'
-
- self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file)
-
- def test_033_01_02(self):
- robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot'
- expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_02.json'
- difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_02.json'
-
- self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file)
-
- def test_033_01_03(self):
- robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot'
- expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01_03.json'
- difference_file = f'{self.folder_test_suites}/doc/results/out_033_01_03.json'
+ def test_033_01(self):
+ robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot'
+ expected_value = f'{self.folder_test_suites}/doc/files/ContextSource/Registration/033_01.json'
+ difference_file = f'{self.folder_test_suites}/doc/results/out_033_01.json'
self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file)
diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource
index 4dce6bb76ef2d864ee523e8ed8177b77f3a34eaa..c42714eb5f754e89eaa89e7a85ff3b5149c88625 100755
--- a/resources/ApiUtils/ContextInformationConsumption.resource
+++ b/resources/ApiUtils/ContextInformationConsumption.resource
@@ -27,7 +27,6 @@ ${response} ${EMPTY}
*** Keywords ***
Query Entities
[Arguments]
- ... ${base_url}=${url}
... ${entity_ids}=${EMPTY}
... ${entity_types}=${EMPTY}
... ${accept}=${EMPTY}
@@ -89,7 +88,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
diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource
index 4d797536555c149d8abcd1099190cb1779bfc001..18b26358b364f4b2059d8db0495171894c176264 100755
--- a/resources/ApiUtils/ContextInformationProvision.resource
+++ b/resources/ApiUtils/ContextInformationProvision.resource
@@ -151,13 +151,16 @@ Batch Upsert Entities
RETURN ${response}
Create Entity
- [Arguments] ${filename} ${entity_id} ${base_url}=${url}
+ [Arguments] ${filename} ${entity_id} ${local}=${EMPTY}
+ &{params}= Create Dictionary
+ IF '${local}'!='' Set To Dictionary ${params} local=${local}
${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}
+ ... params=${params}
... headers=${headers}
... expected_status=any
Output ${response} Create Entity
@@ -240,9 +243,12 @@ Delete Entity Attributes
RETURN ${response}
Delete Entity by Id
- [Arguments] ${id} ${base_url}=${url}
+ [Arguments] ${id} ${local}=${EMPTY}
+ &{params}= Create Dictionary
+ IF '${local}'!='' Set To Dictionary ${params} local=${local}
${response}= DELETE
- ... url=${base_url}/${ENTITIES_ENDPOINT_PATH}${id}
+ ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}
+ ... params=${params}
... expected_status=any
IF ${delete_temporal_on_core_delete}
Delete Temporal Representation Of Entity ${id}
diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource
index 827ceb17fd92cf032f270f8a62dd369790ffaa4e..d6d4135bc8a4a264eea6de396eb9cc95fbd8bdc8 100755
--- a/resources/ApiUtils/ContextSourceRegistration.resource
+++ b/resources/ApiUtils/ContextSourceRegistration.resource
@@ -18,11 +18,12 @@ ${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}
+ [Arguments] ${id} ${registration_file} ${entity_id}=${EMPTY} ${mode}=${EMPTY} ${endpoint}=${EMPTY} ${operations}=[]
${payload}= Load JSON From File ${EXECDIR}/data/${registration_file}
${registration_payload}= Update Value To JSON
@@ -32,7 +33,7 @@ Prepare Context Source Registration From File
${registration_payload}= Update Value To JSON
... ${registration_payload}
... $..endpoint
- ... ${context_source_endpoint}
+ ... ${context_source_url}${endpoint}
IF '${entity_id}' != ''
${dict}= Create Dictionary id=${entity_id}
${registration_payload}= Add Object To JSON
@@ -47,6 +48,13 @@ Prepare Context Source Registration From File
... $
... ${dict}
END
+ IF ${operations}
+ ${dict}= Create Dictionary operations=${operations}
+ ${registration_payload}= Add Object To JSON
+ ... ${registration_payload}
+ ... $
+ ... ${dict}
+ END
RETURN ${registration_payload}
Create Context Source Registration
diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource
index ca5ca922fefd2af5e91b853f0f1a73e3acc321a0..008b0ac1c804a6c7ef20ed9974bd296a0f628c86 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 ***
@@ -113,7 +114,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
@@ -302,14 +303,14 @@ 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}
+
+ ${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()}
diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource
index 82ef9dc0b068a77e89e8b9f8cd8569753d2de7de..558f5946e80564caf35273d5b4f9b370b7051969 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
diff --git a/resources/variables.py b/resources/variables.py
index f570a71ec7cee3249c9202fb8562f9bbb79e29f4..738576829c56e4474640e53baeb048891c6923ca 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'