diff --git a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot index 08bdca8a75727a95b8d6908b72ad471efcb2be06..d8db41e78c148efdc2056d4b160c4161d5eb5395 100644 --- a/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/DeleteContextSourceRegistration/035_01.robot @@ -7,7 +7,6 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Test Setup Setup Initial Context Source Registrations -Test Teardown Delete Created Context Source Registrations *** Variables *** @@ -37,6 +36,3 @@ Setup Initial Context Source Registrations ${create_response}= Create Context Source Registration With Return ${updated_payload} Check Response Status Code 201 ${create_response.status_code} Set Test Variable ${registration_id} - -Delete Created Context Source Registrations - Delete Context Source Registration ${registration_id} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot similarity index 61% rename from TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot rename to TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot index ac196405b723df21776f3cccd23474387c00246c..75e200bec1ff38336139882d36d1e193c2c4be25 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_01.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01.robot @@ -7,6 +7,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Suite Teardown Delete Created Context Source Registrations +Test Template Create Context Source Registration *** Variables *** @@ -14,24 +15,43 @@ ${registration_id_prefix}= urn:ngsi-ld:Registration: ${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 Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} + ${registration_payload}= Update Value To JSON ${payload} $.id ${registration_id} ${response}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${registration_id} ${response.headers} ${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 236dc7e6fa468d120524a2a222444af7ef9e9235..0000000000000000000000000000000000000000 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_02.robot +++ /dev/null @@ -1,38 +0,0 @@ -*** Settings *** -Documentation Check that one can create a context source registration that never expires - -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource -Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource -Resource ${EXECDIR}/resources/AssertionUtils.resource -Resource ${EXECDIR}/resources/JsonUtils.resource - -Suite Teardown Delete Created Context Source Registrations - - -*** Variables *** -${registration_id_prefix}= urn:ngsi-ld:Registration: -${registration_payload_file_path}= csourceRegistrations/context-source-registration.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 Entity Id ${registration_id_prefix} - Set Suite Variable ${registration_id} - ${payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} - ${registration_payload}= Update Value To JSON ${payload} $..id ${registration_id} - ${response}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response.status_code} - Check Response Headers Containing URI set to ${registration_id} ${response.headers} - ${response1}= Retrieve Context Source Registration - ... context_source_registration_id=${registration_id} - ... context=${ngsild_test_suite_context} - ... accept=${CONTENT_TYPE_LD_JSON} - ${ignored_attributes}= Create List ${status_regex_expr} - 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 b68aee121b7218a3edacc68a84d0bd87037d5b23..bd0005ec182fa062f97ec3f5651bcc2ec2dcb7d7 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_02.robot @@ -13,12 +13,12 @@ ${registration_payload_file_path}= csourceRegistrations/context-source-regi *** Test Cases *** -033_02_01 Create a context source registration with invalid JSON file - [Documentation] Create a context source registration with invalid JSON file +033_02_01 Create a context source registration with invalid content + [Documentation] Check that one cannot create a context source with invalid content [Tags] csr-create 5_9_2 - ${subscription_payload}= Get File ${EXECDIR}/data/${registration_payload_file_path} + ${csr_payload}= Load JSON From File ${EXECDIR}/data/${registration_payload_file_path} ${response}= Create Context Source Registration - ... ${subscription_payload} + ... ${csr_payload} Check Response Status Code 400 ${response.status_code} Check Response Body Type When Using Session Request ${response.json()} ${ERROR_TYPE_BAD_REQUEST_DATA} Check Response Body Title When Using Session Request ${response.json()} diff --git a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_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 55d7e7938949e53cc33d2a0f4277af045f4d2608..43f81eac06ff16ed3b5261de4054ec0337ec955a 100644 --- a/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_01_03.robot +++ b/TP/NGSI-LD/ContextSource/Registration/RegisterContextSource/033_11.robot @@ -15,7 +15,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 c3ac9e555e71c67e26fdd991203474a464c25dcf..fe302ca3c9b1da30acc23571e25c0cdcf2494cb4 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_01_inc.robot @@ -7,14 +7,15 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld @@ -23,18 +24,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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -43,7 +45,9 @@ 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 89c5c9d2669254b015ae266104dd52152c97e04c..699a6f1f5ad527e17d705840d4afb2e4cab01de2 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_02_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -23,17 +24,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 +Setup Registration And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -42,7 +44,10 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server + + -Delete Created Entity And Registration - Delete Entity By Id ${entity_id} base_url=${remote_url} - Delete Context Source Registration ${registration_id} +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 b412909369df75e6e7c0058f2b893583e7dc184d..c2d07a34e27d5775ee5823d7a008843a5f354821 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_03_inc.robot @@ -7,31 +7,35 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration - +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${entity_payload_filename} vehicle-simple-attributes.jsonld -${entity_payload_filename2} vehicle-simple-attributes-second.jsonld +${entity_payload_filename2} vehicle-simple-attributes-second.json ${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-entities.jsonld + *** Test Cases *** D011_01_03_inc Query The Context Broker With Type and Attribute [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 Entity Id ${entity_id_prefix} Set Suite Variable ${first_entity_id} ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} @@ -39,8 +43,6 @@ Create Entities With Different Payloads And Registration ${second_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${second_entity_id} - ${response1}= Create Entity ${entity_payload_filename2} ${second_entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response1.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -49,8 +51,10 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response2.status_code} + Start Context Source Mock Server + -Delete Created Entities And Registration +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} Delete Entity By Id ${first_entity_id} - Delete Entity By Id ${second_entity_id} base_url=${remote_url} + Stop Context Source Mock Server diff --git a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot index 4a9fd8caca8927ffd40c84c39db5509dd9628227..f08c029c7e0b311767f4cbe866ba8d3a3bb2b2be 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_04_inc.robot @@ -7,14 +7,14 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration - +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-attributes-second.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld @@ -24,17 +24,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 Entity Id ${entity_id_prefix} Set Suite Variable ${first_entity_id} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${second_entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${second_entity_id} @@ -48,8 +49,11 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response2}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response2.status_code} + Start Context Source Mock Server + + -Delete Created Entities And Registration - Delete Context Source Registration ${registration_id} - Delete Entity By Id ${first_entity_id} base_url=${remote_url} - Delete Entity By Id ${second_entity_id} +Delete Created Entity And Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + 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 ce4f5539f9a39b911dcf0e8467a8f7fff23d06ff..c072bcc774addfd40db8a09a42cc25616409d0df 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_01_05_inc.robot @@ -7,14 +7,14 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entities With Different Payloads And Registration -Test Teardown Delete Created Entities And Registration - +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld +${entity_payload_filename} vehicle-simple-attributes.json ${entity_payload_filename2} vehicle-simple-different-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld @@ -23,7 +23,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} @@ -37,12 +40,10 @@ D011_01_05_inc Query The Context Broker With Type *** Keywords *** -Create Entities With Different Payloads And Registration +Create Entity And Registration On The Context Broker And Start Context Source Mock Server ${entity_id}= Generate Random Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} - + ${response}= Create Entity ${entity_payload_filename2} ${entity_id} Check Response Status Code 201 ${response.status_code} @@ -53,8 +54,12 @@ Create Entities With Different Payloads And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server -Delete Created Entities And Registration + + +Delete Created Entity And Registration And Stop Context Source Mock Server Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} - Delete Entity By Id ${entity_id} + 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 1bf3a5c2ae2363a5b8ddae918f3ba9e65097fab2..b9bb9706d926f7a737fcf7d23f5c1ebfdba6d9eb 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/QueryEntities/D011_02_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -23,17 +24,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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -42,7 +43,11 @@ Setup Entity On Remote And Registration ... ${registration_payload_file_path} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server -Delete Created Entity And Registration - Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} + + +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server + 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 4905c505bc675d3b9d6119e7aa363f90f6ab2aa4..755265dce75b87d16ed8a8e63c65d964cd10ea9a 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_01_inc.robot @@ -7,33 +7,33 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration - +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** -${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld -${registration_id_prefix} urn:ngsi-ld:Registration: -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld - +${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_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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -42,7 +42,10 @@ 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 6f0a6add6010e36823777ba708d6fc576d8612b7..164ad1a7eeb107a928bdf0739af229e6f292693a 100644 --- a/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Consumption/Entity/RetrieveEntity/D010_02_inc.robot @@ -7,14 +7,13 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration - +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** ${entity_id_prefix} urn:ngsi-ld:Vehicle: -${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld @@ -24,15 +23,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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -41,7 +40,10 @@ 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/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index c6af44fac782d1db7cc6fc4743bd2840717964e4..9c387a4a4492e0f3e24bcc2c0974ff2646155459 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 @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity Id And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Setup Entity Id And Registration And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,19 +24,22 @@ ${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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} @@ -45,10 +49,11 @@ Setup Entity Id And Registration ... ${registration_id} ... ${registration_payload_file_path} ... entity_id=${entity_id} - ${response1}= Create Context Source Registration With Return ${registration_payload} - Check Response Status Code 201 ${response1.status_code} - -Delete Created Entities And Registration + ${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} - 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 6e34b123d243e174be0aaf364fab220462c19a04..f834d9b985164009e227f4e9cb0a65e0de8b89a1 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup 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 *** @@ -27,16 +28,13 @@ 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 timeout=5 ${response_query}= Query Entities entity_types=Vehicle local=true context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_query.status_code} Should Be Empty ${response_query.json()} - ${response_query_remote}= Query Entities entity_types=Vehicle base_url=${remote_url} - Check Response Status Code 200 ${response_query_remote.status_code} - Should Be Empty ${response_query_remote.json()} - *** Keywords *** -Setup Initial Context Source Registration +Setup Registration And Start Context Source Mock Server ${context_source_registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${context_source_registration_id} ${registration_payload}= Prepare Context Source Registration From File @@ -44,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 b6278f521b5372c176f3865820c97166212a5a79..05f5297f89a1129c2f761185ba127ddc41b5f729 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_01_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Local And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,18 +24,22 @@ ${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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -48,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 d403306c180a9c0e1888c672739555bba655f713..b91322963968e37277e5da470bfb160faa1789af 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_02_inc.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Verify that, when one has an entity on a Context Broker and on a Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker +Documentation Verify that, when one has an entity on both Context Broker and Context Source and an inclusive registration on the Context Broker, one is not able to create that entity on the Context Source from the Context Broker Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.resource Resource ${EXECDIR}/resources/ApiUtils/ContextSourceDiscovery.resource @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entities And Registration -Test Teardown Delete Created Entities And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** @@ -23,22 +24,21 @@ ${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 - ${entity_id}= Generate Random Entity Id ${entity_id_prefix} +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} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -48,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} 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 3fcc270e3284dd6375acf275d1627e5a6f4eface..623df13a68ea0ba7733290a4714c58f5591db0c2 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_03_03_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created 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 *** @@ -20,12 +21,12 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** -D001_03_03_inc Create entity already existing remotely on the Context Broker +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} @@ -34,11 +35,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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -48,8 +47,9 @@ Setup Entity On Remote And Registration ... entity_id=${entity_id} ${response1}= Create Context Source Registration With Return ${registration_payload} Check Response Status Code 201 ${response1.status_code} + Start Context Source Mock Server -Delete Created Entities And Registration +Delete 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/DeleteEntity/D002_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot index 16431571774be4d3dac36b07f30f7b42aca351d4..618f67cabe02ffcae9329f6af898054519125ea6 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_01_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup 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 *** @@ -20,24 +21,25 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** -D002_01_inc Delete Entities On Both Context Broker and Context Source +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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -47,8 +49,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 9b25cf1ab0cc3454cc16f23fd0c5e79469fe0539..9ce0ac2324b94349414bd6520e526f92b8d26a6b 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_01_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Local And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -23,13 +24,16 @@ ${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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} ${response}= Create Entity ${entity_payload_filename} ${entity_id} @@ -43,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} + 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 aa00071a86c1be4921b4c823041f2985cbc0eaed..85a1ff04af209212b06beabddfc50c84531258cf 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/DeleteEntity/D002_02_02_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -20,20 +21,23 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi *** Test Cases *** -D002_02_02_inc Delete Entity On a Context Source +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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -43,7 +47,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/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot index 22997bd0365bf2f1b4fce5eca8d40b24ae610d25..dba120eb1fe9ac41ae848615a91b52d5fe1e7d80 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/EntityAttributes/UpdateEntityAttributes/D004_01_inc.robot @@ -7,9 +7,10 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.re Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource +Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity On Remote And Registration -Test Teardown Delete Created Entity And Registration +Test Setup Setup Registration And Start Context Source Mock Server +Test Teardown Delete Registration And Stop Context Source Mock Server *** Variables *** @@ -17,32 +18,35 @@ ${entity_id_prefix} urn:ngsi-ld:Vehicle: ${entity_payload_filename} vehicle-simple-attributes.jsonld ${registration_id_prefix} urn:ngsi-ld:Registration: ${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld -${fragment_filename} vehicle-brandname-fragment.jsonld +${fragment_filename} vehicle-brandname-complete-fragment.jsonld + *** Test Cases *** D004_01_inc Query The Context Broker With Type [Documentation] Check that if one request the Context Broker to update an entity that matches an inclusive registration, this is updated on the Context Source too [Tags] since_v1.6.1 dist-ops 4_3_3 cf_06 additive-inclusive 4_3_6_2 5_6_2 - - ${response}= Update Entity Attributes + + 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 Entity Id ${entity_id_prefix} Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} base_url=${remote_url} - Check Response Status Code 201 ${response.status_code} ${registration_id}= Generate Random Entity Id ${registration_id_prefix} Set Suite Variable ${registration_id} @@ -52,7 +56,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 Entity And Registration - Delete Context Source Registration ${registration_id} - Delete Entity By Id ${entity_id} base_url=${remote_url} +Delete Registration And Stop Context Source Mock Server + Delete Context Source Registration ${registration_id} + Stop Context Source Mock Server 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-auxiliary.jsonld b/data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..2967d8864def2664440c1d97a0657c7819b92535 --- /dev/null +++ b/data/csourceRegistrations/context-source-registration-vehicle-complete-auxiliary.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:ContextSourceRegistration:randomUUID", + "type": "ContextSourceRegistration", + "information": [ + { + "entities": [ + { + "type": "Vehicle" + } + ] + } + ], + "endpoint": "http://my.csource.org:1026", + "mode": "auxiliary", + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/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/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/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index bb03910bd5a02283d4611c96f0234282524a4ad3..1aecf15bb0a53a3085a05183c1831ae8dc7fb754 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -26,7 +26,6 @@ ${response} ${EMPTY} *** Keywords *** Query Entities [Arguments] - ... ${base_url}=${url} ... ${entity_ids}=${EMPTY} ... ${entity_types}=${EMPTY} ... ${accept}=${EMPTY} @@ -87,7 +86,7 @@ Query Entities IF '${q}'!='' Set To Dictionary ${params} q=${q} IF '${local}'!='' Set To Dictionary ${params} local=${local} ${response}= GET - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -211,12 +210,7 @@ Retrieve Attributes RETURN ${response} Retrieve Entity by Id - [Arguments] - ... ${id} - ... ${accept}=${CONTENT_TYPE_LD_JSON} - ... ${context}=${EMPTY} - ... ${local}=${EMPTY} - ... ${options}=${EMPTY} + [Arguments] ${id} ${accept}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${local}=${EMPTY} ${options}=${EMPTY} ${headers}= Create Dictionary &{params}= Create Dictionary ${options_length}= Get Length ${options} diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index defb0c4f15b1bfab87ccfcb8265236e74cfd6afe..41d3a7c06bd03added091c1d2fae4964a1f0ea1e 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -151,12 +151,12 @@ Batch Upsert Entities RETURN ${response} Create Entity - [Arguments] ${filename} ${entity_id} ${base_url}=${url} + [Arguments] ${filename} ${entity_id} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $..id ${entity_id} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}/${ENTITIES_ENDPOINT_PATH} ... json=${entity} ... headers=${headers} ... expected_status=any @@ -238,9 +238,9 @@ Delete Entity Attributes RETURN ${response} Delete Entity by Id - [Arguments] ${id} ${base_url}=${url} + [Arguments] ${id} ${response}= DELETE - ... url=${base_url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} ... expected_status=any IF ${delete_temporal_on_core_delete} Delete Temporal Representation Of Entity ${id} diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 165144f7f2d247cc43f76a69bdff1494a0fb78a7..b8737ba53bdadf9b0fdc9ecef24d6697fb7fa646 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -17,11 +17,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} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} ${registration_payload}= Update Value To JSON @@ -31,7 +32,7 @@ Prepare Context Source Registration From File ${registration_payload}= Update Value To JSON ... ${registration_payload} ... $..endpoint - ... ${context_source_endpoint} + ... ${context_source_url}${endpoint} IF '${entity_id}' != '' ${dict}= Create Dictionary id=${entity_id} ${registration_payload}= Add Object To JSON diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 9026e800e3cfb61031c409fbcffae8492f1d6ee7..e8ca1df1544e9de6921e1fc1088fbfa408090e92 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 *** @@ -108,7 +109,7 @@ Check Response Headers ID Not Empty Check Response Body Containing an Attribute set to [Arguments] ${expected_attribute_name} ${response_body} ${expected_attribute_value}=${EMPTY} Should Not Be Empty ${response_body['${expected_attribute_name}']} - IF '${expected_attribute_value}'!='' + IF ${expected_attribute_value}!='' Should Be Equal ${response_body['${expected_attribute_name}']} ${expected_attribute_value} END @@ -305,14 +306,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'