From ca2f1fed34833afed64a35bf3f97779db632158e Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Mon, 20 Jul 2026 16:16:12 +0200 Subject: [PATCH 01/34] feat: remove ngsi-ld/v1 from configuration --- README.md | 18 +++---- itb/ITBTestCases/resources/template.json | 6 +-- .../testSuite/resources/test-request.json | 6 +-- .../src/main/resources/test-request.json | 6 +-- resources/ApiUtils/Common.resource | 10 ++-- .../ContextInformationConsumption.resource | 14 +++--- .../ContextInformationProvision.resource | 48 +++++++++---------- .../ContextInformationSubscription.resource | 16 +++---- .../ApiUtils/ContextSourceDiscovery.resource | 6 +-- .../ContextSourceRegistration.resource | 22 +++++---- ...extSourceRegistrationSubscription.resource | 12 ++--- ...oralContextInformationConsumption.resource | 8 ++-- ...mporalContextInformationProvision.resource | 18 +++---- resources/ApiUtils/jsonldContext.resource | 23 +++++---- resources/MockServerUtils.resource | 3 +- resources/variables.py | 4 +- 16 files changed, 116 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index 074d36c5..e5180daf 100644 --- a/README.md +++ b/README.md @@ -58,10 +58,10 @@ taking into account the content of `requirements.txt` file. Further details on e In the `resources/variables.py` file, configure the following parameters: -- `url` : It is the url of the context broker which is to be tested (including the `/ngsi-ld/v1` path, -e.g., http://localhost:8080/ngsi-ld/v1). +- `url` : It is the base URL of the context broker which is to be tested (without the `/ngsi-ld/v1` path, +e.g., http://localhost:8080). - `temporal_api_url` : This is the url of the GET temporal operation API, in case that a Context Broker splits -this portion of the API (e.g., http://localhost:8080/ngsi-ld/v1). +this portion of the API (without the `/ngsi-ld/v1` path, e.g., http://localhost:8080). - `ngsild_test_suite_context` : This is the url of the default context used in the ETSI NGSI-LD requests (e.g. 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'). - `notification_server_host` and `notification_server_port` : This is the address and port used to create the local @@ -170,11 +170,11 @@ test launch command followed by the file name. The following example shows how to run an interoperability test with multiple brokers: ``` - robot --variable broker_A_url:http://localhost:8080/ngsi-ld/v1 \ - --variable broker_B_url:http://localhost:8081/ngsi-ld/v1 \ - --variable broker_C_url:http://localhost:8082/ngsi-ld/v1 \ - --variable broker_D_url:http://localhost:8083/ngsi-ld/v1 \ - --variable broker_E_url:http://localhost:8084/ngsi-ld/v1 \ + robot --variable broker_A_url:http://localhost:8080 \ + --variable broker_B_url:http://localhost:8081 \ + --variable broker_C_url:http://localhost:8082 \ + --variable broker_D_url:http://localhost:8083 \ + --variable broker_E_url:http://localhost:8084 \ ./TP/NGSI-LD/Interoperability/Provision/Entities/CreateEntity/IOP_CNF_01_01.robot ``` @@ -222,4 +222,4 @@ the pre-commit formatting hook, Test Case authoring rules, documentation update Copyright 2021-2026 ETSI The content of this repository and the files contained are released under the [ETSI Software License](LICENSE) a -(BSD-3-Clause LICENSE). \ No newline at end of file +(BSD-3-Clause LICENSE). diff --git a/itb/ITBTestCases/resources/template.json b/itb/ITBTestCases/resources/template.json index 23fb5aca..0c953012 100644 --- a/itb/ITBTestCases/resources/template.json +++ b/itb/ITBTestCases/resources/template.json @@ -4,8 +4,8 @@ "testName": "${testName}", "excludeOption": "${exclude}", "parameters": { - "url": "${url}/ngsi-ld/v1", - "temporal_api_url": "${temporalApiUrl}/ngsi-ld/v1", + "url": "${url}", + "temporal_api_url": "${temporalApiUrl}", "ngsild_test_suite_context": "${ngsildTestSuiteContext}", "notification_server_host": "${notificationServerHost}", "notification_server_port": "${notificationServerPort}", @@ -18,4 +18,4 @@ "core_context": "${coreContext}", "delete_temporal_on_core_delete": "${deleteTemporalOnCoreDelete}" } -} \ No newline at end of file +} diff --git a/itb/ITBTestCases/testSuite/resources/test-request.json b/itb/ITBTestCases/testSuite/resources/test-request.json index 55c683d0..89cbc532 100644 --- a/itb/ITBTestCases/testSuite/resources/test-request.json +++ b/itb/ITBTestCases/testSuite/resources/test-request.json @@ -1,8 +1,8 @@ { "testName": "${testName}", "parameters": { - "url": "${url}/ngsi-ld/v1", - "temporal_api_url": "${temporalApiUrl}/ngsi-ld/v1", + "url": "${url}", + "temporal_api_url": "${temporalApiUrl}", "ngsild_test_suite_context": "${ngsildTestSuiteContext}", "notification_server_host": "${notificationServerHost}", "notification_server_port": "${notificationServerPort}", @@ -15,4 +15,4 @@ "core_context": "${coreContext}", "delete_temporal_on_core_delete": "${deleteTemporalOnCoreDelete}" } -} \ No newline at end of file +} diff --git a/itb/robot-processing/test-runner-service/src/main/resources/test-request.json b/itb/robot-processing/test-runner-service/src/main/resources/test-request.json index 55c683d0..89cbc532 100644 --- a/itb/robot-processing/test-runner-service/src/main/resources/test-request.json +++ b/itb/robot-processing/test-runner-service/src/main/resources/test-request.json @@ -1,8 +1,8 @@ { "testName": "${testName}", "parameters": { - "url": "${url}/ngsi-ld/v1", - "temporal_api_url": "${temporalApiUrl}/ngsi-ld/v1", + "url": "${url}", + "temporal_api_url": "${temporalApiUrl}", "ngsild_test_suite_context": "${ngsildTestSuiteContext}", "notification_server_host": "${notificationServerHost}", "notification_server_port": "${notificationServerPort}", @@ -15,4 +15,4 @@ "core_context": "${coreContext}", "delete_temporal_on_core_delete": "${deleteTemporalOnCoreDelete}" } -} \ No newline at end of file +} diff --git a/resources/ApiUtils/Common.resource b/resources/ApiUtils/Common.resource index 5b6e4b75..5ac29d67 100644 --- a/resources/ApiUtils/Common.resource +++ b/resources/ApiUtils/Common.resource @@ -9,6 +9,8 @@ Library String *** Variables *** +${NGSI_LD_API_PATH} /ngsi-ld/v1 + ${BUILDING_ID_PREFIX} urn:ngsi-ld:Building: ${BUS_ID_PREFIX} urn:ngsi-ld:Bus: ${CITY_ID_PREFIX} urn:ngsi-ld:City: @@ -82,24 +84,24 @@ Call Api Endpoint With Invalid Parameter # No multi method request function in the robotframework-requests library IF "${method}"=="GET" ${response}= GET - ... url=${url}/${endpoint}${params} + ... url=${url}${NGSI_LD_API_PATH}/${endpoint}${params} ... headers=${headers} ... expected_status=any ELSE IF "${method}"=="POST" ${response}= POST - ... url=${url}/${endpoint}${params} + ... url=${url}${NGSI_LD_API_PATH}/${endpoint}${params} ... json=${file_content} ... headers=${headers} ... expected_status=any ELSE IF "${method}"=="PUT" ${response}= PUT - ... url=${url}/${endpoint}${params} + ... url=${url}${NGSI_LD_API_PATH}/${endpoint}${params} ... json=${file_content} ... headers=${headers} ... expected_status=any ELSE IF "${method}"=="DELETE" ${response}= DELETE - ... url=${url}/${endpoint}${params} + ... url=${url}${NGSI_LD_API_PATH}/${endpoint}${params} ... headers=${headers} ... expected_status=any END diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 332029af..02a098d5 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -113,7 +113,7 @@ Query Entities END ${response}= GET - ... url=${final_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -168,7 +168,7 @@ Query Entities Via POST END ${response}= POST - ... url=${final_url}/${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITY_OPERATIONS_QUERY_ENDPOINT_PATH} ... json=${body} ... headers=${headers} ... params=${params} @@ -233,7 +233,7 @@ Retrieve Entity IF '${local}'!='' Set To Dictionary ${params} local=${local} ${response}= GET - ... url=${final_url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id} ... headers=${headers} ... params=${params} ... expected_status=any @@ -255,7 +255,7 @@ Retrieve Attribute ... Link=${context_link} END ${response}= GET - ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} + ... url=${url}${NGSI_LD_API_PATH}/${ATTRIBUTES_ENDPOINT_PATH}/${attribute_name} ... headers=${headers} ... expected_status=any Output ${response} Retrieve Attribute @@ -278,7 +278,7 @@ Retrieve Attributes END Set To Dictionary ${params} details=${details} ${response}= GET - ... url=${url}/${ATTRIBUTES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${ATTRIBUTES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -300,7 +300,7 @@ Retrieve Entity Type ... Link=${context_link} END ${response}= GET - ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_TYPES_ENDPOINT_PATH}/${type} ... headers=${headers} ... expected_status=any Output ${response} Retrieve Entity Type @@ -323,7 +323,7 @@ Retrieve Entity Types END Set To Dictionary ${params} details=${details} ${response}= GET - ... url=${url}/${ENTITIES_TYPES_ENDPOINT_PATH}/ + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_TYPES_ENDPOINT_PATH}/ ... headers=${headers} ... params=${params} ... expected_status=any diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index 0dfdfe9f..8e795f00 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -46,7 +46,7 @@ Append Entity Attributes &{headers}= Create Dictionary Content-Type=${content_type} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -59,7 +59,7 @@ Append Entity Attributes With Parameters &{headers}= Create Dictionary Content-Type=${content_type} ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/?options=${options} ... json=${fragment_payload} ... headers=${headers} ... expected_status=any @@ -85,7 +85,7 @@ Batch Create Entities ... Link=${context_link} END ${response}= POST - ... url=${url}/${BATCH_CREATE_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${BATCH_CREATE_ENDPOINT_PATH} ... json=@{entities_to_be_created} ... headers=${headers} ... expected_status=any @@ -97,7 +97,7 @@ Batch Delete Entities [Arguments] ${entities_ids_to_be_deleted} ${teardown}=False &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${BATCH_DELETE_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${BATCH_DELETE_ENDPOINT_PATH} ... json=@{entities_ids_to_be_deleted} ... headers=${headers} ... expected_status=any @@ -111,7 +111,7 @@ Batch Request Entities From File ${endpoint_url}= Get From Dictionary ${BATCH_OPERATION_ENDPOINT_MAPPING} ${batchOperation} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${endpoint_url} + ... url=${url}${NGSI_LD_API_PATH}/${endpoint_url} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -128,7 +128,7 @@ Batch Update Entities ${params_as_string}= Catenate SEPARATOR=& @{params} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${BATCH_UPDATE_ENDPOINT_PATH}?${params_as_string} + ... url=${url}${NGSI_LD_API_PATH}/${BATCH_UPDATE_ENDPOINT_PATH}?${params_as_string} ... json=@{entities_to_be_updated} ... headers=${headers} ... expected_status=any @@ -140,7 +140,7 @@ Batch Merge Entities [Arguments] @{entities_to_be_merged} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${BATCH_MERGE_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${BATCH_MERGE_ENDPOINT_PATH} ... json=@{entities_to_be_merged} ... headers=${headers} ... expected_status=any @@ -152,7 +152,7 @@ Batch Upsert Entities [Arguments] @{entities_to_be_upserted} ${update_option}=replace &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} + ... url=${url}${NGSI_LD_API_PATH}/${BATCH_UPSERT_ENDPOINT_PATH}?options=${update_option} ... json=@{entities_to_be_upserted} ... headers=${headers} ... expected_status=any @@ -169,7 +169,7 @@ Create Entity ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${final_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... json=${entity} ... params=${params} ... headers=${headers} @@ -189,7 +189,7 @@ Create Entity selecting @context &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... json=${entity} ... headers=${headers} ... expected_status=any @@ -212,7 +212,7 @@ Create Entity Selecting Content Type ... Link=${context_link} END ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... json=${entity} ... headers=${headers} ... expected_status=any @@ -226,7 +226,7 @@ Create Entity From File ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${final_url}/${ENTITIES_ENDPOINT_PATH} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -238,7 +238,7 @@ Create Entity From JSON-LD Content [Arguments] ${content} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... json=${content} ... headers=${headers} ... expected_status=any @@ -264,7 +264,7 @@ Delete Entity Attributes END ${params_as_string}= Catenate SEPARATOR=& @{params} ${response}= DELETE - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} ... expected_status=any Output ${response} Delete Entity Attributes @@ -276,10 +276,10 @@ Delete Entity &{params}= Create Dictionary IF '${local}'!='' Set To Dictionary ${params} local=${local} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} - &{headers}= Create Dictionary - IF '${via}'!='' Set To Dictionary ${headers} Via ${via} + &{headers}= Create Dictionary + IF '${via}'!='' Set To Dictionary ${headers} Via ${via} ${response}= DELETE - ... url=${final_url}/${ENTITIES_ENDPOINT_PATH}${id} + ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id} ... params=${params} ... headers=${headers} ... expected_status=any @@ -310,7 +310,7 @@ Partial Update Entity Attributes END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= PATCH - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entityId}/attrs/${attributeId} ... json=${fragment_payload} ... headers=${headers} ... expected_status=any @@ -323,7 +323,7 @@ Update Entity Attributes &{headers}= Create Dictionary Content-Type=${content_type} ${file_content}= Get File ${EXECDIR}/data/entities/fragmentEntities/${fragment_filename} ${response}= PATCH - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id}/attrs/ ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -348,7 +348,7 @@ Replace Entity ... Link=${context_link} END ${response}= PUT - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entity_id} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entity_id} ... headers=${headers} ... json=${entity} ... expected_status=any @@ -370,7 +370,7 @@ Replace Entity Selecting Content Type ... Link=${context_link} END ${response}= PUT - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entity_id} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entity_id} ... headers=${headers} ... json=${entity_fragment} ... expected_status=any @@ -403,7 +403,7 @@ Purge Entities IF '${local}'!='' Set To Dictionary ${params} local=${local} ${response}= DELETE - ... url=${url}/${ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -427,7 +427,7 @@ Merge Entity ... Link=${context_link} END ${response}= PATCH - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entity_id} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entity_id} ... headers=${headers} ... json=${entity} ... expected_status=any @@ -450,7 +450,7 @@ Replace Attribute Selecting Content Type ... Link=${context_link} END ${response}= PUT - ... url=${url}/${ENTITIES_ENDPOINT_PATH}${entity_id}/attrs/${attr_id} + ... url=${url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${entity_id}/attrs/${attr_id} ... headers=${headers} ... json=${attribute_fragment} ... expected_status=any diff --git a/resources/ApiUtils/ContextInformationSubscription.resource b/resources/ApiUtils/ContextInformationSubscription.resource index 348ecd87..24a9293d 100755 --- a/resources/ApiUtils/ContextInformationSubscription.resource +++ b/resources/ApiUtils/ContextInformationSubscription.resource @@ -47,7 +47,7 @@ Create Subscription ${subscription_payload}= Load JSON From File ${EXECDIR}/data/${filename_path} ${subscription}= Update Value To JSON ${subscription_payload} $.id ${subscription_id} ${response}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH} ... json=${subscription} ... headers=${headers} ... expected_status=any @@ -60,7 +60,7 @@ Create Subscription From File ${file_content}= Get File ${EXECDIR}/data/subscriptions/${filename} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -85,7 +85,7 @@ Create Subscription From Subscription Payload ... Link=${context_link} END ${response}= POST - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH} ... json=${subscription_payload} ... headers=${headers} ... expected_status=any @@ -96,7 +96,7 @@ Delete Subscription [Tags] actor_context-subscriber [Arguments] ${subscription_id} ${response}= DELETE - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} ... expected_status=any Output ${response} Delete Subscription RETURN ${response} @@ -120,7 +120,7 @@ Query Subscriptions END ${response}= GET - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -143,7 +143,7 @@ Retrieve Subscription END ${response}= GET - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${id} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH}${id} ... headers=${headers} ... expected_status=any Output ${response} Retrieve Subscription @@ -169,7 +169,7 @@ Update Subscription END ${subscription_update_fragment}= Load JSON From File ${EXECDIR}/data/${fragment_filename} ${response}= PATCH - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} ... json=${subscription_update_fragment} ... headers=${headers} ... expected_status=any @@ -190,7 +190,7 @@ Update Subscription With Payload ... Link=${context_link} END ${response}= PATCH - ... url=${url}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${SUBSCRIPTION_ENDPOINT_PATH}${subscription_id} ... json=${payload} ... headers=${headers} ... expected_status=any diff --git a/resources/ApiUtils/ContextSourceDiscovery.resource b/resources/ApiUtils/ContextSourceDiscovery.resource index ded3e8ba..4299bedf 100755 --- a/resources/ApiUtils/ContextSourceDiscovery.resource +++ b/resources/ApiUtils/ContextSourceDiscovery.resource @@ -75,7 +75,7 @@ Query Context Source Registrations IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} ${response}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -137,7 +137,7 @@ Query Context Source Registrations With Return IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} ${response}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -157,7 +157,7 @@ Retrieve Context Source Registration ... Link=${context_link} END ${response}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... headers=${headers} ... expected_status=any Output ${response} Retrieve Context Source Registration diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 04f0fa7f..639259e2 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -79,7 +79,7 @@ Create Context Source Registration &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} ... json=${context_source_registration_payload} ... headers=${headers} ... expected_status=any @@ -88,7 +88,12 @@ Create Context Source Registration Create Context Source Registration With Return [Tags] actor_context-producer - [Arguments] ${payload} ${content_type}=${CONTENT_TYPE_LD_JSON} ${context}=${EMPTY} ${accept}=${EMPTY} ${broker_url}=${EMPTY} + [Arguments] + ... ${payload} + ... ${content_type}=${CONTENT_TYPE_LD_JSON} + ... ${context}=${EMPTY} + ... ${accept}=${EMPTY} + ... ${broker_url}=${EMPTY} &{headers}= Create Dictionary Content-Type=${content_type} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} IF '${accept}'!='' @@ -101,7 +106,7 @@ Create Context Source Registration With Return ... Link=${context_link} END ${response}= POST - ... url=${final_url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} + ... url=${final_url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH} ... json=${payload} ... headers=${headers} ... expected_status=any @@ -113,7 +118,8 @@ Delete Context Source Registration [Arguments] ${context_source_registration_id} ${broker_url}=${EMPTY} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} - ${response}= DELETE url=${final_url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ${response}= DELETE + ... url=${final_url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} Output ${response} Delete Context Source Registration RETURN ${response} @@ -122,7 +128,7 @@ Delete Context Source Registration With Return [Arguments] ${registration_id} ${broker_url}=${EMPTY} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} ${response}= DELETE - ... url=${final_url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... url=${final_url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} ... expected_status=any Output ${response} Delete Context Source Registration RETURN ${response} @@ -132,7 +138,7 @@ Update Context Source Registration [Arguments] ${context_source_registration_id} ${update_fragment} ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... json=${update_fragment} ... expected_status=any Output ${response} Update Context Source Registration @@ -147,7 +153,7 @@ Update Context Source Registration From File ${file_content}= Get File ${EXECDIR}/data/csourceRegistrations/${filename} ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${context_source_registration_id} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -161,7 +167,7 @@ Update Context Source Registration With Return &{headers}= Create Dictionary Content-Type=${content_type} IF '${accept}'!='' Set To Dictionary ${headers} Accept=${accept} ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_ENDPOINT_PATH}/${registration_id} ... json=${fragment} ... headers=${headers} ... expected_status=any diff --git a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource index c3850cd6..97a745cc 100755 --- a/resources/ApiUtils/ContextSourceRegistrationSubscription.resource +++ b/resources/ApiUtils/ContextSourceRegistrationSubscription.resource @@ -31,7 +31,7 @@ Create Context Source Registration Subscription Set To Dictionary ${headers} Accept ${accept} END ${response}= POST - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} ... json=${subscription_payload} ... headers=${headers} ... expected_status=any @@ -43,7 +43,7 @@ Delete Context Source Registration Subscription [Arguments] ${subscription_id} ${response}= DELETE - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} Output ${response} Delete Context Source Registration Subscription RETURN ${response} @@ -64,7 +64,7 @@ Query Context Source Registration Subscriptions IF '${offset}'!='' Set To Dictionary ${params} offset=${offset} ${response}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -84,7 +84,7 @@ Retrieve Context Source Registration Subscription ... Link=${context_link} END ${response}= GET - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... headers=${headers} ... expected_status=any Output ${response} Retrieve Context Source Registration Subscription @@ -95,7 +95,7 @@ Update Context Source Registration Subscription [Arguments] ${subscription_id} ${subscription_update_fragment} ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... json=${subscription_update_fragment} ... expected_status=any Output ${response} Update Context Source Registration Subscription @@ -106,7 +106,7 @@ Update Context Source Registration Subscription From File [Arguments] ${subscription_id} ${file_path} ${file_content}= Get File ${EXECDIR}/data/${file_path} ${response}= PATCH - ... url=${url}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} + ... url=${url}${NGSI_LD_API_PATH}/${CONTEXT_SOURCE_REGISTRATION_SUBSCRIPTION_ENDPOINT_PATH}/${subscription_id} ... data=${file_content} ... expected_status=any Output ${response} Update Context Source Registration Subscription From File diff --git a/resources/ApiUtils/TemporalContextInformationConsumption.resource b/resources/ApiUtils/TemporalContextInformationConsumption.resource index 95f22cf5..85bc823a 100755 --- a/resources/ApiUtils/TemporalContextInformationConsumption.resource +++ b/resources/ApiUtils/TemporalContextInformationConsumption.resource @@ -119,7 +119,7 @@ Query Temporal Representation Of Entities IF '${local}'!='' Set To Dictionary ${params} local=${local} ${response}= GET - ... url=${temporal_api_url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... url=${temporal_api_url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -139,7 +139,7 @@ Query Temporal Representation Of Entities Via Post END ${query_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/${query_file_name} ${response}= POST - ... url=${temporal_api_url}/${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query + ... url=${temporal_api_url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITY_OPERATIONS_ENDPOINT_PATH}/query ... json=${query_payload} ... headers=${headers} ... expected_status=any @@ -208,7 +208,7 @@ Query Temporal Representation Of Entities With Return IF '${limit}'!='' Set To Dictionary ${params} limit=${limit} ${response}= GET - ... url=${temporal_api_url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... url=${temporal_api_url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... headers=${headers} ... params=${params} ... expected_status=any @@ -271,7 +271,7 @@ Retrieve Temporal Representation Of Entity IF ${omit_length}>0 Set To Dictionary ${params} omit=${omit} ${response}= GET - ... url=${temporal_api_url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... url=${temporal_api_url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... headers=${headers} ... params=${params} ... expected_status=any diff --git a/resources/ApiUtils/TemporalContextInformationProvision.resource b/resources/ApiUtils/TemporalContextInformationProvision.resource index 805698e9..acdb823f 100755 --- a/resources/ApiUtils/TemporalContextInformationProvision.resource +++ b/resources/ApiUtils/TemporalContextInformationProvision.resource @@ -28,7 +28,7 @@ Append Attribute To Temporal Entity &{headers}= Create Dictionary Content-Type=${content_type} ${file_content}= Get File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -48,7 +48,7 @@ Create Or Update Temporal Representation Of Entity Selecting Content Type Set To Dictionary ${headers} Accept ${accept} END ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/ ... json=${temporal_entity_representation} ... headers=${headers} ... expected_status=any @@ -66,7 +66,7 @@ Create Temporal Representation Of Entity &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... json=${temporal_entity_representation} ... headers=${headers} ... expected_status=any @@ -79,7 +79,7 @@ Create Temporal Representation Of Entity Selecting Content Type ${file_content}= Get File ${EXECDIR}/data/temporalEntities/${filename} &{headers}= Create Dictionary Content-Type=${content_type} ${response}= POST - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -111,7 +111,7 @@ Delete Attribute From Temporal Entity END ${params_as_string}= Catenate SEPARATOR=& @{params} ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${entityId}/attrs/${attributeId}?${params_as_string} ... headers=${headers} ... expected_status=any Output ${response} Delete Attribute From Temporal Entity @@ -128,7 +128,7 @@ Delete Attribute Instance From Temporal Entity ... Link=${context_link} END ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... headers=${headers} ... expected_status=any Output ${response} Delete Attribute Instance From Temporal Entity @@ -139,7 +139,7 @@ Delete Temporal Representation Of Entity [Arguments] ${temporal_entity_representation_id} ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... expected_status=any Output ${response} Delete Temporal Representation Of Entity RETURN ${response} @@ -148,7 +148,7 @@ Delete Temporal Representation Of Entity With Returning Response [Tags] actor_context-producer [Arguments] ${temporal_entity_representation_id} ${response}= DELETE - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_representation_id} ... expected_status=any Output ${response} Delete Temporal Representation Of Entity RETURN ${response} @@ -171,7 +171,7 @@ Modify Attribute Instance From Temporal Entity END ${fragment_payload}= Load JSON From File ${EXECDIR}/data/temporalEntities/fragments/${fragment_filename} ${response}= PATCH - ... url=${url}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} + ... url=${url}${NGSI_LD_API_PATH}/${TEMPORAL_ENTITIES_ENDPOINT_PATH}/${temporal_entity_id}/attrs/${attributeId}/${instanceId} ... json=${fragment_payload} ... headers=${headers} ... expected_status=any diff --git a/resources/ApiUtils/jsonldContext.resource b/resources/ApiUtils/jsonldContext.resource index 89f77326..6448741c 100644 --- a/resources/ApiUtils/jsonldContext.resource +++ b/resources/ApiUtils/jsonldContext.resource @@ -4,6 +4,7 @@ Library ${EXECDIR}/libraries/logUtils.py Library Collections Library RequestsLibrary Library OperatingSystem +Resource ${EXECDIR}/resources/ApiUtils/Common.resource *** Variables *** @@ -29,7 +30,7 @@ Add a new @context &{headers}= Create Dictionary Content-Type=application/json ${response}= POST - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH} ... data=${file_content} ... headers=${headers} ... expected_status=any @@ -40,19 +41,19 @@ Add a new @context Serve a @context [Tags] actor_context-consumer [Arguments] ${contextId} ${details}=${EMPTY} - ${contextId}= Replace String ${contextId} /ngsi-ld/v1/${JSONLDCONTEXTS_ENDPOINT_PATH}/ ${EMPTY} + ${contextId}= Replace String ${contextId} ${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/ ${EMPTY} ${contextId}= Evaluate urllib.parse.quote("${contextId}", safe='') modules=urllib IF '${details}'!='' &{params}= Create Dictionary Set To Dictionary ${params} details=${details} ${response}= GET - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} ... params=${params} ... expected_status=any ELSE ${response}= GET - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} ... expected_status=any END @@ -66,20 +67,22 @@ Delete a @context # or the path prefix alone, leaving only the localId. Anchoring on the # absolute form prevents a leftover "http://host" prefix in front of the # localId when callers pass a fully-qualified URL. - ${contextId}= Remove String Using Regexp ${contextId} ^https?://[^/]+/ngsi-ld/v1/${JSONLDCONTEXTS_ENDPOINT_PATH}/ - ${contextId}= Replace String ${contextId} /ngsi-ld/v1/${JSONLDCONTEXTS_ENDPOINT_PATH}/ ${EMPTY} + ${contextId}= Remove String Using Regexp + ... ${contextId} + ... ^https?://[^/]+${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/ + ${contextId}= Replace String ${contextId} ${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/ ${EMPTY} ${contextId}= Evaluate urllib.parse.quote("${contextId}", safe='') modules=urllib IF '${reload}'!='' &{params}= Create Dictionary Set To Dictionary ${params} reload=${reload} ${response}= DELETE - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} ... params=${params} ... expected_status=any ELSE ${response}= DELETE - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}/${contextId} ... expected_status=any END @@ -94,7 +97,7 @@ List @contexts IF '${details}'=='' and '${kind}'=='' ${response}= GET - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH} ... expected_status=any ELSE IF '${details}'!='' @@ -107,7 +110,7 @@ List @contexts ${params_as_string}= Evaluate '&'.join(${string_list}) ${response}= GET - ... url=${url}/${JSONLDCONTEXTS_ENDPOINT_PATH}?${params_as_string} + ... url=${url}${NGSI_LD_API_PATH}/${JSONLDCONTEXTS_ENDPOINT_PATH}?${params_as_string} ... expected_status=any END diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index 5e326090..b1bd9bc2 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -3,6 +3,7 @@ Documentation Mock http server for subscriber Library HttpCtrl.Server Variables ${EXECDIR}/resources/variables.py +Resource ${EXECDIR}/resources/ApiUtils/Common.resource *** Keywords *** @@ -23,7 +24,7 @@ Wait for redirected request Answer to Create Entity [Tags] actor_remote-broker - Set Stub Reply POST /ngsi-ld/v1/entities 201 + Set Stub Reply POST ${NGSI_LD_API_PATH}/entities 201 Stop Context Source Mock Server [Tags] actor_remote-broker diff --git a/resources/variables.py b/resources/variables.py index 73857682..cbd1b452 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,5 +1,5 @@ -url = 'http://localhost:8080/ngsi-ld/v1' -temporal_api_url = 'http://localhost:8080/ngsi-ld/v1' +url = 'http://localhost:8080' +temporal_api_url = 'http://localhost:8080' ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' notification_server_host = '0.0.0.0' notification_server_port = 8085 -- GitLab From c7d29db7f08e304758949c407d15123f203b01a3 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 21 Jul 2026 10:44:51 +0200 Subject: [PATCH 02/34] fix: change typos in tests --- .../Entity/QueryEntities/IOP_003_01_01.robot | 37 ++++++++++--------- .../Entity/QueryEntities/IOP_003_01_02.robot | 31 ++++++++-------- .../Entity/QueryEntities/IOP_003_02_01.robot | 10 ++--- .../Entity/QueryEntities/IOP_003_02_02.robot | 8 ++-- .../Entity/QueryEntities/IOP_003_03_01.robot | 18 ++++----- .../Entity/QueryEntities/IOP_003_03_02.robot | 20 +++++----- .../Entity/QueryEntities/IOP_003_04_01.robot | 20 +++++----- .../Entity/QueryEntities/IOP_003_04_02.robot | 20 +++++----- ...ext-source-registration-inclusive-2.jsonld | 2 +- .../offstreet-parking1-full.jsonld | 13 +------ .../offstreet-parking2-full.jsonld | 15 +------- ...ffstreet-parking2-location-and-name.jsonld | 13 +------ ...g2-no-location-and-totalspotsnumber.jsonld | 13 +------ .../ContextSourceRegistration.resource | 5 ++- .../IOPUtils/InteroperabilityUtils.resource | 6 +-- 15 files changed, 94 insertions(+), 137 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 5b22ad9e..40c774ea 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -23,29 +23,27 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_2 6_4_3_1 - #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} + #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - @{payload}= Set Variable ${response.json()} - Should Contain ${payload}\[OffstreetParking1] availableSpotsNumber - Should Contain ${payload}\[OffstreetParking1] totalSpotsNumber - Should Contain ${payload}\[OffstreetParking2] availableSpotsNumber - Should Contain ${payload}\[OffstreetParking2] location - - #Agent queries all entities with type OffstreetParking in B and C - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_B_url} + Should Contain ${response.json()} availableSpotsNumber + Should Contain ${response.json()} totalSpotsNumber + Should Contain ${response.json()} availableSpotsNumber + Should Contain ${response.json()} location + + #Agent queries all entities with type OffStreetParking in B and C + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} @{first_expected_payload}= Set Variable ${response.json()} ${entity_ids}= Create List ${entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_C_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} @{second_expected_payload}= Set Variable ${response.json()} Check Response Body Containing Entities URIS set to ${entity_id} ${response.json()} - #Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C. - Should Be Equal ${payload}\[OffstreetParking1] ${first_expected_payload}\[OffstreetParking1] - Should Contain ${payload}\[OffstreetParking2] ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber] - Should Contain ${payload}\[OffstreetParking2] ${second_expected_payload}\[OffstreetParking2][location] + #Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C. + Should Be Equal ${response.json()} ${first_expected_payload} + Should Contain ${response.json()} ${second_expected_payload} *** Keywords *** Setup Initial Context Source Registrations @@ -98,6 +96,9 @@ Setup Initial Context Source Registrations Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} - @{entities_to_delete}= Create List ${entity_id} ${second_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Context Source Registration With Return ${registration_id1} broker_url=${broker_A_url} + Delete Context Source Registration With Return ${registration_id2} broker_url=${broker_A_url} + Delete Context Source Registration With Return ${registration_id3} broker_url=${broker_A_url} + Delete Entity ${entity_id} broker_url=${broker_B_url} + Delete Entity ${second_entity_id} broker_url=${broker_B_url} + Delete Entity ${entity_id} broker_url=${broker_C_url} \ No newline at end of file diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index 63f01501..66072d3d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -10,7 +10,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** ${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld ${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +${third_entity_payload_filename} interoperability/offstreet-parking2-no-location.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${broker_A_url} @@ -19,33 +19,32 @@ ${broker_C_url} *** Test Cases *** IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. C contains OffStreetParking:2. + [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location. C contains OffStreetParking:2. ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_2 6_23_2_1 - #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. @{entities}= Create List ${entity_id} ${second_entity_id} - ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_A_url} + ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - @{payload}= Set Variable ${response.json()} - Should Contain ${payload}\[OffstreetParking1] availableSpotsNumber - Should Contain ${payload}\[OffstreetParking1] totalSpotsNumber - Should Contain ${payload}\[OffstreetParking2] availableSpotsNumber - Should Contain ${payload}\[OffstreetParking2] location - - #Agent queries all entities with type OffstreetParking in B and C - ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_B_url} + Should Contain ${response.json()} availableSpotsNumber + Should Contain ${response.json()} totalSpotsNumber + Should Contain ${response.json()} availableSpotsNumber + Should Contain ${response.json()} location + + #Agent queries all entities with type OffStreetParking in B and C + ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_B_url} context=${ngsild_test_suite_context} @{first_expected_payload}= Set Variable ${response.json()} Check Response Body Containing Entities URIS set to ${entities} ${response.json()} - ${response}= Query Entities Via POST entities=${entity_id} broker_url=${broker_C_url} + ${response}= Query Entities Via POST entities=${entity_id} broker_url=${broker_C_url} context=${ngsild_test_suite_context} @{second_expected_payload}= Set Variable ${response.json()} Check Response Body Containing Entities URIS set to ${entity_id} ${response.json()} #Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C. - Should Be Equal ${payload}\[OffstreetParking1] ${first_expected_payload}\[OffstreetParking1] - Should Contain ${payload}\[OffstreetParking2] ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber] - Should Contain ${payload}\[OffstreetParking2] ${second_expected_payload}\[OffstreetParking2][location] + Should Be Equal ${response.json()} ${first_expected_payload} + Should Contain ${response.json()} ${first_expected_payload} + Should Contain ${response.json()} ${second_expected_payload} *** Keywords *** Setup Initial Context Source Registrations diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index eafd651a..683e54f7 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -28,7 +28,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 #Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} + ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} @{entities_A}= Set Variable ${response.json()} ${first_payload}= Get From List ${entities_A} 0 @@ -37,20 +37,20 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET Should Not Contain ${second_payload} name #Agent queries all entities with type OffstreetParking in B, C and D - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_B_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} @{entities_B}= Set Variable ${response.json()} ${first_B_payload}= Get From List ${entities_B} 0 ${second_B_payload}= Get From List ${entities_B} 1 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_C_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} @{entities_C}= Set Variable ${response.json()} ${C_payload}= Get From List ${entities_C} 0 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_D_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} @{entities_D}= Set Variable ${response.json()} ${D_payload}= Get From List ${entities_D} 0 - #Agent checks that OffstreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffstreetParking:2 entity in A contains the attributes of both OffstreetParking:2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D. + #Agent checks that OffStreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffStreetParking:2 entity in A contains the attributes of both OffStreetParking:2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D. Should Be Equal ${first_payload}[availableSpotsNumber] ${first_b2_payload}[availableSpotsNumber] Should Be Equal ${first_payload}[totalSpotsNumber] ${first_b2_payload}[totalSpotsNumber] Should Be Equal ${first_payload}[location] ${b3_payload}[location] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index db195496..8fe2a6d3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -31,7 +31,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle with attrs [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 #Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities. - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_A_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} &{payload}= Evaluate {i['id']: i for i in ${response.json()}} ${parking1_payload}= Get From Dictionary ${payload} ${first_parking_entity_id} @@ -44,11 +44,11 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle with attrs Should Contain ${vehicle2_payload} location #Client queries all entities with type OffstreetParking and Vehicle in B, C and D. - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_B_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_B_url} context=${ngsild_test_suite_context} &{first_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_C_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_C_url} context=${ngsild_test_suite_context} &{second_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_D_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_D_url} context=${ngsild_test_suite_context} &{third_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 73958a9f..4b2b1e35 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -26,25 +26,25 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_2 6_4_3_1 #Client queries all entities with type OffstreetParking in A and checks for a successful response. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffstreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffstreetParking:2 + ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 + ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 #Client queries all entities with type OffstreetParking in B, C and D. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_B_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking1}= Get From Dictionary ${payload} OffstreetParking:2 + ${expected_parking1}= Get From Dictionary ${payload} OffStreetParking:2 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_C_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking2}= Get From Dictionary ${payload} OffstreetParking:1 + ${expected_parking2}= Get From Dictionary ${payload} OffStreetParking:1 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_D_url} + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking3}= Get From Dictionary ${payload} OffstreetParking:2 + ${expected_parking3}= Get From Dictionary ${payload} OffStreetParking:2 #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. Should Be Equal ${first_parking_payload}[name] ${expected_parking2}[name] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index cce79e83..3a4d373b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -27,29 +27,29 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle with attrs [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_2 6_4_3_1 #Client retrieves the location property from all entities with type OffstreetParking and Vehicle in A and checks for a successful response. - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_A_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffstreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffstreetParking:2 + ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 + ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 ${first_vehicle}= Get From Dictionary ${payload} Vehicle:1 Should Contain ${first_parking_payload} location Should Contain ${second_parking_payload} location - #Client queries all entities with type OffstreetParking and Vehicle in B, C and D. - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_B_url} + #Client queries all entities with type OffStreetParking and Vehicle in B, C and D. + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_B_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} ${expected_entity1}= Get From Dictionary ${payload} Vehicle:1 - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_C_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_C_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffstreetParking:1 + ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 - ${response}= Query Entities entity_types=OffstreetParking,Vehicle attrs=location broker_url=${broker_D_url} + ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_D_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity3}= Get From Dictionary ${payload} OffstreetParking:1 - ${expected_entity4}= Get From Dictionary ${payload} OffstreetParking:2 + ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:1 + ${expected_entity4}= Get From Dictionary ${payload} OffStreetParking:2 #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. Should Be Equal ${first_parking_payload}[name] ${expected_entity2}[name] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 5ec35be3..982e34d1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -30,26 +30,26 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 - #Client queries all entities with type OffstreetParking in A and checks for a successful response. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} + #Client queries all entities with type OffStreetParking in A and checks for a successful response. + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffstreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffstreetParking:2 + ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 + ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 Should Contain ${first_parking_payload} location Should Contain ${second_parking_payload} availableSpotsNumber Should Contain ${second_parking_payload} totalSpotsNumber Should Contain ${second_parking_payload} location - #Client queries all entities with type OffstreetParking in D and E. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_D_url} + #Client queries all entities with type OffStreetParking in D and E. + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity1}= Get From Dictionary ${payload} OffstreetParking:2 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_E_url} + ${expected_entity1}= Get From Dictionary ${payload} OffStreetParking:2 + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_E_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffstreetParking:1 - ${expected_entity3}= Get From Dictionary ${payload} OffstreetParking:2 + ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 + ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:2 #Client checks that the attributes of the entities in A are the same as the ones in D and E. Should Be Equal ${first_parking_payload}[location] ${expected_entity2}[location] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index d0a6fbbb..cd3b1024 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -30,26 +30,26 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_7_2 6_23_2_1 - #Client queries all entities with type OffstreetParking in A and checks for a successful response. - ${response}= Query Entities Via POST entity_types=OffstreetParking broker_url=${broker_A_url} + #Client queries all entities with type OffStreetParking in A and checks for a successful response. + ${response}= Query Entities Via POST entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffstreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffstreetParking:2 + ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 + ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 Should Contain ${first_parking_payload} location Should Contain ${second_parking_payload} availableSpotsNumber Should Contain ${second_parking_payload} totalSpotsNumber Should Contain ${second_parking_payload} location - #Client queries all entities with type OffstreetParking in D and E. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_D_url} + #Client queries all entities with type OffStreetParking in D and E. + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity1}= Get From Dictionary ${payload} OffstreetParking:2 - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_E_url} + ${expected_entity1}= Get From Dictionary ${payload} OffStreetParking:2 + ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_E_url} context=${ngsild_test_suite_context} ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffstreetParking:1 - ${expected_entity3}= Get From Dictionary ${payload} OffstreetParking:2 + ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 + ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:2 #Client checks that the attributes of the entities in A are the same as the ones in D and E. Should Be Equal ${first_parking_payload}[location] ${expected_entity2}[location] diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld index 4f835c57..58c4d473 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld @@ -18,5 +18,5 @@ "endpoint": "xxx", "@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/interoperability/offstreet-parking1-full.jsonld b/data/entities/interoperability/offstreet-parking1-full.jsonld index c35bf599..998bf94c 100644 --- a/data/entities/interoperability/offstreet-parking1-full.jsonld +++ b/data/entities/interoperability/offstreet-parking1-full.jsonld @@ -29,17 +29,6 @@ } }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/interoperability/offstreet-parking2-full.jsonld b/data/entities/interoperability/offstreet-parking2-full.jsonld index 0708f5e7..d3efac75 100644 --- a/data/entities/interoperability/offstreet-parking2-full.jsonld +++ b/data/entities/interoperability/offstreet-parking2-full.jsonld @@ -28,18 +28,7 @@ ] } }, - "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "@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/interoperability/offstreet-parking2-location-and-name.jsonld b/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld index b707bf73..59449061 100644 --- a/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld +++ b/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld @@ -17,17 +17,6 @@ } }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld b/data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld index 0e04c702..dba4633c 100644 --- a/data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +++ b/data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld @@ -15,17 +15,6 @@ } }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] } \ No newline at end of file diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 639259e2..14237dbc 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -34,7 +34,8 @@ Prepare Context Source Registration From File ... ${broker_url}=${EMPTY} ... ${operations}=[] ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} - ${final_context_source_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${context_source_url} + ${final_context_source_url}= Set Variable If '${endpoint}' != '' ${endpoint} ${context_source_url} + ${registration_payload}= Update Value To JSON ... ${payload} ... $.id @@ -42,7 +43,7 @@ Prepare Context Source Registration From File ${registration_payload}= Update Value To JSON ... ${registration_payload} ... $..endpoint - ... ${final_context_source_url}${endpoint} + ... ${final_context_source_url} IF '${entity_id}' != '' ${dict}= Create Dictionary id=${entity_id} ${registration_payload}= Add Object To JSON diff --git a/resources/IOPUtils/InteroperabilityUtils.resource b/resources/IOPUtils/InteroperabilityUtils.resource index c2fa4613..35e1abb0 100644 --- a/resources/IOPUtils/InteroperabilityUtils.resource +++ b/resources/IOPUtils/InteroperabilityUtils.resource @@ -17,7 +17,7 @@ Compose IOP Configuration ${entity_id}= Get From List ${sets}[${i}] 0 ${registration_filename}= Get From List ${sets}[${i}] 1 ${mode}= Get From List ${sets}[${i}] 2 - ${broker_url}= Get From List ${sets}[${i}] 3 + ${endpoint}= Get From List ${sets}[${i}] 3 ${registration_broker_url}= Get From List ${sets}[${i}] 4 ${registration_id${i+1}}= Generate Random CSR Id Set Suite Variable ${registration_id${i+1}} @@ -28,7 +28,7 @@ Compose IOP Configuration ... ${registration_filename} ... entity_id=${entity_id} ... mode=${mode} - ... broker_url=${broker_url} + ... endpoint=${endpoint} ${response}= Create Context Source Registration With Return ... ${registration_payload} ... content_type=${CONTENT_TYPE_LD_JSON} @@ -43,7 +43,7 @@ Delete Registrations And Entities ${len_brokers}= Get Length ${brokers_url} ${len_entities}= Get Length ${entities} FOR ${i} IN RANGE ${len_brokers}-1 - Delete Context Source Registration With Return ${registration_id${i+1}} broker_url=${registration_broker_url${i+1}} + Delete Context Source Registration With Return ${registration_id${i+1}} broker_url=${broker_A_url} END FOR ${i} IN RANGE ${len_entities}-1 Delete Entity ${entities}[${i}] -- GitLab From 1c5ac09a702c7aa50f4fb5ef0e53f11fef75e799 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Tue, 21 Jul 2026 14:26:38 +0200 Subject: [PATCH 03/34] fix: change Test Setup to Suite Setup --- .../Provision/Entities/CreateEntity/D001_01_inc.robot | 7 +++---- .../Provision/Entities/CreateEntity/D001_01_red.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_02_exc.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_02_inc.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_03_01_inc.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_03_02_inc.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_03_03_inc.robot | 4 ++-- .../Provision/Entities/CreateEntity/D001_04_inc.robot | 2 +- 8 files changed, 16 insertions(+), 17 deletions(-) diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_inc.robot index 417c8efd..1a40aeaa 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 @@ -10,13 +10,13 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -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 +Suite Setup Setup Entity Id And Registration And Start Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** ${entity_payload_filename} vehicle-simple-attributes.jsonld -${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld +${registration_payload_file_path} csourceRegistrations/context-source-registration-vehicle-complete.jsonld *** Test Cases *** @@ -27,7 +27,6 @@ D001_01_inc Create Entity On Both Context Broker And Context Source ${response}= Create Entity ${entity_payload_filename} ${entity_id} Check Response Status Code 201 ${response.status_code} - Wait for redirected request ${request_payload}= Get Request Body ${payload_list}= Evaluate [json.loads('''${request_payload}''')] json @{entities_id}= Create List ${entity_id} diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_red.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_red.robot index 9248dee7..1d06b236 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_red.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_01_red.robot @@ -9,8 +9,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Entity Id And Registration And Start Context Source Mock Server -Test Teardown Delete Registrations And Stop Context Source Mock Server +Suite Setup Setup Entity Id And Registration And Start Context Source Mock Server +Suite Teardown Delete Registrations And Stop Context Source Mock Server *** Variables *** diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_exc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_exc.robot index 4fa7d476..1031429a 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_exc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_02_exc.robot @@ -10,8 +10,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource Resource ${EXECDIR}/resources/AssertionUtils.resource -Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Suite Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** 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 f20069db..b92c653e 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 @@ -10,8 +10,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Registration And Start Context Source Mock Server -Test Teardown Delete Created Registration And Stop Context Source Mock Server +Suite Setup Setup Registration And Start Context Source Mock Server +Suite Teardown Delete Created Registration And Stop Context Source Mock Server *** Variables *** 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 9da66a89..754b8db7 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 @@ -10,8 +10,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Suite Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** 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 6c789117..bf6b446c 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 @@ -10,8 +10,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Suite Setup Create Entity And Registration On The Context Broker And Start Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** 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 f900e4a6..908afc5e 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 @@ -10,8 +10,8 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource -Test Setup Setup Registration And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Suite Setup Setup Registration And Start Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** diff --git a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot index 34671dcd..985bdc07 100644 --- a/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot +++ b/TP/NGSI-LD/DistributedOperations/Provision/Entities/CreateEntity/D001_04_inc.robot @@ -11,7 +11,7 @@ Resource ${EXECDIR}/resources/JsonUtils.resource Resource ${EXECDIR}/resources/MockServerUtils.resource Suite Setup Setup Entity Id And Registration And Start Context Source Mock Server -Test Teardown Delete Created Entity And Registration And Stop Context Source Mock Server +Suite Teardown Delete Created Entity And Registration And Stop Context Source Mock Server *** Variables *** -- GitLab From 2ad92d1ee78d880c7da41413e722f6bef0f4e1a2 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 21 Jul 2026 16:59:22 +0200 Subject: [PATCH 04/34] feat: adds expectation files for test 003 01 01, also fix test logic and remove redundant query operations --- .../Entity/QueryEntities/IOP_003_01_01.robot | 56 ++++++------------- ...ext-source-registration-exclusive-1.jsonld | 6 +- .../query-entity-IOP-003-01-01-first.json | 28 ++++++++++ .../query-entity-IOP-003-01-01-second.json | 21 +++++++ resources/AssertionUtils.resource | 19 +++++++ 5 files changed, 90 insertions(+), 40 deletions(-) create mode 100644 data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json create mode 100644 data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 40c774ea..0547bbc5 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -11,8 +11,10 @@ Test Teardown Delete Entities and Delete Registrations ${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld ${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld ${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json +${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json ${broker_A_url} ${broker_B_url} ${broker_C_url} @@ -24,38 +26,24 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_2 6_4_3_1 #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} location + ${response_a}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_a.status_code} - #Agent queries all entities with type OffStreetParking in B and C - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} - @{first_expected_payload}= Set Variable ${response.json()} - ${entity_ids}= Create List ${entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} - @{second_expected_payload}= Set Variable ${response.json()} - Check Response Body Containing Entities URIS set to ${entity_id} ${response.json()} + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response_a.json()} #Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C. - Should Be Equal ${response.json()} ${first_expected_payload} - Should Contain ${response.json()} ${second_expected_payload} + Check Response Body Containing Entity element by id ${first_expected_payload_file_path} ${first_entity_id} ${response_a.json()} + Check Response Body Containing Entity element by id ${second_expected_payload_file_path} ${second_entity_id} ${response_a.json()} *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${second_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${first_entity_payload_filename} - ... ${entity_id} + ... ${first_entity_id} ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} @@ -67,12 +55,12 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${second_entity_payload_filename} - ... ${entity_id} + ... ${second_entity_id} ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} @@ -80,25 +68,17 @@ Setup Initial Context Source Registrations @{second_set}= Create List ... ${second_entity_id} - ... ${inclusive_registration_payload_file_path} - ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} - - @{third_set}= Create List - ... ${entity_id} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_C_url} ... ${broker_A_url} - @{first_configuration}= Create List ${first_set} ${second_set} ${third_set} + @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations Delete Context Source Registration With Return ${registration_id1} broker_url=${broker_A_url} Delete Context Source Registration With Return ${registration_id2} broker_url=${broker_A_url} - Delete Context Source Registration With Return ${registration_id3} broker_url=${broker_A_url} - Delete Entity ${entity_id} broker_url=${broker_B_url} + Delete Entity ${first_entity_id} broker_url=${broker_B_url} Delete Entity ${second_entity_id} broker_url=${broker_B_url} - Delete Entity ${entity_id} broker_url=${broker_C_url} \ No newline at end of file + Delete Entity ${second_entity_id} broker_url=${broker_C_url} \ No newline at end of file diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index f11d58de..6e2c8c18 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -5,11 +5,13 @@ { "entities": [ { - "id": "urn:ngsi-ld:OffStreetParking:2" + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking" } ], "propertyNames": [ - "totalSpotsNumber" + "totalSpotsNumber", + "availableSpotsNumber" ] } ], diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json new file mode 100644 index 00000000..08c7d47a --- /dev/null +++ b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json @@ -0,0 +1,28 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:1", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown One" + }, + "availableSpotsNumber": { + "type": "Property", + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "reliability": { + "type": "Property", + "value": 0.7 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 200 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.5, 41.2] + } + } +} diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json new file mode 100644 index 00000000..06376a23 --- /dev/null +++ b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown Two" + }, + "availableSpotsNumber": { + "type": "Property", + "value": 92, + "observedAt": "2017-07-30T12:10:02Z", + "reliability": { + "type": "Property", + "value": 0.56 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 150 + } +} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 629f8ee3..4c211e35 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -173,6 +173,25 @@ Check Response Body Containing Entity element ... ${ignore_core_context_version} Should Be Empty ${comparison_result} msg=${comparison_result.pretty()} +Check Response Body Containing Entity element by id + [Arguments] ${expectation_filename} ${entity_id} ${response_body} ${ignore_core_context_version}=False + ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/expectations/${expectation_filename} + IF isinstance($response_body, list) + ${filtered_response_body}= Evaluate next((entity for entity in $response_body if entity["id"] == "${entity_id}"), None) + IF $filtered_response_body is None + Fail Entity with id ${entity_id} not found in response body + END + ELSE + Should Be Equal ${response_body}[id] ${entity_id} + ${filtered_response_body}= Set Variable ${response_body} + END + + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${filtered_response_body} + ... ${ignore_core_context_version} + Check Response Body Containing List Containing Entity Elements [Arguments] ... ${expectation_filename} -- GitLab From 5bc87746b8e491c03f710cf01beab974d4fe28c1 Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Wed, 22 Jul 2026 09:50:16 +0200 Subject: [PATCH 05/34] feat: reworked IOP --- .../Entity/QueryEntities/IOP_003_01_01.robot | 57 ++++-- .../Entity/QueryEntities/IOP_003_01_02.robot | 107 +++++----- .../Entity/QueryEntities/IOP_003_02_01.robot | 153 +++++++-------- .../Entity/QueryEntities/IOP_003_02_02.robot | 183 +++++++++++------- .../Entity/QueryEntities/IOP_003_03_01.robot | 106 +++++----- .../Entity/QueryEntities/IOP_003_03_02.robot | 177 +++++++++-------- .../Entity/QueryEntities/IOP_003_04_01.robot | 152 +++++++++------ .../Entity/QueryEntities/IOP_003_04_02.robot | 154 +++++++++------ .../Entity/RetrieveEntity/IOP_002_01_01.robot | 60 +++--- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 47 +++-- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 74 +++---- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 69 ++++--- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 78 ++++---- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 70 ++++--- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 100 ++++++---- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 123 +++++++----- .../CreateEntity/IOP_001_01_01.robot | 69 ++++--- .../CreateEntity/IOP_001_01_02.robot | 74 ++++--- .../CreateEntity/IOP_001_02_01.robot | 89 +++++---- .../CreateEntity/IOP_001_02_02.robot | 77 +++++--- .../CreateEntity/IOP_001_03_01.robot | 81 ++++---- .../CreateEntity/IOP_001_03_02.robot | 68 ++++--- .../CreateEntity/IOP_001_04_01.robot | 120 ++++++++---- .../CreateEntity/IOP_001_04_02.robot | 126 ++++++++---- ...ext-source-registration-exclusive-1.jsonld | 6 +- ...ext-source-registration-exclusive-2.jsonld | 3 +- ...ext-source-registration-exclusive-3.jsonld | 2 +- ...ext-source-registration-inclusive-1.jsonld | 3 +- ...ext-source-registration-inclusive-2.jsonld | 3 +- ...ext-source-registration-inclusive-3.jsonld | 2 +- ...text-source-registration-redirect-1.jsonld | 3 +- ...text-source-registration-redirect-2.jsonld | 3 +- ...text-source-registration-redirect-3.jsonld | 2 +- ...text-source-registration-redirect-4.jsonld | 2 +- .../create-entity-IOP-001-01-01-b.json | 17 ++ .../create-entity-IOP-001-01-02-a.json | 21 ++ .../create-entity-IOP-001-01-02-b.json | 17 ++ .../create-entity-IOP-001-01-02-c.json | 11 ++ .../query-entity-IOP-003-01-01-second.json | 7 + .../retrieve-entity-IOP-002-01-02.json | 28 +++ ...ffstreet-parking1-location-and-name.jsonld | 21 +- .../offstreet-parking1-no-location.jsonld | 15 +- ...ffstreet-parking2-location-and-name.jsonld | 8 +- .../offstreet-parking2-no-location.jsonld | 15 +- .../interoperability/vehicle1-full.jsonld | 17 +- .../interoperability/vehicle2-full.jsonld | 15 +- .../IOPUtils/InteroperabilityUtils.resource | 27 ++- 47 files changed, 1578 insertions(+), 1084 deletions(-) create mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json create mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json create mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json create mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json create mode 100644 data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 0547bbc5..7412ce50 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -7,34 +7,55 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json -${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json -${broker_A_url} -${broker_B_url} -${broker_C_url} +${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json +${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_2 6_4_3_1 + ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 - #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. - ${response_a}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + # Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + ${response_a}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response_a.status_code} ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${entity_ids} ${response_a.json()} - #Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C. - Check Response Body Containing Entity element by id ${first_expected_payload_file_path} ${first_entity_id} ${response_a.json()} - Check Response Body Containing Entity element by id ${second_expected_payload_file_path} ${second_entity_id} ${response_a.json()} + # Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C. + Check Response Body Containing Entity element by id + ... ${first_expected_payload_file_path} + ... ${first_entity_id} + ... ${response_a.json()} + Check Response Body Containing Entity element by id + ... ${second_expected_payload_file_path} + ... ${second_entity_id} + ... ${response_a.json()} + *** Keywords *** Setup Initial Context Source Registrations @@ -81,4 +102,4 @@ Delete Entities And Delete Registrations Delete Context Source Registration With Return ${registration_id2} broker_url=${broker_A_url} Delete Entity ${first_entity_id} broker_url=${broker_B_url} Delete Entity ${second_entity_id} broker_url=${broker_B_url} - Delete Entity ${second_entity_id} broker_url=${broker_C_url} \ No newline at end of file + Delete Entity ${second_entity_id} broker_url=${broker_C_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index 66072d3d..474931ed 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -7,56 +7,66 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${third_entity_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} +${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json +${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_2 6_23_2_1 - - #Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. - @{entities}= Create List ${entity_id} ${second_entity_id} - ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_A_url} context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} location - - #Agent queries all entities with type OffStreetParking in B and C - ${response}= Query Entities Via POST entities=${entities} broker_url=${broker_B_url} context=${ngsild_test_suite_context} - @{first_expected_payload}= Set Variable ${response.json()} - Check Response Body Containing Entities URIS set to ${entities} ${response.json()} - - ${response}= Query Entities Via POST entities=${entity_id} broker_url=${broker_C_url} context=${ngsild_test_suite_context} - @{second_expected_payload}= Set Variable ${response.json()} - Check Response Body Containing Entities URIS set to ${entity_id} ${response.json()} - - #Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C. - Should Be Equal ${response.json()} ${first_expected_payload} - Should Contain ${response.json()} ${first_expected_payload} - Should Contain ${response.json()} ${second_expected_payload} + ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_2 + ... 6_23_2_1 + + # Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + &{entity_selector}= Create Dictionary type=OffStreetParking + @{entities}= Create List ${entity_selector} + ${response_a}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_a.status_code} + + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response_a.json()} + + # Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C. + Check Response Body Containing Entity element by id + ... ${first_expected_payload_file_path} + ... ${first_entity_id} + ... ${response_a.json()} + Check Response Body Containing Entity element by id + ... ${second_expected_payload_file_path} + ... ${second_entity_id} + ... ${response_a.json()} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${second_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_entity_id} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${first_entity_payload_filename} - ... ${entity_id} + ... ${first_entity_id} ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} @@ -68,35 +78,28 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${second_entity_payload_filename} - ... ${entity_id} + ... ${second_entity_id} ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${second_entity_id} - ... ${inclusive_registration_payload_file_path} - ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} - - @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_C_url} ... ${broker_A_url} - @{first_configuration}= Create List ${first_set} ${second_set} ${third_set} + @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} - @{entities_to_delete}= Create List ${entity_id} ${second_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index 683e54f7..bfa3c6e7 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -7,116 +7,117 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_entity_no_location_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${second_entity_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld +${first_entity_no_location_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${second_entity_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld +${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET [Documentation] Pre-conditions: no user context. Data on every broker. B contains OffStreetParking:1 without location and OffStreetParking:2 without location. C contains OffStreetParking:1 and OffStreetParking:2. D contains OffStreetParking:2 with location and name only. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 - - #Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute. - ${response}= Query Entities entity_types=OffstreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + + # Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute. + ${response}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - @{entities_A}= Set Variable ${response.json()} - ${first_payload}= Get From List ${entities_A} 0 - ${second_payload}= Get From List ${entities_A} 1 - Should Not Contain ${first_payload} name - Should Not Contain ${second_payload} name - - #Agent queries all entities with type OffstreetParking in B, C and D - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} - @{entities_B}= Set Variable ${response.json()} - ${first_B_payload}= Get From List ${entities_B} 0 - ${second_B_payload}= Get From List ${entities_B} 1 - - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} - @{entities_C}= Set Variable ${response.json()} - ${C_payload}= Get From List ${entities_C} 0 - - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} - @{entities_D}= Set Variable ${response.json()} - ${D_payload}= Get From List ${entities_D} 0 - - #Agent checks that OffStreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffStreetParking:2 entity in A contains the attributes of both OffStreetParking:2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D. - Should Be Equal ${first_payload}[availableSpotsNumber] ${first_b2_payload}[availableSpotsNumber] - Should Be Equal ${first_payload}[totalSpotsNumber] ${first_b2_payload}[totalSpotsNumber] - Should Be Equal ${first_payload}[location] ${b3_payload}[location] - - Should Be Equal ${second_payload}[availableSpotsNumber] ${second_B_payload}[availableSpotsNumber] - Should Be Equal ${second_payload}[totalSpotsNumber] ${second_B_payload}[totalSpotsNumber] - Should Be Equal ${second_payload}[location] ${D_payload}[location] + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + + ${first_expected}= Load Entity ${first_entity_no_location_payload_filename} ${first_entity_id} + ${first_location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${first_expected} @context name + Set To Dictionary ${first_expected} location=${first_location_source}[location] + ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] + Should Be Equal ${first_entity}[0] ${first_expected} + + ${second_expected}= Load Entity ${second_entity_no_location_payload_filename} ${second_entity_id} + ${second_location_source}= Load Entity ${location_name_payload_filename} ${second_entity_id} + Remove From Dictionary ${second_expected} @context name + Set To Dictionary ${second_expected} location=${second_location_source}[location] + ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] + Should Be Equal ${second_entity}[0] ${second_expected} + *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${second_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_entity_id} - - ${response}= Create Entity ${first_entity_no_location_payload_filename} ${entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${first_entity_no_location_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_entity_no_location_payload_filename} ${second_entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${second_entity_no_location_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${first_full_entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_entity_payload_filename} ${second_entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${second_full_entity_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${location_name_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${location_name_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${second_entity_id} - ... ${inclusive_registration_payload_file_path} - ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} - - @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} - @{fourth_set}= Create List - ... ${entity_id} - ... ${first_redirect_registration_payload_file_path} - ... redirect - ... ${broker_C_url} - ... ${broker_A_url} - - @{fifth_set}= Create List - ... ${entity_id} + @{third_set}= Create List + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_A_url} - @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${entity_id} ${second_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 8fe2a6d3..55e921ed 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -7,124 +7,165 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld -${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld -${first_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${third_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld +${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld +${first_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld +${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +${third_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** -IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle with attrs +IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and Vehicle:1. C contains OffStreetParking:1 with location and name only and OffStreetParking:2. D contains OffStreetParking:2 with location and name only and Vehicle:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 - - #Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities. - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + + # Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities. + ${response}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${parking1_payload}= Get From Dictionary ${payload} ${first_parking_entity_id} - ${parking2_payload}= Get From Dictionary ${payload} ${second_parking_entity_id} - ${vehicle1_payload}= Get From Dictionary ${payload} ${first_vehicle_entity_id} - ${vehicle2_payload}= Get From Dictionary ${payload} ${second_vehicle_entity_id} - Should Contain ${parking1_payload} location - Should Contain ${parking2_payload} location - Should Contain ${vehicle1_payload} location - Should Contain ${vehicle2_payload} location - - #Client queries all entities with type OffstreetParking and Vehicle in B, C and D. - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_B_url} context=${ngsild_test_suite_context} - &{first_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_C_url} context=${ngsild_test_suite_context} - &{second_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_D_url} context=${ngsild_test_suite_context} - &{third_expected_payload}= Evaluate {i['id']: i for i in ${response.json()}} - - #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. - ${expected_vehicle1}= Get From Dictionary ${first_expected_payload} ${first_vehicle_entity_id} - ${expected_parking1}= Get From Dictionary ${second_expected_payload} ${first_parking_entity_id} - ${expected_vehicle2}= Get From Dictionary ${third_expected_payload} ${second_vehicle_entity_id} - ${expected_parking2}= Get From Dictionary ${third_expected_payload} ${second_parking_entity_id} - Should Be Equal ${vehicle1_payload} ${expected_vehicle1} - Should Be Equal ${parking1_payload} ${expected_parking1} - Should Be Equal ${vehicle2_payload} ${expected_vehicle2} - Should Be Equal ${parking2_payload} ${expected_parking2} + ${entity_ids}= Create List + ... ${first_parking_entity_id} + ... ${second_parking_entity_id} + ... ${first_vehicle_entity_id} + ... ${second_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + + ${first_parking_expected}= Load Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_parking_entity_id} + Keep In Dictionary ${first_parking_expected} id type location + ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] + Should Be Equal ${first_parking}[0] ${first_parking_expected} + + ${second_parking_expected}= Load Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_parking_entity_id} + Keep In Dictionary ${second_parking_expected} id type location + ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] + Should Be Equal ${second_parking}[0] ${second_parking_expected} + + ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} + Keep In Dictionary ${first_vehicle_expected} id type location + ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] + Should Be Equal ${first_vehicle}[0] ${first_vehicle_expected} + + ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} + Keep In Dictionary ${second_vehicle_expected} id type location + ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] + Should Be Equal ${second_vehicle}[0] ${second_vehicle_expected} + *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${first_parking_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_parking_entity_id} urn:ngsi-ld:OffStreetParking:2 + Set Test Variable ${first_vehicle_entity_id} urn:ngsi-ld:Vehicle:1 + Set Test Variable ${second_vehicle_entity_id} urn:ngsi-ld:Vehicle:2 - ${first_parking_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${first_parking_entity_id} - ${second_parking_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_parking_entity_id} - ${first_vehicle_entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${first_vehicle_entity_id} - ${second_vehicle_entity_id}= Generate Random Vehicle Entity Id - Set Suite Variable ${second_vehicle_entity_id} - - ${response}= Create Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${first_vehicle_payload_filename} + ... ${first_vehicle_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_offstreet_payload_filename} ${first_parking_entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${first_offstreet_payload_filename} + ... ${first_parking_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_parking_location_name_payload_filename} ${first_parking_entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_parking_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_offstreet_payload_filename} ${second_parking_entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${second_offstreet_payload_filename} + ... ${second_parking_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_parking_location_name_payload_filename} ${second_parking_entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_parking_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_vehicle_payload_filename} + ... ${second_vehicle_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${first_parking_entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${first_vehicle_entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{third_set}= Create List - ... ${first_parking_entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} @{fourth_set}= Create List - ... ${second_parking_entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${second_vehicle_entity_id} + ... ${EMPTY} ... ${third_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_A_url} - @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + @{second_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${first_parking_entity_id} ${second_parking_entity_id} ${first_vehicle_entity_id} ${second_vehicle_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List + ... ${first_parking_entity_id} + ... ${second_parking_entity_id} + ... ${first_vehicle_entity_id} + ... ${second_vehicle_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 4b2b1e35..efb74411 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -7,81 +7,93 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${offstreet_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld -${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${offstreet_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld +${first_offstreet_no_location_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:2 without location. C contains OffStreetParking:1. D contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_2 6_4_3_1 - - #Client queries all entities with type OffstreetParking in A and checks for a successful response. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + + # Client queries all entities with type OffstreetParking in A and checks for a successful response. + ${response}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 + ${first_expected}= Load Entity ${first_full_offstreet_payload_filename} ${first_entity_id} + Remove From Dictionary ${first_expected} @context + ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] + Should Be Equal ${first_entity}[0] ${first_expected} - #Client queries all entities with type OffstreetParking in B, C and D. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_B_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking1}= Get From Dictionary ${payload} OffStreetParking:2 + ${second_expected}= Load Entity ${offstreet_no_location_payload_filename} ${second_entity_id} + Remove From Dictionary ${second_expected} @context + ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] + Should Be Equal ${second_entity}[0] ${second_expected} - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_C_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking2}= Get From Dictionary ${payload} OffStreetParking:1 - - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_parking3}= Get From Dictionary ${payload} OffStreetParking:2 - - #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. - Should Be Equal ${first_parking_payload}[name] ${expected_parking2}[name] - Should Be Equal ${first_parking_payload}[location] ${expected_parking2}[location] - Should Be Equal ${second_parking_payload}[availableSpotsNumber] ${expected_parking3}[availableSpotsNumber] - Should Be Equal ${second_parking_payload}[totalSpotsNumber] ${expected_parking3}[totalSpotsNumber] - Should Not Be Equal ${second_parking_payload}[availableSpotsNumber] ${expected_parking1}[availableSpotsNumber] *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - - ${response}= Create Entity ${offstreet_no_location_payload_filename} ${entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${offstreet_no_location_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_offstreet_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${first_full_offstreet_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_offstreet_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${first_offstreet_no_location_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} @@ -92,5 +104,5 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 3a4d373b..40432c77 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -7,120 +7,145 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld -${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld -${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld -${parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld +${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld +${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld +${parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${inclusive_vehicle_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** -IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle with attrs +IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs [Documentation] Pre-conditions: no user context. Data only on leaves. B contains Vehicle:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:1, OffStreetParking:2 and Vehicle:2. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_2 6_4_3_1 - - #Client retrieves the location property from all entities with type OffstreetParking and Vehicle in A and checks for a successful response. - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + + # Client retrieves the location property from all entities with type OffstreetParking and Vehicle in A and checks for a successful response. + ${response}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + ${entity_ids}= Create List + ... ${first_parking_entity_id} + ... ${second_parking_entity_id} + ... ${first_vehicle_entity_id} + ... ${second_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + + ${first_parking_expected}= Load Entity + ... ${parking_location_name_payload_filename} + ... ${first_parking_entity_id} + Keep In Dictionary ${first_parking_expected} id type location + ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] + Should Be Equal ${first_parking}[0] ${first_parking_expected} + + ${second_parking_expected}= Load Entity + ... ${second_full_offstreet_payload_filename} + ... ${second_parking_entity_id} + Keep In Dictionary ${second_parking_expected} id type location + ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] + Should Be Equal ${second_parking}[0] ${second_parking_expected} + + ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} + Keep In Dictionary ${first_vehicle_expected} id type location + ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] + Should Be Equal ${first_vehicle}[0] ${first_vehicle_expected} + + ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} + Keep In Dictionary ${second_vehicle_expected} id type location + ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] + Should Be Equal ${second_vehicle}[0] ${second_vehicle_expected} - &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 - ${first_vehicle}= Get From Dictionary ${payload} Vehicle:1 - Should Contain ${first_parking_payload} location - Should Contain ${second_parking_payload} location - - #Client queries all entities with type OffStreetParking and Vehicle in B, C and D. - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_B_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity1}= Get From Dictionary ${payload} Vehicle:1 - - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_C_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 - - ${response}= Query Entities entity_types=OffStreetParking,Vehicle attrs=location broker_url=${broker_D_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:1 - ${expected_entity4}= Get From Dictionary ${payload} OffStreetParking:2 - - #Client checks that the attributes of the entities in A are the same as the ones in B, C and D. - Should Be Equal ${first_parking_payload}[name] ${expected_entity2}[name] - Should Be Equal ${first_parking_payload}[location] ${expected_entity2}[location] - Should Be Equal ${first_parking_payload}[availableSpotsNumber] ${expected_entity3}[availableSpotsNumber] - Should Be Equal ${first_parking_payload}[totalSpotsNumber] ${expected_entity3}[totalSpotsNumber] - Should Be Equal ${second_parking_payload} ${expected_entity4} - Should Be Equal ${first_vehicle} ${expected_entity1} *** Keywords *** Setup Initial Context Source Registrations - - ${parking_entity_id1}= Generate Random Parking Entity Id - Set Suite Variable ${parking_entity_id1} - ${parking_entity_id2}= Generate Random Parking Entity Id - Set Suite Variable ${parking_entity_id2} - ${vehicle_entity_id1}= Generate Random Vehicle Entity Id - Set Suite Variable ${vehicle_entity_id1} - ${vehicle_entity_id2}= Generate Random Vehicle Entity Id - Set Suite Variable ${vehicle_entity_id2} - - ${response}= Create Entity ${first_vehicle_payload_filename} ${vehicle_entity_id1} broker_url=${broker_B_url} + Set Test Variable ${first_parking_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_parking_entity_id} urn:ngsi-ld:OffStreetParking:2 + Set Test Variable ${first_vehicle_entity_id} urn:ngsi-ld:Vehicle:1 + Set Test Variable ${second_vehicle_entity_id} urn:ngsi-ld:Vehicle:2 + + ${response}= Create Entity + ... ${first_vehicle_payload_filename} + ... ${first_vehicle_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${parking_location_name_payload_filename} ${parking_entity_id1} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${parking_location_name_payload_filename} + ... ${first_parking_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_offstreet_payload_filename} ${parking_entity_id1} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${first_full_offstreet_payload_filename} + ... ${first_parking_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_offstreet_payload_filename} ${parking_entity_id2} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_offstreet_payload_filename} + ... ${second_parking_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_vehicle_payload_filename} ${vehicle_entity_id2} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_vehicle_payload_filename} + ... ${second_vehicle_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${vehicle_entity_id1} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${parking_entity_id1} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${vehicle_entity_id2} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} ... ${broker_A_url} @{fourth_set}= Create List - ... ${parking_entity_id1} - ... ${inclusive_registration_payload_file_path} - ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} - - @{fifth_set}= Create List - ... ${parking_entity_id2} - ... ${inclusive_registration_payload_file_path} + ... ${EMPTY} + ... ${inclusive_vehicle_registration_payload_file_path} ... inclusive ... ${broker_D_url} ... ${broker_A_url} - - @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + + @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${vehicle_entity_id1} ${vehicle_entity_id2} ${parking_entity_id1} ${parking_entity_id2} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List + ... ${first_vehicle_entity_id} + ... ${second_vehicle_entity_id} + ... ${first_parking_entity_id} + ... ${second_parking_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 982e34d1..3d0323cd 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -7,119 +7,149 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld +${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 with location and name only and OffStreetParking:2. E contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_7_2 6_4_3_1 - - #Client queries all entities with type OffStreetParking in A and checks for a successful response. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + + # Client queries all entities with type OffStreetParking in A and checks for a successful response. + ${response}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + + ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Keep In Dictionary ${first_expected} id type location + ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] + Should Be Equal ${first_entity}[0] ${first_expected} + + ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + ${second_location_source}= Load Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_entity_id} + Set To Dictionary ${second_expected} location=${second_location_source}[location] + Remove From Dictionary ${second_expected} @context + ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] + Should Be Equal ${second_entity}[0] ${second_expected} - &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 - Should Contain ${first_parking_payload} location - Should Contain ${second_parking_payload} availableSpotsNumber - Should Contain ${second_parking_payload} totalSpotsNumber - Should Contain ${second_parking_payload} location - - #Client queries all entities with type OffStreetParking in D and E. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity1}= Get From Dictionary ${payload} OffStreetParking:2 - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_E_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 - ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:2 - - #Client checks that the attributes of the entities in A are the same as the ones in D and E. - Should Be Equal ${first_parking_payload}[location] ${expected_entity2}[location] - Should Be Equal ${second_parking_payload}[availableSpotsNumber] ${expected_entity1}[availableSpotsNumber] - Should Be Equal ${second_parking_payload}[totalSpotsNumber] ${expected_entity1}[totalSpotsNumber] - Should Be Equal ${second_parking_payload}[location] ${expected_entity3}[location] *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${second_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_entity_id} - - ${response}= Create Entity ${first_parking_location_name_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_parking_payload_filename} ${second_entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_parking_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_parking_payload_filename} ${entity_id} broker_url=${broker_E_url} + ${response}= Create Entity + ... ${first_full_parking_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_parking_location_name_payload_filename} ${second_entity_id} broker_url=${broker_E_url} + ${response}= Create Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${second_entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${second_entity_id} + ... ${EMPTY} ... ${first_exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} @{sixth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} ${sixth_set} + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} + ... ${sixth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} - @{entities_to_delete}= Create List ${entity_id} ${second_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index cd3b1024..22514b66 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -7,119 +7,151 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld +${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 with location and name only and OffStreetParking:2. E contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_7_2 6_23_2_1 - - #Client queries all entities with type OffStreetParking in A and checks for a successful response. - ${response}= Query Entities Via POST entity_types=OffStreetParking broker_url=${broker_A_url} context=${ngsild_test_suite_context} + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_23_2_1 + + # Client queries all entities with type OffStreetParking in A and checks for a successful response. + &{entity_selector}= Create Dictionary type=OffStreetParking + @{entities}= Create List ${entity_selector} + ${response}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + + ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Keep In Dictionary ${first_expected} id type location + ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] + Should Be Equal ${first_entity}[0] ${first_expected} + + ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + ${second_location_source}= Load Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_entity_id} + Set To Dictionary ${second_expected} location=${second_location_source}[location] + Remove From Dictionary ${second_expected} @context + ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] + Should Be Equal ${second_entity}[0] ${second_expected} - &{payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${first_parking_payload}= Get From Dictionary ${payload} OffStreetParking:1 - ${second_parking_payload}= Get From Dictionary ${payload} OffStreetParking:2 - Should Contain ${first_parking_payload} location - Should Contain ${second_parking_payload} availableSpotsNumber - Should Contain ${second_parking_payload} totalSpotsNumber - Should Contain ${second_parking_payload} location - - #Client queries all entities with type OffStreetParking in D and E. - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_D_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity1}= Get From Dictionary ${payload} OffStreetParking:2 - ${response}= Query Entities entity_types=OffStreetParking broker_url=${broker_E_url} context=${ngsild_test_suite_context} - ${payload}= Evaluate {i['id']: i for i in ${response.json()}} - ${expected_entity2}= Get From Dictionary ${payload} OffStreetParking:1 - ${expected_entity3}= Get From Dictionary ${payload} OffStreetParking:2 - - #Client checks that the attributes of the entities in A are the same as the ones in D and E. - Should Be Equal ${first_parking_payload}[location] ${expected_entity2}[location] - Should Be Equal ${second_parking_payload}[availableSpotsNumber] ${expected_entity1}[availableSpotsNumber] - Should Be Equal ${second_parking_payload}[totalSpotsNumber] ${expected_entity1}[totalSpotsNumber] - Should Be Equal ${second_parking_payload}[location] ${expected_entity3}[location] *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${second_entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${second_entity_id} - - ${response}= Create Entity ${first_parking_location_name_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_parking_payload_filename} ${second_entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_parking_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_parking_payload_filename} ${entity_id} broker_url=${broker_E_url} + ${response}= Create Entity + ... ${first_full_parking_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_parking_location_name_payload_filename} ${second_entity_id} broker_url=${broker_E_url} + ${response}= Create Entity + ... ${second_parking_location_name_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${second_entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${second_entity_id} + ... ${EMPTY} ... ${first_exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} @{sixth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} ${sixth_set} + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} + ... ${sixth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} - @{entities_to_delete}= Create List ${entity_id} ${second_entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index d207b35e..2dcc26ba 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -7,70 +7,68 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} +${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_002_01_01 Retrieve OffStreetParking:1 [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a successful response. - ${response}= Retrieve Entity ${entity_id1} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a successful response. + ${response}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber + Check Response Body Containing Entity element by id + ... ${expected_payload_file_path} + ... ${first_entity_id} + ... ${response.json()} - #Client retrieves OffStreetParking:1 in B. - ${expected_payload}= Load Entity ${first_entity_payload_filename} ${entity_id1} - ${response}= Retrieve Entity ${entity_id1} broker_url=${broker_B_url} - Check Response Status Code 200 ${response.status_code} - - #Client checks that the entity returned is the full entity. - Should Be Equal ${response.json()} ${expected_payload} *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id1}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id1} - ${entity_id2}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id2} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${first_entity_payload_filename} - ... ${entity_id1} + ... ${first_entity_id} ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} - ... ${entity_id2} + ... ${second_entity_id} ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} - ... ${entity_id2} + ... ${second_entity_id} ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id1} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id2} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_C_url} @@ -81,5 +79,5 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} - @{entities_to_delete}= Create List ${entity_id1} ${entity_id2} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index e157b91d..c9bf2de8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -7,42 +7,39 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} +${entity_payload_filename} interoperability/offstreet-parking2-no-location.jsonld +${full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${expected_payload_file_path} interoperability/retrieve-entity-IOP-002-01-02.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_002_01_02 Retrieve OffStreetParking:2 [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:2 without location. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 - #Client retrieves OffStreetParking:2 in A and checks for a successful response. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:2 in A and checks for a successful response. + ${response}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - - #Client retrieves OffStreetParking:2 in B and C. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_B_url} - ${first_expected_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} - ${second_expected_payload}= Set To Dictionary ${response.json()} + Check Response Body Containing Entity element by id + ... ${expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} - #Client checks that the entity returned from A has attributes from both entities in B and C. - Should Be Equal ${payload}[availableSpotNumbers][value] ${first_expected_payload}[availableSpotNumbers][value] - Should Be Equal ${payload}[totalSpotsNumber][value] ${first_expected_payload}[totalSpotsNumber][value] - Should Be Equal ${payload}[location][value] ${second_expected_payload}[location][value] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${entity_payload_filename} @@ -76,4 +73,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 980c2ace..6a61db03 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -7,69 +7,71 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_002_02_01 Retrieve OffStreetParking:1 [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 without location. C contains OffStreetParking:1. D contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should be the whole entity. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should be the whole entity. + ${response}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 207 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - Should Be Equal ${payload} ${first_full_entity_payload_filename} - - #Client retrieves OffStreetParking:1 in B and C. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_B_url} - ${first_expected_payload}= Set To Dictionary ${response.json()} + ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} + ${location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + Set To Dictionary ${expected_payload} location=${location_source}[location] + Remove From Dictionary ${expected_payload} @context + Should Be Equal ${response.json()} ${expected_payload} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} - ${second_expected_payload}= Set To Dictionary ${response.json()} - - #Client checks that the entity returned from A has attributes from the entities in B and C. - Should Be Equal ${payload}[availableSpotNumbers][value] ${first_expected_payload}[availableSpotNumbers][value] - Should Be Equal ${payload}[totalSpotsNumber][value] ${first_expected_payload}[totalSpotsNumber][value] - Should Be Equal ${payload}[location][value] ${second_expected_payload}[location][value] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_B_url} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${first_full_entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_entity_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} @@ -80,5 +82,5 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 78931e7e..beca9c81 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -7,64 +7,71 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should contain the location attribute. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should contain the location attribute. + ${response}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 207 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - Should Contain ${payload} location + ${expected_payload}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + ${location_source}= Load Entity ${entity_payload_filename} ${first_entity_id} + Set To Dictionary ${expected_payload} location=${location_source}[location] + Remove From Dictionary ${expected_payload} @context + Should Be Equal ${response.json()} ${expected_payload} - #Client retrieves OffStreetParking:1 in C with local=true. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} local=true - ${expected_payload}= Set To Dictionary ${response.json()} - - #Client checks that the location attribute in C is the same as the one in A. - Should Be Equal ${payload}[location][value] ${expected_payload}[location][value] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${first_full_entity_payload_filename} ${entity_id} broker_url=${broker_B_url} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 + ${response}= Create Entity + ... ${first_full_entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_entity_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} @@ -75,5 +82,5 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index 126791a2..ef149253 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -7,81 +7,81 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_002_03_01 Retrieve OffStreetParking:1 [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1. C contains OffStreetParking:1 without location. D contains OffStreetParking:2. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should not contain the location attribute. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should not contain the location attribute. + ${response}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 207 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - Should Not Contain ${payload} location - - #Client retrieves OffStreetParking:1 in B, C and D with the local=true flag. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} local=true - ${first_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_B_url} local=true - ${second_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} local=true - ${third_payload}= Set To Dictionary ${response.json()} + ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_payload} @context + Should Be Equal ${response.json()} ${expected_payload} - #Client checks that the entity returned from A should have the same attributes as the one in B and it should not contain the attribute location found in C. - Should Be Equal ${payload} ${first_payload} - Should Not Contain ${payload}[location] ${second_payload}[location] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 + Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${first_full_entity_payload_filename} ${entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${first_full_entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${second_full_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${second_full_entity_payload_filename} + ... ${second_entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} ... ${broker_A_url} - + @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} - @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index c3e58fc4..a00c16b5 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -7,67 +7,75 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should only contain the location attribute. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should only contain the location attribute. + ${response}= Retrieve Entity + ... ${entity_id} + ... attrs=location + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 207 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - Should Contain ${payload} location + ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_payload} id type location + Should Be Equal ${response.json()} ${expected_payload} - #Client retrieves OffStreetParking:1 in C with local=true. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} local=true - ${expected_payload}= Set To Dictionary ${response.json()} - - #Client checks that the location attribute in A is the same as the one in C. - Should Be Equal ${payload}[location][value] ${expected_payload}[location][value] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${location_name_entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${location_name_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} @@ -79,4 +87,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 47c879f0..2325b99d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -7,91 +7,111 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_002_04_01 Retrieve OffStreetParking:1 [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 without location. E contains OffStreetParking:1. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-redirect proxy-exclusive 4_3_6 5_7_1 - - #Client retrieves OffStreetParking:1 in A and checks for a successful response. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-redirect + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + + # Client retrieves OffStreetParking:1 in A and checks for a successful response. + ${response}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - - #Client retrieves OffStreetParking:1 in D and E. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_D_url} - ${first_expected_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_E_url} - ${second_expected_payload}= Set To Dictionary ${response.json()} + ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + ${location_source}= Load Entity ${full_entity_payload_filename} ${entity_id} + Set To Dictionary ${expected_payload} location=${location_source}[location] + Remove From Dictionary ${expected_payload} @context + Should Be Equal ${response.json()} ${expected_payload} - #Client checks that the entity returned from A has attributes from the entity in D and E. - Should Be Equal ${payload}[availableSpotNumbers] ${first_expected_payload}[availableSpotNumbers] - Should Be Equal ${payload}[totalSpotsNumber] ${first_expected_payload}[totalSpotsNumber] - Should Be Equal ${payload}[location] ${second_expected_payload}[location] *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 061482de..8ccd3ace 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -7,102 +7,127 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld +${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1 without location. C contains OffStreetParking:1 without location. D contains OffStreetParking:1. E contains OffStreetParking:1 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-redirect proxy-exclusive 4_3_6 5_7_1 + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-redirect + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 - #Client retrieves OffStreetParking:1 in A and checks for a successful response. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} + # Client retrieves OffStreetParking:1 in A and checks for a successful response. + ${response}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} - ${payload}= Set To Dictionary ${response.json()} - Should Contain ${payload} location - - #Client retrieves OffStreetParking:1 in B, C and E with local=true. - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_B_url} local=true - ${first_expected_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} local=true - ${second_expected_payload}= Set To Dictionary ${response.json()} - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_E_url} local=true - ${third_expected_payload}= Set To Dictionary ${response.json()} - - #Client checks that the entity returned from A should have the same attributes as the one in B, C and E. - Should Be Equal ${payload}[availableSpotsNumbers] ${first_expected_payload}[availableSpotsNumbers] - Should Be Equal ${payload}[totalSpotsNumber] ${first_expected_payload}[totalSpotsNumber] - Should Be Equal ${payload}[location] ${second_expected_payload}[location] - Should Be Equal ${payload}[name] ${third_expected_payload}[name] + ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + ${location_source}= Load Entity ${location_name_entity_payload_filename} ${entity_id} + Set To Dictionary ${expected_payload} location=${location_source}[location] + Remove From Dictionary ${expected_payload} @context + Should Be Equal ${response.json()} ${expected_payload} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_B_url} + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_B_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${no_location_entity_payload_filename} ${entity_id} broker_url=${broker_C_url} + ${response}= Create Entity + ... ${no_location_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_C_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${location_name_entity_payload_filename} ${entity_id} broker_url=${broker_E_url} + ${response}= Create Entity + ... ${location_name_entity_payload_filename} + ... ${entity_id} + ... broker_url=${broker_E_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} - - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index d61eddb2..77f8de1c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -7,57 +7,74 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} +${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${broker_a_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json +${broker_b_expected_payload_file_path} interoperability/create-entity-IOP-001-01-01-b.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_001_01_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - #Create OffStreetParking:1 in A and check for a successful response - ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} + # Create OffStreetParking:1 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - #Agent checks, with local=true, that the entity is created in A - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + # Agent checks, with local=true, that the entity is created in A + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Response Body Containing Entity element by id + ... ${broker_a_expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} - #Agent checks, with local=true, that the entity is created in B and only contains the attributes availableSpotsNumber and totalSpotsNumber - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + # Agent checks, with local=true, that the entity is created in B and only contains the attributes availableSpotsNumber and totalSpotsNumber + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber - Should Not Contain ${response.json()} name - Should Not Contain ${response.json()} location + Check Response Body Containing Entity element by id + ... ${broker_b_expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} - #Agent checks, with local=true, that the entity is not created in C - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is not created in C + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_C_url} @@ -69,4 +86,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index 8a2dabd0..fc38191f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -7,57 +7,79 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} +${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${broker_a_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-a.json +${broker_b_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-b.json +${broker_c_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-c.json +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} + *** Test Cases *** IOP_001_01_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - #Create the full entity of OffStreetParking:2 in A and check for a successful response + # Create the full entity of OffStreetParking:2 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - #Agent checks, with local=true, that the entity is created in A and does not contain the location property - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_A_url} local=true + # Agent checks, with local=true, that the entity is created in A and does not contain the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... broker_url=${broker_A_url} + ... local=true + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location + Check Response Body Containing Entity element by id + ... ${broker_a_expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} - #Agent checks, with local=true, that the entity is created in B and does not contain the location property - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_B_url} local=true + # Agent checks, with local=true, that the entity is created in B and does not contain the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... broker_url=${broker_B_url} + ... local=true + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location + Check Response Body Containing Entity element by id + ... ${broker_b_expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} - #Agent checks, with local=true, that the entity is created in C and only contains the location property - ${response}= Retrieve Entity ${entity_id} broker_url=${broker_C_url} local=true + # Agent checks, with local=true, that the entity is created in C and only contains the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... broker_url=${broker_C_url} + ... local=true + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} location - Should Not Contain ${response.json()} name - Should Not Contain ${response.json()} availableSpotsNumber - Should Not Contain ${response.json()} totalSpotsNumber + Check Response Body Containing Entity element by id + ... ${broker_c_expected_payload_file_path} + ... ${entity_id} + ... ${response.json()} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_C_url} @@ -69,4 +91,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index c35d5355..2b649188 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -7,74 +7,91 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_001_02_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - #The agent creates the full entity of OffStreetParking:1 in A and check for a successful response + # The agent creates the full entity of OffStreetParking:1 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - - #Agent checks, with local=true, that the entity is created in A and does not contain the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + + ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_payload} @context location + + # Agent checks, with local=true, that the entity is created in A and does not contain the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location + Should Be Equal ${response.json()} ${expected_payload} - #Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location - Should Not Contain ${response.json()} name + ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber + Should Be Equal ${response.json()} ${expected_b_payload} - #Agent checks, with local=true, that the entity is created in C and only contains the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C and only contains the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} location - Should Not Contain ${response.json()} name - Should Not Contain ${response.json()} availableSpotsNumber - Should Not Contain ${response.json()} totalSpotsNumber + ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_location_payload} id type location + Should Be Equal ${response.json()} ${expected_location_payload} - #Agent checks, with local=true, that the entity is created in D and only contains the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + # Agent checks, with local=true, that the entity is created in D and only contains the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} location - Should Not Contain ${response.json()} name - Should Not Contain ${response.json()} availableSpotsNumber - Should Not Contain ${response.json()} totalSpotsNumber + Should Be Equal ${response.json()} ${expected_location_payload} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} @@ -86,4 +103,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 5206722e..8f18e6ab 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -7,69 +7,92 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** ${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_001_02_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - #Create the full entity of OffStreetParking:2 in A and check for a successful response + # Create the full entity of OffStreetParking:2 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - #Agent checks, with local=true, that the entity is created in A and does not contain the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_payload} @context location + + # Agent checks, with local=true, that the entity is created in A and does not contain the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location - - #Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + Should Be Equal ${response.json()} ${expected_payload} + + # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Not Contain ${response.json()} location - Should Not Contain ${response.json()} name + ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber + Should Be Equal ${response.json()} ${expected_b_payload} - #Agent checks, with local=true, that the entity is created in C and only contains the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C and only contains the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} location + ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_location_payload} id type location + Should Be Equal ${response.json()} ${expected_location_payload} - #Agent checks, with local=true, that the entity is created in D and only contains the location property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + # Agent checks, with local=true, that the entity is created in D and only contains the location property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} location + Should Be Equal ${response.json()} ${expected_location_payload} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} @@ -81,4 +104,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 90b5b210..1d4a75ee 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -7,74 +7,89 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** ${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_001_03_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - #Agent checks that the full entity of OffStreetParking:1 is created in A and check for a successful response + # Agent checks that the full entity of OffStreetParking:1 is created in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - Should Contain ${response.json()} name - Should Contain ${response.json()} location - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber - - #Agent checks, with local=true, that the entity is created in A - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} - Should Be Equal ${response.json()} ${IOP_REGISTRY_URL}[parking][full_1] + + ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_full_payload} @context + + # Agent checks, with local=true, that the entity is created in A + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + Should Be Equal ${response.json()} ${expected_full_payload} - #Agent checks, with local=true, that the entity was not created in B - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + # Agent checks, with local=true, that the entity was not created in B + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity is created in C - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${IOP_REGISTRY_URL}[parking][location_and_name_1] + Should Be Equal ${response.json()} ${expected_full_payload} - #Agent checks, with local=true, that the entity is created in D and only contains the properties availableSpotsNumber and totalSpotsNumber - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + # Agent checks, with local=true, that the entity is created in D and only contains the properties availableSpotsNumber and totalSpotsNumber + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} availableSpotsNumber - Should Contain ${response.json()} totalSpotsNumber - Should Not Contain ${response.json()} name - Should Not Contain ${response.json()} location + ${expected_spots_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_spots_payload} id type availableSpotsNumber totalSpotsNumber + Should Be Equal ${response.json()} ${expected_spots_payload} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} - + @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} @@ -86,4 +101,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 7505ea61..35936d6d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -7,63 +7,83 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** ${entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} + *** Test Cases *** IOP_001_03_02 Create Partial OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - #Check that the the entity of OffStreetParking:1 with location and name only is created in A and check for a successful response + # Check that the the entity of OffStreetParking:1 with location and name only is created in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - Should Contain ${response.json()} name - Should Contain ${response.json()} location - #Agent checks, with local=true, that the entity is created in A - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_payload} @context + + # Agent checks, with local=true, that the entity is created in A + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - #Agent checks, with local=true, that the entity was not created in B - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + Should Be Equal ${response.json()} ${expected_payload} + # Agent checks, with local=true, that the entity was not created in B + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity is created in C - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - #Agent checks, with local=true, that the entity was not created in D - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + Should Be Equal ${response.json()} ${expected_payload} + # Agent checks, with local=true, that the entity was not created in D + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} - + @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive ... ${broker_D_url} @@ -75,4 +95,4 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index ebecb8ee..a138b580 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -1,96 +1,142 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities created in B and one inclusive for the entity created in C. B has two registration, one redirect for the entities created in D, one redirect for the entity created in E. C has one exclusive registration to E. -... The client creates the entity in A. The entity should be present in C, it should not be present in B, D and E. +... The client creates the entity in A. The entity should be present in C, it should not be present in B, D and E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_001_04_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_6_1 + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 - #Create the full entity of OffStreetParking:1 in A and check for a successful response + # Create the full entity of OffStreetParking:1 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - #Agent checks, with local=true, that the entity is created in A - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_payload} @context + + # Agent checks, with local=true, that the entity is created in A + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - #Agent checks, with local=true, that the entity was not created in B - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + Should Be Equal ${response.json()} ${expected_payload} + # Agent checks, with local=true, that the entity was not created in B + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity is created in C - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - #Agent checks, with local=true, that the entity was not created in D - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + Should Be Equal ${response.json()} ${expected_payload} + # Agent checks, with local=true, that the entity was not created in D + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity was not created in E - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_E_url} + # Agent checks, with local=true, that the entity was not created in E + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_E_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} + *** Keywords *** Setup Initial Context Source Registrations + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} - @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} - ... ${broker_B_url} + ... ${broker_C_url} - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 5baa798a..b388b8e8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -7,95 +7,145 @@ Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations + *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${broker_A_url} -${broker_B_url} -${broker_C_url} -${broker_D_url} -${broker_E_url} +${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +${broker_A_url} ${EMPTY} +${broker_B_url} ${EMPTY} +${broker_C_url} ${EMPTY} +${broker_D_url} ${EMPTY} +${broker_E_url} ${EMPTY} + *** Test Cases *** IOP_001_04_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. - [Tags] since_v1.6.1 iop cnf_04 4_3_3 additive-inclusive additive-auxiliary proxy-exclusive proxy-redirect 4_3_6 5_6_1 - - #Create the full entity of OffStreetParking:2 in A and check for a successful response + ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + + # Create the full entity of OffStreetParking:2 in A and check for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} - #Agent checks, with local=true, that the entity is created in A - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_A_url} + ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_full_payload} @context + + # Agent checks, with local=true, that the entity is created in A + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_A_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + Should Be Equal ${response.json()} ${expected_full_payload} - #Agent checks, with local=true, that the entity was not created in B - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_B_url} + # Agent checks, with local=true, that the entity was not created in B + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_B_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity is created in C - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_C_url} + # Agent checks, with local=true, that the entity is created in C + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_C_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} + ${expected_c_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_c_payload} @context totalSpotsNumber + Should Be Equal ${response.json()} ${expected_c_payload} - #Agent checks, with local=true, that the entity was not created in D - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_D_url} + # Agent checks, with local=true, that the entity was not created in D + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_D_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - #Agent checks, with local=true, that the entity is created in E and only contains the totalSpotsNumber property - ${response}= Retrieve Entity ${entity_id} local=true broker_url=${broker_E_url} + # Agent checks, with local=true, that the entity is created in E and only contains the totalSpotsNumber property + ${response}= Retrieve Entity + ... ${entity_id} + ... local=true + ... broker_url=${broker_E_url} + ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Contain ${response.json()} totalSpotsNumber + ${expected_e_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_e_payload} id type totalSpotsNumber + Should Be Equal ${response.json()} ${expected_e_payload} + *** Keywords *** Setup Initial Context Source Registrations - - ${entity_id}= Generate Random Parking Entity Id - Set Suite Variable ${entity_id} + Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary ... ${broker_B_url} ... ${broker_A_url} - + @{second_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect ... ${broker_D_url} ... ${broker_B_url} @{third_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect ... ${broker_E_url} ... ${broker_B_url} @{fourth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive ... ${broker_C_url} ... ${broker_A_url} @{fifth_set}= Create List - ... ${entity_id} + ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive ... ${broker_E_url} ... ${broker_C_url} - @{fourth_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} ${fifth_set} + @{fourth_configuration}= Create List + ... ${first_set} + ... ${second_set} + ... ${third_set} + ... ${fourth_set} + ... ${fifth_set} Compose IOP Configuration ${fourth_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} ${broker_E_url} + @{broker_count}= Create List + ... ${broker_A_url} + ... ${broker_B_url} + ... ${broker_C_url} + ... ${broker_D_url} + ... ${broker_E_url} @{entities_to_delete}= Create List ${entity_id} - Delete Registrations And Entities ${broker_count} ${entities_to_delete} \ No newline at end of file + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index 6e2c8c18..ba2e6741 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -10,14 +10,14 @@ } ], "propertyNames": [ - "totalSpotsNumber", - "availableSpotsNumber" + "totalSpotsNumber" ] } ], "mode": "exclusive", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-exclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld index fdc4730a..9d8c38c6 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld @@ -15,8 +15,9 @@ } ], "mode": "exclusive", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-exclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld index d137f7b4..795c2e7c 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld @@ -20,4 +20,4 @@ "@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/interoperability/context-source-registration-inclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld index 42145ec1..bf2b6681 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld @@ -11,8 +11,9 @@ } ], "mode": "inclusive", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-inclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld index 58c4d473..f7b0fe92 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld @@ -15,8 +15,9 @@ } ], "mode": "inclusive", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-inclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld index 8697ffce..37f3e73d 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld @@ -16,4 +16,4 @@ "@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/interoperability/context-source-registration-redirect-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld index 754d1c63..ce6fe900 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld @@ -11,8 +11,9 @@ } ], "mode": "redirect", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-redirect-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld index 2cc6e981..5153eaf4 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld @@ -14,8 +14,9 @@ } ], "mode": "redirect", + "operations": ["redirectionOps"], "endpoint": "xxx", "@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/interoperability/context-source-registration-redirect-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld index 44e537ca..5598b967 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld @@ -20,4 +20,4 @@ "@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/interoperability/context-source-registration-redirect-4.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld index bde367a9..9869cc0f 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld @@ -20,4 +20,4 @@ "@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/expectations/interoperability/create-entity-IOP-001-01-01-b.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json new file mode 100644 index 00000000..a7c0d516 --- /dev/null +++ b/data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:1", + "type": "OffStreetParking", + "availableSpotsNumber": { + "type": "Property", + "value": 121, + "observedAt": "2017-07-29T12:05:02Z", + "reliability": { + "type": "Property", + "value": 0.7 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 200 + } +} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json new file mode 100644 index 00000000..bb45bd2b --- /dev/null +++ b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json @@ -0,0 +1,21 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown Two" + }, + "availableSpotsNumber": { + "type": "Property", + "value": 112, + "observedAt": "2017-07-29T12:05:02Z", + "reliability": { + "type": "Property", + "value": 0.4 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 150 + } +} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json new file mode 100644 index 00000000..10dfa9b1 --- /dev/null +++ b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking", + "availableSpotsNumber": { + "type": "Property", + "value": 112, + "observedAt": "2017-07-29T12:05:02Z", + "reliability": { + "type": "Property", + "value": 0.4 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 150 + } +} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json new file mode 100644 index 00000000..bb08e441 --- /dev/null +++ b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking", + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.45, 41.2] + } + } +} diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json index 06376a23..4bb87dcc 100644 --- a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json +++ b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json @@ -17,5 +17,12 @@ "totalSpotsNumber": { "type": "Property", "value": 150 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.45, 41.2] + } } } diff --git a/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json b/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json new file mode 100644 index 00000000..86ef78b9 --- /dev/null +++ b/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json @@ -0,0 +1,28 @@ +{ + "id": "urn:ngsi-ld:OffStreetParking:2", + "type": "OffStreetParking", + "name": { + "type": "Property", + "value": "Downtown Two" + }, + "availableSpotsNumber": { + "type": "Property", + "value": 87, + "observedAt": "2017-07-29T12:10:02Z", + "reliability": { + "type": "Property", + "value": 0.55 + } + }, + "totalSpotsNumber": { + "type": "Property", + "value": 150 + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [-8.45, 41.2] + } + } +} diff --git a/data/entities/interoperability/offstreet-parking1-location-and-name.jsonld b/data/entities/interoperability/offstreet-parking1-location-and-name.jsonld index 6ec58ac6..824cfa90 100644 --- a/data/entities/interoperability/offstreet-parking1-location-and-name.jsonld +++ b/data/entities/interoperability/offstreet-parking1-location-and-name.jsonld @@ -12,22 +12,11 @@ "coordinates": [ -8.9, 42.2 - ] , + ] + }, "observedAt": "2021-04-04T11:45:00Z" - } - }, + }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] -} \ No newline at end of file +} diff --git a/data/entities/interoperability/offstreet-parking1-no-location.jsonld b/data/entities/interoperability/offstreet-parking1-no-location.jsonld index b15ef9d7..cbb13215 100644 --- a/data/entities/interoperability/offstreet-parking1-no-location.jsonld +++ b/data/entities/interoperability/offstreet-parking1-no-location.jsonld @@ -19,17 +19,6 @@ "value": 200 }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] -} \ No newline at end of file +} diff --git a/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld b/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld index 59449061..4dd2ea5f 100644 --- a/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld +++ b/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld @@ -12,11 +12,11 @@ "coordinates": [ -8.46, 41.25 - ] , + ] + }, "observedAt": "2021-04-04T11:46:00Z" - } - }, + }, "@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/interoperability/offstreet-parking2-no-location.jsonld b/data/entities/interoperability/offstreet-parking2-no-location.jsonld index bb4191b9..c6418d9c 100644 --- a/data/entities/interoperability/offstreet-parking2-no-location.jsonld +++ b/data/entities/interoperability/offstreet-parking2-no-location.jsonld @@ -19,17 +19,6 @@ "value": 150 }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] -} \ No newline at end of file +} diff --git a/data/entities/interoperability/vehicle1-full.jsonld b/data/entities/interoperability/vehicle1-full.jsonld index 6518b986..ff8125d1 100644 --- a/data/entities/interoperability/vehicle1-full.jsonld +++ b/data/entities/interoperability/vehicle1-full.jsonld @@ -29,17 +29,6 @@ } }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" - ] -} \ No newline at end of file + "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/entities/interoperability/vehicle2-full.jsonld b/data/entities/interoperability/vehicle2-full.jsonld index ab1e79da..427399f6 100644 --- a/data/entities/interoperability/vehicle2-full.jsonld +++ b/data/entities/interoperability/vehicle2-full.jsonld @@ -29,17 +29,6 @@ } }, "@context": [ - { - "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", - "Vehicle": "https://ngsi-ld-test-suite/context#Vehicle", - "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", - "brandName": "https://ngsi-ld-test-suite/context#brandName", - "isParked": "https://ngsi-ld-test-suite/context#isParked", - "name": "https://ngsi-ld-test-suite/context#name", - "source": "https://ngsi-ld-test-suite/context#source", - "speed": "https://ngsi-ld-test-suite/context#speed", - "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber" - }, - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.6.jsonld" + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] -} \ No newline at end of file +} diff --git a/resources/IOPUtils/InteroperabilityUtils.resource b/resources/IOPUtils/InteroperabilityUtils.resource index 35e1abb0..10e9945e 100644 --- a/resources/IOPUtils/InteroperabilityUtils.resource +++ b/resources/IOPUtils/InteroperabilityUtils.resource @@ -8,11 +8,13 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextSourceRegistration.reso Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource + *** Keywords *** Compose IOP Configuration [Arguments] ${sets} ${len}= Get Length ${sets} + Set Test Variable ${registration_count} 0 FOR ${i} IN RANGE ${len} ${entity_id}= Get From List ${sets}[${i}] 0 ${registration_filename}= Get From List ${sets}[${i}] 1 @@ -34,17 +36,26 @@ Compose IOP Configuration ... content_type=${CONTENT_TYPE_LD_JSON} ... broker_url=${registration_broker_url} Check Response Status Code 201 ${response.status_code} + ${created_count}= Evaluate $i + 1 + Set Test Variable ${registration_count} ${created_count} END Delete Registrations And Entities [Arguments] ${brokers_url} - ... ${entities} + ... ${entities} - ${len_brokers}= Get Length ${brokers_url} - ${len_entities}= Get Length ${entities} - FOR ${i} IN RANGE ${len_brokers}-1 - Delete Context Source Registration With Return ${registration_id${i+1}} broker_url=${broker_A_url} + ${created_count}= Get Variable Value \${registration_count} 0 + ${registration_end}= Evaluate int($created_count) + 1 + FOR ${i} IN RANGE 1 ${registration_end} + Delete Context Source Registration With Return + ... ${registration_id${i}} + ... broker_url=${registration_broker_url${i}} + END + ${temporal_cleanup_setting}= Set Variable ${delete_temporal_on_core_delete} + Set Test Variable ${delete_temporal_on_core_delete} ${False} + FOR ${broker_url} IN @{brokers_url} + FOR ${entity_id} IN @{entities} + Delete Entity ${entity_id} local=true broker_url=${broker_url} + END END - FOR ${i} IN RANGE ${len_entities}-1 - Delete Entity ${entities}[${i}] - END \ No newline at end of file + Set Test Variable ${delete_temporal_on_core_delete} ${temporal_cleanup_setting} -- GitLab From e8a9dfe328672ec3dfe0c4b417553d4c3fb8cc5b Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Wed, 22 Jul 2026 11:40:14 +0200 Subject: [PATCH 06/34] fix: exclusive registration according to D6 --- .../context-source-registration-exclusive-1.jsonld | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index 6e2c8c18..f2fb9455 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -10,8 +10,7 @@ } ], "propertyNames": [ - "totalSpotsNumber", - "availableSpotsNumber" + "totalSpotsNumber" ] } ], -- GitLab From b815d904d32726a5804766a8f0655497b17c9087 Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Wed, 22 Jul 2026 14:05:07 +0200 Subject: [PATCH 07/34] feat: reworked IOP --- .../Consumption/Entity/QueryEntities/IOP_003_03_01.robot | 6 ++++++ .../Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot | 8 +++----- .../Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot | 2 +- plug-test/scorpio/docker-compose.yml | 1 + resources/ApiUtils/ContextInformationProvision.resource | 8 +++++++- resources/ApiUtils/ContextSourceRegistration.resource | 4 ++++ resources/IOPUtils/InteroperabilityUtils.resource | 1 + .../jsonld-contexts/ngsi-ld-test-suite-compound.jsonld | 4 ++-- 11 files changed, 28 insertions(+), 12 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index efb74411..6a68c3c2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -47,6 +47,12 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} ${first_expected}= Load Entity ${first_full_offstreet_payload_filename} ${first_entity_id} + ${latest_attribute_source}= Load Entity + ... ${first_offstreet_no_location_payload_filename} + ... ${first_entity_id} + Set To Dictionary + ... ${first_expected} + ... availableSpotsNumber=${latest_attribute_source}[availableSpotsNumber] Remove From Dictionary ${first_expected} @context ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] Should Be Equal ${first_entity}[0] ${first_expected} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 2dcc26ba..466665a6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -13,7 +13,6 @@ ${first_entity_payload_filename} interoperability/offstreet-parki ${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json ${broker_A_url} ${EMPTY} ${broker_B_url} ${EMPTY} ${broker_C_url} ${EMPTY} @@ -31,10 +30,9 @@ IOP_002_01_01 Retrieve OffStreetParking:1 ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${expected_payload_file_path} - ... ${first_entity_id} - ... ${response.json()} + ${expected_payload}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber + Should Be Equal ${response.json()} ${expected_payload} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 6a61db03..f41ffe4d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -31,7 +31,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} - Check Response Status Code 207 ${response.status_code} + Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} ${location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} Set To Dictionary ${expected_payload} location=${location_source}[location] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index beca9c81..e6fce9fc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -31,7 +31,7 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} - Check Response Status Code 207 ${response.status_code} + Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} ${location_source}= Load Entity ${entity_payload_filename} ${first_entity_id} Set To Dictionary ${expected_payload} location=${location_source}[location] diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index ef149253..3f44c99a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -32,7 +32,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} - Check Response Status Code 207 ${response.status_code} + Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} Remove From Dictionary ${expected_payload} @context Should Be Equal ${response.json()} ${expected_payload} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index a00c16b5..f4fc8e1b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -33,7 +33,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute ... attrs=location ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} - Check Response Status Code 207 ${response.status_code} + Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_payload} id type location Should Be Equal ${response.json()} ${expected_payload} diff --git a/plug-test/scorpio/docker-compose.yml b/plug-test/scorpio/docker-compose.yml index f164ea88..fcccb0c0 100644 --- a/plug-test/scorpio/docker-compose.yml +++ b/plug-test/scorpio/docker-compose.yml @@ -7,6 +7,7 @@ services: hostname: scorpio${SUFFIX} environment: DBHOST: scorpio-database${SUFFIX} + SCORPIO_GATEWAY_URL: ${GATEWAY_URL:-http://localhost:9090} ports: - "${PORT}:9090" depends_on: diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index 8e795f00..78582c24 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -161,11 +161,17 @@ Batch Upsert Entities Create Entity [Tags] actor_context-producer - [Arguments] ${filename} ${entity_id} ${local}=${EMPTY} ${broker_url}=${EMPTY} + [Arguments] + ... ${filename} + ... ${entity_id} + ... ${local}=${EMPTY} + ... ${broker_url}=${EMPTY} + ... ${context}=${ngsild_test_suite_context} &{params}= Create Dictionary IF '${local}'!='' Set To Dictionary ${params} local=${local} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $.id ${entity_id} + ${entity}= Update Value To JSON ${entity} $['@context'] ${context} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 14237dbc..6b41cb15 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -33,7 +33,11 @@ Prepare Context Source Registration From File ... ${endpoint}=${EMPTY} ... ${broker_url}=${EMPTY} ... ${operations}=[] + ... ${context}=${EMPTY} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} + IF '${context}' != '${EMPTY}' + ${payload}= Update Value To JSON ${payload} $['@context'] ${context} + END ${final_context_source_url}= Set Variable If '${endpoint}' != '' ${endpoint} ${context_source_url} ${registration_payload}= Update Value To JSON diff --git a/resources/IOPUtils/InteroperabilityUtils.resource b/resources/IOPUtils/InteroperabilityUtils.resource index 10e9945e..42a312d9 100644 --- a/resources/IOPUtils/InteroperabilityUtils.resource +++ b/resources/IOPUtils/InteroperabilityUtils.resource @@ -31,6 +31,7 @@ Compose IOP Configuration ... entity_id=${entity_id} ... mode=${mode} ... endpoint=${endpoint} + ... context=${ngsild_test_suite_context} ${response}= Create Context Source Registration With Return ... ${registration_payload} ... content_type=${CONTENT_TYPE_LD_JSON} diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld index ba572931..512d86a4 100644 --- a/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld +++ b/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld @@ -1,6 +1,6 @@ { "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld", - "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.8.jsonld" + "ngsi-ld-test-suite.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context-v1.9.jsonld" ] } -- GitLab From 67da27cd582955d7da61e992b992b1684c22e1e7 Mon Sep 17 00:00:00 2001 From: Thomas BOUSSELIN Date: Wed, 22 Jul 2026 16:23:01 +0200 Subject: [PATCH 08/34] feat: avoid Should be equal --- .../Entity/QueryEntities/IOP_003_01_01.robot | 8 +++----- .../Entity/QueryEntities/IOP_003_02_01.robot | 4 ++-- .../Entity/QueryEntities/IOP_003_02_02.robot | 8 ++++---- .../Entity/QueryEntities/IOP_003_03_01.robot | 4 ++-- .../Entity/QueryEntities/IOP_003_03_02.robot | 8 ++++---- .../Entity/QueryEntities/IOP_003_04_01.robot | 12 +++++++++--- .../Entity/QueryEntities/IOP_003_04_02.robot | 12 +++++++++--- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 2 +- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 4 ++-- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 4 ++-- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 2 +- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 2 +- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 6 ++---- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 2 +- .../Provision/CreateEntity/IOP_001_02_01.robot | 8 ++++---- .../Provision/CreateEntity/IOP_001_02_02.robot | 8 ++++---- .../Provision/CreateEntity/IOP_001_03_01.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_03_02.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_04_01.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_04_02.robot | 6 +++--- .../query-entity-IOP-003-01-01-second.json | 7 ------- .../retrieve-entity-IOP-002-01-02.json | 4 ---- 22 files changed, 61 insertions(+), 64 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 7412ce50..0629e34a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -98,8 +98,6 @@ Setup Initial Context Source Registrations Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - Delete Context Source Registration With Return ${registration_id1} broker_url=${broker_A_url} - Delete Context Source Registration With Return ${registration_id2} broker_url=${broker_A_url} - Delete Entity ${first_entity_id} broker_url=${broker_B_url} - Delete Entity ${second_entity_id} broker_url=${broker_B_url} - Delete Entity ${second_entity_id} broker_url=${broker_C_url} + @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} + Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index bfa3c6e7..1f6bb39d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -52,14 +52,14 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET Remove From Dictionary ${first_expected} @context name Set To Dictionary ${first_expected} location=${first_location_source}[location] ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Should Be Equal ${first_entity}[0] ${first_expected} + Check Resource Set To ${first_expected} ${first_entity}[0] ${second_expected}= Load Entity ${second_entity_no_location_payload_filename} ${second_entity_id} ${second_location_source}= Load Entity ${location_name_payload_filename} ${second_entity_id} Remove From Dictionary ${second_expected} @context name Set To Dictionary ${second_expected} location=${second_location_source}[location] ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Should Be Equal ${second_entity}[0] ${second_expected} + Check Resource Set To ${second_expected} ${second_entity}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 55e921ed..68a8619f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -60,24 +60,24 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... ${first_parking_entity_id} Keep In Dictionary ${first_parking_expected} id type location ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] - Should Be Equal ${first_parking}[0] ${first_parking_expected} + Check Resource Set To ${first_parking_expected} ${first_parking}[0] ${second_parking_expected}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_parking_entity_id} Keep In Dictionary ${second_parking_expected} id type location ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] - Should Be Equal ${second_parking}[0] ${second_parking_expected} + Check Resource Set To ${second_parking_expected} ${second_parking}[0] ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} Keep In Dictionary ${first_vehicle_expected} id type location ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] - Should Be Equal ${first_vehicle}[0] ${first_vehicle_expected} + Check Resource Set To ${first_vehicle_expected} ${first_vehicle}[0] ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} Keep In Dictionary ${second_vehicle_expected} id type location ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] - Should Be Equal ${second_vehicle}[0] ${second_vehicle_expected} + Check Resource Set To ${second_vehicle_expected} ${second_vehicle}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 6a68c3c2..6d3d38cd 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -55,12 +55,12 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ... availableSpotsNumber=${latest_attribute_source}[availableSpotsNumber] Remove From Dictionary ${first_expected} @context ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Should Be Equal ${first_entity}[0] ${first_expected} + Check Resource Set To ${first_expected} ${first_entity}[0] ${second_expected}= Load Entity ${offstreet_no_location_payload_filename} ${second_entity_id} Remove From Dictionary ${second_expected} @context ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Should Be Equal ${second_entity}[0] ${second_expected} + Check Resource Set To ${second_expected} ${second_entity}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 40432c77..973ab917 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -57,24 +57,24 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... ${first_parking_entity_id} Keep In Dictionary ${first_parking_expected} id type location ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] - Should Be Equal ${first_parking}[0] ${first_parking_expected} + Check Resource Set To ${first_parking_expected} ${first_parking}[0] ${second_parking_expected}= Load Entity ... ${second_full_offstreet_payload_filename} ... ${second_parking_entity_id} Keep In Dictionary ${second_parking_expected} id type location ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] - Should Be Equal ${second_parking}[0] ${second_parking_expected} + Check Resource Set To ${second_parking_expected} ${second_parking}[0] ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} Keep In Dictionary ${first_vehicle_expected} id type location ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] - Should Be Equal ${first_vehicle}[0] ${first_vehicle_expected} + Check Resource Set To ${first_vehicle_expected} ${first_vehicle}[0] ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} Keep In Dictionary ${second_vehicle_expected} id type location ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] - Should Be Equal ${second_vehicle}[0] ${second_vehicle_expected} + Check Resource Set To ${second_vehicle_expected} ${second_vehicle}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 3d0323cd..894561c3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -55,16 +55,22 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} Keep In Dictionary ${first_expected} id type location ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Should Be Equal ${first_entity}[0] ${first_expected} + Check Resource Set To ${first_expected} ${first_entity}[0] ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} ${second_location_source}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} Set To Dictionary ${second_expected} location=${second_location_source}[location] - Remove From Dictionary ${second_expected} @context + Keep In Dictionary + ... ${second_expected} + ... id + ... type + ... availableSpotsNumber + ... totalSpotsNumber + ... location ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Should Be Equal ${second_entity}[0] ${second_expected} + Check Resource Set To ${second_expected} ${second_entity}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index 22514b66..a7352c56 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -57,16 +57,22 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} Keep In Dictionary ${first_expected} id type location ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Should Be Equal ${first_entity}[0] ${first_expected} + Check Resource Set To ${first_expected} ${first_entity}[0] ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} ${second_location_source}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} Set To Dictionary ${second_expected} location=${second_location_source}[location] - Remove From Dictionary ${second_expected} @context + Keep In Dictionary + ... ${second_expected} + ... id + ... type + ... availableSpotsNumber + ... totalSpotsNumber + ... location ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Should Be Equal ${second_entity}[0] ${second_expected} + Check Resource Set To ${second_expected} ${second_entity}[0] *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 466665a6..bd5cbd0d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -32,7 +32,7 @@ IOP_002_01_01 Retrieve OffStreetParking:1 Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${first_entity_payload_filename} ${first_entity_id} Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index f41ffe4d..cf05ac58 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -33,10 +33,10 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber ${location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} Set To Dictionary ${expected_payload} location=${location_source}[location] - Remove From Dictionary ${expected_payload} @context - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index e6fce9fc..6a631ceb 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -35,8 +35,8 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute ${expected_payload}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} ${location_source}= Load Entity ${entity_payload_filename} ${first_entity_id} Set To Dictionary ${expected_payload} location=${location_source}[location] - Remove From Dictionary ${expected_payload} @context - Should Be Equal ${response.json()} ${expected_payload} + Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber location + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index 3f44c99a..e6da2c8d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -35,7 +35,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} Remove From Dictionary ${expected_payload} @context - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index f4fc8e1b..7957e8a3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -36,7 +36,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_payload} id type location - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 2325b99d..f40762c3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -46,10 +46,8 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... broker_url=${broker_A_url} Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} - ${location_source}= Load Entity ${full_entity_payload_filename} ${entity_id} - Set To Dictionary ${expected_payload} location=${location_source}[location] - Remove From Dictionary ${expected_payload} @context - Should Be Equal ${response.json()} ${expected_payload} + Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 8ccd3ace..20ae840a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -50,7 +50,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${location_source}= Load Entity ${location_name_entity_payload_filename} ${entity_id} Set To Dictionary ${expected_payload} location=${location_source}[location] Remove From Dictionary ${expected_payload} @context - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index 2b649188..e56114dd 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -38,7 +38,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties ${response}= Retrieve Entity @@ -49,7 +49,7 @@ IOP_001_02_01 Create OffStreetParking:1 Check Response Status Code 200 ${response.status_code} ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber - Should Be Equal ${response.json()} ${expected_b_payload} + Check Resource Set To ${expected_b_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in C and only contains the location property ${response}= Retrieve Entity @@ -60,7 +60,7 @@ IOP_001_02_01 Create OffStreetParking:1 Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location - Should Be Equal ${response.json()} ${expected_location_payload} + Check Resource Set To ${expected_location_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in D and only contains the location property ${response}= Retrieve Entity @@ -69,7 +69,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... broker_url=${broker_D_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_location_payload} + Check Resource Set To ${expected_location_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 8f18e6ab..184744d0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -39,7 +39,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties ${response}= Retrieve Entity @@ -50,7 +50,7 @@ IOP_001_02_02 Create OffStreetParking:2 Check Response Status Code 200 ${response.status_code} ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber - Should Be Equal ${response.json()} ${expected_b_payload} + Check Resource Set To ${expected_b_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in C and only contains the location property ${response}= Retrieve Entity @@ -61,7 +61,7 @@ IOP_001_02_02 Create OffStreetParking:2 Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location - Should Be Equal ${response.json()} ${expected_location_payload} + Check Resource Set To ${expected_location_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in D and only contains the location property ${response}= Retrieve Entity @@ -70,7 +70,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... broker_url=${broker_D_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_location_payload} + Check Resource Set To ${expected_location_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 1d4a75ee..90e4a344 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -39,7 +39,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_full_payload} + Check Resource Set To ${expected_full_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in B ${response}= Retrieve Entity @@ -56,7 +56,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... broker_url=${broker_C_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_full_payload} + Check Resource Set To ${expected_full_payload} ${response.json()} # Agent checks, with local=true, that the entity is created in D and only contains the properties availableSpotsNumber and totalSpotsNumber ${response}= Retrieve Entity @@ -67,7 +67,7 @@ IOP_001_03_01 Create OffStreetParking:1 Check Response Status Code 200 ${response.status_code} ${expected_spots_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_spots_payload} id type availableSpotsNumber totalSpotsNumber - Should Be Equal ${response.json()} ${expected_spots_payload} + Check Resource Set To ${expected_spots_payload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 35936d6d..d655794e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -39,7 +39,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in B ${response}= Retrieve Entity ... ${entity_id} @@ -54,7 +54,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... broker_url=${broker_C_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in D ${response}= Retrieve Entity ... ${entity_id} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index a138b580..91333e8c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -52,7 +52,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in B ${response}= Retrieve Entity ... ${entity_id} @@ -67,7 +67,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... broker_url=${broker_C_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_payload} + Check Resource Set To ${expected_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in D ${response}= Retrieve Entity ... ${entity_id} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index b388b8e8..0c0ba282 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -52,7 +52,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... broker_url=${broker_A_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Should Be Equal ${response.json()} ${expected_full_payload} + Check Resource Set To ${expected_full_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in B ${response}= Retrieve Entity @@ -71,7 +71,7 @@ IOP_001_04_02 Create OffStreetParking:2 Check Response Status Code 200 ${response.status_code} ${expected_c_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_c_payload} @context totalSpotsNumber - Should Be Equal ${response.json()} ${expected_c_payload} + Check Resource Set To ${expected_c_payload} ${response.json()} # Agent checks, with local=true, that the entity was not created in D ${response}= Retrieve Entity @@ -90,7 +90,7 @@ IOP_001_04_02 Create OffStreetParking:2 Check Response Status Code 200 ${response.status_code} ${expected_e_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_e_payload} id type totalSpotsNumber - Should Be Equal ${response.json()} ${expected_e_payload} + Check Resource Set To ${expected_e_payload} ${response.json()} *** Keywords *** diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json index 4bb87dcc..06376a23 100644 --- a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json +++ b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json @@ -17,12 +17,5 @@ "totalSpotsNumber": { "type": "Property", "value": 150 - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [-8.45, 41.2] - } } } diff --git a/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json b/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json index 86ef78b9..ca2feac6 100644 --- a/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json +++ b/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json @@ -1,10 +1,6 @@ { "id": "urn:ngsi-ld:OffStreetParking:2", "type": "OffStreetParking", - "name": { - "type": "Property", - "value": "Downtown Two" - }, "availableSpotsNumber": { "type": "Property", "value": 87, -- GitLab From 4eac6e727f7c49ae2dd4e7c7248e72ddcae12d97 Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Wed, 22 Jul 2026 17:34:44 +0200 Subject: [PATCH 09/34] fix: improved documentation text --- .../Consumption/Entity/QueryEntities/IOP_003_01_01.robot | 6 +++--- .../Consumption/Entity/QueryEntities/IOP_003_01_02.robot | 6 +++--- .../Consumption/Entity/QueryEntities/IOP_003_02_01.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_02_02.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_03_01.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_03_02.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_04_01.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_04_02.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot | 2 +- .../Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot | 6 +++--- .../Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_01_01.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_01_02.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_02_01.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_02_02.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_03_01.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_03_02.robot | 6 +++--- .../Provision/CreateEntity/IOP_001_04_01.robot | 8 ++++---- .../Provision/CreateEntity/IOP_001_04_02.robot | 8 ++++---- 24 files changed, 58 insertions(+), 58 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 0629e34a..c6984ba6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities created in B and one exclusive for the entity created in C. -... The client sends a HTTP GET request to check that quering the offparking type returns the entities in B and C. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. +... The client sends a HTTP GET request to check that quering the OffStreetParking type returns the entities in B and C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -36,7 +36,7 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 - # Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + # Client queries all entities with type OffStreetParking in A. Agent checks for a successful response that contains the attributes availableSpotsNumber and totalSpotsNumber from OffStreetParking:1 and the attributes availableSpotsNumber and totalSpotsNumber and location from OffStreetParking:2. ${response_a}= Query Entities ... entity_types=OffStreetParking ... broker_url=${broker_A_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index 474931ed..f8096226 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities created in B and one exclusive for the entity created in C. -... The client sends and HTTP POST request to check that the entities can be queried from all brokers. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. +... The client sends and HTTP POST request to check that the entities with type OffStreetParking can be queried from all brokers. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -36,7 +36,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... 5_7_2 ... 6_23_2_1 - # Agent queries all entities with type OffStreetParking in A and checks for a successful response that contains the attributes of both entities in B and C. + # Client queries all entities with type OffStreetParking in A and agent checks for a successful response. It should contain the attributes availableSpotsNumber and totalSpotsNumber from OffStreetParking:1 and the attributes availableSpotsNumber and location from OffStreetParking:2. &{entity_selector}= Create Dictionary type=OffStreetParking @{entities}= Create List ${entity_selector} ${response_a}= Query Entities Via POST diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index 1f6bb39d..cba6b6f8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities created in B, one redirect for the entities created in C and D and one redirect for the entity created in D. -... The client sends a HTTP GET request to check that quering the offparking type returns the entities in B, C and D and said entities have the same attributes as the ones queried from A. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entities in C and D and one redirect for the entity in D. +... The client sends a HTTP GET request to check that quering the type OffStreetParking returns the entities in B, C and D. Said entities shall have the same attributes as the ones queried from A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 68a8619f..8a121495 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has five registrations, two inclusive for the entities created in B, one redirect for the entities created in C and two redirect for the entity created in D. -... Check that the entities in B, C and D and said entities have the same attributes as the ones queried from A. +Documentation Four brokers are set up A, B, C and D. A has five registrations, two inclusive for the entities in B, one redirect for the entities in C and two redirect for the entity in D. +... Check that the entities in B, C and D have the same attributes as the ones queried from A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 6d3d38cd..34cc7c1c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities created in B, one inclusive for the entities created in C and one inclusive for the entity created in D. -... Check that the entities returned from A match the attributes from the entities in B, C and D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. +... Check that the entities returned from A match the attributes of the entities in B, C and D. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 973ab917..766066ca 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities created in B, one inclusive for the entities created in C and one inclusive for the entity created in D. -... Check that queried entities returned from B, C and D match the attributes from the entities in A. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. +... Check that queried entities returned from B, C and D match the attributes of the entities in A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 894561c3..5a349c41 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C. B has two registrations, one redirect for the entity created in D and one redirect for the entity created in E. C has two exclusive registrations to E. -... Check that the entities found in B, C, D and E can be queried from A via HTTP GET and said entities have the same attributes as the ones queried from A. +Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. +... Check that the entities found in B, C, D and E can be queried from A via HTTP GET. The entities shall have the same attributes as the ones queried from A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index a7352c56..ae1686fb 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C. B has two registrations, one redirect for the entity created in D and one redirect for the entity created in E. C has two exclusive registrations to E. -... Check that the entities found in B, C, D and E can be queried from A via HTTP POST and said entities have the same attributes as the ones queried from A. +Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. +... Check that the entities found in B, C, D and E can be queried from A via HTTP POST. The entities shall have the same attributes as the ones queried from A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index bd5cbd0d..8d3df59b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities created in B and one exclusive for the entity created in C. -... Check that the same entity created in B and C can be returned from A. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. +... Check that the entity found foundin B and C shall be returned from A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index c9bf2de8..9159944b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the the entity created in B and one exclusive for the entity created in C. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the the entity in B and one exclusive for the entity in C. ... Check that the entity returned from A has attributes from both entities in B and C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index cf05ac58..dea4e52e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity created in B, one redirect for the entity created in C and one redirect for the entity created in D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and one redirect for the entity in D. ... Check that the entity returned from A has attributes from the entities in B and C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -26,7 +26,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should be the whole entity. + # Client retrieves OffStreetParking:1 in A and agent checks for a partial successful. The entity returned should be the whole entity. ${response}= Retrieve Entity ... ${first_entity_id} ... context=${ngsild_test_suite_context} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 6a631ceb..6522a040 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity created in B, one redirect for the entity created in C and one redirect for the entity created in D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and ofoundne redirect for the entity in D. ... Check that the entity returned from C has the same location attribute found in A. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index e6da2c8d..3cc705b8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C and one inclusive for the entity created in D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. ... Check that a partial response was returned from A and that the entity matches the one in B and it does not contain the attribute location found in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index 7957e8a3..5b74c898 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C and one inclusive for the entity created in D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. ... Check the entity returned from A contains the location property and said attribute is the same as the one returned from C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -27,7 +27,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should only contain the location attribute. + # Client retrieves OffStreetParking:1 in A and agent checks for a partial successful. The entity returned should only contain the location attribute. ${response}= Retrieve Entity ... ${entity_id} ... attrs=location @@ -36,7 +36,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_payload} id type location - Check Resource Set To ${expected_payload} ${response.json()} + Check Resource Set To ${expected_paf in B,yload} ${response.json()} *** Keywords *** diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index f40762c3..7d33c5a0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C. B has two registrations, one redirect for the entity created in D and one redirect for the entity created in E. C shall establish one exclusive registration to E. +Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. ... Check that the entity returned from A has attributes from the entity in D and E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -39,7 +39,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... 4_3_6 ... 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a successful response. + # Client retrieves OffStreetParking:1 in A and agent checks for a successful response. ${response}= Retrieve Entity ... ${entity_id} ... context=${ngsild_test_suite_context} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 20ae840a..5c7fb7bf 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity created in B, one inclusive for the entity created in C. B has two registrations, one redirect for the entity created in D and one redirect for the entity created in E. C shall establish one exclusive registration to E. +Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. ... Check that the entity returned from A match the attributes from the entity in B, C and E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -40,7 +40,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... 4_3_6 ... 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a successful response. + # Client retrieves OffStreetParking:1 in A and agent checks for a successful response. ${response}= Retrieve Entity ... ${entity_id} ... context=${ngsild_test_suite_context} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 77f8de1c..d8a45ba6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -1,5 +1,5 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities created in B and one exclusive for the entity created in C. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. ... Check that the entity is created in A and B but not in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -25,7 +25,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Create OffStreetParking:1 in A and check for a successful response + # Client sends a request to A to create OffStreetParking:1 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} @@ -53,7 +53,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... ${response.json()} - # Agent checks, with local=true, that the entity is not created in C + # Agent checks, with local=true, that the entity is NOT created in C ${response}= Retrieve Entity ... ${entity_id} ... local=true diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index fc38191f..2e0d8e15 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities created in B and one exclusive for the entity created in C. -... Check that, in A and B, the entity is created containing the location attribute, while in C it is not contained. +Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. +... Check that, in A and B, the entity is created not containing the location attribute, while C only contains the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -26,7 +26,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... Registrations established: Inclusive in A to B. Exclusive in A to C. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Create the full entity of OffStreetParking:2 in A and check for a successful response + # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index e56114dd..bba80cd4 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities created in B, one redirect for the entity created in C and one redirect for the entities created in D. -... The client creates the entity in A. The entity should not contain the location attribute in A and B. The C and D brokers should only contain the location attribute. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. +... The client creates the entity in A. The entity in A and B shall not contain the location attribute. The entity in C and D shall only contain the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -24,7 +24,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # The agent creates the full entity of OffStreetParking:1 in A and check for a successful response + # The client creates the full entity of OffStreetParking:1 in A and the agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 184744d0..a5e82c94 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities created in B, one redirect for the entity created in C and one redirect for the entities created in D. -... The client creates the entity in A. The entity should not contain the location attribute in A and B. The C and D brokers should only contain the location attribute. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. +... The client creates the entity in A. The entity in A and B shall not contain the location attribute. The entity in C and D shall contain the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -25,7 +25,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Create the full entity of OffStreetParking:2 in A and check for a successful response + # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 90e4a344..bc07f1fb 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities created in B, one inclusive for the entity created in C and one inclusive for the entities created in D. -... The client creates the entity in A. The entity should be present in A and B, should not be present in C and should only contain some attributes in D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. +... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be present in C. The entity in D shall only contain availableSpotsNumber and totalSpotsNumber. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -25,7 +25,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Agent checks that the full entity of OffStreetParking:1 is created in A and check for a successful response + # Client creates the full entity of OffStreetParking:1 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index d655794e..ff7e68f5 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities created in B, one inclusive for the entity created in C and one inclusive for the entities created in D. -... The client creates the entity in A. The entity should be present in C, should not be present in both B and D. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. +... The client creates the entity in A. The entity shall be present in A and C. The entity shall not be present in B and D. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -25,7 +25,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Check that the the entity of OffStreetParking:1 with location and name only is created in A and check for a successful response + # Client creates the entity of OffStreetParking:1 with location and name only in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index 91333e8c..a19051d3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities created in B and one inclusive for the entity created in C. B has two registration, one redirect for the entities created in D, one redirect for the entity created in E. C has one exclusive registration to E. -... The client creates the entity in A. The entity should be present in C, it should not be present in B, D and E. +Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities in B and one inclusive for the entity in C. B has two registration, one redirect for the entities in D, one redirect for the entity in E. C has one exclusive registration to E. +... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be created in B, D and E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -38,7 +38,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... 4_3_6 ... 5_6_1 - # Create the full entity of OffStreetParking:1 in A and check for a successful response + # Client creates the full entity of OffStreetParking:1 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} @@ -75,7 +75,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... broker_url=${broker_D_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity was not created in E + # Agent checks, with local=true, that the entity was NOT created in E ${response}= Retrieve Entity ... ${entity_id} ... local=true diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 0c0ba282..79d0cb6a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities created in B and one inclusive for the entity created in C. B has two registration, one redirect for the entities created in D, one redirect for the entity created in E. C has one exclusive registration to E. -... The client creates the entity in A. The entity should be present in C and in E with only one attribute. The entity shall not be present in B and E. +... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be created in C and D. The entity shall be created in E with only one the totalSpotsNumber attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -38,7 +38,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... 4_3_6 ... 5_6_1 - # Create the full entity of OffStreetParking:2 in A and check for a successful response + # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} Check Response Status Code 201 ${response.status_code} @@ -54,7 +54,7 @@ IOP_001_04_02 Create OffStreetParking:2 Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in B + # Agent checks, with local=true, that the entity was NOT created in B ${response}= Retrieve Entity ... ${entity_id} ... local=true @@ -73,7 +73,7 @@ IOP_001_04_02 Create OffStreetParking:2 Remove From Dictionary ${expected_c_payload} @context totalSpotsNumber Check Resource Set To ${expected_c_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in D + # Agent checks, with local=true, that the entity is NOT created in D ${response}= Retrieve Entity ... ${entity_id} ... local=true -- GitLab From 5619ebfba2fadda6c00916fb873495236046fd28 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Thu, 23 Jul 2026 09:52:49 +0200 Subject: [PATCH 10/34] fix: add type to retrieve entity and relative tests fix: add missing terms in context --- .../Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot | 1 + .../Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot | 1 + doc/analysis/requests.py | 6 ++++-- resources/ApiUtils/ContextInformationConsumption.resource | 2 ++ resources/jsonld-contexts/ngsi-ld-test-suite.jsonld | 4 ++++ 11 files changed, 18 insertions(+), 2 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 8d3df59b..185d660a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -29,6 +29,7 @@ IOP_002_01_01 Retrieve OffStreetParking:1 ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${first_entity_payload_filename} ${first_entity_id} Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index 9159944b..c76dc034 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -30,6 +30,7 @@ IOP_002_01_02 Retrieve OffStreetParking:2 ... ${entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} Check Response Body Containing Entity element by id ... ${expected_payload_file_path} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index dea4e52e..683fc07a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -31,6 +31,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 6522a040..1db3f097 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -31,6 +31,7 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} ${location_source}= Load Entity ${entity_payload_filename} ${first_entity_id} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index 3cc705b8..d7e1ff2e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -32,6 +32,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ... ${first_entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} Remove From Dictionary ${expected_payload} @context diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index 5b74c898..39ec627e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -33,6 +33,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute ... attrs=location ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_payload} id type location diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 7d33c5a0..ba7491ee 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -44,6 +44,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... ${entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 5c7fb7bf..ceea2ab4 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -45,6 +45,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... ${entity_id} ... context=${ngsild_test_suite_context} ... broker_url=${broker_A_url} + ... type=OffStreetParking Check Response Status Code 200 ${response.status_code} ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} ${location_source}= Load Entity ${location_name_entity_payload_filename} ${entity_id} diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index 00c9c054..077a8965 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -47,7 +47,7 @@ class Requests: 'Retrieve Entity': { 'positions': [], 'params': ['id', 'accept', 'attrs', 'context', 'geometryProperty', 'options', 'format', 'lang', - 'join', 'joinLevel', 'pick', 'omit', 'local'] + 'join', 'joinLevel', 'pick', 'omit', 'local', 'type'] }, 'Retrieve Subscription': { 'positions': [], @@ -858,7 +858,7 @@ class Requests: @staticmethod def retrieve_entity(kwargs) -> str: expected_parameters = ['id', 'accept', 'attrs', 'context', 'geometry_property', 'options', 'format', 'lang', - 'join', 'joinLevel', 'local'] + 'join', 'joinLevel', 'local', 'type'] result = [x for x in kwargs if x not in expected_parameters] response = "Retrieve Entity Request:" @@ -891,6 +891,8 @@ class Requests: response = f"{response} and\n Query Parameter: omit set to '{value}'" case 'local': response = f"{response} and\n Query Parameter: local set to '{value}'" + case 'type': + response = f"{response} and\n Query Parameter: type set to '{value}'" case _: raise Exception(f"ERROR: unexpected attribute(s) {result}, the attributes expected are " f"{expected_parameters}, but received: {kwargs}") diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 02a098d5..bd1a0ae5 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -193,6 +193,7 @@ Retrieve Entity ... ${omit}=${EMPTY} ... ${local}=${EMPTY} ... ${broker_url}=${EMPTY} + ... ${type}=${EMPTY} ${attrs_length}= Get Length ${attrs} ${accept_length}= Get Length ${accept} @@ -231,6 +232,7 @@ Retrieve Entity IF ${pick_length}>0 Set To Dictionary ${params} pick=${pick} IF ${omit_length}>0 Set To Dictionary ${params} omit=${omit} IF '${local}'!='' Set To Dictionary ${params} local=${local} + IF '${type}'!='' Set To Dictionary ${params} type=${type} ${response}= GET ... url=${final_url}${NGSI_LD_API_PATH}/${ENTITIES_ENDPOINT_PATH}${id} diff --git a/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld b/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld index c4a5bfbf..edc0404b 100644 --- a/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld +++ b/resources/jsonld-contexts/ngsi-ld-test-suite.jsonld @@ -5,11 +5,15 @@ "OffStreetParking": "https://ngsi-ld-test-suite/context#OffStreetParking", "airQualityLevel": "https://ngsi-ld-test-suite/context#airQualityLevel", "almostFull": "https://ngsi-ld-test-suite/context#almostFull", + "availableSpotsNumber": "https://ngsi-ld-test-suite/context#availableSpotsNumber", "brandName": "https://ngsi-ld-test-suite/context#brandName", "fuelLevel": "https://ngsi-ld-test-suite/context#fuelLevel", + "isParked": "https://ngsi-ld-test-suite/context#isParked", "name": "https://ngsi-ld-test-suite/context#name", + "reliability": "https://ngsi-ld-test-suite/context#reliability", "source": "https://ngsi-ld-test-suite/context#source", "speed": "https://ngsi-ld-test-suite/context#speed", + "totalSpotsNumber": "https://ngsi-ld-test-suite/context#totalSpotsNumber", "subCategory": "https://ngsi-ld-test-suite/context#subCategory" } } -- GitLab From 3deddfae97cc90070cd28b03dc37087ba1f2ad8d Mon Sep 17 00:00:00 2001 From: Benedetta Arena Date: Thu, 23 Jul 2026 13:03:52 +0200 Subject: [PATCH 11/34] fix: change variable names to mirror document and improve tests documentation --- .../Entity/QueryEntities/IOP_003_01_01.robot | 8 ++++---- .../Entity/QueryEntities/IOP_003_01_02.robot | 8 ++++---- .../Entity/QueryEntities/IOP_003_02_01.robot | 13 +++++++------ .../Entity/QueryEntities/IOP_003_02_02.robot | 14 +++++++------- .../Entity/QueryEntities/IOP_003_03_01.robot | 10 +++++----- .../Entity/QueryEntities/IOP_003_03_02.robot | 12 ++++++------ .../Entity/QueryEntities/IOP_003_04_01.robot | 10 +++++----- .../Entity/QueryEntities/IOP_003_04_02.robot | 10 +++++----- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 6 +++--- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 6 +++--- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 8 ++++---- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 10 +++++----- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 8 ++++---- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 9 ++++----- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 6 +++--- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 8 ++++---- .../Provision/CreateEntity/IOP_001_01_01.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_01_02.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_02_01.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_02_02.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_03_01.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_03_02.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_04_01.robot | 4 ++-- .../Provision/CreateEntity/IOP_001_04_02.robot | 4 ++-- ...ld => full-version-of-offstreetparking1.jsonld} | 0 ...ld => full-version-of-offstreetparking2.jsonld} | 0 ...full.jsonld => full-version-of-vehicle1.jsonld} | 0 ...full.jsonld => full-version-of-vehicle2.jsonld} | 0 ...eetparking1-with-location-and-name-only.jsonld} | 0 ...d => offstreetparking1-without-location.jsonld} | 0 ...eetparking2-with-location-and-name-only.jsonld} | 0 ...2-without-location-and-totalspotsnumber.jsonld} | 0 ...d => offstreetparking2-without-location.jsonld} | 0 33 files changed, 89 insertions(+), 89 deletions(-) rename data/entities/interoperability/{offstreet-parking1-full.jsonld => full-version-of-offstreetparking1.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking2-full.jsonld => full-version-of-offstreetparking2.jsonld} (100%) rename data/entities/interoperability/{vehicle1-full.jsonld => full-version-of-vehicle1.jsonld} (100%) rename data/entities/interoperability/{vehicle2-full.jsonld => full-version-of-vehicle2.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking1-location-and-name.jsonld => offstreetparking1-with-location-and-name-only.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking1-no-location.jsonld => offstreetparking1-without-location.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking2-location-and-name.jsonld => offstreetparking2-with-location-and-name-only.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking2-no-location-and-totalspotsnumber.jsonld => offstreetparking2-without-location-and-totalspotsnumber.jsonld} (100%) rename data/entities/interoperability/{offstreet-parking2-no-location.jsonld => offstreetparking2-without-location.jsonld} (100%) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index c6984ba6..4c7ec201 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... The client sends a HTTP GET request to check that quering the OffStreetParking type returns the entities in B and C. +... Check that the OffStreetParking:1 entity in A is the same as the one in B. Check that the OffStreetParking:2 entity in A has the same totalSpotsNumber attribute as the one found in B. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld ${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index f8096226..b8716b79 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... The client sends and HTTP POST request to check that the entities with type OffStreetParking can be queried from all brokers. +... Check that the OffStreetParking:1 entity in A is the same as the one in B. Check that the OffStreetParking:2 entity in A has the same totalSpotsNumber attribute as the one found in B. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld -${third_entity_payload_filename} interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld +${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld ${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index cba6b6f8..463f7158 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -1,6 +1,7 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entities in C and D and one redirect for the entity in D. -... The client sends a HTTP GET request to check that quering the type OffStreetParking returns the entities in B, C and D. Said entities shall have the same attributes as the ones queried from A. +... Check that the OffStreetParking:1 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in B. Check that the OffStreetParking:1 entity in A has the same location attribute as the one found in C. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in C. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in D. + Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,11 +10,11 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_entity_no_location_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${second_entity_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${location_name_payload_filename} interoperability/offstreetparking2-location-and-name-only.jsonld +${first_entity_no_location_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${second_entity_no_location_payload_filename} interoperability/offstreetparking2-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 8a121495..9de4d4d1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has five registrations, two inclusive for the entities in B, one redirect for the entities in C and two redirect for the entity in D. -... Check that the entities in B, C and D have the same attributes as the ones queried from A. +... Check that the Vehicle:1 entity in A is the same as the one in B. Check that the entity OffStreetParking:1 in A is the same as the one in C. Check that the entities Vehicle:2 and OffStreetParking:2 in A are the same as the ones in D. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,12 +9,12 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld -${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld -${first_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld +${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld +${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld +${first_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 34cc7c1c..880d029d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. -... Check that the entities returned from A match the attributes of the entities in B, C and D. +... Check that the OffStreetParking:1 entity in A has the same name and location attributes as the ones in C. Check that the entity OffStreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in D. Check that the OffStreetParking:2 entity is the same as the one in B. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${offstreet_no_location_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${first_offstreet_no_location_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld +${offstreet_no_location_payload_filename} interoperability/offstreetparking2-without-location.jsonld +${first_offstreet_no_location_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 766066ca..8499decf 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. -... Check that queried entities returned from B, C and D match the attributes of the entities in A. +... Check that the OffStreetParking:1 entity in A has the same name and location attributes as the ones in C. Check that the OffStreetParking:1 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in D. Check that the OffStreetParking:2 entity is the same as the one in D. Check that the Vehicle:1 entity in A is the same as the one in B. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,11 +9,11 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_vehicle_payload_filename} interoperability/vehicle1-full.jsonld -${second_vehicle_payload_filename} interoperability/vehicle2-full.jsonld -${first_full_offstreet_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_offstreet_payload_filename} interoperability/offstreet-parking2-full.jsonld -${parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld +${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld +${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${inclusive_vehicle_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 5a349c41..dd849121 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. -... Check that the entities found in B, C, D and E can be queried from A via HTTP GET. The entities shall have the same attributes as the ones queried from A. +... Check that the OffStreetParking:1 entity has the same location attribute as the one in E. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld +${first_full_parking_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_parking_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index ae1686fb..b7b309de 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. -... Check that the entities found in B, C, D and E can be queried from A via HTTP POST. The entities shall have the same attributes as the ones queried from A. +... Check that the OffStreetParking:1 entity has the same location attribute as the one in E. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreet-parking2-location-and-name.jsonld -${first_full_parking_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_parking_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld +${first_full_parking_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_parking_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 185d660a..36b4a460 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the entity found foundin B and C shall be returned from A. +... Check that the OffStreetParking:1 entity returned from B matches the full OffStreetParking:1 entity. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${broker_A_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index c76dc034..c11a73ce 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the the entity in B and one exclusive for the entity in C. -... Check that the entity returned from A has attributes from both entities in B and C. +... Check that the OffStreetParking:2 entity returned from A has the same availableSpotsNumber and totalSpotsNumber attributes as the ones returned from B. Check that the OffStreetParking:2 entity returned from A has the same location attribute as the one returned from C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-no-location.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/offstreetparking2-without-location.jsonld +${full_entity_payload_filename} interoperability/full-version-of-offstreetparking2-full.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${expected_payload_file_path} interoperability/retrieve-entity-IOP-002-01-02.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 683fc07a..64606c0b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and one redirect for the entity in D. -... Check that the entity returned from A has attributes from the entities in B and C. +... Check that the OffStreetParking:1 entity returned from A match the availableSpotsNumber and totalSpotsNumber from the entity in B. Check that the OffStreetParking:1 entity returned from A match the location attribute from the entity in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${broker_A_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 1db3f097..101a246c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and ofoundne redirect for the entity in D. -... Check that the entity returned from C has the same location attribute found in A. +Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and one redirect for the entity in D. +... Check that the OffStreetParking:1 entity returned from A has location attribute. Check that the location attribute from the entity returned from A is the same as the one returned from C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${broker_A_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index d7e1ff2e..a008a292 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. -... Check that a partial response was returned from A and that the entity matches the one in B and it does not contain the attribute location found in C. +... Check that the OffStreetParking:1 entity returned from A does not contain the location attribute. Check that the entity returned from A does not contain the location attribute returned from C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${first_full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld -${second_full_entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index 39ec627e..354935cc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -1,7 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. -... Check the entity returned from A contains the location property and said attribute is the same as the one returned from C. - +... Check that the entity returned from A has the same location attribute as the one found in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations @@ -9,9 +8,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${location_name_entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index ba7491ee..1dd892f6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. -... Check that the entity returned from A has attributes from the entity in D and E. +... Check that the entity returned from A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the entity returned from A has the same location attribute as the one in E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index ceea2ab4..69bef0fe 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. -... Check that the entity returned from A match the attributes from the entity in B, C and E. +... Check that the entity returned from A has the same availableSpotsNumber and totalSpotsNumber as the ones found in B. Check that the entity returned from A has the same name attribute as the one in C. Check that the entity returned from A has the same location attribute as the one in E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreet-parking1-no-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld -${full_entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld +${location_name_entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index d8a45ba6..a42b7312 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the entity is created in A and B but not in C. +... Check that the entity is fully created in A. Check that the entity is created in B and only contains the availableSpotsNumber and totalSpotsNumber attributes. Check that the entity is not created in C. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${broker_a_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index 2e0d8e15..b5a7bbdc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that, in A and B, the entity is created not containing the location attribute, while C only contains the location attribute. +... Check that the entity is created in A and B not containing the location attribute. Check that the entity is created in C containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${broker_a_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-a.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index bba80cd4..62643007 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. -... The client creates the entity in A. The entity in A and B shall not contain the location attribute. The entity in C and D shall only contain the location attribute. +... Check that the entity is created in A and it does not contain the location property. Check that the entity is created in B and does not contain the location and name attributes. Check that the entity is created in C and D containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${broker_A_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index a5e82c94..dae43ad2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. -... The client creates the entity in A. The entity in A and B shall not contain the location attribute. The entity in C and D shall contain the location attribute. +... Check that the entity is created in A and does not contain the location attribute. Check that the entity is created in B and does not contain the location and name properties. Check that the entity is created in C and D containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index bc07f1fb..203496bc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. -... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be present in C. The entity in D shall only contain availableSpotsNumber and totalSpotsNumber. +... Check that the entity is created in A and C. The entity shall not be present in C. The entity in D shall only contain availableSpotsNumber and totalSpotsNumber. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index ff7e68f5..de17e859 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. -... The client creates the entity in A. The entity shall be present in A and C. The entity shall not be present in B and D. +... Check that the entity is created in A and C. The entity shall not be present in B and D. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-location-and-name.jsonld +${entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index a19051d3..bb5e71a5 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities in B and one inclusive for the entity in C. B has two registration, one redirect for the entities in D, one redirect for the entity in E. C has one exclusive registration to E. -... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be created in B, D and E. +... Check that the entity is created in A and C. The entity shall not be created in B, D and E. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking1-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 79d0cb6a..997f7c36 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities created in B and one inclusive for the entity created in C. B has two registration, one redirect for the entities created in D, one redirect for the entity created in E. C has one exclusive registration to E. -... The client creates the entity in A. The entity shall be created in A and C. The entity shall not be created in C and D. The entity shall be created in E with only one the totalSpotsNumber attribute. +... Check that the entity is created in A and C. The entity shall not be created in B and D. The entity shall be created in E with only one the totalSpotsNumber attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreet-parking2-full.jsonld +${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/data/entities/interoperability/offstreet-parking1-full.jsonld b/data/entities/interoperability/full-version-of-offstreetparking1.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking1-full.jsonld rename to data/entities/interoperability/full-version-of-offstreetparking1.jsonld diff --git a/data/entities/interoperability/offstreet-parking2-full.jsonld b/data/entities/interoperability/full-version-of-offstreetparking2.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking2-full.jsonld rename to data/entities/interoperability/full-version-of-offstreetparking2.jsonld diff --git a/data/entities/interoperability/vehicle1-full.jsonld b/data/entities/interoperability/full-version-of-vehicle1.jsonld similarity index 100% rename from data/entities/interoperability/vehicle1-full.jsonld rename to data/entities/interoperability/full-version-of-vehicle1.jsonld diff --git a/data/entities/interoperability/vehicle2-full.jsonld b/data/entities/interoperability/full-version-of-vehicle2.jsonld similarity index 100% rename from data/entities/interoperability/vehicle2-full.jsonld rename to data/entities/interoperability/full-version-of-vehicle2.jsonld diff --git a/data/entities/interoperability/offstreet-parking1-location-and-name.jsonld b/data/entities/interoperability/offstreetparking1-with-location-and-name-only.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking1-location-and-name.jsonld rename to data/entities/interoperability/offstreetparking1-with-location-and-name-only.jsonld diff --git a/data/entities/interoperability/offstreet-parking1-no-location.jsonld b/data/entities/interoperability/offstreetparking1-without-location.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking1-no-location.jsonld rename to data/entities/interoperability/offstreetparking1-without-location.jsonld diff --git a/data/entities/interoperability/offstreet-parking2-location-and-name.jsonld b/data/entities/interoperability/offstreetparking2-with-location-and-name-only.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking2-location-and-name.jsonld rename to data/entities/interoperability/offstreetparking2-with-location-and-name-only.jsonld diff --git a/data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld b/data/entities/interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking2-no-location-and-totalspotsnumber.jsonld rename to data/entities/interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld diff --git a/data/entities/interoperability/offstreet-parking2-no-location.jsonld b/data/entities/interoperability/offstreetparking2-without-location.jsonld similarity index 100% rename from data/entities/interoperability/offstreet-parking2-no-location.jsonld rename to data/entities/interoperability/offstreetparking2-without-location.jsonld -- GitLab From c1c0ebfc0ed367512c20840ccbb39b3130b27615 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 24 Jul 2026 12:06:31 +0200 Subject: [PATCH 12/34] fix tests to match D6 steps (added intermediate steps) --- .../Entity/QueryEntities/IOP_003_01_01.robot | 112 +++++++++---- .../Entity/QueryEntities/IOP_003_01_02.robot | 112 +++++++++---- .../Entity/QueryEntities/IOP_003_02_01.robot | 134 +++++++++++----- .../Entity/QueryEntities/IOP_003_02_02.robot | 127 ++++++++++----- .../Entity/QueryEntities/IOP_003_03_01.robot | 116 +++++++++----- .../Entity/QueryEntities/IOP_003_03_02.robot | 149 +++++++++++------- .../Entity/QueryEntities/IOP_003_04_01.robot | 142 +++++++++++------ .../Entity/QueryEntities/IOP_003_04_02.robot | 142 +++++++++++------ .../Entity/RetrieveEntity/IOP_002_01_01.robot | 64 +++++--- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 75 ++++++--- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 85 ++++++---- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 70 ++++---- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 90 ++++++++--- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 72 +++++---- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 99 ++++++++---- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 125 ++++++++++----- .../CreateEntity/IOP_001_01_01.robot | 57 ++++--- .../CreateEntity/IOP_001_01_02.robot | 64 ++++---- .../CreateEntity/IOP_001_02_01.robot | 56 +++---- .../CreateEntity/IOP_001_02_02.robot | 56 +++---- .../CreateEntity/IOP_001_03_01.robot | 50 +++--- .../CreateEntity/IOP_001_03_02.robot | 50 +++--- .../CreateEntity/IOP_001_04_01.robot | 72 +++++---- .../CreateEntity/IOP_001_04_02.robot | 84 +++++----- README.md | 12 +- .../create-entity-IOP-001-01-01-b.json | 17 -- .../create-entity-IOP-001-01-02-a.json | 21 --- .../create-entity-IOP-001-01-02-b.json | 17 -- .../create-entity-IOP-001-01-02-c.json | 11 -- .../query-entity-IOP-003-01-01-first.json | 28 ---- .../query-entity-IOP-003-01-01-second.json | 21 --- .../retrieve-entity-IOP-002-01-02.json | 24 --- scripts/run_tests.ps1 | 4 +- scripts/run_tests.sh | 4 +- 34 files changed, 1402 insertions(+), 960 deletions(-) delete mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json delete mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json delete mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json delete mode 100644 data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json delete mode 100644 data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json delete mode 100644 data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json delete mode 100644 data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 4c7ec201..84480347 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the OffStreetParking:1 entity in A is the same as the one in B. Check that the OffStreetParking:2 entity in A has the same totalSpotsNumber attribute as the one found in B. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in C. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the entities in b2 and one exclusive for the entity in b3. +... Check that OffStreetParking:1 in b1 contains availableSpotsNumber and totalSpotsNumber from b2. Check that OffStreetParking:2 in b1 contains availableSpotsNumber from b2 and location from b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -12,19 +12,17 @@ Test Teardown Delete Entities and Delete Registrations ${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json -${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. b3 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] ... since_v1.6.1 ... iop @@ -36,25 +34,69 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 - # Client queries all entities with type OffStreetParking in A. Agent checks for a successful response that contains the attributes availableSpotsNumber and totalSpotsNumber from OffStreetParking:1 and the attributes availableSpotsNumber and totalSpotsNumber and location from OffStreetParking:2. - ${response_a}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve all Entities with type OffstreetParking + ${response_b1}= Query Entities ... entity_types=OffStreetParking - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_a.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response_a.json()} - - # Agent checks that OffStreetParking:1 in A is the same as the one in B and that OffStreetParking:2 in A contains the attributes of both OffStreetParking:2 in B and C. - Check Response Body Containing Entity element by id - ... ${first_expected_payload_file_path} - ... ${first_entity_id} - ... ${response_a.json()} - Check Response Body Containing Entity element by id - ... ${second_expected_payload_file_path} - ... ${second_entity_id} - ... ${response_a.json()} + # Agent checks that a success response has been returned and that the following Entities were returned: + # OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber + # OffstreetParking:2 with the attributes availableSpotsNumber and location + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b2 to retrieve all Entities with type OffstreetParking + ${response_b2}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${first_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b3 to retrieve all Entities with type OffstreetParking + ${response_b3}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${second_entity_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${second_entity_id}')] + + # Agent checks that b2 returns OffstreetParking:1 and OffstreetParking:2 and b3 returns OffstreetParking:2 + ${expected_first_b2}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b2} @context + Check Resource Set To ${expected_first_b2} ${first_entity_b2}[0] + ${expected_second_b2}= Load Entity ${third_entity_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b2} @context + Check Resource Set To ${expected_second_b2} ${second_entity_b2}[0] + ${expected_second_b3}= Load Entity ${second_entity_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b3} @context + Check Resource Set To ${expected_second_b3} ${second_entity_b3}[0] + + # Agent checks that OffstreetParking:1 returned in step (2) matches b2 and OffstreetParking:2 combines b2 and b3 + ${expected_first_b1}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_first_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_first_b1} + ... availableSpotsNumber=${first_entity_b2}[0][availableSpotsNumber] + ... totalSpotsNumber=${first_entity_b2}[0][totalSpotsNumber] + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + + ${expected_second_b1}= Load Entity ${third_entity_payload_filename} ${second_entity_id} + Keep In Dictionary ${expected_second_b1} id type availableSpotsNumber + Set To Dictionary + ... ${expected_second_b1} + ... availableSpotsNumber=${second_entity_b2}[0][availableSpotsNumber] + ... location=${second_entity_b3}[0][location] + Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] *** Keywords *** @@ -65,39 +107,39 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${second_entity_id} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index b8716b79..d0206b55 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the OffStreetParking:1 entity in A is the same as the one in B. Check that the OffStreetParking:2 entity in A has the same totalSpotsNumber attribute as the one found in B. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in C. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the entities in b2 and one exclusive for the entity in b3. +... Check that OffStreetParking:1 in b1 contains availableSpotsNumber and totalSpotsNumber from b2. Check that OffStreetParking:2 in b1 contains availableSpotsNumber from b2 and location from b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -12,19 +12,17 @@ Test Teardown Delete Entities and Delete Registrations ${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${first_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json -${second_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-second.json -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2 without location. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. b3 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] ... since_v1.6.1 ... iop @@ -36,27 +34,71 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... 5_7_2 ... 6_23_2_1 - # Client queries all entities with type OffStreetParking in A and agent checks for a successful response. It should contain the attributes availableSpotsNumber and totalSpotsNumber from OffStreetParking:1 and the attributes availableSpotsNumber and location from OffStreetParking:2. + # Client sends an HTTP POST request to b1 to retrieve all Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @{entities}= Create List ${entity_selector} - ${response_a}= Query Entities Via POST + ${response_b1}= Query Entities Via POST ... entities=${entities} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response_a.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response_a.json()} - - # Agent checks that OffstreetParking:1 in A is the same as the one in B and that OffstreetParking:2 in A contains the attributes of both OffstreetParking:2 in B and C. - Check Response Body Containing Entity element by id - ... ${first_expected_payload_file_path} - ... ${first_entity_id} - ... ${response_a.json()} - Check Response Body Containing Entity element by id - ... ${second_expected_payload_file_path} - ... ${second_entity_id} - ... ${response_a.json()} + # Agent checks that a success response has been returned and that the following Entities were returned: + # OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber + # OffstreetParking:2 with the attributes availableSpotsNumber and location + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP POST request to b2 to retrieve all Entities with type OffstreetParking + ${response_b2}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${first_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP POST request to b3 to retrieve all Entities with type OffstreetParking + ${response_b3}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${second_entity_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${second_entity_id}')] + + # Agent checks that b2 returns OffstreetParking:1 and OffstreetParking:2 and b3 returns OffstreetParking:2 + ${expected_first_b2}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b2} @context + Check Resource Set To ${expected_first_b2} ${first_entity_b2}[0] + ${expected_second_b2}= Load Entity ${third_entity_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b2} @context + Check Resource Set To ${expected_second_b2} ${second_entity_b2}[0] + ${expected_second_b3}= Load Entity ${second_entity_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b3} @context + Check Resource Set To ${expected_second_b3} ${second_entity_b3}[0] + + # Agent checks that OffstreetParking:1 returned in step (2) matches b2 and OffstreetParking:2 combines b2 and b3 + ${expected_first_b1}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_first_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_first_b1} + ... availableSpotsNumber=${first_entity_b2}[0][availableSpotsNumber] + ... totalSpotsNumber=${first_entity_b2}[0][totalSpotsNumber] + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + + ${expected_second_b1}= Load Entity ${third_entity_payload_filename} ${second_entity_id} + Keep In Dictionary ${expected_second_b1} id type availableSpotsNumber + Set To Dictionary + ... ${expected_second_b1} + ... availableSpotsNumber=${second_entity_b2}[0][availableSpotsNumber] + ... location=${second_entity_b3}[0][location] + Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] *** Keywords *** @@ -67,39 +109,39 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index 463f7158..1b6bf36f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -1,7 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entities in C and D and one redirect for the entity in D. -... Check that the OffStreetParking:1 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in B. Check that the OffStreetParking:1 entity in A has the same location attribute as the one found in C. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in C. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in D. - +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one inclusive for the entities in b2, one redirect for the entities in b3 and b4 and one redirect for the entity in b4. +... Check that the OffStreetParking:1 entity in b1 has the same availableSpotsNumber and totalSpotsNumber attributes as the one in b2. Check that the OffStreetParking:1 entity in b1 has the same location attribute as the one found in b3. Check that the OffStreetParking:2 entity in b1 has the same availableSpotsNumber and totalSpotsNumber attributes as the one in b3. Check that the OffStreetParking:2 entity in b1 has the same location attribute as the one in b4. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -18,16 +17,16 @@ ${second_full_entity_payload_filename} interoperability/full-ve ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data on every broker. B contains OffStreetParking:1 without location and OffStreetParking:2 without location. C contains OffStreetParking:1 and OffStreetParking:2. D contains OffStreetParking:2 with location and name only. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 without location and OffStreetParking:2 without location. b3 contains OffStreetParking:1 and OffStreetParking:2. b4 contains OffStreetParking:2 with location and name only. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] ... since_v1.6.1 ... iop @@ -39,28 +38,85 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 - # Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute. - ${response}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking + ${response_b1}= Query Entities ... entity_types=OffStreetParking - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - ${first_expected}= Load Entity ${first_entity_no_location_payload_filename} ${first_entity_id} - ${first_location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} - Remove From Dictionary ${first_expected} @context name - Set To Dictionary ${first_expected} location=${first_location_source}[location] - ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Check Resource Set To ${first_expected} ${first_entity}[0] + # Agent checks that a success response has been returned and that OffstreetParking:1 and OffstreetParking:2 were returned with all properties but "name" + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] - ${second_expected}= Load Entity ${second_entity_no_location_payload_filename} ${second_entity_id} - ${second_location_source}= Load Entity ${location_name_payload_filename} ${second_entity_id} - Remove From Dictionary ${second_expected} @context name - Set To Dictionary ${second_expected} location=${second_location_source}[location] - ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Check Resource Set To ${second_expected} ${second_entity}[0] + # Client sends an HTTP GET request to b2 to retrieve Entities with type OffstreetParking + ${response_b2}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${first_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b3 to retrieve Entities with type OffstreetParking + ${response_b3}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${first_entity_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b4 to retrieve Entities with type OffstreetParking + ${response_b4}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${second_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_entity_id}')] + + ${expected_first_b2}= Load Entity ${first_entity_no_location_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b2} @context + Check Resource Set To ${expected_first_b2} ${first_entity_b2}[0] + ${expected_second_b2}= Load Entity ${second_entity_no_location_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b2} @context + Check Resource Set To ${expected_second_b2} ${second_entity_b2}[0] + ${expected_first_b3}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b3} @context + Check Resource Set To ${expected_first_b3} ${first_entity_b3}[0] + ${expected_second_b3}= Load Entity ${second_full_entity_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b3} @context + Check Resource Set To ${expected_second_b3} ${second_entity_b3}[0] + ${expected_second_b4}= Load Entity ${location_name_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b4} @context + Check Resource Set To ${expected_second_b4} ${second_entity_b4}[0] + + # Agent checks the broker-b1 Entities against the attributes returned by b2, b3 and b4 + ${expected_first_b1}= Load Entity ${first_entity_no_location_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_first_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_first_b1} + ... availableSpotsNumber=${first_entity_b2}[0][availableSpotsNumber] + ... totalSpotsNumber=${first_entity_b2}[0][totalSpotsNumber] + ... location=${first_entity_b3}[0][location] + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + + ${expected_second_b1}= Load Entity ${second_entity_no_location_payload_filename} ${second_entity_id} + Keep In Dictionary ${expected_second_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_second_b1} + ... availableSpotsNumber=${second_entity_b2}[0][availableSpotsNumber] + ... totalSpotsNumber=${second_entity_b2}[0][totalSpotsNumber] + ... location=${second_entity_b4}[0][location] + Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] *** Keywords *** @@ -71,54 +127,54 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_entity_no_location_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_no_location_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 9de4d4d1..e7e81c74 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has five registrations, two inclusive for the entities in B, one redirect for the entities in C and two redirect for the entity in D. -... Check that the Vehicle:1 entity in A is the same as the one in B. Check that the entity OffStreetParking:1 in A is the same as the one in C. Check that the entities Vehicle:2 and OffStreetParking:2 in A are the same as the ones in D. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has five registrations, two inclusive for the entities in b2, one redirect for the entities in b3 and two redirect for the entity in b4. +... Check that the Vehicle:1 entity in b1 is the same as the one in b2. Check that the entity OffStreetParking:1 in b1 is the same as the one in b3. Check that the entities Vehicle:2 and OffStreetParking:2 in b1 are the same as the ones in b4. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -20,16 +20,16 @@ ${second_inclusive_registration_payload_file_path} csourceRegistrations/int ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld ${third_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and Vehicle:1. C contains OffStreetParking:1 with location and name only and OffStreetParking:2. D contains OffStreetParking:2 with location and name only and Vehicle:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and Vehicle:1. b3 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b4 contains OffStreetParking:2 with location and name only and Vehicle:2. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] ... since_v1.6.1 ... iop @@ -41,43 +41,86 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 5_7_2 ... 6_4_3_1 - # Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities. - ${response}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List + + # Agent checks that a success response has been returned and that all four Entities were returned with the "location" Property only + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ... ${first_parking_entity_id} ... ${second_parking_entity_id} ... ${first_vehicle_entity_id} ... ${second_vehicle_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_parking_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_parking_entity_id}')] + ${second_parking_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_parking_entity_id}')] + ${first_vehicle_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_vehicle_entity_id}')] + ${second_vehicle_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_vehicle_entity_id}')] + + # Client sends an HTTP GET request to b2 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b2}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${first_parking_entity_id} ${first_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${first_parking_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_parking_entity_id}')] + ${first_vehicle_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_vehicle_entity_id}')] + + # Client sends an HTTP GET request to b3 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b3}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${first_parking_entity_id} ${second_parking_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${first_parking_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${first_parking_entity_id}')] + ${second_parking_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${second_parking_entity_id}')] + + # Client sends an HTTP GET request to b4 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b4}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List ${second_parking_entity_id} ${second_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${second_parking_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_parking_entity_id}')] + ${second_vehicle_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_vehicle_entity_id}')] ${first_parking_expected}= Load Entity ... ${first_parking_location_name_payload_filename} ... ${first_parking_entity_id} Keep In Dictionary ${first_parking_expected} id type location - ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] - Check Resource Set To ${first_parking_expected} ${first_parking}[0] - + Check Resource Set To ${first_parking_expected} ${first_parking_b2}[0] + Check Resource Set To ${first_parking_expected} ${first_parking_b3}[0] ${second_parking_expected}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_parking_entity_id} Keep In Dictionary ${second_parking_expected} id type location - ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] - Check Resource Set To ${second_parking_expected} ${second_parking}[0] - + Check Resource Set To ${second_parking_expected} ${second_parking_b3}[0] + Check Resource Set To ${second_parking_expected} ${second_parking_b4}[0] ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} Keep In Dictionary ${first_vehicle_expected} id type location - ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] - Check Resource Set To ${first_vehicle_expected} ${first_vehicle}[0] - + Check Resource Set To ${first_vehicle_expected} ${first_vehicle_b2}[0] ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} Keep In Dictionary ${second_vehicle_expected} id type location - ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] - Check Resource Set To ${second_vehicle_expected} ${second_vehicle}[0] + Check Resource Set To ${second_vehicle_expected} ${second_vehicle_b4}[0] + + # Agent checks that Vehicle:1 matches b2, OffstreetParking:1 matches b3, and Vehicle:2 and OffstreetParking:2 match b4 + Check Resource Set To ${first_parking_b3}[0] ${first_parking_b1}[0] + Check Resource Set To ${second_parking_b4}[0] ${second_parking_b1}[0] + Check Resource Set To ${first_vehicle_b2}[0] ${first_vehicle_b1}[0] + Check Resource Set To ${second_vehicle_b4}[0] ${second_vehicle_b1}[0] *** Keywords *** @@ -90,68 +133,68 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_payload_filename} ... ${first_parking_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_parking_location_name_payload_filename} ... ${first_parking_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_offstreet_payload_filename} ... ${second_parking_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_parking_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fourth_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${third_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ... ${first_set} @@ -162,7 +205,7 @@ Setup Initial Context Source Registrations Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ... ${first_parking_entity_id} ... ${second_parking_entity_id} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 880d029d..2758d00a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. -... Check that the OffStreetParking:1 entity in A has the same name and location attributes as the ones in C. Check that the entity OffStreetParking:1 in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in D. Check that the OffStreetParking:2 entity is the same as the one in B. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entities in b2, one inclusive for the entities in b3 and one inclusive for the entity in b4. +... Check that the OffStreetParking:1 entity in b1 has the same name and location attributes as the ones in b3. Check that the entity OffStreetParking:1 in b1 has the same availableSpotsNumber and totalSpotsNumber attributes as the one in b4. Check that the OffStreetParking:2 entity is the same as the one in b2. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -16,16 +16,16 @@ ${second_full_offstreet_payload_filename} interoperability/full-ve ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:2 without location. C contains OffStreetParking:1. D contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:2 without location. b3 contains OffStreetParking:1. b4 contains OffStreetParking:1 without location. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] ... since_v1.6.1 ... iop @@ -37,30 +37,70 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 - # Client queries all entities with type OffstreetParking in A and checks for a successful response. - ${response}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking + ${response_b1}= Query Entities ... entity_types=OffStreetParking - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - ${first_expected}= Load Entity ${first_full_offstreet_payload_filename} ${first_entity_id} - ${latest_attribute_source}= Load Entity - ... ${first_offstreet_no_location_payload_filename} - ... ${first_entity_id} - Set To Dictionary - ... ${first_expected} - ... availableSpotsNumber=${latest_attribute_source}[availableSpotsNumber] - Remove From Dictionary ${first_expected} @context - ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Check Resource Set To ${first_expected} ${first_entity}[0] + # Agent checks that a success response has been returned with the Full version of OffstreetParking:1 and OffstreetParking:2 without location + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b2 to retrieve Entities with type OffstreetParking + ${response_b2}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${second_entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${second_entity_id}')] - ${second_expected}= Load Entity ${offstreet_no_location_payload_filename} ${second_entity_id} - Remove From Dictionary ${second_expected} @context - ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Check Resource Set To ${second_expected} ${second_entity}[0] + # Client sends an HTTP GET request to b3 to retrieve Entities with type OffstreetParking + ${response_b3}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${first_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${first_entity_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${first_entity_id}')] + + # Client sends an HTTP GET request to b4 to retrieve Entities with type OffstreetParking + ${response_b4}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List ${first_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${first_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${first_entity_id}')] + + ${expected_second_b2}= Load Entity ${offstreet_no_location_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b2} @context + Check Resource Set To ${expected_second_b2} ${second_entity_b2}[0] + ${expected_first_b3}= Load Entity ${first_full_offstreet_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b3} @context + Check Resource Set To ${expected_first_b3} ${first_entity_b3}[0] + ${expected_first_b4}= Load Entity ${first_offstreet_no_location_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b4} @context + Check Resource Set To ${expected_first_b4} ${first_entity_b4}[0] + + # Agent checks that OffstreetParking:1 combines b3 and b4 and OffstreetParking:2 matches b2 + ${expected_first_b1}= Load Entity ${first_full_offstreet_payload_filename} ${first_entity_id} + Set To Dictionary + ... ${expected_first_b1} + ... availableSpotsNumber=${first_entity_b4}[0][availableSpotsNumber] + ... totalSpotsNumber=${first_entity_b4}[0][totalSpotsNumber] + ... name=${first_entity_b3}[0][name] + ... location=${first_entity_b3}[0][location] + Remove From Dictionary ${expected_first_b1} @context + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + Check Resource Set To ${second_entity_b2}[0] ${second_entity_b1}[0] *** Keywords *** @@ -71,44 +111,44 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${offstreet_no_location_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_no_location_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 8499decf..5ec589c8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entities in C and one inclusive for the entity in D. -... Check that the OffStreetParking:1 entity in A has the same name and location attributes as the ones in C. Check that the OffStreetParking:1 entity in A has the same availableSpotsNumber and totalSpotsNumber attributes as the one in D. Check that the OffStreetParking:2 entity is the same as the one in D. Check that the Vehicle:1 entity in A is the same as the one in B. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entities in b2, one inclusive for the entities in b3 and one inclusive for the entity in b4. +... Check that the OffStreetParking:1 entity in b1 has the same name and location attributes as the ones in b3. Check that the OffStreetParking:1 entity in b1 has the same availableSpotsNumber and totalSpotsNumber attributes as the one in b4. Check that the OffStreetParking:2 entity is the same as the one in b4. Check that the Vehicle:1 entity in b1 is the same as the one in b2. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -9,24 +9,23 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld -${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld -${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld -${parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld -${inclusive_vehicle_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld +${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld +${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains Vehicle:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:1, OffStreetParking:2 and Vehicle:2. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains Vehicle:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:1, OffStreetParking:2 and Vehicle:2. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] ... since_v1.6.1 ... iop @@ -38,43 +37,92 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 5_7_2 ... 6_4_3_1 - # Client retrieves the location property from all entities with type OffstreetParking and Vehicle in A and checks for a successful response. - ${response}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve the "location" Property from all Entities having type OffstreetParking or Vehicle + ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List + + # Agent checks that a success response has been returned with OffstreetParking:1, OffstreetParking:2 and Vehicle:1 + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ... ${first_parking_entity_id} ... ${second_parking_entity_id} ... ${first_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_parking_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_parking_entity_id}')] + ${second_parking_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_parking_entity_id}')] + ${first_vehicle_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_vehicle_entity_id}')] + + # Client sends an HTTP GET request to b2 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b2}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b2_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2_ids}= Create List ${first_vehicle_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} + ${first_vehicle_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${first_vehicle_entity_id}')] + + # Client sends an HTTP GET request to b3 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b3}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b3_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3_ids}= Create List ${first_parking_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} + ${first_parking_b3}= Get Value From JSON ${response_b3.json()} $[?(@.id=='${first_parking_entity_id}')] + + # Client sends an HTTP GET request to b4 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle + ${response_b4}= Query Entities + ... entity_types=OffStreetParking,Vehicle + ... attrs=location + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List + ... ${first_parking_entity_id} + ... ${second_parking_entity_id} ... ${second_vehicle_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${first_parking_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${first_parking_entity_id}')] + ${second_parking_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_parking_entity_id}')] + ${second_vehicle_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_vehicle_entity_id}')] ${first_parking_expected}= Load Entity ... ${parking_location_name_payload_filename} ... ${first_parking_entity_id} Keep In Dictionary ${first_parking_expected} id type location - ${first_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${first_parking_entity_id}')] - Check Resource Set To ${first_parking_expected} ${first_parking}[0] - + Check Resource Set To ${first_parking_expected} ${first_parking_b3}[0] + ${first_parking_b4_expected}= Load Entity + ... ${first_full_offstreet_payload_filename} + ... ${first_parking_entity_id} + Keep In Dictionary ${first_parking_b4_expected} id type location + Check Resource Set To ${first_parking_b4_expected} ${first_parking_b4}[0] ${second_parking_expected}= Load Entity ... ${second_full_offstreet_payload_filename} ... ${second_parking_entity_id} Keep In Dictionary ${second_parking_expected} id type location - ${second_parking}= Get Value From JSON ${response.json()} $[?(@.id=='${second_parking_entity_id}')] - Check Resource Set To ${second_parking_expected} ${second_parking}[0] - + Check Resource Set To ${second_parking_expected} ${second_parking_b4}[0] ${first_vehicle_expected}= Load Entity ${first_vehicle_payload_filename} ${first_vehicle_entity_id} - Keep In Dictionary ${first_vehicle_expected} id type location - ${first_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${first_vehicle_entity_id}')] - Check Resource Set To ${first_vehicle_expected} ${first_vehicle}[0] - + ${first_vehicle_location_expected}= Load Entity + ... ${first_vehicle_payload_filename} + ... ${first_vehicle_entity_id} + Keep In Dictionary ${first_vehicle_location_expected} id type location + Check Resource Set To ${first_vehicle_location_expected} ${first_vehicle_b2}[0] ${second_vehicle_expected}= Load Entity ${second_vehicle_payload_filename} ${second_vehicle_entity_id} Keep In Dictionary ${second_vehicle_expected} id type location - ${second_vehicle}= Get Value From JSON ${response.json()} $[?(@.id=='${second_vehicle_entity_id}')] - Check Resource Set To ${second_vehicle_expected} ${second_vehicle}[0] + Check Resource Set To ${second_vehicle_expected} ${second_vehicle_b4}[0] + + # Agent checks that OffstreetParking:1 matches b3, OffstreetParking:2 matches b4 and Vehicle:1 comes from b2 + Check Resource Set To ${first_parking_b3}[0] ${first_parking_b1}[0] + Check Resource Set To ${second_parking_b4}[0] ${second_parking_b1}[0] + Remove From Dictionary ${first_vehicle_expected} @context + Check Resource Set To ${first_vehicle_expected} ${first_vehicle_b1}[0] *** Keywords *** @@ -87,62 +135,55 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${parking_location_name_payload_filename} ... ${first_parking_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_parking_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_offstreet_payload_filename} ... ${second_parking_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} - - @{fourth_set}= Create List - ... ${EMPTY} - ... ${inclusive_vehicle_registration_payload_file_path} - ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} - @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} ${fourth_set} + @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ... ${first_vehicle_entity_id} ... ${second_vehicle_entity_id} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index dd849121..a35696fe 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. -... Check that the OffStreetParking:1 entity has the same location attribute as the one in E. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in E. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3. b2 has two registrations, one redirect for the entity in b4 and one redirect for the entity in b5. b3 has two exclusive registrations to b5. +... Check that the OffStreetParking:1 entity has the same location attribute as the one in b5. Check that the OffStreetParking:2 entity in b1 has the same availableSpotsNumber and totalSpotsNumber as the ones found in b4. Check that the OffStreetParking:2 entity in b1 has the same location attribute as the one in b5. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -19,17 +19,17 @@ ${first_exclusive_registration_payload_file_path} csourceRegistrations/int ${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 with location and name only and OffStreetParking:2. E contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b5 contains OffStreetParking:1 and OffStreetParking:2 with location and name only. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -43,34 +43,72 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 - # Client queries all entities with type OffStreetParking in A and checks for a successful response. - ${response}= Query Entities + # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking + ${response_b1}= Query Entities ... entity_types=OffStreetParking - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} - Keep In Dictionary ${first_expected} id type location - ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Check Resource Set To ${first_expected} ${first_entity}[0] + # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] - ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} - ${second_location_source}= Load Entity + # Client sends an HTTP GET request to b4 to retrieve Entities with type OffstreetParking + ${response_b4}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${first_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP GET request to b5 to retrieve Entities with type OffstreetParking + ${response_b5}= Query Entities + ... entity_types=OffStreetParking + ... broker_url=${b5_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b5.status_code} + ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} + ${first_entity_b5}= Get Value From JSON ${response_b5.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b5}= Get Value From JSON ${response_b5.json()} $[?(@.id=='${second_entity_id}')] + + ${expected_first_b4}= Load Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_entity_id} + Remove From Dictionary ${expected_first_b4} @context + Check Resource Set To ${expected_first_b4} ${first_entity_b4}[0] + ${expected_second_b4}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b4} @context + Check Resource Set To ${expected_second_b4} ${second_entity_b4}[0] + ${expected_first_b5}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b5} @context + Check Resource Set To ${expected_first_b5} ${first_entity_b5}[0] + ${expected_second_b5}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} - Set To Dictionary ${second_expected} location=${second_location_source}[location] - Keep In Dictionary - ... ${second_expected} - ... id - ... type - ... availableSpotsNumber - ... totalSpotsNumber - ... location - ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Check Resource Set To ${second_expected} ${second_entity}[0] + Remove From Dictionary ${expected_second_b5} @context + Check Resource Set To ${expected_second_b5} ${second_entity_b5}[0] + + # Agent checks that OffstreetParking:1 uses the location from b5 and OffstreetParking:2 combines b4 and b5 + ${expected_first_b1}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_first_b1} id type location + Set To Dictionary ${expected_first_b1} location=${first_entity_b5}[0][location] + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + + ${expected_second_b1}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + Keep In Dictionary ${expected_second_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_second_b1} + ... availableSpotsNumber=${second_entity_b4}[0][availableSpotsNumber] + ... totalSpotsNumber=${second_entity_b4}[0][totalSpotsNumber] + ... location=${second_entity_b5}[0][location] + Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] *** Keywords *** @@ -81,65 +119,65 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${first_exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{sixth_set}= Create List ... ${EMPTY} ... ${second_exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -152,10 +190,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index b7b309de..a7ed8eba 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C has two exclusive registrations to E. -... Check that the OffStreetParking:1 entity has the same location attribute as the one in E. Check that the OffStreetParking:2 entity in A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the OffStreetParking:2 entity in A has the same location attribute as the one in E. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3. b2 has two registrations, one redirect for the entity in b4 and one redirect for the entity in b5. b3 has two exclusive registrations to b5. +... Check that the OffStreetParking:1 entity has the same location attribute as the one in b5. Check that the OffStreetParking:2 entity in b1 has the same availableSpotsNumber and totalSpotsNumber as the ones found in b4. Check that the OffStreetParking:2 entity in b1 has the same location attribute as the one in b5. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -19,17 +19,17 @@ ${first_exclusive_registration_payload_file_path} csourceRegistrations/int ${second_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST - [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 with location and name only and OffStreetParking:2. E contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b5 contains OffStreetParking:1 and OffStreetParking:2 with location and name only. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -43,36 +43,74 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ... 5_7_2 ... 6_23_2_1 - # Client queries all entities with type OffStreetParking in A and checks for a successful response. + # Client sends an HTTP POST request to b1 to retrieve Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @{entities}= Create List ${entity_selector} - ${response}= Query Entities Via POST + ${response_b1}= Query Entities Via POST ... entities=${entities} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - Check Response Status Code 200 ${response.status_code} - ${entity_ids}= Create List ${first_entity_id} ${second_entity_id} - Check Response Body Containing Entities URIS set to ${entity_ids} ${response.json()} - ${first_expected}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} - Keep In Dictionary ${first_expected} id type location - ${first_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${first_entity_id}')] - Check Resource Set To ${first_expected} ${first_entity}[0] + # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" + Check Response Status Code 200 ${response_b1.status_code} + ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} + ${first_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${second_entity_id}')] - ${second_expected}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} - ${second_location_source}= Load Entity + # Client sends an HTTP POST request to b4 to retrieve Entities with type OffstreetParking + ${response_b4}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${b4_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} + ${first_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b4}= Get Value From JSON ${response_b4.json()} $[?(@.id=='${second_entity_id}')] + + # Client sends an HTTP POST request to b5 to retrieve Entities with type OffstreetParking + ${response_b5}= Query Entities Via POST + ... entities=${entities} + ... broker_url=${b5_url} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response_b5.status_code} + ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} + ${first_entity_b5}= Get Value From JSON ${response_b5.json()} $[?(@.id=='${first_entity_id}')] + ${second_entity_b5}= Get Value From JSON ${response_b5.json()} $[?(@.id=='${second_entity_id}')] + + ${expected_first_b4}= Load Entity + ... ${first_parking_location_name_payload_filename} + ... ${first_entity_id} + Remove From Dictionary ${expected_first_b4} @context + Check Resource Set To ${expected_first_b4} ${first_entity_b4}[0] + ${expected_second_b4}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + Remove From Dictionary ${expected_second_b4} @context + Check Resource Set To ${expected_second_b4} ${second_entity_b4}[0] + ${expected_first_b5}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_first_b5} @context + Check Resource Set To ${expected_first_b5} ${first_entity_b5}[0] + ${expected_second_b5}= Load Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} - Set To Dictionary ${second_expected} location=${second_location_source}[location] - Keep In Dictionary - ... ${second_expected} - ... id - ... type - ... availableSpotsNumber - ... totalSpotsNumber - ... location - ${second_entity}= Get Value From JSON ${response.json()} $[?(@.id=='${second_entity_id}')] - Check Resource Set To ${second_expected} ${second_entity}[0] + Remove From Dictionary ${expected_second_b5} @context + Check Resource Set To ${expected_second_b5} ${second_entity_b5}[0] + + # Agent checks that OffstreetParking:1 uses the location from b5 and OffstreetParking:2 combines b4 and b5 + ${expected_first_b1}= Load Entity ${first_full_parking_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_first_b1} id type location + Set To Dictionary ${expected_first_b1} location=${first_entity_b5}[0][location] + Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] + + ${expected_second_b1}= Load Entity ${second_full_parking_payload_filename} ${second_entity_id} + Keep In Dictionary ${expected_second_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_second_b1} + ... availableSpotsNumber=${second_entity_b4}[0][availableSpotsNumber] + ... totalSpotsNumber=${second_entity_b4}[0][totalSpotsNumber] + ... location=${second_entity_b5}[0][location] + Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] *** Keywords *** @@ -83,65 +121,65 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${first_exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{sixth_set}= Create List ... ${EMPTY} ... ${second_exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -154,10 +192,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 36b4a460..f5e7cc47 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the OffStreetParking:1 entity returned from B matches the full OffStreetParking:1 entity. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the entities in b2 and one exclusive for the entity in b3. +... Check that the OffStreetParking:1 entity returned from b2 matches the full OffStreetParking:1 entity. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -13,27 +13,47 @@ ${first_entity_payload_filename} interoperability/full-version-of ${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 and OffStreetParking:2. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2. b3 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a successful response. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${first_entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${first_entity_payload_filename} ${first_entity_id} - Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a success response has been returned and that only availableSpotsNumber and totalSpotsNumber of OffStreetParking:1 were returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b2 to retrieve the OffStreetParking:1 + ${response_b2}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b2_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b2.status_code} + + # Agent checks that the Entity returned in step (3) is the full Entity + ${expected_b2}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b2} @context + Check Resource Set To ${expected_b2} ${response_b2.json()} + + ${expected_b1}= Load Entity ${first_entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_b1} + ... availableSpotsNumber=${response_b2.json()}[availableSpotsNumber] + ... totalSpotsNumber=${response_b2.json()}[totalSpotsNumber] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -44,39 +64,39 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index c11a73ce..158bf09f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the the entity in B and one exclusive for the entity in C. -... Check that the OffStreetParking:2 entity returned from A has the same availableSpotsNumber and totalSpotsNumber attributes as the ones returned from B. Check that the OffStreetParking:2 entity returned from A has the same location attribute as the one returned from C. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the the entity in b2 and one exclusive for the entity in b3. +... Check that the OffStreetParking:2 entity returned from b1 has the same availableSpotsNumber and totalSpotsNumber attributes as the ones returned from b2. Check that the OffStreetParking:2 entity returned from b1 has the same location attribute as the one returned from b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -13,29 +13,60 @@ ${entity_payload_filename} interoperability/offstreetparkin ${full_entity_payload_filename} interoperability/full-version-of-offstreetparking2-full.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${expected_payload_file_path} interoperability/retrieve-entity-IOP-002-01-02.json -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_02 Retrieve OffStreetParking:2 - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:2 without location. C contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:2 without location. b3 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 - # Client retrieves OffStreetParking:2 in A and checks for a successful response. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:2 + ${response_b1}= Retrieve Entity ... ${entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${expected_payload_file_path} + + # Agent checks that a success response has been returned and that the Entity OffStreetParking:2 was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:2 + ${response_b2}= Retrieve Entity ... ${entity_id} - ... ${response.json()} + ... context=${ngsild_test_suite_context} + ... broker_url=${b2_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b2} @context + Check Resource Set To ${expected_b2} ${response_b2.json()} + + # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:2 + ${response_b3}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${full_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Agent checks that the Entity returned in step (2) is structured as follows + # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # The attribute "location" matches the one from the Entity returned in step (4) + ${expected_b1}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_b1} + ... availableSpotsNumber=${response_b2.json()}[availableSpotsNumber] + ... totalSpotsNumber=${response_b2.json()}[totalSpotsNumber] + ... location=${response_b3.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -45,33 +76,33 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${full_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${entity_id} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${entity_id} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 64606c0b..5283f925 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and one redirect for the entity in D. -... Check that the OffStreetParking:1 entity returned from A match the availableSpotsNumber and totalSpotsNumber from the entity in B. Check that the OffStreetParking:1 entity returned from A match the location attribute from the entity in C. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one inclusive for the entity in b2, one redirect for the entity in b3 and one redirect for the entity in b4. +... Check that the OffStreetParking:1 entity returned from b1 match the availableSpotsNumber and totalSpotsNumber from the entity in b2. Check that the OffStreetParking:1 entity returned from b1 match the location attribute from the entity in b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -14,74 +14,105 @@ ${first_full_entity_payload_filename} interoperability/full-version-of ${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1 without location. C contains OffStreetParking:1. D contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 without location. b3 contains OffStreetParking:1. b4 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and agent checks for a partial successful. The entity returned should be the whole entity. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${first_entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} - Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber - ${location_source}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} - Set To Dictionary ${expected_payload} location=${location_source}[location] - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a partial success response has been returned and that the Full version of OffStreetParking:1 was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:1 + ${response_b2}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b2_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2}= Load Entity ${entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b2} @context + Check Resource Set To ${expected_b2} ${response_b2.json()} + + # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:1 + ${response_b3}= Retrieve Entity + ... ${first_entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Agent checks that the Entity returned in step (2) is structured as follows + # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # The attribute "location" matches the one from the Entity returned in step (4) + ${expected_b1}= Load Entity ${entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_b1} + ... availableSpotsNumber=${response_b2.json()}[availableSpotsNumber] + ... totalSpotsNumber=${response_b2.json()}[totalSpotsNumber] + ... location=${response_b3.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** Setup Initial Context Source Registrations Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_B_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 101a246c..d485bd4c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entity in B, one redirect for the entity in C and one redirect for the entity in D. -... Check that the OffStreetParking:1 entity returned from A has location attribute. Check that the location attribute from the entity returned from A is the same as the one returned from C. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one inclusive for the entity in b2, one redirect for the entity in b3 and one redirect for the entity in b4. +... Check that the OffStreetParking:1 entity returned from b1 has location attribute. Check that the location attribute from the entity returned from b1 is the same as the one returned from b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -14,30 +14,46 @@ ${first_full_entity_payload_filename} interoperability/full-version-of ${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:2. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:2. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should contain the location attribute. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the "location" Property from the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${first_entity_id} + ... attrs=location ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} - ${location_source}= Load Entity ${entity_payload_filename} ${first_entity_id} - Set To Dictionary ${expected_payload} location=${location_source}[location] - Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber location - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a partial success response has been returned and that OffStreetParking:1 with the "location" Property was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request (with local=true) to b3 to retrieve the Entity OffStreetParking:1 + ${response_b3}= Retrieve Entity + ... ${first_entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Agent checks that the Entity returned in step (2) contains the attribute "location" and that it matches the one from the Entity returned in step (3) + ${expected_b1}= Load Entity ${entity_payload_filename} ${first_entity_id} + Keep In Dictionary ${expected_b1} id type location + Set To Dictionary ${expected_b1} location=${response_b3.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -47,41 +63,41 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_C_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index a008a292..703fdb5e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. -... Check that the OffStreetParking:1 entity returned from A does not contain the location attribute. Check that the entity returned from A does not contain the location attribute returned from C. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3 and one inclusive for the entity in b4. +... Check that the OffStreetParking:1 entity returned from b1 does not contain the location attribute. Check that the entity returned from b1 does not contain the location attribute returned from b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -15,74 +15,112 @@ ${second_full_entity_payload_filename} interoperability/full-ve ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1. C contains OffStreetParking:1 without location. D contains OffStreetParking:2. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 without location. b4 contains OffStreetParking:2. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and checks for a partial successful. The entity returned should not contain the location attribute. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${first_entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${entity_payload_filename} ${first_entity_id} - Remove From Dictionary ${expected_payload} @context - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a partial success response has been returned and that the Entity OffstreetParking:1 without the "location" Property was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b1 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b1_local}= Retrieve Entity + ... ${first_entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b1_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b1_local.status_code} + ${expected_b1_local}= Load Entity ${entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b1_local} @context + Check Resource Set To ${expected_b1_local} ${response_b1_local.json()} + + # Client sends an HTTP GET request to b2 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b2}= Retrieve Entity + ... ${first_entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b2_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2}= Load Entity ${first_full_entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b2} @context + Check Resource Set To ${expected_b2} ${response_b2.json()} + + # Client sends an HTTP GET request to b3 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b3}= Retrieve Entity + ... ${first_entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${entity_payload_filename} ${first_entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Agent checks that the Entity returned in step (2) matches the one returned in step (3) and that it does not contain the "location" Property returned in step (4) + Check Resource Set To ${response_b1_local.json()} ${response_b1.json()} *** Keywords *** Setup Initial Context Source Registrations Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_A_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b1_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${broker_C_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${first_entity_id} ${second_entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index 354935cc..b16502e9 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -1,6 +1,7 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entity in B, one inclusive for the entity in C and one inclusive for the entity in D. -... Check that the entity returned from A has the same location attribute as the one found in C. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3 and one inclusive for the entity in b4. +... Check that the entity returned from b1 has the same location attribute as the one found in b3. + Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource Test Setup Setup Initial Context Source Registrations @@ -13,30 +14,47 @@ ${location_name_entity_payload_filename} interoperability/offstre ${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1. C contains OffStreetParking:1 with location and name only. D contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:1 without location. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 - # Client retrieves OffStreetParking:1 in A and agent checks for a partial successful. The entity returned should only contain the location attribute. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${entity_id} ... attrs=location ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${location_name_entity_payload_filename} ${entity_id} - Keep In Dictionary ${expected_payload} id type location - Check Resource Set To ${expected_paf in B,yload} ${response.json()} + + # Agent checks that a partial success response has been returned and that the Entity OffstreetParking:1 containing only the "location" Property was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b3 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b3}= Retrieve Entity + ... ${entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${location_name_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Agent checks that the Entity returned in step (2) contains the attribute "location" and that it matches the one from the Entity returned in step (3) + ${expected_b1}= Load Entity ${location_name_entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b1} id type location + Set To Dictionary ${expected_b1} location=${response_b3.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -45,46 +63,46 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_B_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 1dd892f6..731a45b1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. -... Check that the entity returned from A has the same availableSpotsNumber and totalSpotsNumber as the ones found in D. Check that the entity returned from A has the same location attribute as the one in E. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3. b2 has two registrations, one redirect for the entity in b4 and one redirect for the entity in b5. b3 shall establish one exclusive registration to b5. +... Check that the entity returned from b1 has the same availableSpotsNumber and totalSpotsNumber as the ones found in b4. Check that the entity returned from b1 has the same location attribute as the one in b5. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -16,17 +16,17 @@ ${auxiliary_registration_payload_file_path} csourceRegistrations/int ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_002_04_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. D contains OffStreetParking:1 without location. E contains OffStreetParking:1. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 without location. b5 contains OffStreetParking:1. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -39,16 +39,49 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... 4_3_6 ... 5_7_1 - # Client retrieves OffStreetParking:1 in A and agent checks for a successful response. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} - Keep In Dictionary ${expected_payload} id type availableSpotsNumber totalSpotsNumber - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a success response has been returned and that the Entity OffStreetParking:1 was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b4 to retrieve the Entity OffStreetParking:1 + ${response_b4}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b4_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b4.status_code} + ${expected_b4}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b4} @context + Check Resource Set To ${expected_b4} ${response_b4.json()} + + # Client sends an HTTP GET request to b5 to retrieve the Entity OffStreetParking:1 + ${response_b5}= Retrieve Entity + ... ${entity_id} + ... context=${ngsild_test_suite_context} + ... broker_url=${b5_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b5.status_code} + ${expected_b5}= Load Entity ${full_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b5} @context + Check Resource Set To ${expected_b5} ${response_b5.json()} + + # Agent checks that the Entity returned in step (2) is structured as follows + # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # The attribute "location" matches the one from the Entity returned in step (4) + ${expected_b1}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber + Set To Dictionary + ... ${expected_b1} + ... availableSpotsNumber=${response_b4.json()}[availableSpotsNumber] + ... totalSpotsNumber=${response_b4.json()}[totalSpotsNumber] + ... location=${response_b5.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -57,45 +90,45 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_E_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -107,10 +140,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 69bef0fe..61037f12 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entity in B, one inclusive for the entity in C. B has two registrations, one redirect for the entity in D and one redirect for the entity in E. C shall establish one exclusive registration to E. -... Check that the entity returned from A has the same availableSpotsNumber and totalSpotsNumber as the ones found in B. Check that the entity returned from A has the same name attribute as the one in C. Check that the entity returned from A has the same location attribute as the one in E. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entity in b2, one inclusive for the entity in b3. b2 has two registrations, one redirect for the entity in b4 and one redirect for the entity in b5. b3 shall establish one exclusive registration to b5. +... Check that the entity returned from b1 has the same availableSpotsNumber and totalSpotsNumber as the ones found in b2. Check that the entity returned from b1 has the same name attribute as the one in b3. Check that the entity returned from b1 has the same location attribute as the one in b5. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -16,18 +16,18 @@ ${inclusive_registration_payload_file_path} csourceRegistrations/int ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data on every broker. A contains OffStreetParking:1 without location. B contains OffStreetParking:1 without location. C contains OffStreetParking:1 without location. D contains OffStreetParking:1. E contains OffStreetParking:1 with location and name only. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1 without location. b3 contains OffStreetParking:1 without location. b4 contains OffStreetParking:1. b5 contains OffStreetParking:1 with location and name only. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -40,18 +40,65 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... 4_3_6 ... 5_7_1 - # Client retrieves OffStreetParking:1 in A and agent checks for a successful response. - ${response}= Retrieve Entity + # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 + ${response_b1}= Retrieve Entity ... ${entity_id} ... context=${ngsild_test_suite_context} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... type=OffStreetParking - Check Response Status Code 200 ${response.status_code} - ${expected_payload}= Load Entity ${no_location_entity_payload_filename} ${entity_id} - ${location_source}= Load Entity ${location_name_entity_payload_filename} ${entity_id} - Set To Dictionary ${expected_payload} location=${location_source}[location] - Remove From Dictionary ${expected_payload} @context - Check Resource Set To ${expected_payload} ${response.json()} + + # Agent checks that a success response has been returned and that the Entity OffStreetParking:1 with the "location" Property was returned + Check Response Status Code 200 ${response_b1.status_code} + + # Client sends an HTTP GET request to b2 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b2}= Retrieve Entity + ... ${entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b2_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b2.status_code} + ${expected_b2}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b2} @context + Check Resource Set To ${expected_b2} ${response_b2.json()} + + # Client sends an HTTP GET request to b3 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b3}= Retrieve Entity + ... ${entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b3_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b3.status_code} + ${expected_b3}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b3} @context + Check Resource Set To ${expected_b3} ${response_b3.json()} + + # Client sends an HTTP GET request to b5 (with local=true) to retrieve the Entity OffStreetParking:1 + ${response_b5}= Retrieve Entity + ... ${entity_id} + ... local=true + ... context=${ngsild_test_suite_context} + ... broker_url=${b5_url} + ... type=OffStreetParking + Check Response Status Code 200 ${response_b5.status_code} + ${expected_b5}= Load Entity ${location_name_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b5} @context + Check Resource Set To ${expected_b5} ${response_b5.json()} + + # Agent checks that the Entity returned in step (2) is structured as follows + # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # The attribute "name" matches the one from the Entity returned in step (4) + # The attribute "location" matches the one from the Entity returned in step (5) + ${expected_b1}= Load Entity ${no_location_entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b1} @context + Set To Dictionary + ... ${expected_b1} + ... availableSpotsNumber=${response_b2.json()}[availableSpotsNumber] + ... totalSpotsNumber=${response_b2.json()}[totalSpotsNumber] + ... name=${response_b3.json()}[name] + ... location=${response_b5.json()}[location] + Check Resource Set To ${expected_b1} ${response_b1.json()} *** Keywords *** @@ -60,60 +107,60 @@ Setup Initial Context Source Registrations ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${broker_D_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b4_url} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -125,10 +172,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index a42b7312..7f914251 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the entity is fully created in A. Check that the entity is created in B and only contains the availableSpotsNumber and totalSpotsNumber attributes. Check that the entity is not created in C. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the entities in b2 and one exclusive for the entity in b3. +... Check that the entity is fully created in b1. Check that the entity is created in b2 and only contains the availableSpotsNumber and totalSpotsNumber attributes. Check that the entity is not created in b3. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -12,52 +12,51 @@ Test Teardown Delete Entities and Delete Registrations ${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_a_expected_payload_file_path} interoperability/query-entity-IOP-003-01-01-first.json -${broker_b_expected_payload_file_path} interoperability/create-entity-IOP-001-01-01-b.json -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client sends a request to A to create OffStreetParking:1 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} - # Agent checks, with local=true, that the entity is created in A + ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_full_payload} @context + + # Agent checks (with local=true) that the full Entity was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${broker_a_expected_payload_file_path} - ... ${entity_id} - ... ${response.json()} + Check Resource Set To ${expected_full_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in B and only contains the attributes availableSpotsNumber and totalSpotsNumber + # Agent checks (with local=true) that the Entity was created in b2 and that the Entity only contains "availableSpotsNumber" and "totalSpotsNumber" ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${broker_b_expected_payload_file_path} - ... ${entity_id} - ... ${response.json()} + ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber + Check Resource Set To ${expected_b2_payload} ${response.json()} - # Agent checks, with local=true, that the entity is NOT created in C + # Agent checks (with local=true) that the Entity was NOT created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} @@ -70,20 +69,20 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index b5a7bbdc..0d20c7c0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Three brokers are set up A, B and C. A has two registrations, one inclusive for the entities in B and one exclusive for the entity in C. -... Check that the entity is created in A and B not containing the location attribute. Check that the entity is created in C containing only the location attribute. +Documentation Three brokers are set up b1, b2 and b3. b1 has two registrations, one inclusive for the entities in b2 and one exclusive for the entity in b3. +... Check that the entity is created in b1 and b2 not containing the location attribute. Check that the entity is created in b3 containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -12,59 +12,55 @@ Test Teardown Delete Entities and Delete Registrations ${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld -${broker_a_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-a.json -${broker_b_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-b.json -${broker_c_expected_payload_file_path} interoperability/create-entity-IOP-001-01-02-c.json -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Exclusive in A to C. + ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} - # Agent checks, with local=true, that the entity is created in A and does not contain the location property + # Agent checks (with local=true) that the Entity was created in b1 and that the Entity does not contain the "location" Property ${response}= Retrieve Entity ... ${entity_id} - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... local=true ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${broker_a_expected_payload_file_path} - ... ${entity_id} - ... ${response.json()} + ${expected_b1_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b1_payload} @context location + Check Resource Set To ${expected_b1_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in B and does not contain the location property + # Agent checks (with local=true) that the Entity was created in b2 and that the Entity does not contain the "location" Property ${response}= Retrieve Entity ... ${entity_id} - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... local=true ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${broker_b_expected_payload_file_path} - ... ${entity_id} - ... ${response.json()} + ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber + Check Resource Set To ${expected_b2_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in C and only contains the location property + # Agent checks (with local=true) that the Entity was created in b3 and that the Entity contains only the "location" Property ${response}= Retrieve Entity ... ${entity_id} - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... local=true ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - Check Response Body Containing Entity element by id - ... ${broker_c_expected_payload_file_path} - ... ${entity_id} - ... ${response.json()} + ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b3_payload} id type location + Check Resource Set To ${expected_b3_payload} ${response.json()} *** Keywords *** @@ -75,20 +71,20 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} Compose IOP Configuration ${first_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index 62643007..ba1dbad6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. -... Check that the entity is created in A and it does not contain the location property. Check that the entity is created in B and does not contain the location and name attributes. Check that the entity is created in C and D containing only the location attribute. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one inclusive for the entities in b2, one redirect for the entity in b3 and one redirect for the entities in b4. +... Check that the entity is created in b1 and it does not contain the location property. Check that the entity is created in b2 and does not contain the location and name attributes. Check that the entity is created in b3 and b4 containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -12,61 +12,63 @@ Test Teardown Delete Entities and Delete Registrations ${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # The client creates the full entity of OffStreetParking:1 in A and the agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_payload} @context location - # Agent checks, with local=true, that the entity is created in A and does not contain the location property + # Agent checks (with local=true) that the Entity was created in b1 and that the Entity does not contain the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties + # Agent checks (with local=true) that the Entity was created in b2 and that the Entity does not contain the "location" and "name" Properties ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} - Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber - Check Resource Set To ${expected_b_payload} ${response.json()} + ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber + Check Resource Set To ${expected_b2_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in C and only contains the location property + # Agent checks (with local=true) that the Entity was created in b3 and that the Entity contains only the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location Check Resource Set To ${expected_location_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in D and only contains the location property + # Agent checks (with local=true) that the Entity was created in b4 and that the Entity contains only the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} @@ -80,27 +82,27 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index dae43ad2..3b0dde1b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one inclusive for the entities in B, one redirect for the entity in C and one redirect for the entities in D. -... Check that the entity is created in A and does not contain the location attribute. Check that the entity is created in B and does not contain the location and name properties. Check that the entity is created in C and D containing only the location attribute. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one inclusive for the entities in b2, one redirect for the entity in b3 and one redirect for the entities in b4. +... Check that the entity is created in b1 and does not contain the location attribute. Check that the entity is created in b2 and does not contain the location and name properties. Check that the entity is created in b3 and b4 containing only the location attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -13,61 +13,63 @@ ${entity_payload_filename} interoperability/full-ve ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D. + ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_payload} @context location - # Agent checks, with local=true, that the entity is created in A and does not contain the location property + # Agent checks (with local=true) that the Entity was created in b1 and that the Entity does not contain the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in B and does not contain the location and name properties + # Agent checks (with local=true) that the Entity was created in b2 and that the Entity does not contain the "location" and "name" Properties ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${expected_b_payload}= Load Entity ${entity_payload_filename} ${entity_id} - Keep In Dictionary ${expected_b_payload} id type availableSpotsNumber totalSpotsNumber - Check Resource Set To ${expected_b_payload} ${response.json()} + ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber + Check Resource Set To ${expected_b2_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in C and only contains the location property + # Agent checks (with local=true) that the Entity was created in b3 and that the Entity contains only the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location Check Resource Set To ${expected_location_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in D and only contains the location property + # Agent checks (with local=true) that the Entity was created in b4 and that the Entity contains only the "location" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} @@ -81,27 +83,27 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${second_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 203496bc..0f1f675d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. -... Check that the entity is created in A and C. The entity shall not be present in C. The entity in D shall only contain availableSpotsNumber and totalSpotsNumber. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entities in b2, one inclusive for the entity in b3 and one inclusive for the entities in b4. +... Check that the entity is created in b1 and b3. The entity shall not be present in b3. The entity in b4 shall only contain availableSpotsNumber and totalSpotsNumber. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -13,56 +13,58 @@ ${entity_payload_filename} interoperability/full-ve ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client creates the full entity of OffStreetParking:1 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-3) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_full_payload} @context - # Agent checks, with local=true, that the entity is created in A + # Agent checks (with local=true) that the Entity was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in B + # Agent checks (with local=true) that the Entity was NOT created in b2 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity is created in C + # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} - # Agent checks, with local=true, that the entity is created in D and only contains the properties availableSpotsNumber and totalSpotsNumber + # Agent checks (with local=true) that the Entity was created in b4 and that it only contains "availableSpotsNumber" and "totalSpotsNumber" ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} ${expected_spots_payload}= Load Entity ${entity_payload_filename} ${entity_id} @@ -78,27 +80,27 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index de17e859..473910d4 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Four brokers are set up A, B, C and D. A has three registrations, one auxiliary for the entities in B, one inclusive for the entity in C and one inclusive for the entities in D. -... Check that the entity is created in A and C. The entity shall not be present in B and D. +Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three registrations, one auxiliary for the entities in b2, one inclusive for the entity in b3 and one inclusive for the entities in b4. +... Check that the entity is created in b1 and b3. The entity shall not be present in b2 and b4. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -13,53 +13,55 @@ ${entity_payload_filename} interoperability/offstre ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_02 Create Partial OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client creates the entity of OffStreetParking:1 with location and name only in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create OffstreetParking:1 with location and name only (Figure 4.1.1.1-3) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_payload} @context - # Agent checks, with local=true, that the entity is created in A + # Agent checks (with local=true) that the Entity was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in B + # Agent checks (with local=true) that the Entity was NOT created in b2 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity is created in C + # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in D + # Agent checks (with local=true) that the Entity was NOT created in b4 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} @@ -72,27 +74,27 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{third_set}= Create List ... ${EMPTY} ... ${second_inclusive_registration_payload_file_path} ... inclusive - ... ${broker_D_url} - ... ${broker_A_url} + ... ${b4_url} + ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} Compose IOP Configuration ${third_configuration} Delete Entities And Delete Registrations - @{broker_count}= Create List ${broker_A_url} ${broker_B_url} ${broker_C_url} ${broker_D_url} + @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index bb5e71a5..14240965 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities in B and one inclusive for the entity in C. B has two registration, one redirect for the entities in D, one redirect for the entity in E. C has one exclusive registration to E. -... Check that the entity is created in A and C. The entity shall not be created in B, D and E. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entities in b2 and one inclusive for the entity in b3. b2 has two registration, one redirect for the entities in b4, one redirect for the entity in b5. b3 has one exclusive registration to b5. +... Check that the entity is created in b1 and b3. The entity shall not be created in b2, b4 and b5. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -15,17 +15,17 @@ ${first_redirect_registration_payload_file_path} csourceRegistrations/int ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_001_04_01 Create OffStreetParking:1 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -38,48 +38,50 @@ IOP_001_04_01 Create OffStreetParking:1 ... 4_3_6 ... 5_6_1 - # Client creates the full entity of OffStreetParking:1 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_payload} @context - # Agent checks, with local=true, that the entity is created in A + # Agent checks (with local=true) that the Entity was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in B + # Agent checks (with local=true) that the Entity was NOT created in b2 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity is created in C + # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} - # Agent checks, with local=true, that the entity was not created in D + # Agent checks (with local=true) that the Entity was NOT created in b4 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity was NOT created in E + # Agent checks (with local=true) that the Entity was NOT created in b5 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} @@ -92,36 +94,36 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -133,10 +135,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 997f7c36..bf85db63 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -1,6 +1,6 @@ *** Settings *** -Documentation Five brokers are set up A, B, C, D and E. A has two registrations, one auxiliary for the entities created in B and one inclusive for the entity created in C. B has two registration, one redirect for the entities created in D, one redirect for the entity created in E. C has one exclusive registration to E. -... Check that the entity is created in A and C. The entity shall not be created in B and D. The entity shall be created in E with only one the totalSpotsNumber attribute. +Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two registrations, one auxiliary for the entities created in b2 and one inclusive for the entity created in b3. b2 has two registration, one redirect for the entities created in b4, one redirect for the entity created in b5. b3 has one exclusive registration to b5. +... Check that the entity is created in b1 and b3. The entity shall not be created in b2 and b4. The entity shall be created in b5 with only one the totalSpotsNumber attribute. Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource @@ -15,17 +15,17 @@ ${first_redirect_registration_payload_file_path} csourceRegistrations/int ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld -${broker_A_url} ${EMPTY} -${broker_B_url} ${EMPTY} -${broker_C_url} ${EMPTY} -${broker_D_url} ${EMPTY} -${broker_E_url} ${EMPTY} +${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b4_url} ${EMPTY} +${b5_url} ${EMPTY} *** Test Cases *** IOP_001_04_02 Create OffStreetParking:2 [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in A to B. Inclusive in A to C. Redirect in B to D. Redirect in B to E. Exclusive in C to E. + ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop @@ -38,59 +38,61 @@ IOP_001_04_02 Create OffStreetParking:2 ... 4_3_6 ... 5_6_1 - # Client creates the full entity of OffStreetParking:2 in A and agent checks for a successful response - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${broker_A_url} + # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + + # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_full_payload} @context - # Agent checks, with local=true, that the entity is created in A + # Agent checks (with local=true) that the Entity was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_A_url} + ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} - # Agent checks, with local=true, that the entity was NOT created in B + # Agent checks (with local=true) that the Entity was NOT created in b2 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_B_url} + ... broker_url=${b2_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity is created in C + # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_C_url} + ... broker_url=${b3_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${expected_c_payload}= Load Entity ${entity_payload_filename} ${entity_id} - Remove From Dictionary ${expected_c_payload} @context totalSpotsNumber - Check Resource Set To ${expected_c_payload} ${response.json()} + ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Remove From Dictionary ${expected_b3_payload} @context totalSpotsNumber + Check Resource Set To ${expected_b3_payload} ${response.json()} - # Agent checks, with local=true, that the entity is NOT created in D + # Agent checks (with local=true) that the Entity was NOT created in b4 ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_D_url} + ... broker_url=${b4_url} ... context=${ngsild_test_suite_context} Check Response Status Code 404 ${response.status_code} - # Agent checks, with local=true, that the entity is created in E and only contains the totalSpotsNumber property + # Agent checks (with local=true) that the Entity was created in b5 and that the Entity only contains the "totalSpotsNumber" Property ${response}= Retrieve Entity ... ${entity_id} ... local=true - ... broker_url=${broker_E_url} + ... broker_url=${b5_url} ... context=${ngsild_test_suite_context} Check Response Status Code 200 ${response.status_code} - ${expected_e_payload}= Load Entity ${entity_payload_filename} ${entity_id} - Keep In Dictionary ${expected_e_payload} id type totalSpotsNumber - Check Resource Set To ${expected_e_payload} ${response.json()} + ${expected_b5_payload}= Load Entity ${entity_payload_filename} ${entity_id} + Keep In Dictionary ${expected_b5_payload} id type totalSpotsNumber + Check Resource Set To ${expected_b5_payload} ${response.json()} *** Keywords *** @@ -101,36 +103,36 @@ Setup Initial Context Source Registrations ... ${EMPTY} ... ${auxiliary_registration_payload_file_path} ... auxiliary - ... ${broker_B_url} - ... ${broker_A_url} + ... ${b2_url} + ... ${b1_url} @{second_set}= Create List ... ${EMPTY} ... ${first_redirect_registration_payload_file_path} ... redirect - ... ${broker_D_url} - ... ${broker_B_url} + ... ${b4_url} + ... ${b2_url} @{third_set}= Create List ... ${EMPTY} ... ${second_redirect_registration_payload_file_path} ... redirect - ... ${broker_E_url} - ... ${broker_B_url} + ... ${b5_url} + ... ${b2_url} @{fourth_set}= Create List ... ${EMPTY} ... ${inclusive_registration_payload_file_path} ... inclusive - ... ${broker_C_url} - ... ${broker_A_url} + ... ${b3_url} + ... ${b1_url} @{fifth_set}= Create List ... ${EMPTY} ... ${exclusive_registration_payload_file_path} ... exclusive - ... ${broker_E_url} - ... ${broker_C_url} + ... ${b5_url} + ... ${b3_url} @{fourth_configuration}= Create List ... ${first_set} @@ -142,10 +144,10 @@ Setup Initial Context Source Registrations Delete Entities And Delete Registrations @{broker_count}= Create List - ... ${broker_A_url} - ... ${broker_B_url} - ... ${broker_C_url} - ... ${broker_D_url} - ... ${broker_E_url} + ... ${b1_url} + ... ${b2_url} + ... ${b3_url} + ... ${b4_url} + ... ${b5_url} @{entities_to_delete}= Create List ${entity_id} Delete Registrations And Entities ${broker_count} ${entities_to_delete} diff --git a/README.md b/README.md index e5180daf..2ae39ea8 100644 --- a/README.md +++ b/README.md @@ -170,12 +170,12 @@ test launch command followed by the file name. The following example shows how to run an interoperability test with multiple brokers: ``` - robot --variable broker_A_url:http://localhost:8080 \ - --variable broker_B_url:http://localhost:8081 \ - --variable broker_C_url:http://localhost:8082 \ - --variable broker_D_url:http://localhost:8083 \ - --variable broker_E_url:http://localhost:8084 \ - ./TP/NGSI-LD/Interoperability/Provision/Entities/CreateEntity/IOP_CNF_01_01.robot + robot --variable b1_url:http://localhost:8080 \ + --variable b2_url:http://localhost:8081 \ + --variable b3_url:http://localhost:8082 \ + --variable b4_url:http://localhost:8083 \ + --variable b5_url:http://localhost:8084 \ + ./IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot ``` ### Generate output file details only for failed tests diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json deleted file mode 100644 index a7c0d516..00000000 --- a/data/entities/expectations/interoperability/create-entity-IOP-001-01-01-b.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:1", - "type": "OffStreetParking", - "availableSpotsNumber": { - "type": "Property", - "value": 121, - "observedAt": "2017-07-29T12:05:02Z", - "reliability": { - "type": "Property", - "value": 0.7 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 200 - } -} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json deleted file mode 100644 index bb45bd2b..00000000 --- a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-a.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:2", - "type": "OffStreetParking", - "name": { - "type": "Property", - "value": "Downtown Two" - }, - "availableSpotsNumber": { - "type": "Property", - "value": 112, - "observedAt": "2017-07-29T12:05:02Z", - "reliability": { - "type": "Property", - "value": 0.4 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 150 - } -} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json deleted file mode 100644 index 10dfa9b1..00000000 --- a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-b.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:2", - "type": "OffStreetParking", - "availableSpotsNumber": { - "type": "Property", - "value": 112, - "observedAt": "2017-07-29T12:05:02Z", - "reliability": { - "type": "Property", - "value": 0.4 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 150 - } -} diff --git a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json b/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json deleted file mode 100644 index bb08e441..00000000 --- a/data/entities/expectations/interoperability/create-entity-IOP-001-01-02-c.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:2", - "type": "OffStreetParking", - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [-8.45, 41.2] - } - } -} diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json deleted file mode 100644 index 08c7d47a..00000000 --- a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-first.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:1", - "type": "OffStreetParking", - "name": { - "type": "Property", - "value": "Downtown One" - }, - "availableSpotsNumber": { - "type": "Property", - "value": 121, - "observedAt": "2017-07-29T12:05:02Z", - "reliability": { - "type": "Property", - "value": 0.7 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 200 - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [-8.5, 41.2] - } - } -} diff --git a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json b/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json deleted file mode 100644 index 06376a23..00000000 --- a/data/entities/expectations/interoperability/query-entity-IOP-003-01-01-second.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:2", - "type": "OffStreetParking", - "name": { - "type": "Property", - "value": "Downtown Two" - }, - "availableSpotsNumber": { - "type": "Property", - "value": 92, - "observedAt": "2017-07-30T12:10:02Z", - "reliability": { - "type": "Property", - "value": 0.56 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 150 - } -} diff --git a/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json b/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json deleted file mode 100644 index ca2feac6..00000000 --- a/data/entities/expectations/interoperability/retrieve-entity-IOP-002-01-02.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "id": "urn:ngsi-ld:OffStreetParking:2", - "type": "OffStreetParking", - "availableSpotsNumber": { - "type": "Property", - "value": 87, - "observedAt": "2017-07-29T12:10:02Z", - "reliability": { - "type": "Property", - "value": 0.55 - } - }, - "totalSpotsNumber": { - "type": "Property", - "value": 150 - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [-8.45, 41.2] - } - } -} diff --git a/scripts/run_tests.ps1 b/scripts/run_tests.ps1 index 7eb53eef..d53be645 100644 --- a/scripts/run_tests.ps1 +++ b/scripts/run_tests.ps1 @@ -30,7 +30,7 @@ robot --variable b1_url: ` --variable b3_url: ` --variable b4_url: ` --variable b5_url: ` - --outputdir .\results .\TP\NGSI-LD\Interoperability\ + --outputdir .\results .\IOP_TP\NGSI-LD\Interoperability\ # run specific interoperability tests suite with multiple brokers robot --variable b1_url: ` @@ -38,4 +38,4 @@ robot --variable b1_url: ` --variable b3_url: ` --variable b4_url: ` --variable b5_url: ` - --outputdir .\results .\TP\NGSI-LD\Interoperability\Provision\Entities\CreateEntity\IOP_CNF_01_01.robot + --outputdir .\results .\IOP_TP\NGSI-LD\Interoperability\Provision\CreateEntity\IOP_001_01_01.robot diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 48d6d93e..c0309f00 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -37,7 +37,7 @@ robot --variable b1_url: \ --variable b3_url: \ --variable b4_url: \ --variable b5_url: \ - --outputdir ./results ./TP/NGSI-LD/Interoperability + --outputdir ./results ./IOP_TP/NGSI-LD/Interoperability #run specific interoperability test suite with multiple brokers robot --variable b1_url: \ @@ -45,4 +45,4 @@ robot --variable b1_url: \ --variable b3_url: \ --variable b4_url: \ --variable b5_url: \ - --outputdir ./results ./TP/NGSI-LD/Interoperability/Provision/Entities/CreateEntity/IOP_CNF_01_01.robot + --outputdir ./results ./IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot -- GitLab From ff12b96975f439d92ea6bd039cf5b08070ec2b61 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 24 Jul 2026 13:10:04 +0200 Subject: [PATCH 13/34] feat: allow scripts to automatic detect established registrations from the code --- doc/analysis/generaterobotdata.py | 54 +++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 9949d13c..80bb48e1 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -1,4 +1,4 @@ -from os.path import dirname +from os.path import basename, dirname from robot.api import TestSuiteBuilder from analysis.parserobotfile import ParseRobotFile from analysis.parseapiutilsfile import ParseApiUtilsFile @@ -647,9 +647,12 @@ class GenerateRobotData: version = 'v1.3.1' tp_id = self.generate_name_iop() reference, clauses = self.generate_reference(version=version) + test_doc = {} # Add test case documentation if self.robot.test_case_names: - test_doc = self.robot.get_iop_documentation_data(test_name=self.robot.test_case_names[0]) + test_name = self.robot.test_case_names[0] + test_doc = self.robot.get_iop_documentation_data(test_name=test_name) + test_doc['registrations_established'] = self.generate_iop_registrations(test_name=test_name) self.test_suite = { 'tp_id': tp_id, @@ -665,6 +668,52 @@ class GenerateRobotData: 'test_cases': list() } + def generate_iop_registrations(self, test_name: str) -> str: + """Generate the registration description from the test setup.""" + test = next((item for item in self.suite.tests if item.name == test_name), None) + if test is None: + raise ValueError(f"IOP test '{test_name}' was not found") + + setup_name = test.setup.name + setup = next((item for item in self.suite.resource.keywords if item.name == setup_name), None) + if setup is None: + raise ValueError(f"IOP setup keyword '{setup_name}' was not found") + + modes = {'inclusive', 'exclusive', 'redirect', 'auxiliary'} + registrations = [] + + for keyword in setup.body: + if keyword.name != 'Create List' or len(keyword.args) != 5: + continue + + mode = str(keyword.args[2]).lower() + if mode not in modes: + continue + + payload_variable = str(keyword.args[1]) + try: + payload_path = self.robot.variables[payload_variable] + except KeyError: + raise ValueError( + f"Registration payload variable '{payload_variable}' is not defined" + ) + + brokers = [] + for broker_variable in (str(keyword.args[4]), str(keyword.args[3])): + broker_match = match(r'^\$\{(b\d+)_url\}$', broker_variable) + if broker_match is None: + raise ValueError( + f"Registration broker variable '{broker_variable}' is invalid" + ) + brokers.append(broker_match.group(1)) + + registrations.append( + f"{mode.capitalize()} from {brokers[0]} to {brokers[1]} " + f"(Figure {basename(payload_path)})" + ) + + return '. '.join(registrations) + def visit_test_iop(self, test_name: str, suite_setup: str = "", suite_teardown: str = ""): """Process a single IOP test case""" # Get test information from the parsed robot file @@ -715,4 +764,3 @@ class GenerateRobotData: # Fallback if pattern not found return f"IOP_TP/NGSI-LD/{self.robot.test_suite}" - \ No newline at end of file -- GitLab From 5837cc6bffa632744e6c45f9bafc7c6b242e5d65 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 24 Jul 2026 13:14:57 +0200 Subject: [PATCH 14/34] fix: update comments for clarity in entity retrieval tests --- .../Consumption/Entity/QueryEntities/IOP_003_01_01.robot | 4 ++-- .../Consumption/Entity/QueryEntities/IOP_003_01_02.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot | 6 +++--- .../Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot | 6 +++--- .../Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot | 6 +++--- .../Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 84480347..f358fb46 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -41,8 +41,8 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... context=${ngsild_test_suite_context} # Agent checks that a success response has been returned and that the following Entities were returned: - # OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber - # OffstreetParking:2 with the attributes availableSpotsNumber and location + # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber + # - OffstreetParking:2 with the attributes availableSpotsNumber and location Check Response Status Code 200 ${response_b1.status_code} ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index d0206b55..b9aa3bd6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -43,8 +43,8 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... context=${ngsild_test_suite_context} # Agent checks that a success response has been returned and that the following Entities were returned: - # OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber - # OffstreetParking:2 with the attributes availableSpotsNumber and location + # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber + # - OffstreetParking:2 with the attributes availableSpotsNumber and location Check Response Status Code 200 ${response_b1.status_code} ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index 158bf09f..41ecbb0d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -56,9 +56,9 @@ IOP_002_01_02 Retrieve OffStreetParking:2 Remove From Dictionary ${expected_b3} @context Check Resource Set To ${expected_b3} ${response_b3.json()} - # Agent checks that the Entity returned in step (2) is structured as follows - # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) - # The attribute "location" matches the one from the Entity returned in step (4) + # Agent checks that the Entity returned in step (2) is structured as follows: + # - The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # - The attribute "location" matches the one from the Entity returned in step (4) ${expected_b1}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber Set To Dictionary diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 5283f925..c4cb1655 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -58,9 +58,9 @@ IOP_002_02_01 Retrieve OffStreetParking:1 Remove From Dictionary ${expected_b3} @context Check Resource Set To ${expected_b3} ${response_b3.json()} - # Agent checks that the Entity returned in step (2) is structured as follows - # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) - # The attribute "location" matches the one from the Entity returned in step (4) + # Agent checks that the Entity returned in step (2) is structured as follows: + # - The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # - The attribute "location" matches the one from the Entity returned in step (4) ${expected_b1}= Load Entity ${entity_payload_filename} ${first_entity_id} Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber Set To Dictionary diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 731a45b1..bce9352a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -71,9 +71,9 @@ IOP_002_04_01 Retrieve OffStreetParking:1 Remove From Dictionary ${expected_b5} @context Check Resource Set To ${expected_b5} ${response_b5.json()} - # Agent checks that the Entity returned in step (2) is structured as follows - # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) - # The attribute "location" matches the one from the Entity returned in step (4) + # Agent checks that the Entity returned in step (2) is structured as follows: + # - The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # - The attribute "location" matches the one from the Entity returned in step (4) ${expected_b1}= Load Entity ${no_location_entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b1} id type availableSpotsNumber totalSpotsNumber Set To Dictionary diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 61037f12..face7b22 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -86,10 +86,10 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute Remove From Dictionary ${expected_b5} @context Check Resource Set To ${expected_b5} ${response_b5.json()} - # Agent checks that the Entity returned in step (2) is structured as follows - # The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) - # The attribute "name" matches the one from the Entity returned in step (4) - # The attribute "location" matches the one from the Entity returned in step (5) + # Agent checks that the Entity returned in step (2) is structured as follows: + # - The attributes "availableSpotsNumber" and "totalSpotsNumber" match the ones from the Entity returned in step (3) + # - The attribute "name" matches the one from the Entity returned in step (4) + # - The attribute "location" matches the one from the Entity returned in step (5) ${expected_b1}= Load Entity ${no_location_entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_b1} @context Set To Dictionary -- GitLab From 03b1bd8f91b36cfea47853f2cd3df0d59e3ede1c Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 24 Jul 2026 13:54:44 +0200 Subject: [PATCH 15/34] fix naming --- .../Entity/QueryEntities/IOP_003_01_01.robot | 6 +- .../Entity/QueryEntities/IOP_003_01_02.robot | 6 +- .../Entity/QueryEntities/IOP_003_02_01.robot | 10 +-- .../Entity/QueryEntities/IOP_003_02_02.robot | 12 +-- .../Entity/QueryEntities/IOP_003_03_01.robot | 8 +- .../Entity/QueryEntities/IOP_003_03_02.robot | 10 +-- .../Entity/QueryEntities/IOP_003_04_01.robot | 8 +- .../Entity/QueryEntities/IOP_003_04_02.robot | 8 +- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 4 +- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 4 +- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 6 +- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 6 +- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 6 +- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 6 +- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 4 +- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 6 +- .../CreateEntity/IOP_001_01_01.robot | 2 +- .../CreateEntity/IOP_001_01_02.robot | 2 +- .../CreateEntity/IOP_001_02_01.robot | 2 +- .../CreateEntity/IOP_001_02_02.robot | 2 +- .../CreateEntity/IOP_001_03_01.robot | 2 +- .../CreateEntity/IOP_001_03_02.robot | 2 +- .../CreateEntity/IOP_001_04_01.robot | 2 +- .../CreateEntity/IOP_001_04_02.robot | 2 +- ... full-version-of-OffStreetParking1.jsonld} | 0 ... full-version-of-OffStreetParking2.jsonld} | 0 ...jsonld => full-version-of-Vehicle1.jsonld} | 0 ...jsonld => full-version-of-Vehicle2.jsonld} | 0 ...rking1-with-location-and-name-only.jsonld} | 0 ...offStreetParking1-without-location.jsonld} | 0 ...rking2-with-location-and-name-only.jsonld} | 0 ...hout-location-and-totalSpotsNumber.jsonld} | 0 ...offStreetParking2-without-location.jsonld} | 0 doc/statisticsDocumentationData.py | 76 +++++++++++++++++++ 34 files changed, 139 insertions(+), 63 deletions(-) rename data/entities/interoperability/{full-version-of-offstreetparking1.jsonld => full-version-of-OffStreetParking1.jsonld} (100%) rename data/entities/interoperability/{full-version-of-offstreetparking2.jsonld => full-version-of-OffStreetParking2.jsonld} (100%) rename data/entities/interoperability/{full-version-of-vehicle1.jsonld => full-version-of-Vehicle1.jsonld} (100%) rename data/entities/interoperability/{full-version-of-vehicle2.jsonld => full-version-of-Vehicle2.jsonld} (100%) rename data/entities/interoperability/{offstreetparking1-with-location-and-name-only.jsonld => offStreetParking1-with-location-and-name-only.jsonld} (100%) rename data/entities/interoperability/{offstreetparking1-without-location.jsonld => offStreetParking1-without-location.jsonld} (100%) rename data/entities/interoperability/{offstreetparking2-with-location-and-name-only.jsonld => offStreetParking2-with-location-and-name-only.jsonld} (100%) rename data/entities/interoperability/{offstreetparking2-without-location-and-totalspotsnumber.jsonld => offStreetParking2-without-location-and-totalSpotsNumber.jsonld} (100%) rename data/entities/interoperability/{offstreetparking2-without-location.jsonld => offStreetParking2-without-location.jsonld} (100%) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index f358fb46..697ac7c6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld -${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld +${first_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld +${third_entity_payload_filename} interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index b9aa3bd6..a5621963 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld -${third_entity_payload_filename} interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld +${first_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld +${third_entity_payload_filename} interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index 1b6bf36f..f8214371 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -9,11 +9,11 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${location_name_payload_filename} interoperability/offstreetparking2-location-and-name-only.jsonld -${first_entity_no_location_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${second_entity_no_location_payload_filename} interoperability/offstreetparking2-without-location.jsonld -${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${location_name_payload_filename} interoperability/offStreetParking2-with-location-and-name-only.jsonld +${first_entity_no_location_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${second_entity_no_location_payload_filename} interoperability/offStreetParking2-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index e7e81c74..2fb48f60 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -9,12 +9,12 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld -${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld -${first_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld -${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld +${first_vehicle_payload_filename} interoperability/full-version-of-Vehicle1.jsonld +${second_vehicle_payload_filename} interoperability/full-version-of-Vehicle2.jsonld +${first_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld +${first_parking_location_name_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offStreetParking2-with-location-and-name-only.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 2758d00a..0d2e4290 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${offstreet_no_location_payload_filename} interoperability/offstreetparking2-without-location.jsonld -${first_offstreet_no_location_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${offstreet_no_location_payload_filename} interoperability/offStreetParking2-without-location.jsonld +${first_offstreet_no_location_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${first_full_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 5ec589c8..83d1e923 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -9,11 +9,11 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_vehicle_payload_filename} interoperability/full-version-of-vehicle1.jsonld -${second_vehicle_payload_filename} interoperability/full-version-of-vehicle2.jsonld -${first_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_offstreet_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld -${parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${first_vehicle_payload_filename} interoperability/full-version-of-Vehicle1.jsonld +${second_vehicle_payload_filename} interoperability/full-version-of-Vehicle2.jsonld +${first_full_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_offstreet_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld +${parking_location_name_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index a35696fe..68b74c50 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld -${first_full_parking_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_parking_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${first_parking_location_name_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offStreetParking2-with-location-and-name-only.jsonld +${first_full_parking_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_parking_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index a7ed8eba..3609d3e7 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -9,10 +9,10 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_parking_location_name_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${second_parking_location_name_payload_filename} interoperability/offstreetparking2-with-location-and-name-only.jsonld -${first_full_parking_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_parking_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${first_parking_location_name_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${second_parking_location_name_payload_filename} interoperability/offStreetParking2-with-location-and-name-only.jsonld +${first_full_parking_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_parking_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${first_exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index f5e7cc47..0933d87f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${first_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${first_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index 41ecbb0d..6891a963 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreetparking2-without-location.jsonld -${full_entity_payload_filename} interoperability/full-version-of-offstreetparking2-full.jsonld +${entity_payload_filename} interoperability/offStreetParking2-without-location.jsonld +${full_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index c4cb1655..affc39ec 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index d485bd4c..13db6de2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index 703fdb5e..a057de0e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${first_full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld -${second_full_entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${first_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld +${second_full_entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index b16502e9..a77d1f3a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${no_location_entity_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${location_name_entity_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index bce9352a..7f1933f3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -9,8 +9,8 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${no_location_entity_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index face7b22..39efa7b8 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -9,9 +9,9 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${no_location_entity_payload_filename} interoperability/offstreetparking1-without-location.jsonld -${location_name_entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld -${full_entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${no_location_entity_payload_filename} interoperability/offStreetParking1-without-location.jsonld +${location_name_entity_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld +${full_entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 7f914251..801685c6 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index 0d20c7c0..062eae9c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${exclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index ba1dbad6..c6d99d3e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${b1_url} ${EMPTY} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 3b0dde1b..cce5c032 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 0f1f675d..f85d96a1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 473910d4..ab84b9b1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/offstreetparking1-with-location-and-name-only.jsonld +${entity_payload_filename} interoperability/offStreetParking1-with-location-and-name-only.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld ${second_inclusive_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index 14240965..fdc3445f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking1.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index bf85db63..4fab3efa 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -9,7 +9,7 @@ Test Teardown Delete Entities and Delete Registrations *** Variables *** -${entity_payload_filename} interoperability/full-version-of-offstreetparking2.jsonld +${entity_payload_filename} interoperability/full-version-of-OffStreetParking2.jsonld ${auxiliary_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld ${first_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld ${second_redirect_registration_payload_file_path} csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld diff --git a/data/entities/interoperability/full-version-of-offstreetparking1.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld similarity index 100% rename from data/entities/interoperability/full-version-of-offstreetparking1.jsonld rename to data/entities/interoperability/full-version-of-OffStreetParking1.jsonld diff --git a/data/entities/interoperability/full-version-of-offstreetparking2.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld similarity index 100% rename from data/entities/interoperability/full-version-of-offstreetparking2.jsonld rename to data/entities/interoperability/full-version-of-OffStreetParking2.jsonld diff --git a/data/entities/interoperability/full-version-of-vehicle1.jsonld b/data/entities/interoperability/full-version-of-Vehicle1.jsonld similarity index 100% rename from data/entities/interoperability/full-version-of-vehicle1.jsonld rename to data/entities/interoperability/full-version-of-Vehicle1.jsonld diff --git a/data/entities/interoperability/full-version-of-vehicle2.jsonld b/data/entities/interoperability/full-version-of-Vehicle2.jsonld similarity index 100% rename from data/entities/interoperability/full-version-of-vehicle2.jsonld rename to data/entities/interoperability/full-version-of-Vehicle2.jsonld diff --git a/data/entities/interoperability/offstreetparking1-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld similarity index 100% rename from data/entities/interoperability/offstreetparking1-with-location-and-name-only.jsonld rename to data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld diff --git a/data/entities/interoperability/offstreetparking1-without-location.jsonld b/data/entities/interoperability/offStreetParking1-without-location.jsonld similarity index 100% rename from data/entities/interoperability/offstreetparking1-without-location.jsonld rename to data/entities/interoperability/offStreetParking1-without-location.jsonld diff --git a/data/entities/interoperability/offstreetparking2-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld similarity index 100% rename from data/entities/interoperability/offstreetparking2-with-location-and-name-only.jsonld rename to data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld diff --git a/data/entities/interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld similarity index 100% rename from data/entities/interoperability/offstreetparking2-without-location-and-totalspotsnumber.jsonld rename to data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld diff --git a/data/entities/interoperability/offstreetparking2-without-location.jsonld b/data/entities/interoperability/offStreetParking2-without-location.jsonld similarity index 100% rename from data/entities/interoperability/offstreetparking2-without-location.jsonld rename to data/entities/interoperability/offStreetParking2-without-location.jsonld diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index b5e889ef..47ef38ef 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -15,6 +15,80 @@ def locate_result_folder(): return None return folder_result_path + +def generate_interoperability_payload_bodies(basedir: str) -> dict: + source_groups = ( + ( + join(basedir, "data", "entities", "interoperability"), + "type", + ( + ("OffStreetParking", "4.1.1.1"), + ("Vehicle", "4.1.1.2"), + ), + ), + ( + join(basedir, "data", "csourceRegistrations", "interoperability"), + "mode", + ( + ("inclusive", "4.1.3.1"), + ("auxiliary", "4.1.3.2"), + ("exclusive", "4.1.3.3"), + ("redirect", "4.1.3.4"), + ), + ), + ) + + result = {} + filenames = set() + + for source_index, (source_folder, classifier, clauses) in enumerate(source_groups): + payloads = {value: [] for value, _ in clauses} + + for filename in sorted(os.listdir(source_folder), key=str.lower): + source_file = join(source_folder, filename) + if not os.path.isfile(source_file) or not filename.lower().endswith((".json", ".jsonld")): + continue + + if filename in filenames: + raise ValueError(f"Duplicate interoperability payload filename '{filename}'") + filenames.add(filename) + + try: + with open(source_file, "r", encoding="utf-8") as fp: + payload = json.load(fp) + except json.JSONDecodeError as error: + raise ValueError(f"Invalid JSON in interoperability payload '{source_file}'") from error + + if not isinstance(payload, dict): + raise ValueError(f"Interoperability payload '{source_file}' must contain a JSON object") + + classifier_value = payload.get(classifier) + if classifier_value not in payloads: + raise ValueError( + f"Unsupported or missing '{classifier}' value in interoperability payload '{source_file}'" + ) + payloads[classifier_value].append((filename, payload)) + + for classifier_value, clause_number in clauses: + for figure_number, (filename, payload) in enumerate(payloads[classifier_value], start=1): + figure_label = os.path.splitext(filename)[0].replace("-", " ") + result[filename] = { + "data": payload, + "clause_number": clause_number, + "figure_string": f"Figure {clause_number}-{figure_number}", + "figure_label": figure_label[:1].upper() + figure_label[1:], + } + + if source_index == 0: + result["Attribute Fragments"] = None + + output_file = join(basedir, "doc", "results", "interoperability_payload_bodies.jsonld") + with open(output_file, "w", encoding="utf-8") as fp: + json.dump(obj=result, indent=2, fp=fp) + + return result + + if __name__ == "__main__": basedir = dirname(dirname(__file__)) statistics = dict() @@ -287,6 +361,8 @@ if __name__ == "__main__": with open(permutations_file, "w") as fp: json.dump(obj=permutations, indent=2, fp=fp) + generate_interoperability_payload_bodies(basedir=basedir) + # Validate setup keys after all JSON files have been generated print("\nValidating setup keys...\n") initial_setup = InitialSetup() -- GitLab From b6e99767a0a5cb38b9d59f316cf93f9b2de4c442 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 24 Jul 2026 20:10:54 +0200 Subject: [PATCH 16/34] fix: enhance pre_conditions formatting and improve comment extraction in IOP tests --- doc/analysis/parserobotfile.py | 45 ++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index 8a020010..c60ea656 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -692,8 +692,33 @@ class ParseRobotFile: value = re.sub(r'\n\s*\.{3}\s*', ' ', doc_content[match.end():end]) sections[key] = value.replace('\n', ' ').strip().rstrip('.') + if 'pre_conditions' in sections: + sections['pre_conditions'] = self._format_iop_preconditions(sections['pre_conditions']) + return sections + @staticmethod + def _format_iop_preconditions(preconditions: str): + match = re.match( + r'^(.*?)(Data (?:only on leaves|on every broker))\.\s+((?:b\d+\s+contains\s+).+)$', + preconditions, + ) + if match is None: + return preconditions + + prefix, data_location, broker_data = match.groups() + broker_entries = re.split(r'\.\s+(?=b\d+\s+contains\s+)', broker_data) + prefix_entries = [ + entry.strip() + for entry in prefix.rstrip('. ').split('.') + if entry.strip() + ] + return [ + *prefix_entries, + f"{data_location}:", + [entry.rstrip('.') for entry in broker_entries], + ] + def get_iop_test_tags(self, test_name: str) -> list: """Extract [Tags] from a specific IOP test case.""" if test_name not in self.test_cases: @@ -715,8 +740,24 @@ class ParseRobotFile: return [] test_content = self.test_cases[test_name] - comments = re.findall(r'^\s*#(.+?)$', test_content, re.MULTILINE) - return [comment.strip() for comment in comments] + raw_comments = re.findall(r'^\s*#(.+?)$', test_content, re.MULTILINE) + comments = [] + nested_comments = None + + for raw_comment in raw_comments: + comment = raw_comment.strip() + if comment.startswith('-'): + if not comments: + raise ValueError(f"IOP test '{test_name}' has a list item without a parent step") + if nested_comments is None: + nested_comments = [] + comments.append(nested_comments) + nested_comments.append(comment[1:].strip()) + else: + comments.append(comment) + nested_comments = None + + return comments def get_iop_setup(self, test_name: str) -> str: """Extract [Setup] from a specific IOP test case.""" -- GitLab From d0b2b3a0f39a123a01882c2b81ff818cd0e57af2 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 12:13:53 +0200 Subject: [PATCH 17/34] fix: refactor initial_conditions handling and add IOP preconditions tests --- doc/analysis/generaterobotdata.py | 139 +++++++++++++++++++- doc/analysis/parserobotfile.py | 62 --------- doc/tests/test_iop_preconditions.py | 195 ++++++++++++++++++++++++++++ 3 files changed, 327 insertions(+), 69 deletions(-) create mode 100644 doc/tests/test_iop_preconditions.py diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 80bb48e1..80c5ba86 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -5,6 +5,7 @@ from analysis.parseapiutilsfile import ParseApiUtilsFile from analysis.parsevariablesfile import ParseVariablesFile from analysis.initial_setup import InitialSetup from re import match, findall, finditer, sub, MULTILINE +from urllib.parse import urlparse class GenerateRobotData: @@ -647,12 +648,13 @@ class GenerateRobotData: version = 'v1.3.1' tp_id = self.generate_name_iop() reference, clauses = self.generate_reference(version=version) - test_doc = {} - # Add test case documentation + initial_conditions = {} if self.robot.test_case_names: test_name = self.robot.test_case_names[0] - test_doc = self.robot.get_iop_documentation_data(test_name=test_name) - test_doc['registrations_established'] = self.generate_iop_registrations(test_name=test_name) + initial_conditions = { + 'pre_conditions': self.generate_iop_preconditions(test_name=test_name), + 'registrations_established': self.generate_iop_registrations(test_name=test_name) + } self.test_suite = { 'tp_id': tp_id, @@ -663,13 +665,12 @@ class GenerateRobotData: 'clauses': clauses, 'pics_selection': str(), 'keywords': [x.to_dict()['name'] for x in list(self.suite.resource.keywords)], - 'initial_conditions': test_doc, + 'initial_conditions': initial_conditions, 'teardown': str(self.suite.teardown), 'test_cases': list() } - def generate_iop_registrations(self, test_name: str) -> str: - """Generate the registration description from the test setup.""" + def _get_iop_setup(self, test_name: str): test = next((item for item in self.suite.tests if item.name == test_name), None) if test is None: raise ValueError(f"IOP test '{test_name}' was not found") @@ -679,6 +680,130 @@ class GenerateRobotData: if setup is None: raise ValueError(f"IOP setup keyword '{setup_name}' was not found") + return setup + + def _resolve_iop_value(self, value: str, field: str) -> str: + original = str(value) + result = original + visited = set() + + while match(r'^\$\{[^}]+\}$', result): + if result in visited: + raise ValueError(f"{field} variable '{original}' contains a circular reference") + visited.add(result) + + if result in self.robot.variables: + result = str(self.robot.variables[result]) + continue + + try: + result = str(self.config_variables.get_variable(result)) + except KeyError as error: + raise ValueError(f"{field} variable '{result}' is not defined") from error + + return result + + def _iop_filename(self, value: str, field: str) -> str: + resolved = self._resolve_iop_value(value=value, field=field) + path = urlparse(resolved).path.replace('\\', '/').rstrip('/') + filename = basename(path) + if filename == '': + raise ValueError(f"{field} value '{resolved}' does not contain a filename") + return filename + + def _iop_broker_name(self, value: str) -> str: + original = str(value) + result = original + visited = set() + + while result not in visited: + broker_match = match(r'^\$\{(b\d+)_url\}$', result) + if broker_match is not None: + return broker_match.group(1) + + visited.add(result) + if result not in self.robot.variables: + break + result = str(self.robot.variables[result]) + + raise ValueError(f"Create Entity broker variable '{original}' is invalid") + + @staticmethod + def _create_entity_arguments(args) -> dict: + signature = ('filename', 'entity_id', 'local', 'broker_url', 'context') + values = {} + position = 0 + + for argument in (str(item) for item in args): + key, separator, value = argument.partition('=') + if separator and key in signature: + values[key] = value + continue + + while position < len(signature) and signature[position] in values: + position += 1 + if position >= len(signature): + raise ValueError(f"Create Entity has an unexpected argument '{argument}'") + values[signature[position]] = argument + position += 1 + + return values + + def generate_iop_preconditions(self, test_name: str) -> list: + setup = self._get_iop_setup(test_name=test_name) + contexts = [] + data = [] + + for keyword in setup.body: + if keyword.name != 'Create Entity': + continue + + arguments = self._create_entity_arguments(keyword.args) + if 'filename' not in arguments: + raise ValueError('Create Entity does not define a payload filename') + if 'broker_url' not in arguments: + raise ValueError('Create Entity does not define broker_url') + + broker = self._iop_broker_name(arguments['broker_url']) + payload_filename = self._iop_filename( + value=arguments['filename'], + field='Create Entity payload' + ) + data.append(f"{broker} contains {payload_filename}.") + + if 'context' in arguments: + context_filename = self._iop_filename( + value=arguments['context'], + field='Create Entity context' + ) + contexts.append( + f"The {context_filename} user context is used when creating on {broker}." + ) + + return [ + { + 'type': 'context', + 'top-level': ( + 'Context used for creation in following brokers:' + if contexts else + 'No user context used.' + ), + 'nested-object': contexts + }, + { + 'type': 'data', + 'top-level': ( + 'Data in following brokers:' + if data else + 'No data in any broker.' + ), + 'nested-object': data + } + ] + + def generate_iop_registrations(self, test_name: str) -> str: + """Generate the registration description from the test setup.""" + setup = self._get_iop_setup(test_name=test_name) modes = {'inclusive', 'exclusive', 'redirect', 'auxiliary'} registrations = [] diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index c60ea656..f60b8a76 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -657,68 +657,6 @@ class ParseRobotFile: if len(indexes) > 0: self.test_cases[self.test_case_names[-1]] = string_test_cases[indexes[-1]:] - def _get_documentation_content(self, test_name: str) -> str: - """Helper: Extract raw documentation content after [Documentation] until next keyword block.""" - if test_name not in self.test_cases: - return "" - - test_content = self.test_cases[test_name] - match = re.search(r'\[Documentation\]\s*', test_content) - if not match: - return "" - - start_pos = match.end() - doc_section = re.search(r'(.*?)(?=\n\s*\[|\Z)', test_content[start_pos:], re.MULTILINE | re.DOTALL) - return doc_section.group(1) if doc_section else "" - - def get_iop_documentation_data(self, test_name: str) -> dict: - """Extract documentation in the Test Cases.""" - if test_name not in self.test_cases: - return " " - - doc_content = self._get_documentation_content(test_name) - if not doc_content: - return " " - - label_pattern = re.compile( - r'(?:\A[ \t]*|\n[ \t]*\.{3}[ \t]+)([A-Za-z][A-Za-z \-]*):[ \t]*', - re.MULTILINE - ) - matches = list(label_pattern.finditer(doc_content)) - sections = {} - for index, match in enumerate(matches): - end = matches[index + 1].start() if index + 1 < len(matches) else len(doc_content) - key = match.group(1).strip().lower().replace(' ', '_').replace('-', '_') - value = re.sub(r'\n\s*\.{3}\s*', ' ', doc_content[match.end():end]) - sections[key] = value.replace('\n', ' ').strip().rstrip('.') - - if 'pre_conditions' in sections: - sections['pre_conditions'] = self._format_iop_preconditions(sections['pre_conditions']) - - return sections - - @staticmethod - def _format_iop_preconditions(preconditions: str): - match = re.match( - r'^(.*?)(Data (?:only on leaves|on every broker))\.\s+((?:b\d+\s+contains\s+).+)$', - preconditions, - ) - if match is None: - return preconditions - - prefix, data_location, broker_data = match.groups() - broker_entries = re.split(r'\.\s+(?=b\d+\s+contains\s+)', broker_data) - prefix_entries = [ - entry.strip() - for entry in prefix.rstrip('. ').split('.') - if entry.strip() - ] - return [ - *prefix_entries, - f"{data_location}:", - [entry.rstrip('.') for entry in broker_entries], - ] - def get_iop_test_tags(self, test_name: str) -> list: """Extract [Tags] from a specific IOP test case.""" if test_name not in self.test_cases: diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py new file mode 100644 index 00000000..98b92d71 --- /dev/null +++ b/doc/tests/test_iop_preconditions.py @@ -0,0 +1,195 @@ +import sys +import tempfile +import unittest +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / 'doc')) + +from analysis.generaterobotdata import GenerateRobotData + + +class IopPreconditionsTest(unittest.TestCase): + def generate(self, variables: str, setup: str, test_body: str = ' No Operation'): + robot = f'''*** Settings *** +Documentation Objective +Test Setup Prepare Preconditions + + +*** Variables *** +{variables} + + +*** Test Cases *** +IOP_999_01 Generated Preconditions + [Documentation] Pre-conditions: documentation must be ignored. + [Tags] since_v1.6.1 iop 4_3_3 +{test_body} + + +*** Keywords *** +Prepare Preconditions +{setup} +''' + temporary_directory = tempfile.TemporaryDirectory() + self.addCleanup(temporary_directory.cleanup) + path = ( + Path(temporary_directory.name) + / 'IOP_TP' + / 'NGSI-LD' + / 'Interoperability' + / 'Consumption' + / 'Entity' + / 'QueryEntities' + / 'IOP_999_01.robot' + ) + path.parent.mkdir(parents=True) + path.write_text(robot, encoding='utf-8') + + generator = GenerateRobotData(robot_file=str(path), execdir=str(ROOT)) + generator.parse_robot() + return generator.get_info()['initial_conditions'] + + def test_generates_context_and_data_objects(self): + result = self.generate( + variables='''${first_payload} fixtures/first-entity.jsonld +${context_path} https://example.test/contexts/example-context.jsonld?version=1 +${broker_alias} ${b2_url} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY}''', + setup=''' ${response}= Create Entity + ... ${first_payload} + ... urn:ngsi-ld:Example:1 + ... broker_url=${broker_alias} + ... context=${context_path} + Create Entity + ... second-entity.json + ... urn:ngsi-ld:Example:2 + ... ${EMPTY} + ... ${b3_url} + ... ${ngsild_test_suite_context}''', + test_body=''' Create Entity + ... ignored-body-entity.jsonld + ... urn:ngsi-ld:Example:3 + ... broker_url=${b3_url}''' + ) + + self.assertEqual( + result['pre_conditions'], + [ + { + 'type': 'context', + 'top-level': 'Context used for creation in following brokers:', + 'nested-object': [ + 'The example-context.jsonld user context is used when creating on b2.', + ( + 'The ngsi-ld-test-suite-compound.jsonld user context ' + 'is used when creating on b3.' + ) + ] + }, + { + 'type': 'data', + 'top-level': 'Data in following brokers:', + 'nested-object': [ + 'b2 contains first-entity.jsonld.', + 'b3 contains second-entity.json.' + ] + } + ] + ) + + def test_uses_empty_context_object_when_context_is_omitted(self): + result = self.generate( + variables='${b2_url} ${EMPTY}', + setup=( + ' Create Entity repeated.jsonld urn:ngsi-ld:Example:1' + ' broker_url=${b2_url}\n' + ' Create Entity repeated.jsonld urn:ngsi-ld:Example:2' + ' broker_url=${b2_url}' + ) + ) + + self.assertEqual( + result['pre_conditions'], + [ + { + 'type': 'context', + 'top-level': 'No user context used.', + 'nested-object': [] + }, + { + 'type': 'data', + 'top-level': 'Data in following brokers:', + 'nested-object': [ + 'b2 contains repeated.jsonld.', + 'b2 contains repeated.jsonld.' + ] + } + ] + ) + + def test_uses_empty_objects_without_create_entity(self): + result = self.generate( + variables='${b1_url} ${EMPTY}', + setup=' No Operation' + ) + + self.assertEqual( + result['pre_conditions'], + [ + { + 'type': 'context', + 'top-level': 'No user context used.', + 'nested-object': [] + }, + { + 'type': 'data', + 'top-level': 'No data in any broker.', + 'nested-object': [] + } + ] + ) + + def test_rejects_invalid_broker(self): + with self.assertRaisesRegex( + ValueError, + r"Create Entity broker variable '\$\{broker_url\}' is invalid" + ): + self.generate( + variables='${broker_url} https://example.test', + setup=( + ' Create Entity entity.jsonld urn:ngsi-ld:Example:1' + ' broker_url=${broker_url}' + ) + ) + + def test_rejects_undefined_payload_and_context_variables(self): + with self.assertRaisesRegex( + ValueError, + r"Create Entity payload variable '\$\{missing_payload\}' is not defined" + ): + self.generate( + variables='${b1_url} ${EMPTY}', + setup=( + ' Create Entity ${missing_payload} urn:ngsi-ld:Example:1' + ' broker_url=${b1_url}' + ) + ) + + with self.assertRaisesRegex( + ValueError, + r"Create Entity context variable '\$\{missing_context\}' is not defined" + ): + self.generate( + variables='${b1_url} ${EMPTY}', + setup=( + ' Create Entity entity.jsonld urn:ngsi-ld:Example:1' + ' broker_url=${b1_url} context=${missing_context}' + ) + ) + + +if __name__ == '__main__': + unittest.main() -- GitLab From 8e9c40fc65c530908424eb650534a7ec01a6ae03 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 12:21:10 +0200 Subject: [PATCH 18/34] chore: remove documentation lines as they are not needed anymore (text is inferred from code) --- .../Consumption/Entity/QueryEntities/IOP_003_01_01.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_01_02.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_02_01.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_02_02.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_03_01.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_03_02.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_04_01.robot | 2 -- .../Consumption/Entity/QueryEntities/IOP_003_04_02.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot | 2 -- .../Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_01_01.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_01_02.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_02_01.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_02_02.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_03_01.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_03_02.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_04_01.robot | 2 -- .../Interoperability/Provision/CreateEntity/IOP_001_04_02.robot | 2 -- 24 files changed, 48 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 697ac7c6..ed85987a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -21,8 +21,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. b3 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index a5621963..01e8e514 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -21,8 +21,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2 without location and totalSpotsNumber. b3 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index f8214371..6858cb7f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -25,8 +25,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 without location and OffStreetParking:2 without location. b3 contains OffStreetParking:1 and OffStreetParking:2. b4 contains OffStreetParking:2 with location and name only. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 2fb48f60..f2963df3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -28,8 +28,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and Vehicle:1. b3 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b4 contains OffStreetParking:2 with location and name only and Vehicle:2. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 0d2e4290..37ddfada 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -24,8 +24,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:2 without location. b3 contains OffStreetParking:1. b4 contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 83d1e923..cac869dc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -24,8 +24,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains Vehicle:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:1, OffStreetParking:2 and Vehicle:2. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 68b74c50..99516cac 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -28,8 +28,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET - [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b5 contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index 3609d3e7..da44268e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -28,8 +28,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST - [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 with location and name only and OffStreetParking:2. b5 contains OffStreetParking:1 and OffStreetParking:2 with location and name only. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 0933d87f..fae34e73 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -20,8 +20,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 and OffStreetParking:2. b3 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index 6891a963..b9e99691 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -20,8 +20,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_02 Retrieve OffStreetParking:2 - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:2 without location. b3 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:2 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index affc39ec..da679c4c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -22,8 +22,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1 without location. b3 contains OffStreetParking:1. b4 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 13db6de2..21bfa81f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -22,8 +22,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data only on leaves. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:2. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the "location" Property from the Entity OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index a057de0e..c30e500e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -23,8 +23,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 without location. b4 contains OffStreetParking:2. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index a77d1f3a..daba1bf3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -23,8 +23,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1. b3 contains OffStreetParking:1 with location and name only. b4 contains OffStreetParking:1 without location. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 7f1933f3..952d0c7c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -25,8 +25,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_002_04_01 Retrieve OffStreetParking:1 - [Documentation] Pre-conditions: no user context. Data only on leaves. b4 contains OffStreetParking:1 without location. b5 contains OffStreetParking:1. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 39efa7b8..107654b2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -26,8 +26,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute - [Documentation] Pre-conditions: no user context. Data on every broker. b1 contains OffStreetParking:1 without location. b2 contains OffStreetParking:1 without location. b3 contains OffStreetParking:1 without location. b4 contains OffStreetParking:1. b5 contains OffStreetParking:1 with location and name only. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 801685c6..9aa08e7f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -19,8 +19,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_01 Create OffStreetParking:1 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index 062eae9c..d040f97f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -19,8 +19,6 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_02 Create OffStreetParking:2 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in b1 to b2. Exclusive in b1 to b3. [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index c6d99d3e..d78cfb3e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -20,8 +20,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_01 Create OffStreetParking:1 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index cce5c032..2126a841 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -21,8 +21,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_02 Create OffStreetParking:2 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Inclusive in b1 to b2. Redirect in b1 to b3. Redirect in b1 to b4. [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index f85d96a1..d582de18 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -21,8 +21,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_01 Create OffStreetParking:1 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-3) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index ab84b9b1..910e1144 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -21,8 +21,6 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_02 Create Partial OffStreetParking:1 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Inclusive in b1 to b4. [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 # Client sends an HTTP POST request to b1 to create OffstreetParking:1 with location and name only (Figure 4.1.1.1-3) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index fdc3445f..a0c0df58 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -24,8 +24,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_001_04_01 Create OffStreetParking:1 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 4fab3efa..920e5b81 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -24,8 +24,6 @@ ${b5_url} ${EMPTY} *** Test Cases *** IOP_001_04_02 Create OffStreetParking:2 - [Documentation] Pre-conditions: no user context. No data in any broker. - ... Registrations established: Auxiliary in b1 to b2. Inclusive in b1 to b3. Redirect in b2 to b4. Redirect in b2 to b5. Exclusive in b3 to b5. [Tags] ... since_v1.6.1 ... iop -- GitLab From a1659f3cdf0c7193adfade85204cc0c72e024964 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 12:27:46 +0200 Subject: [PATCH 19/34] fix: changed text generated by the script --- doc/analysis/generaterobotdata.py | 29 ++++++------ doc/analysis/parserobotfile.py | 8 ++-- doc/tests/test_iop_preconditions.py | 70 ++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 20 deletions(-) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 80c5ba86..5e984c45 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -801,7 +801,7 @@ class GenerateRobotData: } ] - def generate_iop_registrations(self, test_name: str) -> str: + def generate_iop_registrations(self, test_name: str) -> list: """Generate the registration description from the test setup.""" setup = self._get_iop_setup(test_name=test_name) modes = {'inclusive', 'exclusive', 'redirect', 'auxiliary'} @@ -815,14 +815,10 @@ class GenerateRobotData: if mode not in modes: continue - payload_variable = str(keyword.args[1]) - try: - payload_path = self.robot.variables[payload_variable] - except KeyError: - raise ValueError( - f"Registration payload variable '{payload_variable}' is not defined" - ) - + payload_filename = self._iop_filename( + value=str(keyword.args[1]), + field='Registration payload' + ) brokers = [] for broker_variable in (str(keyword.args[4]), str(keyword.args[3])): broker_match = match(r'^\$\{(b\d+)_url\}$', broker_variable) @@ -832,12 +828,17 @@ class GenerateRobotData: ) brokers.append(broker_match.group(1)) - registrations.append( - f"{mode.capitalize()} from {brokers[0]} to {brokers[1]} " - f"(Figure {basename(payload_path)})" - ) + registrations.append(( + int(brokers[0][1:]), + int(brokers[1][1:]), + ( + f"{mode.capitalize()} {brokers[0]} to {brokers[1]} " + f"(Figure {payload_filename})." + ) + )) - return '. '.join(registrations) + registrations.sort(key=lambda item: (item[0], item[1])) + return list(dict.fromkeys(item[2] for item in registrations)) def visit_test_iop(self, test_name: str, suite_setup: str = "", suite_teardown: str = ""): """Process a single IOP test case""" diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index f60b8a76..658c9517 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -663,14 +663,14 @@ class ParseRobotFile: return [] test_content = self.test_cases[test_name] - pattern = r'\[Tags\]\s*(.*?)(?=\n\s+\[|\n\s*$)' - match = re.search(pattern, test_content, re.MULTILINE | re.DOTALL) + pattern = r'^[ \t]*\[Tags\][ \t]*(?P[^\n]*(?:\n[ \t]*\.{3}[^\n]*)*)' + match = re.search(pattern, test_content, re.MULTILINE) if not match: return [] - tags_text = match.group(1) - return [tag.strip() for tag in tags_text.split() if tag.strip()] + tags_text = match.group('tags') + return [tag for tag in tags_text.split() if tag != '...'] def get_iop_comments(self, test_name: str) -> list: """Extract comments from a specific IOP test case.""" diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py index 98b92d71..97c3d24c 100644 --- a/doc/tests/test_iop_preconditions.py +++ b/doc/tests/test_iop_preconditions.py @@ -24,7 +24,10 @@ Test Setup Prepare Preconditions *** Test Cases *** IOP_999_01 Generated Preconditions [Documentation] Pre-conditions: documentation must be ignored. - [Tags] since_v1.6.1 iop 4_3_3 + [Tags] + ... since_v1.6.1 + ... iop + ... 4_3_3 {test_body} @@ -49,7 +52,19 @@ Prepare Preconditions generator = GenerateRobotData(robot_file=str(path), execdir=str(ROOT)) generator.parse_robot() - return generator.get_info()['initial_conditions'] + self.generated_info = generator.get_info() + return self.generated_info['initial_conditions'] + + def test_removes_tag_continuation_markers(self): + self.generate( + variables='${b1_url} ${EMPTY}', + setup=' No Operation' + ) + + self.assertEqual( + self.generated_info['test_cases'][0]['tags'], + ['since_v1.6.1', 'iop', '4_3_3'] + ) def test_generates_context_and_data_objects(self): result = self.generate( @@ -151,6 +166,57 @@ ${b3_url} ${EMPTY}''', } ] ) + self.assertEqual(result['registrations_established'], []) + + def test_generates_sorted_registration_array(self): + result = self.generate( + variables='''${b1_url} ${EMPTY} +${b2_url} ${EMPTY} +${b3_url} ${EMPTY} +${b5_url} ${EMPTY} +${b10_url} ${EMPTY}''', + setup=''' @{redirect}= Create List + ... ${EMPTY} + ... redirect.jsonld + ... redirect + ... ${b5_url} + ... ${b1_url} + @{last}= Create List + ... ${EMPTY} + ... exclusive.jsonld + ... exclusive + ... ${b1_url} + ... ${b10_url} + @{duplicate}= Create List + ... urn:ngsi-ld:Example:1 + ... exclusive-other.jsonld + ... exclusive + ... ${b1_url} + ... ${b10_url} + @{inclusive}= Create List + ... ${EMPTY} + ... inclusive.jsonld + ... inclusive + ... ${b2_url} + ... ${b1_url} + @{auxiliary}= Create List + ... ${EMPTY} + ... auxiliary.jsonld + ... auxiliary + ... ${b3_url} + ... ${b2_url}''' + ) + + self.assertEqual( + result['registrations_established'], + [ + 'Inclusive b1 to b2 (Figure inclusive.jsonld).', + 'Redirect b1 to b5 (Figure redirect.jsonld).', + 'Auxiliary b2 to b3 (Figure auxiliary.jsonld).', + 'Exclusive b10 to b1 (Figure exclusive.jsonld).', + 'Exclusive b10 to b1 (Figure exclusive-other.jsonld).' + ] + ) def test_rejects_invalid_broker(self): with self.assertRaisesRegex( -- GitLab From d7f2f52287cd6793df34f5fdc2b024fade5bf651 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 12:54:48 +0200 Subject: [PATCH 20/34] chore: add readme with rules to follow when writing tests --- doc/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/README.md b/doc/README.md index ed741145..ee467211 100644 --- a/doc/README.md +++ b/doc/README.md @@ -49,6 +49,18 @@ divided into the NGSI-LD Test Suite Structure groups: - [ContextSource](./files/ContextSource) contains the expected results of the Context Source files. - [jsonldContext](./files/jsonldContext) contains the expected results of the Storing, Managing and Serving @contexts files. +## Rules for writing tests + +When writing interoperability tests, store each payload as a valid UTF-8 JSON object with a unique, descriptive, hyphen-separated `.json` or `.jsonld` filename in either [`data/entities/interoperability`](../data/entities/interoperability) or [`data/csourceRegistrations/interoperability`](../data/csourceRegistrations/interoperability). Entity payloads must contain a `type` value of exactly `OffStreetParking` or `Vehicle`, while context source registration payloads must contain a `mode` value of exactly `inclusive`, `auxiliary`, `exclusive`, or `redirect`; these values determine the documentation clause, and the filename determines the generated figure label. When introducing another type, mode, or clause, update the mappings in [`statisticsDocumentationData.py`](./statisticsDocumentationData.py). + +State the test objective with the suite-level `Documentation` setting in the `*** Settings ***` section. Use `...` continuation lines when the objective spans multiple lines. For interoperability tests, a test-level `[Documentation]` setting is not used to populate `test_objective`. + +The documentation generator infers preconditions from the keyword selected by `Test Setup`. Place the relevant `Create Entity` and `Create List` calls directly in that setup keyword; calls made only in the test body or indirectly through another user keyword are not considered. A `Create Entity` call must provide the payload filename and a broker variable resolving to `${bN_url}` through the `broker_url` argument. It generates text stating that broker `bN` contains that payload. The presence of the optional `context` argument generates the user-context text; omit the argument when no user context is used. A registration is inferred only from a `Create List` call having exactly five arguments in the following order: entity information, registration payload, registration mode, target broker URL, and registering broker URL. Its mode must be one of `inclusive`, `auxiliary`, `exclusive`, or `redirect`, and its broker variables must use the `${bN_url}` form. + +Add `[Tags]` to every test case. Use an `iop` tag for interoperability tests, one `cnf_NN` tag identifying the applicable configuration, numeric clause tags written with underscores such as `4_3_3`, and a `since_vX.Y.Z` tag identifying the first supported release. The numeric tags are converted to specification clause numbers, and all test cases in one file must use the same release tag. Add registration-behaviour tags such as `additive-inclusive`, `additive-auxiliary`, `proxy-exclusive`, or `proxy-redirect` when applicable. Tags may continue on lines beginning with `...`; the continuation marker is discarded. + +Write every documentation step as a standalone line comment inside the test case, immediately before the Robot Framework statement it describes. A comment such as `# Client sends an HTTP GET request to b1` becomes one generated test step. To add details beneath a step, place consecutive comments beginning with `# -` after a normal parent comment. Do not use a `# -` item without a preceding parent comment, and do not rely on comments in setup keywords, keyword implementations, or trailing comments because only full-line comments from the test-case body populate `test_steps`. + ## Execution ### Using PyCharm -- GitLab From eef525bc452e854103205297ab86ecdfaa03f1ea Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 14:18:56 +0200 Subject: [PATCH 21/34] chore: change the steps which points to a specific payload to reference variables --- .../Interoperability/Provision/CreateEntity/IOP_001_01_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_01_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_02_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_02_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_03_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_03_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_04_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_04_02.robot | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 9aa08e7f..63d704f1 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -21,7 +21,7 @@ ${b3_url} ${EMPTY} IOP_001_01_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index d040f97f..e1ca6394 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -21,7 +21,7 @@ ${b3_url} ${EMPTY} IOP_001_01_02 Create OffStreetParking:2 [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index d78cfb3e..b170c8ab 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -22,7 +22,7 @@ ${b4_url} ${EMPTY} IOP_001_02_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 2126a841..18b3d43a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_02_02 Create OffStreetParking:2 [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index d582de18..2cdc7bb0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_03_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-3) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 910e1144..85cc2e91 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_03_02 Create Partial OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create OffstreetParking:1 with location and name only (Figure 4.1.1.1-3) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index a0c0df58..a9a78457 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -36,7 +36,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... 4_3_6 ... 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:1 (Figure 4.1.1.1-1) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 920e5b81..3f9cfc10 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -36,7 +36,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... 4_3_6 ... 5_6_1 - # Client sends an HTTP POST request to b1 to create the Full version of OffstreetParking:2 (Figure 4.1.1.1-4) + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned -- GitLab From 1d3eb381b1cacff4cce1b0bf8be0d992fc347465 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 14:50:36 +0200 Subject: [PATCH 22/34] fix: update payload references in test cases and enhance documentation for variable usage --- .../Entity/QueryEntities/IOP_003_03_01.robot | 2 +- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 2 +- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 2 +- .../CreateEntity/IOP_001_01_01.robot | 2 +- doc/README.md | 14 +++++ doc/statisticsDocumentationData.py | 50 +++++++++++++++- .../test_statistics_documentation_data.py | 58 +++++++++++++++++++ 7 files changed, 125 insertions(+), 5 deletions(-) create mode 100644 doc/tests/test_statistics_documentation_data.py diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 37ddfada..257e482d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -41,7 +41,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ... broker_url=${b1_url} ... context=${ngsild_test_suite_context} - # Agent checks that a success response has been returned with the Full version of OffstreetParking:1 and OffstreetParking:2 without location + # Agent checks that a success response has been returned with ${first_full_offstreet_payload_filename} and ${offstreet_no_location_payload_filename} Check Response Status Code 200 ${response_b1.status_code} ${expected_b1_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b1_ids} ${response_b1.json()} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index fae34e73..f61e0a52 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -40,7 +40,7 @@ IOP_002_01_01 Retrieve OffStreetParking:1 ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} - # Agent checks that the Entity returned in step (3) is the full Entity + # Agent checks that the Entity returned in step (3) matches ${first_entity_payload_filename} ${expected_b2}= Load Entity ${first_entity_payload_filename} ${first_entity_id} Remove From Dictionary ${expected_b2} @context Check Resource Set To ${expected_b2} ${response_b2.json()} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index da679c4c..7e75379b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -31,7 +31,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... broker_url=${b1_url} ... type=OffStreetParking - # Agent checks that a partial success response has been returned and that the Full version of OffStreetParking:1 was returned + # Agent checks that a partial success response has been returned and that ${first_full_entity_payload_filename} was returned Check Response Status Code 200 ${response_b1.status_code} # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:1 diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 63d704f1..ed6eb542 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -30,7 +30,7 @@ IOP_001_01_01 Create OffStreetParking:1 ${expected_full_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_full_payload} @context - # Agent checks (with local=true) that the full Entity was created in b1 + # Agent checks (with local=true) that ${entity_payload_filename} was created in b1 ${response}= Retrieve Entity ... ${entity_id} ... local=true diff --git a/doc/README.md b/doc/README.md index ee467211..b07e10da 100644 --- a/doc/README.md +++ b/doc/README.md @@ -61,6 +61,20 @@ Add `[Tags]` to every test case. Use an `iop` tag for interoperability tests, on Write every documentation step as a standalone line comment inside the test case, immediately before the Robot Framework statement it describes. A comment such as `# Client sends an HTTP GET request to b1` becomes one generated test step. To add details beneath a step, place consecutive comments beginning with `# -` after a normal parent comment. Do not use a `# -` item without a preceding parent comment, and do not rely on comments in setup keywords, keyword implementations, or trailing comments because only full-line comments from the test-case body populate `test_steps`. +When a documentation step refers to a payload that is created, returned, or compared, include the Robot Framework variable containing its path instead of writing the payload description or figure number manually. The variable must be declared in the `*** Variables ***` section and resolve to the relevant payload file. For example: + +```robotframework +*** Variables *** +${entity_payload_filename} interoperability/full-version-of-OffStreetParking1.jsonld + +*** Test Cases *** +IOP_001_01_01 Create OffStreetParking:1 + # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} +``` + +During statistics generation, `${entity_payload_filename}` in the generated step is replaced with `full-version-of-OffStreetParking1.jsonld`. Only the filename is emitted; the directory path is removed. Do not include explicit figure numbers because the documentation generator infers the corresponding figure from the filename. + ## Execution ### Using PyCharm diff --git a/doc/statisticsDocumentationData.py b/doc/statisticsDocumentationData.py index 47ef38ef..b310eec8 100644 --- a/doc/statisticsDocumentationData.py +++ b/doc/statisticsDocumentationData.py @@ -8,6 +8,48 @@ import json import re from analysis.initial_setup import InitialSetup + +def replace_test_step_filename_variables(testcase: dict, robot_file: str) -> None: + with open(robot_file, "r", encoding="utf-8") as fp: + robot_content = fp.read() + + variables_section = re.search( + r"^\*\*\* Variables \*\*\*\s*$" + r"(?P.*?)" + r"(?=^\*\*\* .+ \*\*\*\s*$|\Z)", + robot_content, + re.MULTILINE | re.DOTALL, + ) + if variables_section is None: + return + + variables = dict( + re.findall( + r"^\s*(\$\{[^}]+\})\s{2,}(.+?)\s*$", + variables_section.group("variables"), + re.MULTILINE, + ) + ) + + def replace_variables(value): + if isinstance(value, list): + return [replace_variables(item) for item in value] + if not isinstance(value, str): + return value + + return re.sub( + r"\$\{[^}]+\}", + lambda match: os.path.basename( + variables.get(match.group(0), match.group(0)) + ), + value, + ) + + for test_case in testcase.get("test_cases", []): + if "test_steps" in test_case: + test_case["test_steps"] = replace_variables(test_case["test_steps"]) + + def locate_result_folder(): folder_test_suites = dirname(dirname(__file__)).replace("\\", "/") folder_result_path = f"{folder_test_suites}/doc/results" @@ -123,11 +165,17 @@ if __name__ == "__main__": if filename.endswith(ROBOT_FILE_EXTENSION): number_of_all_testcases += 1 name_of_test_case = filename[: -len(ROBOT_FILE_EXTENSION)] + robot_file = join(root, filename).replace("\\", "/") json_of_test_case = create_json_of_robotfile( name_of_test_case, True, - robot_file=join(root, filename).replace("\\", "/"), + robot_file=robot_file, ) + if label == "IOP": + replace_test_step_filename_variables( + testcase=json_of_test_case, + robot_file=robot_file, + ) statistics[name_of_test_case] = dict() strippedpath = root[len(path_info) + 1 :] statistics[name_of_test_case]["path"] = strippedpath diff --git a/doc/tests/test_statistics_documentation_data.py b/doc/tests/test_statistics_documentation_data.py new file mode 100644 index 00000000..11e33b4e --- /dev/null +++ b/doc/tests/test_statistics_documentation_data.py @@ -0,0 +1,58 @@ +import sys +import tempfile +import unittest +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT / "doc")) + +from statisticsDocumentationData import replace_test_step_filename_variables + + +class TestStepFilenameVariablesTest(unittest.TestCase): + def test_replaces_variables_with_filenames(self): + robot = """*** Variables *** +${entity_payload_filename} interoperability/full-version.jsonld + + +*** Test Cases *** +Example + No Operation +""" + testcase = { + "test_cases": [ + { + "test_steps": [ + "Create ${entity_payload_filename}", + [ + "Use ${entity_payload_filename}", + "Keep ${runtime_variable}", + ], + ] + } + ] + } + + with tempfile.TemporaryDirectory() as temporary_directory: + robot_file = Path(temporary_directory) / "example.robot" + robot_file.write_text(robot, encoding="utf-8") + replace_test_step_filename_variables( + testcase=testcase, + robot_file=str(robot_file), + ) + + self.assertEqual( + testcase["test_cases"][0]["test_steps"], + [ + "Create full-version.jsonld", + [ + "Use full-version.jsonld", + "Keep ${runtime_variable}", + ], + ], + ) + + +if __name__ == "__main__": + unittest.main() -- GitLab From a0d1ac1cfc0f88ce6fc981a72ed2e74329601a5b Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 27 Jul 2026 14:58:34 +0200 Subject: [PATCH 23/34] chore: remove text from steps --- .../Interoperability/Provision/CreateEntity/IOP_001_01_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_01_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_02_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_02_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_03_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_03_02.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_04_01.robot | 2 +- .../Interoperability/Provision/CreateEntity/IOP_001_04_02.robot | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index ed6eb542..659d6cbf 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -21,7 +21,7 @@ ${b3_url} ${EMPTY} IOP_001_01_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index e1ca6394..15a4b91a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -21,7 +21,7 @@ ${b3_url} ${EMPTY} IOP_001_01_02 Create OffStreetParking:2 [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index b170c8ab..5d9d78e0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -22,7 +22,7 @@ ${b4_url} ${EMPTY} IOP_001_02_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 18b3d43a..ecb78941 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_02_02 Create OffStreetParking:2 [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 2cdc7bb0..547c057a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_03_01 Create OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 85cc2e91..ee045ed3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} IOP_001_03_02 Create Partial OffStreetParking:1 [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index a9a78457..3ac1991c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -36,7 +36,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... 4_3_6 ... 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 3f9cfc10..176c484c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -36,7 +36,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... 4_3_6 ... 5_6_1 - # Client sends an HTTP POST request to b1 to create the entity defined in ${entity_payload_filename} + # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} # Agent checks that a success response has been returned -- GitLab From d3c03476a9b11a6cda4a014fc11f53043a42ecbb Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 28 Jul 2026 16:45:39 +0200 Subject: [PATCH 24/34] remove context --- ...ext-source-registration-auxiliary-1.jsonld | 5 +- ...ext-source-registration-auxiliary-2.jsonld | 5 +- ...ext-source-registration-auxiliary-3.jsonld | 5 +- ...ext-source-registration-exclusive-1.jsonld | 5 +- ...ext-source-registration-exclusive-2.jsonld | 5 +- ...ext-source-registration-exclusive-3.jsonld | 5 +- ...ext-source-registration-inclusive-1.jsonld | 5 +- ...ext-source-registration-inclusive-2.jsonld | 5 +- ...ext-source-registration-inclusive-3.jsonld | 5 +- ...text-source-registration-redirect-1.jsonld | 5 +- ...text-source-registration-redirect-2.jsonld | 5 +- ...text-source-registration-redirect-3.jsonld | 5 +- ...text-source-registration-redirect-4.jsonld | 5 +- .../full-version-of-OffStreetParking1.jsonld | 5 +- .../full-version-of-OffStreetParking2.jsonld | 7 +-- .../full-version-of-Vehicle1.jsonld | 61 +++++++++---------- .../full-version-of-Vehicle2.jsonld | 61 +++++++++---------- ...arking1-with-location-and-name-only.jsonld | 5 +- .../offStreetParking1-without-location.jsonld | 5 +- ...arking2-with-location-and-name-only.jsonld | 5 +- ...thout-location-and-totalSpotsNumber.jsonld | 5 +- .../offStreetParking2-without-location.jsonld | 5 +- 22 files changed, 79 insertions(+), 145 deletions(-) diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld index d5dabec6..b6d18822 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld @@ -11,8 +11,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } \ No newline at end of file diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld index 1d037309..3a9e0a14 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld @@ -15,8 +15,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } \ No newline at end of file diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld index 2e719b7e..32dd9855 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld @@ -11,8 +11,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } \ No newline at end of file diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index d1ad0a8a..f5cd8843 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld index 9d8c38c6..a347014a 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld index 795c2e7c..61c65ea0 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld index bf2b6681..45c8361f 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld @@ -12,8 +12,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld index f7b0fe92..66403cd8 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld @@ -16,8 +16,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld index 37f3e73d..97b86725 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld @@ -12,8 +12,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld index ce6fe900..4c6246b3 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld @@ -12,8 +12,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld index 5153eaf4..256a09b3 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld @@ -15,8 +15,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld index 5598b967..4edd2920 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld @@ -16,8 +16,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld index 9869cc0f..b5c734bc 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld @@ -16,8 +16,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld index 998bf94c..72d08056 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld @@ -27,8 +27,5 @@ 41.2 ] } - }, - "@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/interoperability/full-version-of-OffStreetParking2.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld index d3efac75..aafa0d23 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld @@ -27,8 +27,5 @@ 41.2 ] } - }, - "@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/interoperability/full-version-of-Vehicle1.jsonld b/data/entities/interoperability/full-version-of-Vehicle1.jsonld index ff8125d1..cb4cb3e8 100644 --- a/data/entities/interoperability/full-version-of-Vehicle1.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle1.jsonld @@ -1,34 +1,31 @@ { - "id": "urn:ngsi-ld:Vehicle:1", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Brand1" - }, - "speed": { - "type": "Property", - "value": 0, - "source": { - "type": "Property", - "value": "Speedometer" - } - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:1", - "observedAt": "2017-07-29T12:00:04Z" - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -8.45, - 41.2 - ] - } - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "id": "urn:ngsi-ld:Vehicle:1", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Brand1" + }, + "speed": { + "type": "Property", + "value": 0, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.45, + 41.2 + ] + } + } } diff --git a/data/entities/interoperability/full-version-of-Vehicle2.jsonld b/data/entities/interoperability/full-version-of-Vehicle2.jsonld index 427399f6..e98f9358 100644 --- a/data/entities/interoperability/full-version-of-Vehicle2.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle2.jsonld @@ -1,34 +1,31 @@ { - "id": "urn:ngsi-ld:Vehicle:2", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Brand2" - }, - "speed": { - "type": "Property", - "value": 5, - "source": { - "type": "Property", - "value": "Speedometer" - } - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:2", - "observedAt": "2017-07-30T12:00:04Z" - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -9.45, - 40.2 - ] - } - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "id": "urn:ngsi-ld:Vehicle:2", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Brand2" + }, + "speed": { + "type": "Property", + "value": 5, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:2", + "observedAt": "2017-07-30T12:00:04Z" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -9.45, + 40.2 + ] + } + } } diff --git a/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld index 824cfa90..6ea20cea 100644 --- a/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld @@ -15,8 +15,5 @@ ] }, "observedAt": "2021-04-04T11:45:00Z" - }, - "@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/entities/interoperability/offStreetParking1-without-location.jsonld b/data/entities/interoperability/offStreetParking1-without-location.jsonld index cbb13215..52fe89c9 100644 --- a/data/entities/interoperability/offStreetParking1-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking1-without-location.jsonld @@ -17,8 +17,5 @@ "totalSpotsNumber": { "type": "Property", "value": 200 - }, - "@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/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld index 4dd2ea5f..0aae0119 100644 --- a/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld @@ -15,8 +15,5 @@ ] }, "observedAt": "2021-04-04T11:46:00Z" - }, - "@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/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld index dba4633c..9b831522 100644 --- a/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld @@ -13,8 +13,5 @@ "type": "Property", "value": 0.56 } - }, - "@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/interoperability/offStreetParking2-without-location.jsonld b/data/entities/interoperability/offStreetParking2-without-location.jsonld index c6418d9c..90962489 100644 --- a/data/entities/interoperability/offStreetParking2-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location.jsonld @@ -17,8 +17,5 @@ "totalSpotsNumber": { "type": "Property", "value": 150 - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + } } -- GitLab From 014b4049a73eb78185f882b94b4eb022a996a738 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 28 Jul 2026 16:50:18 +0200 Subject: [PATCH 25/34] Revert "remove context" This reverts commit d3c03476a9b11a6cda4a014fc11f53043a42ecbb. --- ...ext-source-registration-auxiliary-1.jsonld | 5 +- ...ext-source-registration-auxiliary-2.jsonld | 5 +- ...ext-source-registration-auxiliary-3.jsonld | 5 +- ...ext-source-registration-exclusive-1.jsonld | 5 +- ...ext-source-registration-exclusive-2.jsonld | 5 +- ...ext-source-registration-exclusive-3.jsonld | 5 +- ...ext-source-registration-inclusive-1.jsonld | 5 +- ...ext-source-registration-inclusive-2.jsonld | 5 +- ...ext-source-registration-inclusive-3.jsonld | 5 +- ...text-source-registration-redirect-1.jsonld | 5 +- ...text-source-registration-redirect-2.jsonld | 5 +- ...text-source-registration-redirect-3.jsonld | 5 +- ...text-source-registration-redirect-4.jsonld | 5 +- .../full-version-of-OffStreetParking1.jsonld | 5 +- .../full-version-of-OffStreetParking2.jsonld | 7 ++- .../full-version-of-Vehicle1.jsonld | 61 ++++++++++--------- .../full-version-of-Vehicle2.jsonld | 61 ++++++++++--------- ...arking1-with-location-and-name-only.jsonld | 5 +- .../offStreetParking1-without-location.jsonld | 5 +- ...arking2-with-location-and-name-only.jsonld | 5 +- ...thout-location-and-totalSpotsNumber.jsonld | 5 +- .../offStreetParking2-without-location.jsonld | 5 +- 22 files changed, 145 insertions(+), 79 deletions(-) diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld index b6d18822..d5dabec6 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld @@ -11,5 +11,8 @@ } ], "mode": "auxiliary", - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-auxiliary-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld index 3a9e0a14..1d037309 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld @@ -15,5 +15,8 @@ } ], "mode": "auxiliary", - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-auxiliary-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld index 32dd9855..2e719b7e 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld @@ -11,5 +11,8 @@ } ], "mode": "auxiliary", - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index f5cd8843..d1ad0a8a 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -16,5 +16,8 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-exclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld index a347014a..9d8c38c6 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld @@ -16,5 +16,8 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-exclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld index 61c65ea0..795c2e7c 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld @@ -16,5 +16,8 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-inclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld index 45c8361f..bf2b6681 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld @@ -12,5 +12,8 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-inclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld index 66403cd8..f7b0fe92 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld @@ -16,5 +16,8 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-inclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld index 97b86725..37f3e73d 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld @@ -12,5 +12,8 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-redirect-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld index 4c6246b3..ce6fe900 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld @@ -12,5 +12,8 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-redirect-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld index 256a09b3..5153eaf4 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld @@ -15,5 +15,8 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-redirect-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld index 4edd2920..5598b967 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld @@ -16,5 +16,8 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/interoperability/context-source-registration-redirect-4.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld index b5c734bc..9869cc0f 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld @@ -16,5 +16,8 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx" + "endpoint": "xxx", + "@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/entities/interoperability/full-version-of-OffStreetParking1.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld index 72d08056..998bf94c 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld @@ -27,5 +27,8 @@ 41.2 ] } - } + }, + "@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/interoperability/full-version-of-OffStreetParking2.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld index aafa0d23..d3efac75 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld @@ -27,5 +27,8 @@ 41.2 ] } - } -} + }, + "@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/interoperability/full-version-of-Vehicle1.jsonld b/data/entities/interoperability/full-version-of-Vehicle1.jsonld index cb4cb3e8..ff8125d1 100644 --- a/data/entities/interoperability/full-version-of-Vehicle1.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle1.jsonld @@ -1,31 +1,34 @@ { - "id": "urn:ngsi-ld:Vehicle:1", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Brand1" - }, - "speed": { - "type": "Property", - "value": 0, - "source": { - "type": "Property", - "value": "Speedometer" - } - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:1", - "observedAt": "2017-07-29T12:00:04Z" - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -8.45, - 41.2 - ] - } - } + "id": "urn:ngsi-ld:Vehicle:1", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Brand1" + }, + "speed": { + "type": "Property", + "value": 0, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -8.45, + 41.2 + ] + } + }, + "@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/entities/interoperability/full-version-of-Vehicle2.jsonld b/data/entities/interoperability/full-version-of-Vehicle2.jsonld index e98f9358..427399f6 100644 --- a/data/entities/interoperability/full-version-of-Vehicle2.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle2.jsonld @@ -1,31 +1,34 @@ { - "id": "urn:ngsi-ld:Vehicle:2", - "type": "Vehicle", - "brandName": { - "type": "Property", - "value": "Brand2" - }, - "speed": { - "type": "Property", - "value": 5, - "source": { - "type": "Property", - "value": "Speedometer" - } - }, - "isParked": { - "type": "Relationship", - "object": "urn:ngsi-ld:OffStreetParking:2", - "observedAt": "2017-07-30T12:00:04Z" - }, - "location": { - "type": "GeoProperty", - "value": { - "type": "Point", - "coordinates": [ - -9.45, - 40.2 - ] - } - } + "id": "urn:ngsi-ld:Vehicle:2", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Brand2" + }, + "speed": { + "type": "Property", + "value": 5, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "isParked": { + "type": "Relationship", + "object": "urn:ngsi-ld:OffStreetParking:2", + "observedAt": "2017-07-30T12:00:04Z" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + -9.45, + 40.2 + ] + } + }, + "@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/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld index 6ea20cea..824cfa90 100644 --- a/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld @@ -15,5 +15,8 @@ ] }, "observedAt": "2021-04-04T11:45:00Z" - } + }, + "@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/entities/interoperability/offStreetParking1-without-location.jsonld b/data/entities/interoperability/offStreetParking1-without-location.jsonld index 52fe89c9..cbb13215 100644 --- a/data/entities/interoperability/offStreetParking1-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking1-without-location.jsonld @@ -17,5 +17,8 @@ "totalSpotsNumber": { "type": "Property", "value": 200 - } + }, + "@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/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld index 0aae0119..4dd2ea5f 100644 --- a/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld @@ -15,5 +15,8 @@ ] }, "observedAt": "2021-04-04T11:46:00Z" - } + }, + "@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/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld index 9b831522..dba4633c 100644 --- a/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld @@ -13,5 +13,8 @@ "type": "Property", "value": 0.56 } - } + }, + "@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/interoperability/offStreetParking2-without-location.jsonld b/data/entities/interoperability/offStreetParking2-without-location.jsonld index 90962489..c6418d9c 100644 --- a/data/entities/interoperability/offStreetParking2-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location.jsonld @@ -17,5 +17,8 @@ "totalSpotsNumber": { "type": "Property", "value": 150 - } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] } -- GitLab From d74ed701b0fe03d8e6b7380a897cf1c51b3714d5 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Thu, 30 Jul 2026 18:04:32 +0200 Subject: [PATCH 26/34] feat: use core context for tests that are supposed to be tested with default context --- .../Entity/QueryEntities/IOP_003_01_01.robot | 12 ++++++++---- .../Entity/QueryEntities/IOP_003_01_02.robot | 12 ++++++++---- .../Entity/QueryEntities/IOP_003_02_01.robot | 16 +++++++++++----- .../Entity/QueryEntities/IOP_003_02_02.robot | 17 ++++++++++++----- .../Entity/QueryEntities/IOP_003_03_01.robot | 14 +++++++++----- .../Entity/QueryEntities/IOP_003_03_02.robot | 16 +++++++++++----- .../Entity/QueryEntities/IOP_003_04_01.robot | 13 +++++++++---- .../Entity/QueryEntities/IOP_003_04_02.robot | 13 +++++++++---- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 11 +++++++---- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 12 +++++++----- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 14 ++++++++------ .../Entity/RetrieveEntity/IOP_002_02_02.robot | 12 +++++++----- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 18 ++++++++++-------- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 13 ++++++++----- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 12 +++++++----- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 17 +++++++++++------ .../Provision/CreateEntity/IOP_001_01_01.robot | 12 ++++++------ .../Provision/CreateEntity/IOP_001_01_02.robot | 12 ++++++------ .../Provision/CreateEntity/IOP_001_02_01.robot | 14 +++++++------- .../Provision/CreateEntity/IOP_001_02_02.robot | 14 +++++++------- .../Provision/CreateEntity/IOP_001_03_01.robot | 14 +++++++------- .../Provision/CreateEntity/IOP_001_03_02.robot | 14 +++++++------- .../Provision/CreateEntity/IOP_001_04_01.robot | 15 ++++++++------- .../Provision/CreateEntity/IOP_001_04_02.robot | 15 ++++++++------- .../IOPUtils/InteroperabilityUtils.resource | 5 +++-- 25 files changed, 201 insertions(+), 136 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index ed85987a..4353dbad 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -31,12 +31,13 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve all Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned and that the following Entities were returned: # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber @@ -51,7 +52,7 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -62,7 +63,7 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -106,18 +107,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -135,7 +139,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index 01e8e514..aa6f0a13 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -31,6 +31,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... 4_3_6 ... 5_7_2 ... 6_23_2_1 + ... default-context # Client sends an HTTP POST request to b1 to retrieve all Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @@ -38,7 +39,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b1}= Query Entities Via POST ... entities=${entities} ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned and that the following Entities were returned: # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber @@ -53,7 +54,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b2}= Query Entities Via POST ... entities=${entities} ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -64,7 +65,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b3}= Query Entities Via POST ... entities=${entities} ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -108,18 +109,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -137,7 +141,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index 6858cb7f..f9073183 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -35,12 +35,13 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned and that OffstreetParking:1 and OffstreetParking:2 were returned with all properties but "name" Check Response Status Code 200 ${response_b1.status_code} @@ -53,7 +54,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -64,7 +65,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -75,7 +76,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -126,26 +127,31 @@ Setup Initial Context Source Registrations ... ${first_entity_no_location_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_no_location_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -170,7 +176,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index f2963df3..517b4dba 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -38,13 +38,14 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned and that all four Entities were returned with the "location" Property only Check Response Status Code 200 ${response_b1.status_code} @@ -64,7 +65,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_parking_entity_id} ${first_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -76,7 +77,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_parking_entity_id} ${second_parking_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -88,7 +89,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${second_parking_entity_id} ${second_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -132,31 +133,37 @@ Setup Initial Context Source Registrations ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_parking_location_name_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_offstreet_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -200,7 +207,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index 257e482d..cbf6eed0 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -34,12 +34,13 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned with ${first_full_offstreet_payload_filename} and ${offstreet_no_location_payload_filename} Check Response Status Code 200 ${response_b1.status_code} @@ -52,7 +53,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -62,7 +63,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -72,7 +73,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -110,16 +111,19 @@ Setup Initial Context Source Registrations ... ${offstreet_no_location_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_no_location_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -144,7 +148,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index cac869dc..63fae1b9 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -34,13 +34,14 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve the "location" Property from all Entities having type OffstreetParking or Vehicle ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned with OffstreetParking:1, OffstreetParking:2 and Vehicle:1 Check Response Status Code 200 ${response_b1.status_code} @@ -58,7 +59,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -69,7 +70,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_parking_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -80,7 +81,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ... ${first_parking_entity_id} @@ -134,26 +135,31 @@ Setup Initial Context Source Registrations ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${parking_location_name_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_offstreet_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -178,7 +184,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 99516cac..575ac35d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -40,12 +40,13 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ... 4_3_6 ... 5_7_2 ... 6_4_3_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" Check Response Status Code 200 ${response_b1.status_code} @@ -58,7 +59,7 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -69,7 +70,7 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ${response_b5}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b5_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b5.status_code} ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} @@ -118,21 +119,25 @@ Setup Initial Context Source Registrations ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} ... broker_url=${b5_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b5_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -184,7 +189,7 @@ Setup Initial Context Source Registrations ... ${fourth_set} ... ${fifth_set} ... ${sixth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index da44268e..63142fea 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -40,6 +40,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ... 4_3_6 ... 5_7_2 ... 6_23_2_1 + ... default-context # Client sends an HTTP POST request to b1 to retrieve Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @@ -47,7 +48,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b1}= Query Entities Via POST ... entities=${entities} ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" Check Response Status Code 200 ${response_b1.status_code} @@ -60,7 +61,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b4}= Query Entities Via POST ... entities=${entities} ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -71,7 +72,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b5}= Query Entities Via POST ... entities=${entities} ... broker_url=${b5_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response_b5.status_code} ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} @@ -120,21 +121,25 @@ Setup Initial Context Source Registrations ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} ... broker_url=${b5_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b5_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -186,7 +191,7 @@ Setup Initial Context Source Registrations ... ${fourth_set} ... ${fifth_set} ... ${sixth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index f61e0a52..65396c29 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -20,12 +20,12 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -35,7 +35,7 @@ IOP_002_01_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b2 to retrieve the OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -63,18 +63,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -92,7 +95,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index b9e99691..996393df 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -20,12 +20,12 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_002_01_02 Retrieve OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:2 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -35,7 +35,7 @@ IOP_002_01_02 Retrieve OffStreetParking:2 # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:2 ${response_b2}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -46,7 +46,7 @@ IOP_002_01_02 Retrieve OffStreetParking:2 # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:2 ${response_b3}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -75,12 +75,14 @@ Setup Initial Context Source Registrations ... ${entity_payload_filename} ... ${entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${full_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -98,7 +100,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index 7e75379b..c0790e3b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -22,12 +22,12 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -37,7 +37,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -48,7 +48,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:1 ${response_b3}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -73,17 +73,19 @@ IOP_002_02_01 Retrieve OffStreetParking:1 Setup Initial Context Source Registrations Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b2_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b2_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -108,7 +110,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 21bfa81f..48d8b69b 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -22,13 +22,13 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the "location" Property from the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} ... attrs=location - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -39,7 +39,7 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -62,13 +62,15 @@ Setup Initial Context Source Registrations ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -93,7 +95,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index c30e500e..7f0029d9 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -23,12 +23,12 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -39,7 +39,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b1_local}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b1_local.status_code} @@ -51,7 +51,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -63,7 +63,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b3}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -79,19 +79,21 @@ IOP_002_03_01 Retrieve OffStreetParking:1 Setup Initial Context Source Registrations Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b1_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} + ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -116,7 +118,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index daba1bf3..1dc50346 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -23,13 +23,13 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 + [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} ... attrs=location - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -40,7 +40,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -62,18 +62,21 @@ Setup Initial Context Source Registrations ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b1_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b2_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b2_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -98,7 +101,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 952d0c7c..8971b23d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -36,11 +36,12 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... proxy-exclusive ... 4_3_6 ... 5_7_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -50,7 +51,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b4 to retrieve the Entity OffStreetParking:1 ${response_b4}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b4_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b4.status_code} @@ -61,7 +62,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b5 to retrieve the Entity OffStreetParking:1 ${response_b5}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b5_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b5.status_code} @@ -89,8 +90,9 @@ Setup Initial Context Source Registrations ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b4_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b5_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b5_url} context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -134,7 +136,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index 107654b2..c175bb9c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -37,11 +37,12 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... proxy-exclusive ... 4_3_6 ... 5_7_1 + ... default-context # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -52,7 +53,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b2}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -64,7 +65,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -76,7 +77,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b5}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} ... broker_url=${b5_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b5.status_code} @@ -106,23 +107,27 @@ Setup Initial Context Source Registrations ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b1_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b2_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b4_url} + ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b4_url} context=${core_context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} ... broker_url=${b5_url} + ... context=${core_context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -166,7 +171,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 659d6cbf..1cd0eb86 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -19,10 +19,10 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -35,7 +35,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -44,7 +44,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -55,7 +55,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} @@ -78,7 +78,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index 15a4b91a..e55f51d3 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -19,10 +19,10 @@ ${b3_url} ${EMPTY} *** Test Cases *** IOP_001_01_02 Create OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -32,7 +32,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b1_url} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b1_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_b1_payload} @context location @@ -43,7 +43,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b2_url} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -54,7 +54,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b3_url} ... local=true - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b3_payload} id type location @@ -80,7 +80,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} + Compose IOP Configuration ${first_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index 5d9d78e0..7c378f1f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -20,10 +20,10 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -36,7 +36,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} @@ -45,7 +45,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -56,7 +56,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location @@ -67,7 +67,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} @@ -98,7 +98,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index ecb78941..3d8ab5dc 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -21,10 +21,10 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_02_02 Create OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +37,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} @@ -46,7 +46,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -57,7 +57,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location @@ -68,7 +68,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} @@ -99,7 +99,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} + Compose IOP Configuration ${second_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index 547c057a..e9804142 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -21,10 +21,10 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +37,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -46,7 +46,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 @@ -54,7 +54,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -63,7 +63,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_spots_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_spots_payload} id type availableSpotsNumber totalSpotsNumber @@ -96,7 +96,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index ee045ed3..624dfd41 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -21,10 +21,10 @@ ${b4_url} ${EMPTY} *** Test Cases *** IOP_001_03_02 Create Partial OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 + [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +37,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b2 @@ -45,14 +45,14 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b4 @@ -60,7 +60,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} @@ -90,7 +90,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} + Compose IOP Configuration ${third_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index 3ac1991c..a0e64adf 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -35,9 +35,10 @@ IOP_001_04_01 Create OffStreetParking:1 ... proxy-redirect ... 4_3_6 ... 5_6_1 + ... default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -50,7 +51,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b2 @@ -58,14 +59,14 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b4 @@ -73,14 +74,14 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was NOT created in b5 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b5_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} @@ -129,7 +130,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 176c484c..33c3b695 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -35,9 +35,10 @@ IOP_001_04_02 Create OffStreetParking:2 ... proxy-redirect ... 4_3_6 ... 5_6_1 + ... default-context # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} + ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -50,7 +51,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -59,7 +60,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 @@ -67,7 +68,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_b3_payload} @context totalSpotsNumber @@ -78,7 +79,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b5 and that the Entity only contains the "totalSpotsNumber" Property @@ -86,7 +87,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b5_url} - ... context=${ngsild_test_suite_context} + ... context=${core_context} Check Response Status Code 200 ${response.status_code} ${expected_b5_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b5_payload} id type totalSpotsNumber @@ -138,7 +139,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} + Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/resources/IOPUtils/InteroperabilityUtils.resource b/resources/IOPUtils/InteroperabilityUtils.resource index 42a312d9..e2551305 100644 --- a/resources/IOPUtils/InteroperabilityUtils.resource +++ b/resources/IOPUtils/InteroperabilityUtils.resource @@ -11,7 +11,8 @@ Resource ${EXECDIR}/resources/JsonUtils.resource *** Keywords *** Compose IOP Configuration - [Arguments] ${sets} + [Arguments] ${sets} + ... ${ld_context}=${ngsild_test_suite_context} ${len}= Get Length ${sets} Set Test Variable ${registration_count} 0 @@ -31,7 +32,7 @@ Compose IOP Configuration ... entity_id=${entity_id} ... mode=${mode} ... endpoint=${endpoint} - ... context=${ngsild_test_suite_context} + ... context=${ld_context} ${response}= Create Context Source Registration With Return ... ${registration_payload} ... content_type=${CONTENT_TYPE_LD_JSON} -- GitLab From 1837f418d603556493ebbb25ca32d212fd1dedad Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Fri, 31 Jul 2026 09:03:37 +0200 Subject: [PATCH 27/34] feat: parser is capable to understand if a user context is used and this is reflected in the jsons --- doc/analysis/generaterobotdata.py | 122 ++++++++++++++++++++++++---- doc/tests/test_iop_preconditions.py | 59 ++++++++++++-- 2 files changed, 159 insertions(+), 22 deletions(-) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 5e984c45..9ada8ba3 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -682,7 +682,12 @@ class GenerateRobotData: return setup - def _resolve_iop_value(self, value: str, field: str) -> str: + def _resolve_iop_value( + self, + value: str, + field: str, + setup_variables: dict | None = None, + ) -> str: original = str(value) result = original visited = set() @@ -692,6 +697,10 @@ class GenerateRobotData: raise ValueError(f"{field} variable '{original}' contains a circular reference") visited.add(result) + if setup_variables is not None and result in setup_variables: + result = str(setup_variables[result]) + continue + if result in self.robot.variables: result = str(self.robot.variables[result]) continue @@ -749,12 +758,65 @@ class GenerateRobotData: return values + @staticmethod + def _compose_iop_configuration_context(args) -> str: + for argument in (str(item) for item in args): + key, separator, value = argument.partition('=') + if separator and key == 'ld_context': + return value + + if len(args) > 1: + return str(args[1]) + return '${ngsild_test_suite_context}' + + def _iop_context_kind( + self, + value: str, + field: str, + setup_variables: dict, + ) -> tuple[str, bool]: + resolved = self._resolve_iop_value( + value=value, + field=field, + setup_variables=setup_variables, + ) + core_context = self._resolve_iop_value( + value='${core_context}', + field='Core context', + ) + test_suite_context = self._resolve_iop_value( + value='${ngsild_test_suite_context}', + field='Test suite context', + ) + return ( + 'Default context' if resolved == core_context else 'User context', + resolved == test_suite_context, + ) + def generate_iop_preconditions(self, test_name: str) -> list: setup = self._get_iop_setup(test_name=test_name) - contexts = [] data = [] + context_operations = [] + setup_variables = {} for keyword in setup.body: + if keyword.name == 'Set Test Variable' and len(keyword.args) >= 2: + setup_variables[str(keyword.args[0])] = str(keyword.args[1]) + continue + + if keyword.name == 'Compose IOP Configuration': + context_kind, is_test_suite_context = self._iop_context_kind( + value=self._compose_iop_configuration_context(keyword.args), + field='Compose IOP Configuration context', + setup_variables=setup_variables, + ) + context_operations.append(( + 'registrations', + context_kind, + is_test_suite_context, + )) + continue + if keyword.name != 'Create Entity': continue @@ -771,23 +833,53 @@ class GenerateRobotData: ) data.append(f"{broker} contains {payload_filename}.") - if 'context' in arguments: - context_filename = self._iop_filename( - value=arguments['context'], - field='Create Entity context' - ) - contexts.append( - f"The {context_filename} user context is used when creating on {broker}." - ) + context_kind, is_test_suite_context = self._iop_context_kind( + value=arguments.get('context', '${ngsild_test_suite_context}'), + field='Create Entity context', + setup_variables=setup_variables, + ) + entity_id = self._resolve_iop_value( + value=arguments['entity_id'], + field='Create Entity entity ID', + setup_variables=setup_variables, + ) + context_operations.append(( + 'entity', + context_kind, + is_test_suite_context, + entity_id, + broker, + )) + + if not context_operations or all( + operation[1] == 'Default context' + for operation in context_operations + ): + context_top_level = 'No user context used.' + contexts = [] + elif all(operation[2] for operation in context_operations): + context_top_level = 'User context used in every operation.' + contexts = [] + else: + context_top_level = 'The following user contexts are used:' + contexts = [] + for operation in context_operations: + if operation[0] == 'entity': + _, context_kind, _, entity_id, broker = operation + contexts.append( + f"{context_kind} when creating the entity with id {entity_id} " + f"in broker {broker}." + ) + else: + _, context_kind, _ = operation + contexts.append( + f"{context_kind} when creating the registrations in all brokers." + ) return [ { 'type': 'context', - 'top-level': ( - 'Context used for creation in following brokers:' - if contexts else - 'No user context used.' - ), + 'top-level': context_top_level, 'nested-object': contexts }, { diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py index 97c3d24c..7c85e1e5 100644 --- a/doc/tests/test_iop_preconditions.py +++ b/doc/tests/test_iop_preconditions.py @@ -66,7 +66,7 @@ Prepare Preconditions ['since_v1.6.1', 'iop', '4_3_3'] ) - def test_generates_context_and_data_objects(self): + def test_generates_mixed_context_and_data_objects(self): result = self.generate( variables='''${first_payload} fixtures/first-entity.jsonld ${context_path} https://example.test/contexts/example-context.jsonld?version=1 @@ -95,12 +95,15 @@ ${b3_url} ${EMPTY}''', [ { 'type': 'context', - 'top-level': 'Context used for creation in following brokers:', + 'top-level': 'The following user contexts are used:', 'nested-object': [ - 'The example-context.jsonld user context is used when creating on b2.', ( - 'The ngsi-ld-test-suite-compound.jsonld user context ' - 'is used when creating on b3.' + 'User context when creating the entity with id ' + 'urn:ngsi-ld:Example:1 in broker b2.' + ), + ( + 'User context when creating the entity with id ' + 'urn:ngsi-ld:Example:2 in broker b3.' ) ] }, @@ -115,7 +118,7 @@ ${b3_url} ${EMPTY}''', ] ) - def test_uses_empty_context_object_when_context_is_omitted(self): + def test_uses_test_suite_context_when_context_is_omitted(self): result = self.generate( variables='${b2_url} ${EMPTY}', setup=( @@ -131,7 +134,7 @@ ${b3_url} ${EMPTY}''', [ { 'type': 'context', - 'top-level': 'No user context used.', + 'top-level': 'User context used in every operation.', 'nested-object': [] }, { @@ -145,6 +148,48 @@ ${b3_url} ${EMPTY}''', ] ) + def test_uses_no_user_context_when_all_operations_use_core_context(self): + result = self.generate( + variables='${b1_url} ${EMPTY}', + setup=''' Set Test Variable ${entity_id} urn:ngsi-ld:Example:1 + Create Entity entity.jsonld ${entity_id} broker_url=${b1_url} context=${core_context} + @{configuration}= Create List + Compose IOP Configuration ${configuration} ld_context=${core_context}''' + ) + + self.assertEqual( + result['pre_conditions'][0], + { + 'type': 'context', + 'top-level': 'No user context used.', + 'nested-object': [] + } + ) + + def test_generates_mixed_entity_and_registration_contexts(self): + result = self.generate( + variables='${b1_url} ${EMPTY}', + setup=''' Set Test Variable ${entity_id} urn:ngsi-ld:Example:1 + Create Entity entity.jsonld ${entity_id} broker_url=${b1_url} context=${core_context} + @{configuration}= Create List + Compose IOP Configuration ${configuration} ld_context=${ngsild_test_suite_context}''' + ) + + self.assertEqual( + result['pre_conditions'][0], + { + 'type': 'context', + 'top-level': 'The following user contexts are used:', + 'nested-object': [ + ( + 'Default context when creating the entity with id ' + 'urn:ngsi-ld:Example:1 in broker b1.' + ), + 'User context when creating the registrations in all brokers.' + ] + } + ) + def test_uses_empty_objects_without_create_entity(self): result = self.generate( variables='${b1_url} ${EMPTY}', -- GitLab From fd021ca6ca2ccf526eddc7af18138fd51f9c69ee Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 3 Aug 2026 14:56:13 +0200 Subject: [PATCH 28/34] fix: remove context field from data files --- .../context-source-registration-auxiliary-1.jsonld | 7 ++----- .../context-source-registration-auxiliary-2.jsonld | 7 ++----- .../context-source-registration-auxiliary-3.jsonld | 7 ++----- .../context-source-registration-exclusive-1.jsonld | 5 +---- .../context-source-registration-exclusive-2.jsonld | 5 +---- .../context-source-registration-exclusive-3.jsonld | 5 +---- .../context-source-registration-inclusive-1.jsonld | 5 +---- .../context-source-registration-inclusive-2.jsonld | 5 +---- .../context-source-registration-inclusive-3.jsonld | 5 +---- .../context-source-registration-redirect-1.jsonld | 5 +---- .../context-source-registration-redirect-2.jsonld | 5 +---- .../context-source-registration-redirect-3.jsonld | 5 +---- .../context-source-registration-redirect-4.jsonld | 5 +---- .../full-version-of-OffStreetParking1.jsonld | 7 ++----- .../full-version-of-OffStreetParking2.jsonld | 7 ++----- .../interoperability/full-version-of-Vehicle1.jsonld | 5 +---- .../interoperability/full-version-of-Vehicle2.jsonld | 5 +---- .../offStreetParking1-with-location-and-name-only.jsonld | 5 +---- .../offStreetParking1-without-location.jsonld | 5 +---- .../offStreetParking2-with-location-and-name-only.jsonld | 5 +---- ...etParking2-without-location-and-totalSpotsNumber.jsonld | 7 ++----- .../offStreetParking2-without-location.jsonld | 5 +---- resources/ApiUtils/ContextInformationProvision.resource | 3 ++- resources/ApiUtils/ContextSourceRegistration.resource | 3 ++- 24 files changed, 32 insertions(+), 96 deletions(-) diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld index d5dabec6..8168f03e 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-1.jsonld @@ -11,8 +11,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@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 + "endpoint": "xxx" +} diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld index 1d037309..fa8f84f5 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-2.jsonld @@ -15,8 +15,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@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 + "endpoint": "xxx" +} diff --git a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld index 2e719b7e..49e6c1cf 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-auxiliary-3.jsonld @@ -11,8 +11,5 @@ } ], "mode": "auxiliary", - "endpoint": "xxx", - "@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 + "endpoint": "xxx" +} diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld index d1ad0a8a..f5cd8843 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-1.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld index 9d8c38c6..a347014a 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-2.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld index 795c2e7c..61c65ea0 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-exclusive-3.jsonld @@ -16,8 +16,5 @@ ], "mode": "exclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld index bf2b6681..45c8361f 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-1.jsonld @@ -12,8 +12,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld index f7b0fe92..66403cd8 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-2.jsonld @@ -16,8 +16,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld index 37f3e73d..97b86725 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-inclusive-3.jsonld @@ -12,8 +12,5 @@ ], "mode": "inclusive", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld index ce6fe900..4c6246b3 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-1.jsonld @@ -12,8 +12,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld index 5153eaf4..256a09b3 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-2.jsonld @@ -15,8 +15,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld index 5598b967..4edd2920 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-3.jsonld @@ -16,8 +16,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld index 9869cc0f..b5c734bc 100644 --- a/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld +++ b/data/csourceRegistrations/interoperability/context-source-registration-redirect-4.jsonld @@ -16,8 +16,5 @@ ], "mode": "redirect", "operations": ["redirectionOps"], - "endpoint": "xxx", - "@context":[ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + "endpoint": "xxx" } diff --git a/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld index 998bf94c..c5fca607 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking1.jsonld @@ -27,8 +27,5 @@ 41.2 ] } - }, - "@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/interoperability/full-version-of-OffStreetParking2.jsonld b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld index d3efac75..aafa0d23 100644 --- a/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld +++ b/data/entities/interoperability/full-version-of-OffStreetParking2.jsonld @@ -27,8 +27,5 @@ 41.2 ] } - }, - "@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/interoperability/full-version-of-Vehicle1.jsonld b/data/entities/interoperability/full-version-of-Vehicle1.jsonld index ff8125d1..22501139 100644 --- a/data/entities/interoperability/full-version-of-Vehicle1.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle1.jsonld @@ -27,8 +27,5 @@ 41.2 ] } - }, - "@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/entities/interoperability/full-version-of-Vehicle2.jsonld b/data/entities/interoperability/full-version-of-Vehicle2.jsonld index 427399f6..8c54753d 100644 --- a/data/entities/interoperability/full-version-of-Vehicle2.jsonld +++ b/data/entities/interoperability/full-version-of-Vehicle2.jsonld @@ -27,8 +27,5 @@ 40.2 ] } - }, - "@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/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld index 824cfa90..6ea20cea 100644 --- a/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking1-with-location-and-name-only.jsonld @@ -15,8 +15,5 @@ ] }, "observedAt": "2021-04-04T11:45:00Z" - }, - "@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/entities/interoperability/offStreetParking1-without-location.jsonld b/data/entities/interoperability/offStreetParking1-without-location.jsonld index cbb13215..52fe89c9 100644 --- a/data/entities/interoperability/offStreetParking1-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking1-without-location.jsonld @@ -17,8 +17,5 @@ "totalSpotsNumber": { "type": "Property", "value": 200 - }, - "@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/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld index 4dd2ea5f..0aae0119 100644 --- a/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld +++ b/data/entities/interoperability/offStreetParking2-with-location-and-name-only.jsonld @@ -15,8 +15,5 @@ ] }, "observedAt": "2021-04-04T11:46:00Z" - }, - "@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/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld index dba4633c..bbbe137c 100644 --- a/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location-and-totalSpotsNumber.jsonld @@ -13,8 +13,5 @@ "type": "Property", "value": 0.56 } - }, - "@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/interoperability/offStreetParking2-without-location.jsonld b/data/entities/interoperability/offStreetParking2-without-location.jsonld index c6418d9c..90962489 100644 --- a/data/entities/interoperability/offStreetParking2-without-location.jsonld +++ b/data/entities/interoperability/offStreetParking2-without-location.jsonld @@ -17,8 +17,5 @@ "totalSpotsNumber": { "type": "Property", "value": 150 - }, - "@context": [ - "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" - ] + } } diff --git a/resources/ApiUtils/ContextInformationProvision.resource b/resources/ApiUtils/ContextInformationProvision.resource index 78582c24..3d3e7419 100755 --- a/resources/ApiUtils/ContextInformationProvision.resource +++ b/resources/ApiUtils/ContextInformationProvision.resource @@ -171,7 +171,8 @@ Create Entity IF '${local}'!='' Set To Dictionary ${params} local=${local} ${entity_payload}= Load JSON From File ${EXECDIR}/data/entities/${filename} ${entity}= Update Value To JSON ${entity_payload} $.id ${entity_id} - ${entity}= Update Value To JSON ${entity} $['@context'] ${context} + ${context_member}= Create Dictionary @context=${context} + ${entity}= Add Object To JSON ${entity} $ ${context_member} ${final_url}= Set Variable If '${broker_url}' != '' ${broker_url} ${url} &{headers}= Create Dictionary Content-Type=application/ld+json ${response}= POST diff --git a/resources/ApiUtils/ContextSourceRegistration.resource b/resources/ApiUtils/ContextSourceRegistration.resource index 6b41cb15..766a3e03 100755 --- a/resources/ApiUtils/ContextSourceRegistration.resource +++ b/resources/ApiUtils/ContextSourceRegistration.resource @@ -36,7 +36,8 @@ Prepare Context Source Registration From File ... ${context}=${EMPTY} ${payload}= Load JSON From File ${EXECDIR}/data/${registration_file} IF '${context}' != '${EMPTY}' - ${payload}= Update Value To JSON ${payload} $['@context'] ${context} + ${context_member}= Create Dictionary @context=${context} + ${payload}= Add Object To JSON ${payload} $ ${context_member} END ${final_context_source_url}= Set Variable If '${endpoint}' != '' ${endpoint} ${context_source_url} -- GitLab From 8280c6325e76a84641865414ceb291a95e8ac66a Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Mon, 3 Aug 2026 15:33:03 +0200 Subject: [PATCH 29/34] feat: add permutations for user and default context testing --- .../Entity/QueryEntities/IOP_003_01_01.robot | 42 ++++++++--- .../Entity/QueryEntities/IOP_003_01_02.robot | 42 ++++++++--- .../Entity/QueryEntities/IOP_003_02_01.robot | 48 ++++++++---- .../Entity/QueryEntities/IOP_003_02_02.robot | 50 +++++++++---- .../Entity/QueryEntities/IOP_003_03_01.robot | 44 ++++++++--- .../Entity/QueryEntities/IOP_003_03_02.robot | 48 ++++++++---- .../Entity/QueryEntities/IOP_003_04_01.robot | 46 +++++++++--- .../Entity/QueryEntities/IOP_003_04_02.robot | 46 +++++++++--- .../Entity/RetrieveEntity/IOP_002_01_01.robot | 50 ++++++++++--- .../Entity/RetrieveEntity/IOP_002_01_02.robot | 50 ++++++++++--- .../Entity/RetrieveEntity/IOP_002_02_01.robot | 56 +++++++++++--- .../Entity/RetrieveEntity/IOP_002_02_02.robot | 54 +++++++++++--- .../Entity/RetrieveEntity/IOP_002_03_01.robot | 64 ++++++++++++---- .../Entity/RetrieveEntity/IOP_002_03_02.robot | 56 +++++++++++--- .../Entity/RetrieveEntity/IOP_002_04_01.robot | 45 +++++++++--- .../Entity/RetrieveEntity/IOP_002_04_02.robot | 53 ++++++++++---- .../CreateEntity/IOP_001_01_01.robot | 52 ++++++++++--- .../CreateEntity/IOP_001_01_02.robot | 52 ++++++++++--- .../CreateEntity/IOP_001_02_01.robot | 54 +++++++++++--- .../CreateEntity/IOP_001_02_02.robot | 54 +++++++++++--- .../CreateEntity/IOP_001_03_01.robot | 54 +++++++++++--- .../CreateEntity/IOP_001_03_02.robot | 54 +++++++++++--- .../CreateEntity/IOP_001_04_01.robot | 47 +++++++++--- .../CreateEntity/IOP_001_04_02.robot | 47 +++++++++--- doc/README.md | 6 +- doc/analysis/generaterobotdata.py | 61 ++++++++++++---- doc/analysis/parserobotfile.py | 30 +++++++- doc/tests/test_iop_preconditions.py | 73 ++++++++++++++++++- 28 files changed, 1078 insertions(+), 300 deletions(-) diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot index 4353dbad..218a4426 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_01.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -20,7 +20,7 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET +IOP_003_01_01_01 Query Entities Of Type OffstreetParking Via GET With Default Context [Tags] ... since_v1.6.1 ... iop @@ -32,12 +32,33 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_01_01_02 Query Entities Of Type OffstreetParking Via GET With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve all Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned and that the following Entities were returned: # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber @@ -52,7 +73,7 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -63,7 +84,7 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -97,9 +118,8 @@ IOP_003_01_01 Query Entities Of Type OffstreetParking Via GET ... location=${second_entity_b3}[0][location] Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -107,21 +127,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -139,7 +159,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot index aa6f0a13..88c7195a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_01_02.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -20,7 +20,7 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST +IOP_003_01_02_01 Query Entities Of Type OffstreetParking Via POST With Default Context [Tags] ... since_v1.6.1 ... iop @@ -32,6 +32,27 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... 5_7_2 ... 6_23_2_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_01_02_02 Query Entities Of Type OffstreetParking Via POST With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_2 + ... 6_23_2_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to retrieve all Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @@ -39,7 +60,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b1}= Query Entities Via POST ... entities=${entities} ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned and that the following Entities were returned: # - OffstreetParking:1 with the attributes availableSpotsNumber and totalSpotsNumber @@ -54,7 +75,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b2}= Query Entities Via POST ... entities=${entities} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -65,7 +86,7 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ${response_b3}= Query Entities Via POST ... entities=${entities} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -99,9 +120,8 @@ IOP_003_01_02 Query Entities Of Type OffstreetParking Via POST ... location=${second_entity_b3}[0][location] Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -109,21 +129,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${third_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -141,7 +161,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot index f9073183..87085013 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -24,7 +24,7 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET +IOP_003_02_01_01 Query Entities Of Type OffstreetParking Via GET With Default Context [Tags] ... since_v1.6.1 ... iop @@ -36,12 +36,33 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_02_01_02 Query Entities Of Type OffstreetParking Via GET With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned and that OffstreetParking:1 and OffstreetParking:2 were returned with all properties but "name" Check Response Status Code 200 ${response_b1.status_code} @@ -54,7 +75,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -65,7 +86,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -76,7 +97,7 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -117,9 +138,8 @@ IOP_003_02_01 Query Entities Of Type OffstreetParking Via GET ... location=${second_entity_b4}[0][location] Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -127,31 +147,31 @@ Setup Initial Context Source Registrations ... ${first_entity_no_location_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_no_location_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -176,7 +196,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot index 517b4dba..286d270c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_02_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has five regis Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -27,7 +27,7 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs +IOP_003_02_02_01 Query Entities Of Type OffstreetParking And Vehicle With Attrs With Default Context [Tags] ... since_v1.6.1 ... iop @@ -39,13 +39,34 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_02_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the "location" Property from Entities having type OffstreetParking or Vehicle ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned and that all four Entities were returned with the "location" Property only Check Response Status Code 200 ${response_b1.status_code} @@ -65,7 +86,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_parking_entity_id} ${first_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -77,7 +98,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_parking_entity_id} ${second_parking_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -89,7 +110,7 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${second_parking_entity_id} ${second_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -121,9 +142,8 @@ IOP_003_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs Check Resource Set To ${first_vehicle_b2}[0] ${first_vehicle_b1}[0] Check Resource Set To ${second_vehicle_b4}[0] ${second_vehicle_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_parking_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_parking_entity_id} urn:ngsi-ld:OffStreetParking:2 Set Test Variable ${first_vehicle_entity_id} urn:ngsi-ld:Vehicle:1 @@ -133,37 +153,37 @@ Setup Initial Context Source Registrations ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_parking_location_name_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_offstreet_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -207,7 +227,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot index cbf6eed0..d239acbe 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET +IOP_003_03_01_01 Query Entities Of Type OffstreetParking Via GET With Default Context [Tags] ... since_v1.6.1 ... iop @@ -35,12 +35,33 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_03_01_02 Query Entities Of Type OffstreetParking Via GET With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned with ${first_full_offstreet_payload_filename} and ${offstreet_no_location_payload_filename} Check Response Status Code 200 ${response_b1.status_code} @@ -53,7 +74,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b2}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -63,7 +84,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b3}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -73,7 +94,7 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -101,9 +122,8 @@ IOP_003_03_01 Query Entities Of Type OffstreetParking Via GET Check Resource Set To ${expected_first_b1} ${first_entity_b1}[0] Check Resource Set To ${second_entity_b2}[0] ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -111,19 +131,19 @@ Setup Initial Context Source Registrations ... ${offstreet_no_location_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_offstreet_no_location_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -148,7 +168,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot index 63fae1b9..f22f911a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_03_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -23,7 +23,7 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs +IOP_003_03_02_01 Query Entities Of Type OffstreetParking And Vehicle With Attrs With Default Context [Tags] ... since_v1.6.1 ... iop @@ -35,13 +35,34 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_03_02_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the "location" Property from all Entities having type OffstreetParking or Vehicle ${response_b1}= Query Entities ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned with OffstreetParking:1, OffstreetParking:2 and Vehicle:1 Check Response Status Code 200 ${response_b1.status_code} @@ -59,7 +80,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b2.status_code} ${expected_b2_ids}= Create List ${first_vehicle_entity_id} Check Response Body Containing Entities URIS set to ${expected_b2_ids} ${response_b2.json()} @@ -70,7 +91,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b3.status_code} ${expected_b3_ids}= Create List ${first_parking_entity_id} Check Response Body Containing Entities URIS set to ${expected_b3_ids} ${response_b3.json()} @@ -81,7 +102,7 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs ... entity_types=OffStreetParking,Vehicle ... attrs=location ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ... ${first_parking_entity_id} @@ -123,9 +144,8 @@ IOP_003_03_02 Query Entities Of Type OffstreetParking And Vehicle With Attrs Remove From Dictionary ${first_vehicle_expected} @context Check Resource Set To ${first_vehicle_expected} ${first_vehicle_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_parking_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_parking_entity_id} urn:ngsi-ld:OffStreetParking:2 Set Test Variable ${first_vehicle_entity_id} urn:ngsi-ld:Vehicle:1 @@ -135,31 +155,31 @@ Setup Initial Context Source Registrations ... ${first_vehicle_payload_filename} ... ${first_vehicle_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${parking_location_name_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_offstreet_payload_filename} ... ${first_parking_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_offstreet_payload_filename} ... ${second_parking_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_vehicle_payload_filename} ... ${second_vehicle_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -184,7 +204,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot index 575ac35d..0f4c903e 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_01.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -27,7 +27,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET +IOP_003_04_01_01 Query Entities Of Type OffstreetParking Via GET With Default Context [Tags] ... since_v1.6.1 ... iop @@ -41,12 +41,35 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ... 5_7_2 ... 6_4_3_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_04_01_02 Query Entities Of Type OffstreetParking Via GET With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_4_3_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve Entities with type OffstreetParking ${response_b1}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" Check Response Status Code 200 ${response_b1.status_code} @@ -59,7 +82,7 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ${response_b4}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -70,7 +93,7 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ${response_b5}= Query Entities ... entity_types=OffStreetParking ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b5.status_code} ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} @@ -109,9 +132,8 @@ IOP_003_04_01 Query Entities Of Type OffstreetParking Via GET ... location=${second_entity_b5}[0][location] Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -119,25 +141,25 @@ Setup Initial Context Source Registrations ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -189,7 +211,7 @@ Setup Initial Context Source Registrations ... ${fourth_set} ... ${fifth_set} ... ${sixth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot index 63142fea..7c9a93b2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/QueryEntities/IOP_003_04_02.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -27,7 +27,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST +IOP_003_04_02_01 Query Entities Of Type OffstreetParking Via POST With Default Context [Tags] ... since_v1.6.1 ... iop @@ -41,6 +41,29 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ... 5_7_2 ... 6_23_2_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_003_04_02_02 Query Entities Of Type OffstreetParking Via POST With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_2 + ... 6_23_2_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to retrieve Entities with type OffstreetParking &{entity_selector}= Create Dictionary type=OffStreetParking @@ -48,7 +71,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b1}= Query Entities Via POST ... entities=${entities} ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} # Agent checks that a success response has been returned with OffstreetParking:1 containing "location" and OffstreetParking:2 containing "availableSpotsNumber", "totalSpotsNumber" and "location" Check Response Status Code 200 ${response_b1.status_code} @@ -61,7 +84,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b4}= Query Entities Via POST ... entities=${entities} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b4.status_code} ${expected_b4_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b4_ids} ${response_b4.json()} @@ -72,7 +95,7 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ${response_b5}= Query Entities Via POST ... entities=${entities} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response_b5.status_code} ${expected_b5_ids}= Create List ${first_entity_id} ${second_entity_id} Check Response Body Containing Entities URIS set to ${expected_b5_ids} ${response_b5.json()} @@ -111,9 +134,8 @@ IOP_003_04_02 Query Entities Of Type OffstreetParking Via POST ... location=${second_entity_b5}[0][location] Check Resource Set To ${expected_second_b1} ${second_entity_b1}[0] - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -121,25 +143,25 @@ Setup Initial Context Source Registrations ... ${first_parking_location_name_payload_filename} ... ${first_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_parking_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_parking_payload_filename} ... ${first_entity_id} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_parking_location_name_payload_filename} ... ${second_entity_id} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -191,7 +213,7 @@ Setup Initial Context Source Registrations ... ${fourth_set} ... ${fifth_set} ... ${sixth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot index 65396c29..a682c427 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_01.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -19,13 +19,42 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_002_01_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 default-context +IOP_002_01_01_01 Retrieve OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_01_01_02 Retrieve OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -35,7 +64,7 @@ IOP_002_01_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b2 to retrieve the OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -53,9 +82,8 @@ IOP_002_01_01 Retrieve OffStreetParking:1 ... totalSpotsNumber=${response_b2.json()}[totalSpotsNumber] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 @@ -63,21 +91,21 @@ Setup Initial Context Source Registrations ... ${first_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -95,7 +123,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot index 996393df..8c4eff25 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_01_02.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -19,13 +19,42 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_002_01_02 Retrieve OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_7_1 default-context +IOP_002_01_02_01 Retrieve OffStreetParking:2 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_01_02_02 Retrieve OffStreetParking:2 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:2 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -35,7 +64,7 @@ IOP_002_01_02 Retrieve OffStreetParking:2 # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:2 ${response_b2}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -46,7 +75,7 @@ IOP_002_01_02 Retrieve OffStreetParking:2 # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:2 ${response_b3}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -66,23 +95,22 @@ IOP_002_01_02 Retrieve OffStreetParking:2 ... location=${response_b3.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${entity_payload_filename} ... ${entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${full_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -100,7 +128,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot index c0790e3b..49d4840d 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -21,13 +21,42 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_002_02_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 default-context +IOP_002_02_01_01 Retrieve OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_02_01_02 Retrieve OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -37,7 +66,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b2 to retrieve the Entity OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -48,7 +77,7 @@ IOP_002_02_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b3 to retrieve the Entity OffStreetParking:1 ${response_b3}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -68,24 +97,27 @@ IOP_002_02_01 Retrieve OffStreetParking:1 ... location=${response_b3.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b2_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${b2_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -110,7 +142,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot index 48d8b69b..26b1ee35 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_02_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -21,14 +21,43 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_7_1 default-context +IOP_002_02_02_01 Retrieve OffStreetParking:1 Location Attribute With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_02_02_02 Retrieve OffStreetParking:1 Location Attribute With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the "location" Property from the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} ... attrs=location - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -39,7 +68,7 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -53,24 +82,27 @@ IOP_002_02_02 Retrieve OffStreetParking:1 Location Attribute Set To Dictionary ${expected_b1} location=${response_b3.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${b3_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -95,7 +127,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot index 7f0029d9..dedf6c4a 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -22,13 +22,42 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_002_03_01 Retrieve OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 default-context +IOP_002_03_01_01 Retrieve OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_03_01_02 Retrieve OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${first_entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -39,7 +68,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b1_local}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b1_local.status_code} @@ -51,7 +80,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b2}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -63,7 +92,7 @@ IOP_002_03_01 Retrieve OffStreetParking:1 ${response_b3}= Retrieve Entity ... ${first_entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -74,26 +103,33 @@ IOP_002_03_01 Retrieve OffStreetParking:1 # Agent checks that the Entity returned in step (2) matches the one returned in step (3) and that it does not contain the "location" Property returned in step (4) Check Resource Set To ${response_b1_local.json()} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${first_entity_id} urn:ngsi-ld:OffStreetParking:1 Set Test Variable ${second_entity_id} urn:ngsi-ld:OffStreetParking:2 - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${b1_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${first_full_entity_payload_filename} ... ${first_entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${entity_payload_filename} ${first_entity_id} broker_url=${b3_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${first_entity_id} + ... broker_url=${b3_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${second_full_entity_payload_filename} ... ${second_entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -118,7 +154,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot index 1dc50346..7098cb83 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_03_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -22,14 +22,43 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_7_1 default-context +IOP_002_03_02_01 Retrieve OffStreetParking:1 Location Attribute With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_03_02_02 Retrieve OffStreetParking:1 Location Attribute With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} ... attrs=location - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -40,7 +69,7 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -54,29 +83,32 @@ IOP_002_03_02 Retrieve OffStreetParking:1 Location Attribute Set To Dictionary ${expected_b1} location=${response_b3.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b2_url} context=${core_context} + ${response}= Create Entity + ... ${full_entity_payload_filename} + ... ${entity_id} + ... broker_url=${b2_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -101,7 +133,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot index 8971b23d..fa0d5b52 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_01.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -24,7 +24,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_002_04_01 Retrieve OffStreetParking:1 +IOP_002_04_01_01 Retrieve OffStreetParking:1 With Default Context [Tags] ... since_v1.6.1 ... iop @@ -37,11 +37,33 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... 4_3_6 ... 5_7_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_04_01_02 Retrieve OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-redirect + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -51,7 +73,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b4 to retrieve the Entity OffStreetParking:1 ${response_b4}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b4_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b4.status_code} @@ -62,7 +84,7 @@ IOP_002_04_01 Retrieve OffStreetParking:1 # Client sends an HTTP GET request to b5 to retrieve the Entity OffStreetParking:1 ${response_b5}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b5_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b5.status_code} @@ -82,17 +104,20 @@ IOP_002_04_01 Retrieve OffStreetParking:1 ... location=${response_b5.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b5_url} context=${core_context} + ${response}= Create Entity + ... ${full_entity_payload_filename} + ... ${entity_id} + ... broker_url=${b5_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -136,7 +161,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot index c175bb9c..6259f001 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Consumption/Entity/RetrieveEntity/IOP_002_04_02.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -25,7 +25,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute +IOP_002_04_02_01 Retrieve OffStreetParking:1 Location Attribute With Default Context [Tags] ... since_v1.6.1 ... iop @@ -38,11 +38,33 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... 4_3_6 ... 5_7_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_002_04_02_02 Retrieve OffStreetParking:1 Location Attribute With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-redirect + ... proxy-exclusive + ... 4_3_6 + ... 5_7_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP GET request to b1 to retrieve the Entity OffStreetParking:1 ${response_b1}= Retrieve Entity ... ${entity_id} - ... context=${core_context} + ... context=${context} ... broker_url=${b1_url} ... type=OffStreetParking @@ -53,7 +75,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b2}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b2_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b2.status_code} @@ -65,7 +87,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b3}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b3_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b3.status_code} @@ -77,7 +99,7 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ${response_b5}= Retrieve Entity ... ${entity_id} ... local=true - ... context=${core_context} + ... context=${context} ... broker_url=${b5_url} ... type=OffStreetParking Check Response Status Code 200 ${response_b5.status_code} @@ -99,35 +121,38 @@ IOP_002_04_02 Retrieve OffStreetParking:1 Location Attribute ... location=${response_b5.json()}[location] Check Resource Set To ${expected_b1} ${response_b1.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${no_location_entity_payload_filename} ... ${entity_id} ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} - ${response}= Create Entity ${full_entity_payload_filename} ${entity_id} broker_url=${b4_url} context=${core_context} + ${response}= Create Entity + ... ${full_entity_payload_filename} + ... ${entity_id} + ... broker_url=${b4_url} + ... context=${context} Check Response Status Code 201 ${response.status_code} ${response}= Create Entity ... ${location_name_entity_payload_filename} ... ${entity_id} ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 201 ${response.status_code} @{first_set}= Create List @@ -171,7 +196,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot index 1cd0eb86..e55f89cd 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_01.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Create OffStreetParking Entity *** Variables *** @@ -18,11 +18,44 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_001_01_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 default-context +IOP_001_01_01_01 Create OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_01_01_02 Create OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Create OffStreetParking Entity + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -35,7 +68,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -44,7 +77,7 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -55,12 +88,11 @@ IOP_001_01_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List @@ -78,7 +110,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot index e55f51d3..3830725f 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_01_02.robot @@ -4,8 +4,8 @@ Documentation Three brokers are set up b1, b2 and b3. b1 has two registrat Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -18,11 +18,44 @@ ${b3_url} ${EMPTY} *** Test Cases *** -IOP_001_01_02 Create OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_01 4_3_3 additive-inclusive proxy-exclusive 4_3_6 5_6_1 default-context +IOP_001_01_02_01 Create OffStreetParking:2 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_01_02_02 Create OffStreetParking:2 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_01 + ... 4_3_3 + ... additive-inclusive + ... proxy-exclusive + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -32,7 +65,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b1_url} ... local=true - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b1_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_b1_payload} @context location @@ -43,7 +76,7 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b2_url} ... local=true - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -54,15 +87,14 @@ IOP_001_01_02 Create OffStreetParking:2 ... ${entity_id} ... broker_url=${b3_url} ... local=true - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b3_payload} id type location Check Resource Set To ${expected_b3_payload} ${response.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List @@ -80,7 +112,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{first_configuration}= Create List ${first_set} ${second_set} - Compose IOP Configuration ${first_configuration} ld_context=${core_context} + Compose IOP Configuration ${first_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot index 7c378f1f..8f8550c2 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -19,11 +19,44 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_001_02_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 default-context +IOP_001_02_01_01 Create OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_02_01_02 Create OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -36,7 +69,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} @@ -45,7 +78,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -56,7 +89,7 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location @@ -67,13 +100,12 @@ IOP_001_02_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List @@ -98,7 +130,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot index 3d8ab5dc..4230d4f9 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_02_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -20,11 +20,44 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_001_02_02 Create OffStreetParking:2 - [Tags] since_v1.6.1 iop cnf_02 4_3_3 additive-inclusive proxy-redirect 4_3_6 5_6_1 default-context +IOP_001_02_02_01 Create OffStreetParking:2 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_02_02_02 Create OffStreetParking:2 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_02 + ... 4_3_3 + ... additive-inclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +70,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} @@ -46,7 +79,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b2_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b2_payload} id type availableSpotsNumber totalSpotsNumber @@ -57,7 +90,7 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_location_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_location_payload} id type location @@ -68,13 +101,12 @@ IOP_001_02_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_location_payload} ${response.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List @@ -99,7 +131,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{second_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${second_configuration} ld_context=${core_context} + Compose IOP Configuration ${second_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot index e9804142..c06f607c 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_01.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -20,11 +20,44 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_001_03_01 Create OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 default-context +IOP_001_03_01_01 Create OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_03_01_02 Create OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +70,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -46,7 +79,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 @@ -54,7 +87,7 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -63,15 +96,14 @@ IOP_001_03_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_spots_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_spots_payload} id type availableSpotsNumber totalSpotsNumber Check Resource Set To ${expected_spots_payload} ${response.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List @@ -96,7 +128,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot index 624dfd41..54780cda 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_03_02.robot @@ -4,8 +4,8 @@ Documentation Four brokers are set up b1, b2, b3 and b4. b1 has three regi Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -20,11 +20,44 @@ ${b4_url} ${EMPTY} *** Test Cases *** -IOP_001_03_02 Create Partial OffStreetParking:1 - [Tags] since_v1.6.1 iop cnf_03 4_3_3 additive-inclusive additive-auxiliary 4_3_6 5_6_1 default-context +IOP_001_03_02_01 Create Partial OffStreetParking:1 With Default Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_6_1 + ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_03_02_02 Create Partial OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_03 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -37,7 +70,7 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b2 @@ -45,14 +78,14 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b4 @@ -60,12 +93,11 @@ IOP_001_03_02 Create Partial OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List @@ -90,7 +122,7 @@ Setup Initial Context Source Registrations ... ${b1_url} @{third_configuration}= Create List ${first_set} ${second_set} ${third_set} - Compose IOP Configuration ${third_configuration} ld_context=${core_context} + Compose IOP Configuration ${third_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List ${b1_url} ${b2_url} ${b3_url} ${b4_url} diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot index a0e64adf..fca9e110 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_01.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -23,7 +23,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_001_04_01 Create OffStreetParking:1 +IOP_001_04_01_01 Create OffStreetParking:1 With Default Context [Tags] ... since_v1.6.1 ... iop @@ -36,9 +36,35 @@ IOP_001_04_01 Create OffStreetParking:1 ... 4_3_6 ... 5_6_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_04_01_02 Create OffStreetParking:1 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -51,7 +77,7 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b2 @@ -59,14 +85,14 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_payload} ${response.json()} # Agent checks (with local=true) that the Entity was NOT created in b4 @@ -74,19 +100,18 @@ IOP_001_04_01 Create OffStreetParking:1 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was NOT created in b5 ${response}= Retrieve Entity ... ${entity_id} ... local=true ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:1 @{first_set}= Create List @@ -130,7 +155,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot index 33c3b695..81b43169 100644 --- a/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot +++ b/IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity/IOP_001_04_02.robot @@ -4,8 +4,8 @@ Documentation Five brokers are set up b1, b2, b3, b4 and b5. b1 has two re Resource ${EXECDIR}/resources/IOPUtils/InteroperabilityUtils.resource -Test Setup Setup Initial Context Source Registrations Test Teardown Delete Entities and Delete Registrations +Test Template Run Interoperability Scenario *** Variables *** @@ -23,7 +23,7 @@ ${b5_url} ${EMPTY} *** Test Cases *** -IOP_001_04_02 Create OffStreetParking:2 +IOP_001_04_02_01 Create OffStreetParking:2 With Default Context [Tags] ... since_v1.6.1 ... iop @@ -36,9 +36,35 @@ IOP_001_04_02 Create OffStreetParking:2 ... 4_3_6 ... 5_6_1 ... default-context + [Setup] Setup Initial Context Source Registrations ${core_context} + ${core_context} +IOP_001_04_02_02 Create OffStreetParking:2 With User Context + [Tags] + ... since_v1.6.1 + ... iop + ... cnf_04 + ... 4_3_3 + ... additive-inclusive + ... additive-auxiliary + ... proxy-exclusive + ... proxy-redirect + ... 4_3_6 + ... 5_6_1 + ... user-context + [Setup] Setup Initial Context Source Registrations ${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Interoperability Scenario + [Arguments] ${context} # Client sends an HTTP POST request to b1 to create the entity ${entity_payload_filename} - ${response}= Create Entity ${entity_payload_filename} ${entity_id} broker_url=${b1_url} context=${core_context} + ${response}= Create Entity + ... ${entity_payload_filename} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} # Agent checks that a success response has been returned Check Response Status Code 201 ${response.status_code} @@ -51,7 +77,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b1_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} Check Resource Set To ${expected_full_payload} ${response.json()} @@ -60,7 +86,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b2_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b3 @@ -68,7 +94,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b3_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b3_payload}= Load Entity ${entity_payload_filename} ${entity_id} Remove From Dictionary ${expected_b3_payload} @context totalSpotsNumber @@ -79,7 +105,7 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b4_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 404 ${response.status_code} # Agent checks (with local=true) that the Entity was created in b5 and that the Entity only contains the "totalSpotsNumber" Property @@ -87,15 +113,14 @@ IOP_001_04_02 Create OffStreetParking:2 ... ${entity_id} ... local=true ... broker_url=${b5_url} - ... context=${core_context} + ... context=${context} Check Response Status Code 200 ${response.status_code} ${expected_b5_payload}= Load Entity ${entity_payload_filename} ${entity_id} Keep In Dictionary ${expected_b5_payload} id type totalSpotsNumber Check Resource Set To ${expected_b5_payload} ${response.json()} - -*** Keywords *** Setup Initial Context Source Registrations + [Arguments] ${context} Set Test Variable ${entity_id} urn:ngsi-ld:OffStreetParking:2 @{first_set}= Create List @@ -139,7 +164,7 @@ Setup Initial Context Source Registrations ... ${third_set} ... ${fourth_set} ... ${fifth_set} - Compose IOP Configuration ${fourth_configuration} ld_context=${core_context} + Compose IOP Configuration ${fourth_configuration} ld_context=${context} Delete Entities And Delete Registrations @{broker_count}= Create List diff --git a/doc/README.md b/doc/README.md index b07e10da..95a07faa 100644 --- a/doc/README.md +++ b/doc/README.md @@ -55,11 +55,11 @@ When writing interoperability tests, store each payload as a valid UTF-8 JSON ob State the test objective with the suite-level `Documentation` setting in the `*** Settings ***` section. Use `...` continuation lines when the objective spans multiple lines. For interoperability tests, a test-level `[Documentation]` setting is not used to populate `test_objective`. -The documentation generator infers preconditions from the keyword selected by `Test Setup`. Place the relevant `Create Entity` and `Create List` calls directly in that setup keyword; calls made only in the test body or indirectly through another user keyword are not considered. A `Create Entity` call must provide the payload filename and a broker variable resolving to `${bN_url}` through the `broker_url` argument. It generates text stating that broker `bN` contains that payload. The presence of the optional `context` argument generates the user-context text; omit the argument when no user context is used. A registration is inferred only from a `Create List` call having exactly five arguments in the following order: entity information, registration payload, registration mode, target broker URL, and registering broker URL. Its mode must be one of `inclusive`, `auxiliary`, `exclusive`, or `redirect`, and its broker variables must use the `${bN_url}` form. +The documentation generator infers preconditions from the keyword selected by `Test Setup`, including test-specific setup overrides and their positional or named arguments. Place the relevant `Create Entity` and `Create List` calls directly in that setup keyword; calls made only in the test body or indirectly through another user keyword are not considered. A `Create Entity` call must provide the payload filename and a broker variable resolving to `${bN_url}` through the `broker_url` argument. It generates text stating that broker `bN` contains that payload. `${core_context}` is classified as the default context, while `${ngsild_test_suite_context}` and other context values are classified as user contexts. A registration is inferred only from a `Create List` call having exactly five arguments in the following order: entity information, registration payload, registration mode, target broker URL, and registering broker URL. Its mode must be one of `inclusive`, `auxiliary`, `exclusive`, or `redirect`, and its broker variables must use the `${bN_url}` form. Every generated IOP permutation contains its own `initial_conditions`; suite-level `initial_conditions` is emitted only for files containing one test case. -Add `[Tags]` to every test case. Use an `iop` tag for interoperability tests, one `cnf_NN` tag identifying the applicable configuration, numeric clause tags written with underscores such as `4_3_3`, and a `since_vX.Y.Z` tag identifying the first supported release. The numeric tags are converted to specification clause numbers, and all test cases in one file must use the same release tag. Add registration-behaviour tags such as `additive-inclusive`, `additive-auxiliary`, `proxy-exclusive`, or `proxy-redirect` when applicable. Tags may continue on lines beginning with `...`; the continuation marker is discarded. +Add `[Tags]` to every test case. Use an `iop` tag for interoperability tests, one `cnf_NN` tag identifying the applicable configuration, numeric clause tags written with underscores such as `4_3_3`, and a `since_vX.Y.Z` tag identifying the first supported release. The numeric tags are converted to specification clause numbers, and all test cases in one file must use the same release tag. Add `default-context` or `user-context` to context permutations and registration-behaviour tags such as `additive-inclusive`, `additive-auxiliary`, `proxy-exclusive`, or `proxy-redirect` when applicable. Tags may continue on lines beginning with `...`; the continuation marker is discarded. -Write every documentation step as a standalone line comment inside the test case, immediately before the Robot Framework statement it describes. A comment such as `# Client sends an HTTP GET request to b1` becomes one generated test step. To add details beneath a step, place consecutive comments beginning with `# -` after a normal parent comment. Do not use a `# -` item without a preceding parent comment, and do not rely on comments in setup keywords, keyword implementations, or trailing comments because only full-line comments from the test-case body populate `test_steps`. +Write every documentation step as a standalone line comment immediately before the Robot Framework statement it describes. A comment such as `# Client sends an HTTP GET request to b1` becomes one generated test step. For IOP test templates, place shared steps in the template keyword; the generator uses them when a permutation has no inline comments. Inline test-case comments override template comments. To add details beneath a step, place consecutive comments beginning with `# -` after a normal parent comment. Do not use a `# -` item without a preceding parent step, and do not rely on setup or trailing comments. When a documentation step refers to a payload that is created, returned, or compared, include the Robot Framework variable containing its path instead of writing the payload description or figure number manually. The variable must be declared in the `*** Variables ***` section and resolve to the relevant payload file. For example: diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 9ada8ba3..6ab1cf72 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -553,6 +553,9 @@ class GenerateRobotData: tags = [x.tags for x in self.suite.tests] tags = [element for sublist in tags for element in sublist if element[0].isdigit()] + if self.file_type == "IOP": + return self.generate_reference_testcases(tags=tags, version=version) + if len(tags) == 0: # We have different tests cases that call a test template, maybe the Tags are defined in the template reference, clauses = self.generate_reference_template(version=version) @@ -648,13 +651,6 @@ class GenerateRobotData: version = 'v1.3.1' tp_id = self.generate_name_iop() reference, clauses = self.generate_reference(version=version) - initial_conditions = {} - if self.robot.test_case_names: - test_name = self.robot.test_case_names[0] - initial_conditions = { - 'pre_conditions': self.generate_iop_preconditions(test_name=test_name), - 'registrations_established': self.generate_iop_registrations(test_name=test_name) - } self.test_suite = { 'tp_id': tp_id, @@ -665,11 +661,15 @@ class GenerateRobotData: 'clauses': clauses, 'pics_selection': str(), 'keywords': [x.to_dict()['name'] for x in list(self.suite.resource.keywords)], - 'initial_conditions': initial_conditions, 'teardown': str(self.suite.teardown), 'test_cases': list() } + if len(self.robot.test_case_names) == 1: + self.test_suite['initial_conditions'] = self.generate_iop_initial_conditions( + test_name=self.robot.test_case_names[0] + ) + def _get_iop_setup(self, test_name: str): test = next((item for item in self.suite.tests if item.name == test_name), None) if test is None: @@ -680,7 +680,35 @@ class GenerateRobotData: if setup is None: raise ValueError(f"IOP setup keyword '{setup_name}' was not found") - return setup + return test, setup + + @staticmethod + def _iop_setup_variables(test, setup) -> dict: + argument_names = set(setup.args.argument_names) + positional = [] + named = [] + + for argument in (str(item) for item in test.setup.args): + name, separator, value = argument.partition('=') + if separator and name in argument_names: + named.append((name, value)) + else: + positional.append(argument) + + mapped_positional, mapped_named = setup.args.map(positional, named) + variables = { + f'${{{name}}}': str(value) + for name, value in zip(setup.args.positional, mapped_positional) + } + variables.update( + (f'${{{name}}}', str(value)) + for name, value in mapped_named + ) + + for name, value in setup.args.defaults.items(): + variables.setdefault(f'${{{name}}}', str(value)) + + return variables def _resolve_iop_value( self, @@ -794,10 +822,10 @@ class GenerateRobotData: ) def generate_iop_preconditions(self, test_name: str) -> list: - setup = self._get_iop_setup(test_name=test_name) + test, setup = self._get_iop_setup(test_name=test_name) data = [] context_operations = [] - setup_variables = {} + setup_variables = self._iop_setup_variables(test=test, setup=setup) for keyword in setup.body: if keyword.name == 'Set Test Variable' and len(keyword.args) >= 2: @@ -895,7 +923,7 @@ class GenerateRobotData: def generate_iop_registrations(self, test_name: str) -> list: """Generate the registration description from the test setup.""" - setup = self._get_iop_setup(test_name=test_name) + _, setup = self._get_iop_setup(test_name=test_name) modes = {'inclusive', 'exclusive', 'redirect', 'auxiliary'} registrations = [] @@ -932,6 +960,12 @@ class GenerateRobotData: registrations.sort(key=lambda item: (item[0], item[1])) return list(dict.fromkeys(item[2] for item in registrations)) + def generate_iop_initial_conditions(self, test_name: str) -> dict: + return { + 'pre_conditions': self.generate_iop_preconditions(test_name=test_name), + 'registrations_established': self.generate_iop_registrations(test_name=test_name) + } + def visit_test_iop(self, test_name: str, suite_setup: str = "", suite_teardown: str = ""): """Process a single IOP test case""" # Get test information from the parsed robot file @@ -942,7 +976,8 @@ class GenerateRobotData: 'name': test_name, 'permutation_iop_id': self.base_TP_id, 'tags': tags, - 'test_steps': comments + 'test_steps': comments, + 'initial_conditions': self.generate_iop_initial_conditions(test_name=test_name) } self.test_cases.append(test_case) diff --git a/doc/analysis/parserobotfile.py b/doc/analysis/parserobotfile.py index 658c9517..a040b338 100644 --- a/doc/analysis/parserobotfile.py +++ b/doc/analysis/parserobotfile.py @@ -672,13 +672,41 @@ class ParseRobotFile: tags_text = match.group('tags') return [tag for tag in tags_text.split() if tag != '...'] + def get_iop_keyword_content(self, keyword_name: str) -> str: + """Extract one keyword from the IOP Keywords section.""" + index_start = self.file_contents.find('*** Keywords ***') + if index_start == -1: + return "" + + keywords = self.file_contents[index_start + len('*** Keywords ***'):] + next_section = re.search(r'^\*{3} .+ \*{3}\s*$', keywords, re.MULTILINE) + if next_section: + keywords = keywords[:next_section.start()] + + matches = list(re.finditer(r'^(?!\s|#)(?P.+?)\s*$', keywords, re.MULTILINE)) + normalized_name = re.sub(r'[ _]+', '', keyword_name).lower() + + for index, match in enumerate(matches): + candidate = re.sub(r'[ _]+', '', match.group('name')).lower() + if candidate != normalized_name: + continue + + end = matches[index + 1].start() if index + 1 < len(matches) else len(keywords) + return keywords[match.start():end] + + return "" + def get_iop_comments(self, test_name: str) -> list: - """Extract comments from a specific IOP test case.""" + """Extract comments from an IOP test or its suite-level template.""" if test_name not in self.test_cases: return [] test_content = self.test_cases[test_name] raw_comments = re.findall(r'^\s*#(.+?)$', test_content, re.MULTILINE) + if not raw_comments and self.test_template_name: + template_content = self.get_iop_keyword_content(self.test_template_name) + raw_comments = re.findall(r'^\s*#(.+?)$', template_content, re.MULTILINE) + comments = [] nested_comments = None diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py index 7c85e1e5..b0798716 100644 --- a/doc/tests/test_iop_preconditions.py +++ b/doc/tests/test_iop_preconditions.py @@ -35,6 +35,10 @@ IOP_999_01 Generated Preconditions Prepare Preconditions {setup} ''' + self.generate_from_robot(robot) + return self.generated_info['initial_conditions'] + + def generate_from_robot(self, robot: str): temporary_directory = tempfile.TemporaryDirectory() self.addCleanup(temporary_directory.cleanup) path = ( @@ -53,7 +57,7 @@ Prepare Preconditions generator = GenerateRobotData(robot_file=str(path), execdir=str(ROOT)) generator.parse_robot() self.generated_info = generator.get_info() - return self.generated_info['initial_conditions'] + return self.generated_info def test_removes_tag_continuation_markers(self): self.generate( @@ -166,6 +170,73 @@ ${b3_url} ${EMPTY}''', } ) + def test_generates_conditions_for_parameterized_setup_permutations(self): + self.generate_from_robot('''*** Settings *** +Documentation Objective +Test Template Run Scenario + + +*** Variables *** +${b1_url} ${EMPTY} + + +*** Test Cases *** +IOP_999_01_01 Default Context + [Tags] since_v1.6.1 iop 4_3_3 default-context + [Setup] Prepare Preconditions ${core_context} + ${core_context} + +IOP_999_01_02 User Context + [Tags] since_v1.6.1 iop 4_3_3 user-context + [Setup] Prepare Preconditions context=${ngsild_test_suite_context} + ${ngsild_test_suite_context} + + +*** Keywords *** +Run Scenario + [Documentation] Run context permutation + [Arguments] ${context} + # Shared template action + # - Shared template detail + No Operation + +Prepare Preconditions + [Arguments] ${context} + @{configuration}= Create List + Compose IOP Configuration ${configuration} ld_context=${context} +''') + + default_conditions = self.generated_info['test_cases'][0]['initial_conditions'] + user_conditions = self.generated_info['test_cases'][1]['initial_conditions'] + + self.assertNotIn('initial_conditions', self.generated_info) + self.assertEqual( + default_conditions['pre_conditions'][0], + { + 'type': 'context', + 'top-level': 'No user context used.', + 'nested-object': [] + } + ) + self.assertEqual( + user_conditions['pre_conditions'][0], + { + 'type': 'context', + 'top-level': 'User context used in every operation.', + 'nested-object': [] + } + ) + self.assertIn('default-context', self.generated_info['test_cases'][0]['tags']) + self.assertIn('user-context', self.generated_info['test_cases'][1]['tags']) + self.assertEqual( + self.generated_info['test_cases'][0]['test_steps'], + ['Shared template action', ['Shared template detail']] + ) + self.assertEqual( + self.generated_info['test_cases'][1]['test_steps'], + self.generated_info['test_cases'][0]['test_steps'] + ) + def test_generates_mixed_entity_and_registration_contexts(self): result = self.generate( variables='${b1_url} ${EMPTY}', -- GitLab From 1e36e53faa1bd2bc8ea48eb6d2f1395f86c77b44 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 4 Aug 2026 14:57:40 +0200 Subject: [PATCH 30/34] feat: add viewer logic --- .gitignore | 3 +- tools/interoperability_visualizer/README.md | 69 + .../expected_outputs.py | 554 +++++ .../interoperability_visualizer/extractor.py | 401 ++++ tools/interoperability_visualizer/generate.py | 85 + .../tests/test_visualizer.py | 425 ++++ .../viewer_template.html | 1895 +++++++++++++++++ 7 files changed, 3431 insertions(+), 1 deletion(-) create mode 100644 tools/interoperability_visualizer/README.md create mode 100644 tools/interoperability_visualizer/expected_outputs.py create mode 100644 tools/interoperability_visualizer/extractor.py create mode 100644 tools/interoperability_visualizer/generate.py create mode 100644 tools/interoperability_visualizer/tests/test_visualizer.py create mode 100644 tools/interoperability_visualizer/viewer_template.html diff --git a/.gitignore b/.gitignore index 2cbb645a..080d4b7f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ results *.http .vscode/ .venv -.DS_Store \ No newline at end of file +.DS_Store +/tools/interoperability_visualizer/output/ diff --git a/tools/interoperability_visualizer/README.md b/tools/interoperability_visualizer/README.md new file mode 100644 index 00000000..70299df8 --- /dev/null +++ b/tools/interoperability_visualizer/README.md @@ -0,0 +1,69 @@ +# Interoperability Architecture Visualizer + +Generates an offline interactive architecture view of the Robot Framework tests in +`IOP_TP/NGSI-LD/Interoperability`. + +## Run + +With the project environment active: + +```console +python tools/interoperability_visualizer/generate.py +``` + +Using the local `ttf3` Conda environment: + +```console +conda run -n ttf3 python tools/interoperability_visualizer/generate.py +``` + +The generated page is written to: + +```text +tools/interoperability_visualizer/output/interoperability-architecture.html +``` + +Select a different Robot file or directory with `--source`: + +```console +python tools/interoperability_visualizer/generate.py \ + --source IOP_TP/NGSI-LD/Interoperability/Provision/CreateEntity +``` + +Select another filename inside the dedicated output directory with `--output-name`: + +```console +python tools/interoperability_visualizer/generate.py --output-name provision.html +``` + +Output paths and non-HTML output names are rejected. The complete `output/` directory is ignored by Git. + +## Viewer + +- Select any concrete interoperability test permutation. +- Switch between the full-size **Preview** graph and **Expected output** workspace. +- Hover over a broker to inspect every entity created in that broker during setup. +- Hover over a registration arc to inspect its effective creation payload. +- Browse assertion-derived expected responses by broker or in execution order. +- Timeline view treats each consecutive inline comment block as one numbered Robot step and nests every correlated + Robot keyword operation and expected HTTP response below it. +- Every numbered comment step has its own assertion panel, including `Client sends` and `Agent checks` steps. +- Expand a response step to see its prominent HTTP status, request, assertions, and expected JSON inline. +- Click a broker or registration to pin it; press Escape or use the close button to unpin it. +- Drag brokers to rearrange the architecture. +- Drag empty graph space to pan, use the mouse wheel to zoom, and use **Reset view** to restore the viewport. + +Registration arrows start at the broker where the registration is created and point to the broker referenced by its +endpoint. Effective payloads resolve entity IDs and contexts while keeping runtime broker URLs and generated +registration IDs symbolic. + +Expected responses are derived statically from the Robot request and assertion calls. HTTP 201 and 404 steps remain +status-only, and unsupported future assertion patterns are displayed as unresolved instead of inventing a body. + +## Test + +```console +conda run -n ttf3 python -m unittest discover \ + -s tools/interoperability_visualizer/tests \ + -p 'test_*.py' +``` diff --git a/tools/interoperability_visualizer/expected_outputs.py b/tools/interoperability_visualizer/expected_outputs.py new file mode 100644 index 00000000..6572ec1c --- /dev/null +++ b/tools/interoperability_visualizer/expected_outputs.py @@ -0,0 +1,554 @@ +import copy +import re +from dataclasses import dataclass +from pathlib import Path +from urllib.parse import quote, urlencode + +from robot.api import get_model + +from extractor import ( + ExtractionError, + _broker_name, + _call_arguments, + _load_payload, + _payload_path, +) + + +REQUESTS = { + "Create Entity": ("POST", "/ngsi-ld/v1/entities"), + "Retrieve Entity": ("GET", "/ngsi-ld/v1/entities/{id}"), + "Query Entities": ("GET", "/ngsi-ld/v1/entities"), + "Query Entities Via POST": ("POST", "/ngsi-ld/v1/entityOperations/query"), +} +SIGNATURES = { + "Create Entity": ("filename", "entity_id", "local", "broker_url", "context"), + "Retrieve Entity": ( + "id", "accept", "attrs", "context", "geometryProperty", "options", "format", "lang", + "join", "joinLevel", "pick", "omit", "local", "broker_url", "type", + ), + "Query Entities": ( + "entity_ids", "entity_types", "accept", "attrs", "context", "geoproperty", "options", + "limit", "entity_id_pattern", "scopeq", "georel", "coordinates", "geometry", "count", + "q", "local", "datasetId", "join", "joinLevel", "pick", "omit", "orderBy", "broker_url", + ), + "Query Entities Via POST": ( + "entities", "content_type", "accept", "context", "attrs", "geometry_property", "join", + "joinLevel", "local", "options", "broker_url", + ), +} +VARIABLE = re.compile(r"^[$@&]\{([^}]+)\}(.*)$") +VARIABLE_ANYWHERE = re.compile(r"[$@&]\{([^}]+)\}") +PATH_PART = re.compile(r"\[([^]]+)\]") +JSON_ENTITY_ID = re.compile(r"@\.id\s*==\s*['\"]([^'\"]+)['\"]") + + +@dataclass(frozen=True) +class Response: + request_id: str + + +@dataclass(frozen=True) +class Ref: + request_id: str + path: tuple = () + + +@dataclass(frozen=True) +class Unknown: + expression: str + + +def extract_expected_steps( + robot_file: Path, + suite, + test, + setup_env: dict, + root: Path, + relative_robot_file: str, +) -> tuple[list[dict], list[dict]]: + execution = next((keyword for keyword in suite.resource.keywords if keyword.name == test.template), None) + if execution is None: + raise ExtractionError( + f"{relative_robot_file}: template keyword '{test.template}' for '{test.name}' was not found" + ) + + model = get_model(str(robot_file)) + parsed = _parsed_keyword(model, str(test.template)) + if parsed is None: + raise ExtractionError( + f"{relative_robot_file}: parsed template keyword '{test.template}' for '{test.name}' was not found" + ) + + env = _initial_environment(setup_env) + env.update(_template_variables(test, execution)) + evaluator = Evaluator(env, root, relative_robot_file, test.name) + evaluator.process(parsed.body) + return evaluator.finish(), evaluator.finish_timeline() + + +class Evaluator: + def __init__(self, env: dict, root: Path, robot_file: str, test_name: str): + self.env = env + self.root = root + self.robot_file = robot_file + self.test_name = test_name + self.requests = [] + self.by_id = {} + self.bindings = {} + self.comment = "" + self.timeline_steps = [] + self.current_timeline = None + + def process(self, body) -> None: + index = 0 + while index < len(body): + item = body[index] + if type(item).__name__ == "Comment": + comments = [] + source_line = int(item.lineno) + while index < len(body) and type(body[index]).__name__ == "Comment": + comments.append(_comment_text(body[index])) + index += 1 + self.comment = "\n".join(comment for comment in comments if comment) + self.current_timeline = { + "id": f"timeline-step-{len(self.timeline_steps) + 1}", + "order": len(self.timeline_steps) + 1, + "text": self.comment, + "source_line": source_line, + "operations": [], + "request_ids": [], + } + self.timeline_steps.append(self.current_timeline) + continue + if type(item).__name__ == "KeywordCall": + name = str(item.keyword) + args = tuple(str(arg) for arg in item.args) + request_ids = self._request_ids(args) + request_count = len(self.requests) + self._call(name, args, item.assign, item.lineno) + if len(self.requests) > request_count: + request_ids.append(self.requests[-1]["id"]) + self._timeline_operation(name, item.lineno, request_ids) + index += 1 + + def _timeline_operation(self, name: str, source_line: int, request_ids: list[str]) -> None: + if self.current_timeline is None: + return + unique_ids = list(dict.fromkeys(request_ids)) + if name in REQUESTS: + kind = "request" + elif name.startswith("Check "): + kind = "assertion" + else: + kind = "preparation" + self.current_timeline["operations"].append( + { + "id": f"{self.current_timeline['id']}-operation-{len(self.current_timeline['operations']) + 1}", + "order": len(self.current_timeline["operations"]) + 1, + "keyword": name, + "kind": kind, + "source_line": int(source_line), + "request_ids": unique_ids, + } + ) + for request_id in unique_ids: + if request_id not in self.current_timeline["request_ids"]: + self.current_timeline["request_ids"].append(request_id) + + def _request_ids(self, expressions: tuple[str, ...]) -> list[str]: + request_ids = [] + for expression in expressions: + key, separator, value = expression.partition("=") + target = value if separator and re.match(r"^[A-Za-z_][A-Za-z0-9_-]*$", key) else expression + request_ids.extend(_request_ids_in_value(self.value(target))) + return list(dict.fromkeys(request_ids)) + + def _call(self, name: str, args: tuple[str, ...], assign, lineno: int) -> None: + if name in REQUESTS: + self._request(name, args, assign, lineno) + elif name == "Load Entity": + self._load_entity(args, assign) + elif name == "Create List": + self._assign(assign, [self.value(arg) for arg in args]) + elif name == "Create Dictionary": + self._assign(assign, self._dictionary(args)) + elif name == "Remove From Dictionary" and args: + target = self.value(args[0]) + if isinstance(target, dict): + for key in args[1:]: + target.pop(str(self.value(key)), None) + elif name == "Keep In Dictionary" and args: + target = self.value(args[0]) + if isinstance(target, dict): + keys = {str(self.value(key)) for key in args[1:]} + for key in tuple(target): + if key not in keys: + del target[key] + elif name == "Set To Dictionary" and args: + target = self.value(args[0]) + if isinstance(target, dict): + target.update(self._dictionary(args[1:])) + elif name == "Get Value From JSON" and len(args) >= 2: + self._select_json_entity(args, assign) + elif name == "Check Response Status Code" and len(args) >= 2: + request = self._request_from(args[1]) + if request: + status = self.value(args[0]) + try: + request["status"] = int(status) + except (TypeError, ValueError): + request["status"] = None + self._expectation(request) + elif name == "Check Response Body Containing Entities URIS set to" and len(args) >= 2: + request = self._request_from(args[1]) + if request: + ids = self.value(args[0]) + request["expected_ids"] = ids if isinstance(ids, list) else Unknown(args[0]) + self._expectation(request) + elif name == "Check Resource Set To" and len(args) >= 2: + self._resource_equality(args[0], args[1]) + + def _request(self, name: str, args: tuple[str, ...], assign, lineno: int) -> None: + values = _call_arguments(args, SIGNATURES[name], name) + if "broker_url" not in values: + raise ExtractionError(f"{self.robot_file}: {name} lacks broker_url in '{self.test_name}'") + broker = _broker_name( + values["broker_url"], + _broker_environment(self.env), + f"{self.robot_file}: {name} broker in '{self.test_name}'", + ) + request_id = f"step-{len(self.requests) + 1}" + method, base_endpoint = REQUESTS[name] + endpoint = self._endpoint(name, base_endpoint, values) + request = { + "id": request_id, + "order": len(self.requests) + 1, + "method": method, + "endpoint": endpoint, + "broker": broker, + "status": None, + "request_comment": self.comment, + "expectation_comments": [], + "expected_body": None, + "resolution": "unresolved", + "source_line": int(lineno), + "operation": name, + "expected_ids": None, + } + self.requests.append(request) + self.by_id[request_id] = request + self._assign(assign, Response(request_id)) + + def _endpoint(self, name: str, base_endpoint: str, values: dict[str, str]) -> str: + if name == "Retrieve Entity": + entity_id = self.value(values.get("id", "")) + if isinstance(entity_id, Unknown): + entity_id = values.get("id", "") + base_endpoint = base_endpoint.format(id=quote(str(entity_id), safe=":-._~")) + params = [] + type_value = values.get("type") if name == "Retrieve Entity" else values.get("entity_types") + for label, raw in (("type", type_value), ("attrs", values.get("attrs")), ("local", values.get("local"))): + if raw is None: + continue + value = self.value(raw) + if not isinstance(value, Unknown) and value != "": + params.append((label, str(value))) + return f"{base_endpoint}?{urlencode(params)}" if params else base_endpoint + + def _load_entity(self, args: tuple[str, ...], assign) -> None: + if len(args) < 2: + self._assign(assign, Unknown("Load Entity")) + return + filename = self.value(args[0]) + entity_id = self.value(args[1]) + if isinstance(filename, Unknown) or isinstance(entity_id, Unknown): + self._assign(assign, Unknown("Load Entity")) + return + path = _payload_path(self.root / "data" / "entities", str(filename), self.root, self.robot_file) + payload = _load_payload(path, self.robot_file) + payload["id"] = entity_id + self._assign(assign, payload) + + def _select_json_entity(self, args: tuple[str, ...], assign) -> None: + request = self._request_from(args[0]) + path = self.value(args[1]) + if not request or isinstance(path, Unknown): + self._assign(assign, Unknown(args[1])) + return + match = JSON_ENTITY_ID.search(str(path)) + if match is None: + self._assign(assign, Unknown(args[1])) + return + self._assign(assign, [Ref(request["id"], ("entity", match.group(1)))]) + + def _resource_equality(self, expected_expression: str, actual_expression: str) -> None: + expected = self.value(expected_expression) + actual = self.value(actual_expression) + request = self._request_from(actual_expression) or self._request_from(expected_expression) + if request: + self._expectation(request) + if isinstance(actual, Ref): + self.bindings[actual] = copy.deepcopy(expected) + elif isinstance(expected, Ref): + self.bindings[expected] = copy.deepcopy(actual) + + def _dictionary(self, args: tuple[str, ...]) -> dict: + result = {} + positional = [] + for arg in args: + key, separator, value = arg.partition("=") + if separator: + result[key] = self.value(value) + else: + positional.append(self.value(arg)) + for index in range(0, len(positional) - 1, 2): + result[str(positional[index])] = positional[index + 1] + return result + + def _expectation(self, request: dict) -> None: + if not self.comment: + return + if self.comment != request["request_comment"] or self.comment.lstrip().lower().startswith("agent"): + if self.comment not in request["expectation_comments"]: + request["expectation_comments"].append(self.comment) + + def _request_from(self, expression: str): + value = self.value(expression) + if isinstance(value, Response): + return self.by_id.get(value.request_id) + if isinstance(value, Ref): + return self.by_id.get(value.request_id) + return None + + def _assign(self, assign, value) -> None: + if not assign: + return + name = _variable_name(str(assign[0]).rstrip("=")) + if name: + self.env[name] = value + + def value(self, expression: str, seen: set[str] | None = None): + raw = str(expression) + match = VARIABLE.match(raw) + if match: + name, suffix = match.groups() + response_part = None + if name.endswith(".json()"): + response_part = "body" + name = name[:-7] + elif name.endswith(".status_code"): + response_part = "status" + name = name[:-12] + if name in self.env: + if seen is None: + seen = set() + if name in seen: + return Unknown(raw) + seen = {*seen, name} + value = self.env[name] + if isinstance(value, str) and VARIABLE.match(value): + value = self.value(value, seen) + if response_part == "body" and isinstance(value, Response): + value = Ref(value.request_id) + elif response_part == "status" and isinstance(value, Response): + return value + elif response_part is not None: + return Unknown(raw) + return _apply_suffix(value, suffix, raw) + if not suffix: + return Unknown(raw) + + unknown = False + + def replace(variable_match): + nonlocal unknown + name = variable_match.group(1) + if name not in self.env: + unknown = True + return variable_match.group(0) + value = self.env[name] + if isinstance(value, str) and VARIABLE.match(value): + value = self.value(value) + if isinstance(value, (dict, list, Ref, Response, Unknown)): + unknown = True + return variable_match.group(0) + return str(value) + + resolved = VARIABLE_ANYWHERE.sub(replace, raw) + return Unknown(raw) if unknown else resolved + + def finish(self) -> list[dict]: + result = [] + for request in self.requests: + status = request["status"] + body = None + resolution = "unresolved" + if status == 200: + if request["operation"].startswith("Query Entities"): + ids = self.resolve(request["expected_ids"]) + if isinstance(ids, list) and all(not isinstance(item, Unknown) for item in ids): + bodies = [self.resolve(Ref(request["id"], ("entity", str(entity_id)))) for entity_id in ids] + if all(_is_concrete(item) for item in bodies): + body = sorted(bodies, key=lambda item: str(item.get("id", ""))) + resolution = "exact" + else: + candidate = self.resolve(Ref(request["id"])) + if _is_concrete(candidate): + body = candidate + resolution = "exact" + elif status is not None: + resolution = "status-only" + + result.append( + { + "id": request["id"], + "order": request["order"], + "method": request["method"], + "endpoint": request["endpoint"], + "broker": request["broker"], + "status": status, + "request_comment": request["request_comment"], + "expectation_comments": request["expectation_comments"], + "expected_body": body, + "resolution": resolution, + "source_line": request["source_line"], + } + ) + return result + + def finish_timeline(self) -> list[dict]: + timeline = copy.deepcopy(self.timeline_steps) + for step in timeline: + step["group"] = step["order"] + return timeline + + def resolve(self, value, trail: set[Ref] | None = None): + if isinstance(value, Unknown): + return value + if isinstance(value, Ref): + if trail is None: + trail = set() + if value in trail: + return Unknown(str(value)) + trail = {*trail, value} + if value in self.bindings: + return self.resolve(self.bindings[value], trail) + for length in range(len(value.path) - 1, -1, -1): + parent = Ref(value.request_id, value.path[:length]) + if parent not in self.bindings: + continue + resolved = self.resolve(self.bindings[parent], trail) + return _apply_path(resolved, value.path[length:], str(value)) + return Unknown(str(value)) + if isinstance(value, dict): + return {key: self.resolve(item, trail) for key, item in value.items()} + if isinstance(value, list): + return [self.resolve(item, trail) for item in value] + return value + + +def _parsed_keyword(model, name: str): + for section in model.sections: + if type(section).__name__ != "KeywordSection": + continue + for keyword in section.body: + if str(keyword.name) == name: + return keyword + return None + + +def _template_variables(test, keyword) -> dict: + if not test.body: + return {} + call = test.body[0] + positional = [] + named = [] + names = set(keyword.args.argument_names) + for argument in (str(item) for item in call.args): + name, separator, value = argument.partition("=") + if separator and name in names: + named.append((name, value)) + else: + positional.append(argument) + try: + mapped_positional, mapped_named = keyword.args.map(positional, named) + except Exception as error: + raise ExtractionError(f"Unable to map template arguments for '{test.name}': {error}") from error + values = {name: str(value) for name, value in zip(keyword.args.positional, mapped_positional)} + values.update((name, str(value)) for name, value in mapped_named) + for name, value in keyword.args.defaults.items(): + values.setdefault(name, str(value)) + return values + + +def _initial_environment(env: dict) -> dict: + result = {} + for key, value in env.items(): + name = _variable_name(str(key)) + if name: + result[name] = copy.deepcopy(value) + return result + + +def _broker_environment(env: dict) -> dict: + return {f"${{{name}}}": value for name, value in env.items() if isinstance(value, str)} + + +def _variable_name(value: str) -> str | None: + match = re.match(r"^[$@&]\{([^}]+)\}$", value) + return match.group(1) if match else None + + +def _comment_text(comment) -> str: + token = next((token for token in comment.tokens if token.type == "COMMENT"), None) + return token.value.lstrip("#").strip() if token else "" + + +def _apply_suffix(value, suffix: str, expression: str): + if not suffix: + return value + parts = PATH_PART.findall(suffix) + if "".join(f"[{part}]" for part in parts) != suffix: + return Unknown(expression) + if isinstance(value, Ref): + return Ref(value.request_id, value.path + tuple(_path_key(part) for part in parts)) + return _apply_path(value, tuple(_path_key(part) for part in parts), expression) + + +def _apply_path(value, path: tuple, expression: str): + current = value + for index, key in enumerate(path): + if isinstance(current, Unknown): + return current + if isinstance(current, Ref): + return Ref(current.request_id, current.path + path[index:]) + try: + current = current[key] + except (KeyError, IndexError, TypeError): + return Unknown(expression) + return current + + +def _path_key(value: str): + return int(value) if value.isdigit() else value + + +def _is_concrete(value) -> bool: + if isinstance(value, (Unknown, Ref, Response)): + return False + if isinstance(value, dict): + return all(_is_concrete(item) for item in value.values()) + if isinstance(value, list): + return all(_is_concrete(item) for item in value) + return True + + +def _request_ids_in_value(value) -> list[str]: + if isinstance(value, (Response, Ref)): + return [value.request_id] + if isinstance(value, dict): + return [request_id for item in value.values() for request_id in _request_ids_in_value(item)] + if isinstance(value, (list, tuple)): + return [request_id for item in value for request_id in _request_ids_in_value(item)] + return [] diff --git a/tools/interoperability_visualizer/extractor.py b/tools/interoperability_visualizer/extractor.py new file mode 100644 index 00000000..ccfb92a9 --- /dev/null +++ b/tools/interoperability_visualizer/extractor.py @@ -0,0 +1,401 @@ +import ast +import copy +import json +import re +from collections import defaultdict +from pathlib import Path + +from robot.api import TestSuiteBuilder + + +MODES = ("inclusive", "auxiliary", "redirect", "exclusive") +MODE_COLORS = { + "inclusive": "#009E73", + "auxiliary": "#0072B2", + "redirect": "#E69F00", + "exclusive": "#CC79A7", +} +VARIABLE_PATTERN = re.compile(r"^\$\{[^}]+\}$") +BROKER_PATTERN = re.compile(r"^\$\{(b\d+)_url\}$") + + +class ExtractionError(ValueError): + pass + + +def extract_source(source: Path | str, repo_root: Path | str) -> dict: + root = Path(repo_root).resolve() + source_path = Path(source) + if not source_path.is_absolute(): + source_path = root / source_path + source_path = source_path.resolve() + + if not source_path.exists(): + raise ExtractionError(f"Source does not exist: {source_path}") + if source_path.is_file(): + if source_path.suffix.lower() != ".robot": + raise ExtractionError(f"Source is not a Robot file: {source_path}") + robot_files = [source_path] + else: + robot_files = sorted(source_path.rglob("*.robot")) + if not robot_files: + raise ExtractionError(f"No Robot files found in: {source_path}") + + config_variables = _load_config_variables(root / "resources" / "variables.py") + tests = [] + for robot_file in robot_files: + tests.extend(_extract_robot_file(robot_file, root, config_variables)) + + return { + "modes": [ + { + "id": mode, + "label": mode.capitalize(), + "color": MODE_COLORS[mode], + } + for mode in MODES + ], + "tests": tests, + } + + +def _extract_robot_file(robot_file: Path, root: Path, config_variables: dict[str, str]) -> list[dict]: + try: + suite = TestSuiteBuilder().build(str(robot_file)) + except Exception as error: + raise ExtractionError(f"Unable to parse {robot_file}: {error}") from error + + suite_variables = _suite_variables(suite) + variables = {"${EMPTY}": "", **config_variables, **suite_variables} + relative_robot_file = _relative_path(robot_file, root) + results = [] + + for test in suite.tests: + setup = next((keyword for keyword in suite.resource.keywords if keyword.name == test.setup.name), None) + if setup is None: + raise ExtractionError( + f"{relative_robot_file}: setup keyword '{test.setup.name}' for '{test.name}' was not found" + ) + + setup_variables = _setup_variables(test, setup) + env = {**variables, **setup_variables} + entities_by_broker: dict[str, list[dict]] = defaultdict(list) + registrations = [] + registration_context = "${ngsild_test_suite_context}" + + for keyword in setup.body: + if keyword.name == "Set Test Variable" and len(keyword.args) >= 2: + env[str(keyword.args[0])] = str(keyword.args[1]) + continue + + if keyword.name == "Create Entity": + entity = _extract_entity(keyword.args, env, root, relative_robot_file, test.name) + entities_by_broker[entity["broker"]].append( + { + "source_file": entity["source_file"], + "payload": entity["payload"], + } + ) + continue + + if keyword.name == "Create List" and len(keyword.args) == 5: + args = tuple(str(argument) for argument in keyword.args) + mode = args[2].lower() + if mode in MODES: + registrations.append( + _extract_registration( + args, + len(registrations) + 1, + env, + root, + relative_robot_file, + test.name, + ) + ) + elif _registration_like(args, env): + raise ExtractionError( + f"{relative_robot_file}: unsupported registration mode '{args[2]}' in '{test.name}'" + ) + continue + + if keyword.name == "Compose IOP Configuration": + registration_context = _compose_context(keyword.args) + + resolved_registration_context = _resolve( + registration_context, + env, + f"{relative_robot_file}: registration context in '{test.name}'", + ) + for registration in registrations: + if resolved_registration_context != "": + registration["payload"]["@context"] = resolved_registration_context + + broker_ids = set(entities_by_broker) + for registration in registrations: + broker_ids.add(registration["source"]) + broker_ids.add(registration["target"]) + brokers = [ + { + "id": broker_id, + "entities": entities_by_broker.get(broker_id, []), + } + for broker_id in sorted(broker_ids, key=_broker_sort_key) + ] + + from expected_outputs import extract_expected_steps + + steps, timeline_steps = extract_expected_steps( + robot_file, + suite, + test, + env, + root, + relative_robot_file, + ) + + results.append( + { + "name": test.name, + "suite": relative_robot_file, + "objective": str(suite.doc), + "tags": [str(tag) for tag in test.tags], + "context": resolved_registration_context, + "brokers": brokers, + "registrations": registrations, + "steps": steps, + "timeline_steps": timeline_steps, + } + ) + + return results + + +def _extract_entity(args, env: dict, root: Path, robot_file: str, test_name: str) -> dict: + values = _call_arguments(args, ("filename", "entity_id", "local", "broker_url", "context"), "Create Entity") + for required in ("filename", "entity_id", "broker_url"): + if required not in values: + raise ExtractionError(f"{robot_file}: Create Entity lacks {required} in '{test_name}'") + + filename = _resolve(values["filename"], env, f"{robot_file}: entity filename in '{test_name}'") + entity_id = _resolve(values["entity_id"], env, f"{robot_file}: entity ID in '{test_name}'") + context = _resolve( + values.get("context", "${ngsild_test_suite_context}"), + env, + f"{robot_file}: entity context in '{test_name}'", + ) + broker = _broker_name(values["broker_url"], env, f"{robot_file}: entity broker in '{test_name}'") + payload_path = _payload_path(root / "data" / "entities", filename, root, robot_file) + payload = _load_payload(payload_path, robot_file) + payload["id"] = entity_id + payload["@context"] = context + + return { + "broker": broker, + "source_file": _relative_path(payload_path, root), + "payload": payload, + } + + +def _extract_registration( + args: tuple[str, ...], + index: int, + env: dict, + root: Path, + robot_file: str, + test_name: str, +) -> dict: + entity_id = _resolve(args[0], env, f"{robot_file}: registration entity ID in '{test_name}'") + filename = _resolve(args[1], env, f"{robot_file}: registration filename in '{test_name}'") + mode = args[2].lower() + target = _broker_name(args[3], env, f"{robot_file}: registration endpoint in '{test_name}'") + source = _broker_name(args[4], env, f"{robot_file}: registering broker in '{test_name}'") + payload_path = _payload_path(root / "data", filename, root, robot_file) + payload = _load_payload(payload_path, robot_file) + payload["id"] = f"${{registration_id{index}}}" + payload["endpoint"] = f"${{{target}_url}}" + payload["mode"] = mode + if entity_id != "": + _inject_entity_id(payload, entity_id) + + return { + "id": f"registration-{index}", + "source": source, + "target": target, + "mode": mode, + "source_file": _relative_path(payload_path, root), + "payload": payload, + } + + +def _inject_entity_id(value, entity_id: str) -> None: + if isinstance(value, dict): + entities = value.get("entities") + if isinstance(entities, list): + for entity in entities: + if isinstance(entity, dict): + entity["id"] = entity_id + for nested in value.values(): + _inject_entity_id(nested, entity_id) + elif isinstance(value, list): + for nested in value: + _inject_entity_id(nested, entity_id) + + +def _call_arguments(args, signature: tuple[str, ...], keyword_name: str) -> dict[str, str]: + values = {} + position = 0 + for argument in (str(item) for item in args): + key, separator, value = argument.partition("=") + if separator and key in signature: + values[key] = value + continue + while position < len(signature) and signature[position] in values: + position += 1 + if position >= len(signature): + raise ExtractionError(f"{keyword_name} has an unexpected argument '{argument}'") + values[signature[position]] = argument + position += 1 + return values + + +def _setup_variables(test, setup) -> dict[str, str]: + argument_names = set(setup.args.argument_names) + positional = [] + named = [] + for argument in (str(item) for item in test.setup.args): + name, separator, value = argument.partition("=") + if separator and name in argument_names: + named.append((name, value)) + else: + positional.append(argument) + + try: + mapped_positional, mapped_named = setup.args.map(positional, named) + except Exception as error: + raise ExtractionError(f"Unable to map setup arguments for '{test.name}': {error}") from error + + variables = { + f"${{{name}}}": str(value) + for name, value in zip(setup.args.positional, mapped_positional) + } + variables.update((f"${{{name}}}", str(value)) for name, value in mapped_named) + for name, value in setup.args.defaults.items(): + variables.setdefault(f"${{{name}}}", str(value)) + return variables + + +def _suite_variables(suite) -> dict[str, str]: + variables = {} + for variable in suite.resource.variables: + values = tuple(str(value) for value in variable.value) + if len(values) != 1: + continue + variables[str(variable.name)] = values[0] + return variables + + +def _load_config_variables(path: Path) -> dict[str, str]: + if not path.is_file(): + raise ExtractionError(f"Variable file does not exist: {path}") + try: + tree = ast.parse(path.read_text(encoding="utf-8"), filename=str(path)) + except (OSError, SyntaxError) as error: + raise ExtractionError(f"Unable to parse variable file {path}: {error}") from error + + variables = {} + for node in tree.body: + if not isinstance(node, ast.Assign) or len(node.targets) != 1 or not isinstance(node.targets[0], ast.Name): + continue + try: + value = ast.literal_eval(node.value) + except (ValueError, TypeError): + continue + if isinstance(value, (str, int, float, bool)) or value is None: + variables[f"${{{node.targets[0].id}}}"] = str(value) if value is not None else "" + return variables + + +def _resolve(value: str, env: dict[str, str], field: str) -> str: + original = str(value) + result = original + visited = set() + while VARIABLE_PATTERN.match(result): + if result in visited: + raise ExtractionError(f"{field} contains a circular variable reference: {original}") + visited.add(result) + if result not in env: + raise ExtractionError(f"{field} contains an undefined variable: {result}") + result = str(env[result]) + return result + + +def _broker_name(value: str, env: dict[str, str], field: str) -> str: + original = str(value) + result = original + visited = set() + while result not in visited: + match = BROKER_PATTERN.match(result) + if match is not None: + return match.group(1) + visited.add(result) + if result not in env: + break + result = str(env[result]) + raise ExtractionError(f"{field} is not a broker variable: {original}") + + +def _registration_like(args: tuple[str, ...], env: dict[str, str]) -> bool: + try: + _broker_name(args[3], env, "Registration endpoint") + _broker_name(args[4], env, "Registering broker") + return True + except ExtractionError: + return False + + +def _compose_context(args) -> str: + string_args = tuple(str(argument) for argument in args) + for argument in string_args: + key, separator, value = argument.partition("=") + if separator and key == "ld_context": + return value + if len(string_args) > 1: + return string_args[1] + return "${ngsild_test_suite_context}" + + +def _payload_path(base: Path, relative: str, root: Path, robot_file: str) -> Path: + normalized = relative.replace("\\", "/") + candidate = (base / normalized).resolve() + resolved_base = base.resolve() + if candidate != resolved_base and resolved_base not in candidate.parents: + raise ExtractionError(f"{robot_file}: unsafe payload path '{relative}'") + if not candidate.is_file(): + raise ExtractionError(f"{robot_file}: payload does not exist: {_display_path(candidate, root)}") + return candidate + + +def _load_payload(path: Path, robot_file: str) -> dict: + try: + payload = json.loads(path.read_text(encoding="utf-8")) + except (OSError, UnicodeError, json.JSONDecodeError) as error: + raise ExtractionError(f"{robot_file}: invalid JSON payload {_display_path(path, path.parents[2])}: {error}") from error + if not isinstance(payload, dict): + raise ExtractionError(f"{robot_file}: payload must be a JSON object: {path}") + return copy.deepcopy(payload) + + +def _relative_path(path: Path, root: Path) -> str: + try: + return path.resolve().relative_to(root.resolve()).as_posix() + except ValueError: + return path.resolve().as_posix() + + +def _display_path(path: Path, root: Path) -> str: + return _relative_path(path, root) + + +def _broker_sort_key(broker_id: str) -> tuple[int, str]: + match = re.match(r"^b(\d+)$", broker_id) + return (int(match.group(1)), broker_id) if match else (10**9, broker_id) diff --git a/tools/interoperability_visualizer/generate.py b/tools/interoperability_visualizer/generate.py new file mode 100644 index 00000000..652ae38a --- /dev/null +++ b/tools/interoperability_visualizer/generate.py @@ -0,0 +1,85 @@ +import argparse +import json +import sys +from pathlib import Path + +from extractor import ExtractionError, extract_source + + +TOOL_DIR = Path(__file__).resolve().parent +REPO_ROOT = TOOL_DIR.parents[1] +DEFAULT_SOURCE = REPO_ROOT / "IOP_TP" / "NGSI-LD" / "Interoperability" +DEFAULT_OUTPUT_NAME = "interoperability-architecture.html" +DATA_TOKEN = "__IOP_VIEWER_DATA__" + + +def validate_output_name(value: str) -> str: + if ( + value in {"", ".", ".."} + or "/" in value + or "\\" in value + or Path(value).name != value + or not value.lower().endswith(".html") + ): + raise argparse.ArgumentTypeError("output name must be a single .html filename") + return value + + +def output_path(output_name: str, tool_dir: Path = TOOL_DIR) -> Path: + name = validate_output_name(output_name) + return tool_dir / "output" / name + + +def render_viewer(data: dict, template: str) -> str: + if template.count(DATA_TOKEN) != 1: + raise ValueError(f"Template must contain exactly one {DATA_TOKEN} token") + serialized = json.dumps(data, ensure_ascii=False, separators=(",", ":")) + serialized = serialized.replace("&", "\\u0026").replace("<", "\\u003c").replace(">", "\\u003e") + return template.replace(DATA_TOKEN, serialized) + + +def resolve_source(value: str | None) -> Path: + if value is None: + return DEFAULT_SOURCE + source = Path(value).expanduser() + if source.is_absolute(): + return source + cwd_source = Path.cwd() / source + return cwd_source if cwd_source.exists() else REPO_ROOT / source + + +def build_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser(description="Generate the NGSI-LD interoperability architecture viewer.") + parser.add_argument( + "--source", + help="Robot file or directory. Defaults to IOP_TP/NGSI-LD/Interoperability.", + ) + parser.add_argument( + "--output-name", + default=DEFAULT_OUTPUT_NAME, + type=validate_output_name, + help=f"Filename inside the ignored output directory. Defaults to {DEFAULT_OUTPUT_NAME}.", + ) + return parser + + +def main(argv: list[str] | None = None) -> int: + parser = build_parser() + args = parser.parse_args(argv) + destination = output_path(args.output_name) + try: + data = extract_source(resolve_source(args.source), REPO_ROOT) + template = (TOOL_DIR / "viewer_template.html").read_text(encoding="utf-8") + document = render_viewer(data, template) + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_text(document, encoding="utf-8") + except (ExtractionError, OSError, UnicodeError, ValueError) as error: + print(f"Error: {error}", file=sys.stderr) + return 1 + + print(destination) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tools/interoperability_visualizer/tests/test_visualizer.py b/tools/interoperability_visualizer/tests/test_visualizer.py new file mode 100644 index 00000000..3d36b01c --- /dev/null +++ b/tools/interoperability_visualizer/tests/test_visualizer.py @@ -0,0 +1,425 @@ +import argparse +import json +import re +import sys +import tempfile +import unittest +from pathlib import Path + + +ROOT = Path(__file__).resolve().parents[3] +TOOL_DIR = ROOT / "tools" / "interoperability_visualizer" +sys.path.insert(0, str(TOOL_DIR)) + +from extractor import ExtractionError, extract_source +from generate import DATA_TOKEN, render_viewer, validate_output_name + + +class Fixture: + def __init__(self): + self.temporary_directory = tempfile.TemporaryDirectory() + self.root = Path(self.temporary_directory.name) + self.robot_file = self.root / "IOP_TP" / "NGSI-LD" / "Interoperability" / "fixture.robot" + self.entity_file = self.root / "data" / "entities" / "interoperability" / "entity.jsonld" + self.inclusive_file = ( + self.root + / "data" + / "csourceRegistrations" + / "interoperability" + / "registration-inclusive.jsonld" + ) + self.redirect_file = ( + self.root + / "data" + / "csourceRegistrations" + / "interoperability" + / "registration-redirect.jsonld" + ) + variables_file = self.root / "resources" / "variables.py" + variables_file.parent.mkdir(parents=True) + variables_file.write_text( + "core_context = 'https://example.test/core.jsonld'\n" + "ngsild_test_suite_context = 'https://example.test/user.jsonld'\n", + encoding="utf-8", + ) + self.entity_file.parent.mkdir(parents=True) + self.entity_file.write_text( + json.dumps({"id": "urn:old", "type": "Vehicle", "speed": {"type": "Property", "value": 10}}), + encoding="utf-8", + ) + registration = { + "id": "urn:old-registration", + "type": "ContextSourceRegistration", + "information": [{"entities": [{"type": "Vehicle"}]}], + "mode": "inclusive", + "endpoint": "xxx", + } + self.inclusive_file.parent.mkdir(parents=True) + self.inclusive_file.write_text(json.dumps(registration), encoding="utf-8") + registration["mode"] = "redirect" + self.redirect_file.write_text(json.dumps(registration), encoding="utf-8") + self.write_robot() + + def cleanup(self): + self.temporary_directory.cleanup() + + def write_robot( + self, + entity_payload: str = "interoperability/entity.jsonld", + first_mode: str = "inclusive", + first_endpoint: str = "${b2_url}", + first_registration: str = "${inclusive_registration}", + scenario_body: str = " No Operation", + ): + self.robot_file.parent.mkdir(parents=True, exist_ok=True) + self.robot_file.write_text( + f"""*** Settings *** +Documentation Fixture objective +Test Template Run Scenario + + +*** Variables *** +${{entity_payload}} {entity_payload} +${{inclusive_registration}} csourceRegistrations/interoperability/registration-inclusive.jsonld +${{redirect_registration}} csourceRegistrations/interoperability/registration-redirect.jsonld +${{b1_url}} ${{EMPTY}} +${{b2_url}} ${{EMPTY}} + + +*** Test Cases *** +IOP_999_01_01 Default Context + [Tags] since_v1.6.1 iop default-context 4_3_3 + [Setup] Prepare Configuration ${{core_context}} + ${{core_context}} + +IOP_999_01_02 User Context + [Tags] since_v1.6.1 iop user-context 4_3_3 + [Setup] Prepare Configuration ${{ngsild_test_suite_context}} + ${{ngsild_test_suite_context}} + + +*** Keywords *** +Run Scenario + [Arguments] ${{context}} +{scenario_body} + +Prepare Configuration + [Arguments] ${{context}} + Set Test Variable ${{entity_id}} urn:ngsi-ld:Vehicle:1 + Create Entity + ... ${{entity_payload}} + ... ${{entity_id}} + ... broker_url=${{b2_url}} + ... context=${{context}} + @{{first_set}}= Create List + ... ${{entity_id}} + ... {first_registration} + ... {first_mode} + ... {first_endpoint} + ... ${{b1_url}} + @{{second_set}}= Create List + ... ${{EMPTY}} + ... ${{redirect_registration}} + ... redirect + ... ${{b2_url}} + ... ${{b1_url}} + @{{configuration}}= Create List ${{first_set}} ${{second_set}} + Compose IOP Configuration ${{configuration}} ld_context=${{context}} +""", + encoding="utf-8", + ) + + +class ExtractorTest(unittest.TestCase): + def setUp(self): + self.fixture = Fixture() + self.addCleanup(self.fixture.cleanup) + + def test_extracts_direction_parallel_modes_and_effective_payloads(self): + data = extract_source(self.fixture.robot_file, self.fixture.root) + + self.assertEqual(len(data["tests"]), 2) + default_test, user_test = data["tests"] + self.assertEqual([broker["id"] for broker in default_test["brokers"]], ["b1", "b2"]) + self.assertEqual([registration["source"] for registration in default_test["registrations"]], ["b1", "b1"]) + self.assertEqual([registration["target"] for registration in default_test["registrations"]], ["b2", "b2"]) + self.assertEqual([registration["mode"] for registration in default_test["registrations"]], ["inclusive", "redirect"]) + + b2 = next(broker for broker in default_test["brokers"] if broker["id"] == "b2") + self.assertEqual(len(b2["entities"]), 1) + self.assertEqual(b2["entities"][0]["payload"]["id"], "urn:ngsi-ld:Vehicle:1") + self.assertEqual(b2["entities"][0]["payload"]["@context"], "https://example.test/core.jsonld") + + registration = default_test["registrations"][0] + self.assertEqual(registration["payload"]["id"], "${registration_id1}") + self.assertEqual(registration["payload"]["endpoint"], "${b2_url}") + self.assertEqual(registration["payload"]["mode"], "inclusive") + self.assertEqual(registration["payload"]["@context"], "https://example.test/core.jsonld") + self.assertEqual( + registration["payload"]["information"][0]["entities"][0]["id"], + "urn:ngsi-ld:Vehicle:1", + ) + self.assertEqual(user_test["context"], "https://example.test/user.jsonld") + self.assertEqual( + user_test["registrations"][0]["payload"]["@context"], + "https://example.test/user.jsonld", + ) + + def test_rejects_unsafe_payload_path(self): + self.fixture.write_robot(entity_payload="../../outside.json") + with self.assertRaisesRegex(ExtractionError, "unsafe payload path"): + extract_source(self.fixture.robot_file, self.fixture.root) + + def test_rejects_missing_payload(self): + self.fixture.write_robot(entity_payload="interoperability/missing.jsonld") + with self.assertRaisesRegex(ExtractionError, "payload does not exist"): + extract_source(self.fixture.robot_file, self.fixture.root) + + def test_rejects_malformed_json(self): + self.fixture.entity_file.write_text("{", encoding="utf-8") + with self.assertRaisesRegex(ExtractionError, "invalid JSON payload"): + extract_source(self.fixture.robot_file, self.fixture.root) + + def test_rejects_unsupported_mode(self): + self.fixture.write_robot(first_mode="mystery") + with self.assertRaisesRegex(ExtractionError, "unsupported registration mode 'mystery'"): + extract_source(self.fixture.robot_file, self.fixture.root) + + def test_rejects_invalid_broker_variable(self): + self.fixture.write_robot(first_endpoint="${peer_url}") + with self.assertRaisesRegex(ExtractionError, "is not a broker variable"): + extract_source(self.fixture.robot_file, self.fixture.root) + + +class ExpectedOutputsTest(unittest.TestCase): + def setUp(self): + self.fixture = Fixture() + self.addCleanup(self.fixture.cleanup) + + def extract_test(self): + return extract_source(self.fixture.robot_file, self.fixture.root)["tests"][0] + + def extract_steps(self): + return self.extract_test()["steps"] + + def test_reconstructs_retrieve_body_endpoint_and_nested_comments(self): + self.fixture.write_robot( + scenario_body=""" # Client retrieves the Vehicle + ${response}= Retrieve Entity + ... ${entity_id} + ... attrs=speed + ... local=true + ... broker_url=${b2_url} + ... context=${context} + ... type=Vehicle + # Agent checks the exact entity: + # - only the speed attribute is returned + Check Response Status Code 200 ${response.status_code} + ${expected}= Load Entity ${entity_payload} ${entity_id} + Keep In Dictionary ${expected} id type speed + Check Resource Set To ${expected} ${response.json()}""" + ) + + extracted = self.extract_test() + step = extracted["steps"][0] + self.assertEqual(step["method"], "GET") + self.assertEqual( + step["endpoint"], + "/ngsi-ld/v1/entities/urn:ngsi-ld:Vehicle:1?type=Vehicle&attrs=speed&local=true", + ) + self.assertEqual(step["broker"], "b2") + self.assertEqual(step["status"], 200) + self.assertEqual(step["resolution"], "exact") + self.assertEqual(set(step["expected_body"]), {"id", "type", "speed"}) + self.assertEqual(step["request_comment"], "Client retrieves the Vehicle") + self.assertIn("\n- only the speed attribute is returned", step["expectation_comments"][0]) + self.assertGreater(step["source_line"], 0) + timeline = extracted["timeline_steps"] + self.assertEqual(len(timeline), 2) + self.assertEqual(timeline[0]["text"], "Client retrieves the Vehicle") + self.assertEqual( + timeline[1]["text"], + "Agent checks the exact entity:\n- only the speed attribute is returned", + ) + self.assertEqual(timeline[0]["request_ids"], ["step-1"]) + self.assertEqual(timeline[1]["request_ids"], ["step-1"]) + self.assertEqual([timeline_step["group"] for timeline_step in timeline], [1, 2]) + self.assertEqual( + [operation["keyword"] for operation in timeline[1]["operations"]], + ["Check Response Status Code", "Load Entity", "Keep In Dictionary", "Check Resource Set To"], + ) + + def test_resolves_post_query_and_cross_broker_payload_reference(self): + self.fixture.write_robot( + scenario_body=""" # Client queries b1 via POST + &{selector}= Create Dictionary type=Vehicle + @{selectors}= Create List ${selector} + ${response_b1}= Query Entities Via POST + ... entities=${selectors} + ... broker_url=${b1_url} + ... context=${context} + # Agent checks b1 + Check Response Status Code 200 ${response_b1.status_code} + ${ids_b1}= Create List ${entity_id} + Check Response Body Containing Entities URIS set to ${ids_b1} ${response_b1.json()} + ${entity_b1}= Get Value From JSON ${response_b1.json()} $[?(@.id=='${entity_id}')] + # Client queries b2 + ${response_b2}= Query Entities + ... entity_types=Vehicle + ... broker_url=${b2_url} + ... context=${context} + Check Response Status Code 200 ${response_b2.status_code} + ${ids_b2}= Create List ${entity_id} + Check Response Body Containing Entities URIS set to ${ids_b2} ${response_b2.json()} + ${entity_b2}= Get Value From JSON ${response_b2.json()} $[?(@.id=='${entity_id}')] + ${expected_b2}= Load Entity ${entity_payload} ${entity_id} + Check Resource Set To ${expected_b2} ${entity_b2}[0] + # Agent checks b1 combines b2 + ${expected_b1}= Load Entity ${entity_payload} ${entity_id} + Keep In Dictionary ${expected_b1} id type + Set To Dictionary ${expected_b1} speed=${entity_b2}[0][speed] + Check Resource Set To ${expected_b1} ${entity_b1}[0]""" + ) + + first, second = self.extract_steps() + self.assertEqual(first["endpoint"], "/ngsi-ld/v1/entityOperations/query") + self.assertEqual(first["request_comment"], "Client queries b1 via POST") + self.assertEqual(first["resolution"], "exact") + self.assertEqual(first["expected_body"][0]["speed"], second["expected_body"][0]["speed"]) + self.assertEqual(second["endpoint"], "/ngsi-ld/v1/entities?type=Vehicle") + + def test_creation_and_not_found_are_status_only(self): + self.fixture.write_robot( + scenario_body=""" # Client creates an entity + ${response}= Create Entity + ... ${entity_payload} + ... ${entity_id} + ... broker_url=${b1_url} + ... context=${context} + Check Response Status Code 201 ${response.status_code} + # Client retrieves a missing entity + ${response}= Retrieve Entity + ... urn:ngsi-ld:Vehicle:missing + ... broker_url=${b1_url} + ... context=${context} + Check Response Status Code 404 ${response.status_code}""" + ) + + steps = self.extract_steps() + self.assertEqual([step["status"] for step in steps], [201, 404]) + self.assertTrue(all(step["expected_body"] is None for step in steps)) + self.assertTrue(all(step["resolution"] == "status-only" for step in steps)) + + def test_unsupported_body_expression_remains_unresolved(self): + self.fixture.write_robot( + scenario_body=""" # Client retrieves an entity + ${response}= Retrieve Entity + ... ${entity_id} + ... broker_url=${b1_url} + Check Response Status Code 200 ${response.status_code} + Check Resource Set To ${unsupported_expression} ${response.json()}""" + ) + + step = self.extract_steps()[0] + self.assertEqual(step["status"], 200) + self.assertEqual(step["resolution"], "unresolved") + self.assertIsNone(step["expected_body"]) + + +class GeneratorTest(unittest.TestCase): + def test_output_name_rejects_paths_and_non_html_files(self): + for value in ("../viewer.html", "folder/viewer.html", "folder\\viewer.html", "viewer.json", ""): + with self.subTest(value=value): + with self.assertRaises(argparse.ArgumentTypeError): + validate_output_name(value) + self.assertEqual(validate_output_name("viewer.html"), "viewer.html") + + def test_render_viewer_escapes_embedded_markup(self): + rendered = render_viewer({"value": "") + self.assertNotIn(" + + + -- GitLab From 8c2f05f78f77a7b1bd7f729808f6867f197bef82 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 4 Aug 2026 15:10:58 +0200 Subject: [PATCH 31/34] feat: implement left to right graph propagation --- tools/interoperability_visualizer/README.md | 3 +- .../tests/test_visualizer.py | 4 + .../viewer_template.html | 128 +++++++++++++++--- 3 files changed, 118 insertions(+), 17 deletions(-) diff --git a/tools/interoperability_visualizer/README.md b/tools/interoperability_visualizer/README.md index 70299df8..10f2d0be 100644 --- a/tools/interoperability_visualizer/README.md +++ b/tools/interoperability_visualizer/README.md @@ -42,6 +42,7 @@ Output paths and non-HTML output names are rejected. The complete `output/` dire - Select any concrete interoperability test permutation. - Switch between the full-size **Preview** graph and **Expected output** workspace. +- Brokers use a left-to-right hierarchy rooted at `b1`; each registration hop advances one level. - Hover over a broker to inspect every entity created in that broker during setup. - Hover over a registration arc to inspect its effective creation payload. - Browse assertion-derived expected responses by broker or in execution order. @@ -51,7 +52,7 @@ Output paths and non-HTML output names are rejected. The complete `output/` dire - Expand a response step to see its prominent HTTP status, request, assertions, and expected JSON inline. - Click a broker or registration to pin it; press Escape or use the close button to unpin it. - Drag brokers to rearrange the architecture. -- Drag empty graph space to pan, use the mouse wheel to zoom, and use **Reset view** to restore the viewport. +- Drag empty graph space to pan, use the mouse wheel to zoom, and use **Reset view** to restore the hierarchy and viewport. Registration arrows start at the broker where the registration is created and point to the broker referenced by its endpoint. Effective payloads resolve entity IDs and contexts while keeping runtime broker URLs and generated diff --git a/tools/interoperability_visualizer/tests/test_visualizer.py b/tools/interoperability_visualizer/tests/test_visualizer.py index 3d36b01c..4551946c 100644 --- a/tools/interoperability_visualizer/tests/test_visualizer.py +++ b/tools/interoperability_visualizer/tests/test_visualizer.py @@ -369,6 +369,10 @@ class GeneratorTest(unittest.TestCase): "Assertions and expected output after Step", "Robot operation", "correlated expected HTTP response", + "level-guide", + "initialPositions(test)", + "levels.set(target, nextLevel)", + "renderLevels()", ): self.assertIn(value, template) diff --git a/tools/interoperability_visualizer/viewer_template.html b/tools/interoperability_visualizer/viewer_template.html index b6c4ba13..03a51a42 100644 --- a/tools/interoperability_visualizer/viewer_template.html +++ b/tools/interoperability_visualizer/viewer_template.html @@ -859,6 +859,22 @@ outline: none; } + .level-guide { + stroke: #d7e0e8; + stroke-width: 1; + stroke-dasharray: 5 7; + vector-effect: non-scaling-stroke; + } + + .level-label { + fill: #74869a; + font-size: 11px; + font-weight: 750; + letter-spacing: 0.06em; + text-anchor: middle; + text-transform: uppercase; + } + .node-circle { fill: #fff; stroke: #183957; @@ -1072,6 +1088,7 @@ Brokers are nodes and context source registrations are directed arcs. + @@ -1129,6 +1146,7 @@ const responsesPanel = document.querySelector(".responses-panel"); const svg = document.getElementById("graph"); const viewport = document.getElementById("viewport"); + const levelsLayer = document.getElementById("levels"); const nodesLayer = document.getElementById("nodes"); const edgesLayer = document.getElementById("edges"); const markers = document.getElementById("markers"); @@ -1146,6 +1164,7 @@ const outputViewButton = document.getElementById("output-view"); const positions = new Map(); const nodeElements = new Map(); + let layoutColumns = []; let currentTest = null; let pinned = null; let dragState = null; @@ -1224,28 +1243,95 @@ } } - function initialPositions(brokers) { + function brokerNumber(id) { + const match = /^b(\d+)$/.exec(id); + return match ? Number(match[1]) : Number.MAX_SAFE_INTEGER; + } + + function initialPositions(test) { positions.clear(); - const center = { x: 450, y: 305 }; - if (brokers.length === 1) { - positions.set(brokers[0].id, center); + const brokerIds = test.brokers + .map((broker) => broker.id) + .sort((left, right) => brokerNumber(left) - brokerNumber(right) || left.localeCompare(right)); + if (!brokerIds.length) { + layoutColumns = []; return; } - if (brokers.length === 2) { - positions.set(brokers[0].id, { x: 275, y: 305 }); - positions.set(brokers[1].id, { x: 625, y: 305 }); - return; + + const root = brokerIds.includes("b1") ? "b1" : brokerIds[0]; + const adjacency = new Map(brokerIds.map((id) => [id, []])); + for (const registration of test.registrations) { + if (!adjacency.has(registration.source)) adjacency.set(registration.source, []); + adjacency.get(registration.source).push(registration.target); + } + for (const targets of adjacency.values()) { + targets.sort((left, right) => brokerNumber(left) - brokerNumber(right) || left.localeCompare(right)); } - const radius = brokers.length > 4 ? 235 : 205; - brokers.forEach((broker, index) => { - const angle = -Math.PI / 2 + index * Math.PI * 2 / brokers.length; - positions.set(broker.id, { - x: center.x + Math.cos(angle) * radius, - y: center.y + Math.sin(angle) * radius, + + const levels = new Map([[root, 0]]); + const queue = [root]; + for (let index = 0; index < queue.length; index += 1) { + const source = queue[index]; + const nextLevel = levels.get(source) + 1; + for (const target of adjacency.get(source) || []) { + if (!levels.has(target)) { + levels.set(target, nextLevel); + queue.push(target); + } + } + } + + const disconnectedLevel = Math.max(...levels.values()) + 1; + for (const brokerId of brokerIds) { + if (!levels.has(brokerId)) levels.set(brokerId, disconnectedLevel); + } + + const byLevel = new Map(); + for (const brokerId of brokerIds) { + const level = levels.get(brokerId); + if (!byLevel.has(level)) byLevel.set(level, []); + byLevel.get(level).push(brokerId); + } + + const orderedLevels = [...byLevel.keys()].sort((left, right) => left - right); + const maxLevel = Math.max(...orderedLevels); + const left = 135; + const right = 765; + const top = 120; + const bottom = 520; + layoutColumns = orderedLevels.map((level) => { + const x = maxLevel === 0 ? left : left + (right - left) * level / maxLevel; + const ids = byLevel.get(level); + ids.forEach((id, index) => { + const y = ids.length === 1 + ? (top + bottom) / 2 + : top + (bottom - top) * index / (ids.length - 1); + positions.set(id, { x, y }); }); + return { level, x }; }); } + function renderLevels() { + levelsLayer.replaceChildren(); + for (const column of layoutColumns) { + levelsLayer.append(svgElement("line", { + class: "level-guide", + x1: column.x, + y1: "62", + x2: column.x, + y2: "575", + })); + const label = svgElement("text", { + class: "level-label", + x: column.x, + y: "42", + }); + label.textContent = `Level ${column.level}`; + levelsLayer.append(label); + } + } + function renderNodes(test) { nodesLayer.replaceChildren(); nodeElements.clear(); @@ -1796,6 +1882,15 @@ applyView(); } + function resetLayout() { + if (!currentTest) return; + initialPositions(currentTest); + renderLevels(); + renderNodes(currentTest); + renderEdges(currentTest); + resetView(); + } + svg.addEventListener("pointerdown", (event) => { if (event.button !== 0 || event.target !== svg) return; const point = clientToSvg(event); @@ -1862,9 +1957,10 @@ if (!currentTest) return; pinned = null; detailsPanel.classList.remove("pinned"); - initialPositions(currentTest.brokers); + initialPositions(currentTest); resetView(); renderSummary(currentTest); + renderLevels(); renderNodes(currentTest); renderEdges(currentTest); renderResponses(currentTest); @@ -1874,7 +1970,7 @@ select.addEventListener("change", () => selectTest(Number(select.value))); detailsClose.addEventListener("click", unpin); - resetViewButton.addEventListener("click", resetView); + resetViewButton.addEventListener("click", resetLayout); brokerViewButton.addEventListener("click", () => setResponseView("broker")); timelineViewButton.addEventListener("click", () => setResponseView("timeline")); previewViewButton.addEventListener("click", () => setSurfaceView("architecture")); -- GitLab From 494e7182cc38d7919dbf811926922fe073f46ce5 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 4 Aug 2026 15:30:24 +0200 Subject: [PATCH 32/34] fix: use generic name (without context) for the base testcase when there are permutations based on the context --- doc/analysis/generaterobotdata.py | 7 ++++++- doc/tests/test_iop_preconditions.py | 30 +++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 6ab1cf72..3ba78921 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -971,9 +971,14 @@ class GenerateRobotData: # Get test information from the parsed robot file tags = self.robot.get_iop_test_tags(test_name) comments = self.robot.get_iop_comments(test_name) + + name = test_name + if len(self.robot.test_case_names) > 1: + name = name.replace(' With Default Context', '') + name = name.replace(' With User Context', '') test_case = { - 'name': test_name, + 'name': name, 'permutation_iop_id': self.base_TP_id, 'tags': tags, 'test_steps': comments, diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py index b0798716..4d8764b1 100644 --- a/doc/tests/test_iop_preconditions.py +++ b/doc/tests/test_iop_preconditions.py @@ -11,7 +11,13 @@ from analysis.generaterobotdata import GenerateRobotData class IopPreconditionsTest(unittest.TestCase): - def generate(self, variables: str, setup: str, test_body: str = ' No Operation'): + def generate( + self, + variables: str, + setup: str, + test_body: str = ' No Operation', + test_name: str = 'IOP_999_01 Generated Preconditions', + ): robot = f'''*** Settings *** Documentation Objective Test Setup Prepare Preconditions @@ -22,7 +28,7 @@ Test Setup Prepare Preconditions *** Test Cases *** -IOP_999_01 Generated Preconditions +{test_name} [Documentation] Pre-conditions: documentation must be ignored. [Tags] ... since_v1.6.1 @@ -70,6 +76,18 @@ Prepare Preconditions ['since_v1.6.1', 'iop', '4_3_3'] ) + def test_preserves_context_in_single_test_case_name(self): + self.generate( + variables='${b1_url} ${EMPTY}', + setup=' No Operation', + test_name='IOP_999_01 Scenario With Default Context', + ) + + self.assertEqual( + self.generated_info['test_cases'][0]['name'], + 'IOP_999_01 Scenario With Default Context' + ) + def test_generates_mixed_context_and_data_objects(self): result = self.generate( variables='''${first_payload} fixtures/first-entity.jsonld @@ -181,12 +199,12 @@ ${b1_url} ${EMPTY} *** Test Cases *** -IOP_999_01_01 Default Context +IOP_999_01_01 Scenario With Default Context [Tags] since_v1.6.1 iop 4_3_3 default-context [Setup] Prepare Preconditions ${core_context} ${core_context} -IOP_999_01_02 User Context +IOP_999_01_02 Scenario With User Context [Tags] since_v1.6.1 iop 4_3_3 user-context [Setup] Prepare Preconditions context=${ngsild_test_suite_context} ${ngsild_test_suite_context} @@ -210,6 +228,10 @@ Prepare Preconditions user_conditions = self.generated_info['test_cases'][1]['initial_conditions'] self.assertNotIn('initial_conditions', self.generated_info) + self.assertEqual( + [test_case['name'] for test_case in self.generated_info['test_cases']], + ['IOP_999_01_01 Scenario', 'IOP_999_01_02 Scenario'] + ) self.assertEqual( default_conditions['pre_conditions'][0], { -- GitLab From a144eac1b4af4428cbec11da4e5dcacc6ef7d511 Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 4 Aug 2026 16:18:24 +0200 Subject: [PATCH 33/34] fix: update test case naming to preserve context and improve clarity --- doc/analysis/generaterobotdata.py | 18 ++++++++++++------ doc/tests/test_iop_preconditions.py | 12 +++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/doc/analysis/generaterobotdata.py b/doc/analysis/generaterobotdata.py index 3ba78921..0beb1569 100644 --- a/doc/analysis/generaterobotdata.py +++ b/doc/analysis/generaterobotdata.py @@ -654,6 +654,7 @@ class GenerateRobotData: self.test_suite = { 'tp_id': tp_id, + 'name': self.generate_iop_test_name(), 'test_objective': self.suite.doc, 'reference': reference, 'config_id': str(), @@ -670,6 +671,16 @@ class GenerateRobotData: test_name=self.robot.test_case_names[0] ) + def generate_iop_test_name(self) -> str: + test_names = self.robot.test_case_names + if len(test_names) == 1: + return test_names[0] + + _, separator, name = test_names[0].partition(' ') + name = name.replace(' With Default Context', '') + name = name.replace(' With User Context', '') + return f'{self.robot.test_suite}{separator}{name}' + def _get_iop_setup(self, test_name: str): test = next((item for item in self.suite.tests if item.name == test_name), None) if test is None: @@ -972,13 +983,8 @@ class GenerateRobotData: tags = self.robot.get_iop_test_tags(test_name) comments = self.robot.get_iop_comments(test_name) - name = test_name - if len(self.robot.test_case_names) > 1: - name = name.replace(' With Default Context', '') - name = name.replace(' With User Context', '') - test_case = { - 'name': name, + 'name': test_name, 'permutation_iop_id': self.base_TP_id, 'tags': tags, 'test_steps': comments, diff --git a/doc/tests/test_iop_preconditions.py b/doc/tests/test_iop_preconditions.py index 4d8764b1..72683049 100644 --- a/doc/tests/test_iop_preconditions.py +++ b/doc/tests/test_iop_preconditions.py @@ -77,15 +77,17 @@ Prepare Preconditions ) def test_preserves_context_in_single_test_case_name(self): + name = 'IOP_999_01 Scenario With Default Context' self.generate( variables='${b1_url} ${EMPTY}', setup=' No Operation', - test_name='IOP_999_01 Scenario With Default Context', + test_name=name, ) + self.assertEqual(self.generated_info['name'], name) self.assertEqual( self.generated_info['test_cases'][0]['name'], - 'IOP_999_01 Scenario With Default Context' + name ) def test_generates_mixed_context_and_data_objects(self): @@ -228,9 +230,13 @@ Prepare Preconditions user_conditions = self.generated_info['test_cases'][1]['initial_conditions'] self.assertNotIn('initial_conditions', self.generated_info) + self.assertEqual(self.generated_info['name'], 'IOP_999_01 Scenario') self.assertEqual( [test_case['name'] for test_case in self.generated_info['test_cases']], - ['IOP_999_01_01 Scenario', 'IOP_999_01_02 Scenario'] + [ + 'IOP_999_01_01 Scenario With Default Context', + 'IOP_999_01_02 Scenario With User Context', + ] ) self.assertEqual( default_conditions['pre_conditions'][0], -- GitLab From 708085c497d15a8fb993b1e878221571e520674b Mon Sep 17 00:00:00 2001 From: Marco Cavalli Date: Tue, 4 Aug 2026 16:28:07 +0200 Subject: [PATCH 34/34] fix: adjust arrow marker reference and line drawing calculations for improved rendering --- tools/interoperability_visualizer/viewer_template.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/interoperability_visualizer/viewer_template.html b/tools/interoperability_visualizer/viewer_template.html index 03a51a42..be6d8407 100644 --- a/tools/interoperability_visualizer/viewer_template.html +++ b/tools/interoperability_visualizer/viewer_template.html @@ -1188,7 +1188,7 @@ const marker = svgElement("marker", { id: `arrow-${mode.id}`, viewBox: "0 0 10 10", - refX: "9", + refX: "10", refY: "5", markerWidth: "8", markerHeight: "8", @@ -1391,8 +1391,8 @@ const uy = dy / length; const nx = -uy; const ny = ux; - const start = { x: source.x + ux * 52, y: source.y + uy * 52 }; - const end = { x: target.x - ux * 58, y: target.y - uy * 58 }; + const start = { x: source.x + ux * 48, y: source.y + uy * 48 }; + const end = { x: target.x - ux * 48, y: target.y - uy * 48 }; const control = { x: (start.x + end.x) / 2 + nx * offset, y: (start.y + end.y) / 2 + ny * offset, -- GitLab