diff --git a/README.md b/README.md index 25b3d4e38460faa7a8fcdd479dea086aa7ce4663..d09732ce8b46974a565ec1af1752356025f5e9a4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,63 @@ -# NGSI-LD Test Suite +# Quick start guide +## Install Python & PIP + +* Install Python3 by running the following command: + +```$ sudo dnf install python3``` (Ubuntu) + +```$ brew install python3``` (MacOS) + +* Confirm its installation with: + +```$ python --version``` (Ubuntu) + +```$ python3 --version``` (MacOS) + +* At this point, you can launch Python3 interpreter: + +```$ python``` (Ubuntu) + +```$ python3``` (MacOS) + +* Pip should be included by default. To confirm, run: + +```$ command -v pip``` (Ubuntu) + +```$ pip3 --version``` (MacOS) + +* In case pip is not installed, [follow the official pip installation guide](https://pip.pypa.io/en/latest/installing/). + +## Install IDE (VSCode) + +* Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux) + +* Install [Robot Framework Intellisense](https://marketplace.visualstudio.com/items?itemName=TomiTurtiainen.rf-intellisense) + +## Checkout the base project + +```$ git clone git@forge.etsi.org:cim/ngsi-ld-test-suite.git``` + +## Install the project requirements + +Browse the base project root folder and execute the following command: + +```$ python -m pip install -r requirements.txt``` (Ubuntu) + +```$ python3 -m pip install -r requirements.txt``` (MacOS) + +Further details on each library can be found in [PyPi](https://pypi.org/) and [Robot Framework Standard Libraries](http://robotframework.org/robotframework/#standard-libraries) + +## Execute the tests + +Configure the context broker URL in the resources/variables.py file + +Launch the tests with the following command: + +```$ robot --outputdir ./results .``` + +For more running instructions please consult [scripts/run_tests.sh](https://github.com/easy-global-market/isg-cim-tpdl-demo/blob/rf-demo/scripts/run_tests.sh). + +# Useful links + +* [Robot Framework User Guide](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#output-file) diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot new file mode 100644 index 0000000000000000000000000000000000000000..18e6cec857647046f77d52ff58ee11293ff012d8 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/failure.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot create a batch of entities with an invalid request +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Library RequestsLibrary +Library JSONLibrary +Library OperatingSystem + + +*** Variable *** +${batch_endpoint}= entityOperations/create +${endpoint}= entities + +*** Test Case *** +With invalid json document + [Documentation] Check that you cannot create a batch of entities with an invalid json document + [Tags] critical + + Batch Request Entities From File batch/invalid-json-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} + +With empty json document + [Documentation] Check that you cannot create a batch of entities with an empty json document + [Tags] critical + + Batch Request Entities From File batch/empty-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..4f678cb525d36ee4ec1e6f58af7c611550407638 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/fullSuccess.robot @@ -0,0 +1,76 @@ +*** Settings *** +Documentation Check that you can create a batch of entities +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +*** Variable *** +${batch_endpoint}= entityOperations/create +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of minimal entities + [Documentation] Check that you can create a batch of minimal entities + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + +Create a batch of entities having only simple properties + [Documentation] Check that you can create a batch of entities having only simple properties + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-simple-attributes-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-simple-attributes-sample.jsonld ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + +Create a batch of entities having multiple attributes + [Documentation] Check that you can create a batch of entities having multiple attributes + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} + + Batch Create Entities @{entities_to_be_created} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..db0fef6471f79a75890873ceee0a3ad3685c8c5f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/CreateBatchOfEntities/partialSuccess.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that you can create a batch of entities where some will succeed and others will fail +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/create +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Create a batch of two valid entities and one invalid entity + [Documentation] Check that you can create a batch of two valid entities and one invalid entity + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + ${already_existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} + @{entities_to_be_created}= Create List ${first_entity} ${second_entity} ${already_existing_entity} + + Batch Create Entities @{entities_to_be_created} + + @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + @{expected_failed_entities_ids}= Create List ${existing_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by Id ${existing_entity_id} + +*** Keywords *** +Setup Initial Entities + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${existing_entity_id} + Set Suite Variable ${existing_entity_id} + diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot new file mode 100644 index 0000000000000000000000000000000000000000..6ded9d0193c86fce9a2359878d85ab33ad59ed5c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/failure.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot delete a batch of entities with an invalid request +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Library RequestsLibrary +Library JSONLibrary +Library OperatingSystem + + +*** Variable *** +${batch_endpoint}= entityOperations/delete +${endpoint}= entities + +*** Test Case *** +With invalid json document + [Documentation] Check that you cannot delete a batch of entities with an invalid json document + [Tags] critical + + Batch Request Entities From File batch/invalid-json-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} + +With empty json document + [Documentation] Check that you cannot delete a batch of entities with an empty json document + [Tags] critical + + Batch Request Entities From File batch/empty-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..3e5883f3264da797adbaf642387e8206ded1377c --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/fullSuccess.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation Check that you can delete a batch of entities +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/delete +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Delete a batch of entities + [Documentation] Check that you can delete a batch of entities + [Tags] critical + + @{entities_ids_to_be_deleted}= Create List ${first_entity_id} ${second_entity_id} + + Batch Delete Entities @{entities_ids_to_be_deleted} + + Check Response Status Code Set To 204 + +*** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..5fda7423e4fbcd8037f6357efa0d6afb81a99336 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/DeleteBatchOfEntities/partialSuccess.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that you can delete a batch of entities where some will succeed and others will fail +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/delete +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Delete a batch of non existing and existing entities + [Documentation] Check that you can delete a batch of non existing and existing entities + [Tags] critical + + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + @{entities_ids_to_be_deleted}= Create List ${existing_entity_id} ${new_entity_id} + + Batch Delete Entities @{entities_ids_to_be_deleted} + + @{expected_successful_entities_ids}= Create List ${existing_entity_id} + @{expected_failed_entities_ids}= Create List ${new_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + + +*** Keywords *** +Setup Initial Entities + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${existing_entity_id} + + Set Suite Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot new file mode 100644 index 0000000000000000000000000000000000000000..1698dda2ea23b0ed5dcf3b7c70731d8843ac120f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/failure.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation Check that you cannot update a batch of entities with an invalid request +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library RequestsLibrary +Library JSONLibrary +Library OperatingSystem + +*** Variable *** +${batch_endpoint}= entityOperations/update +${endpoint}= entities + +*** Test Case *** +With invalid json document + [Documentation] Check that you cannot update a batch of entities with an invalid json document + [Tags] critical + + Batch Request Entities From File batch/invalid-json-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} + +With json-ld document not syntactically correct according to the @context + [Documentation] Check that you cannot update a batch of entities with a json-ld document not syntactically correct according to the @context + [Tags] critical + + #TODO: Use a json-ld document not syntactically correct according to the @context + Batch Request Entities From File batch/invalid-json-ld-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..19254c4c123b54b61d002f0de68c8004c1125783 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccess.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can update a batch of entities +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/update +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Update a batch of entities + [Documentation] Check that you can update a batch of entities + [Tags] critical + + ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + + Batch Update Entities @{entities_to_be_updated} + + Check Response Status Code Set To 204 + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + +*** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot new file mode 100644 index 0000000000000000000000000000000000000000..27d8601d03878b6b5d5463b900d032d55f87c81a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/fullSuccessNoOverwriteMode.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can update a batch of entities with noOverwrite option +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/update +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Update a batch of entities with noOverwrite option + [Documentation] Check that you can update a batch of entities with noOverwrite option + [Tags] critical + + ${first_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_entity_id} + @{entities_to_be_updated}= Create List ${first_entity} ${second_entity} + + Batch Update Entities @{entities_to_be_updated} overwrite_option=noOverwrite + + Check Response Status Code Set To 204 + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + +*** Keywords *** +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_entity_id} + + Set Suite Variable ${first_entity_id} + Set Suite Variable ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot new file mode 100644 index 0000000000000000000000000000000000000000..8e20824b1bd0950ce6bc9831bf8823d2d170075f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpdateBatchOfEntities/partialSuccess.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that you can update a batch of entities where some will succeed and others will fail +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/update +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Update a batch of non existing and existing entities + [Documentation] Check that you can update a batch of non existing and existing entities + [Tags] critical + + ${first_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${first_existing_entity_id} + ${second_existing_entity}= Load Entity building-relationship-of-property-sample.jsonld ${second_existing_entity_id} + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity building-relationship-of-property-sample.jsonld ${new_entity_id} + + @{entities_to_be_updated}= Create List ${first_existing_entity} ${second_existing_entity} ${new_entity} + + Batch Update Entities @{entities_to_be_updated} + + + @{expected_successful_entities_ids}= Create List ${first_existing_entity_id} ${second_existing_entity_id} + @{expected_failed_entities_ids}= Create List ${new_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_existing_entity_id} + Delete Entity by Id ${second_existing_entity_id} + +*** Keywords *** +Setup Initial Entities + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-simple-attributes-sample.jsonld ${first_existing_entity_id} + Create Entity building-simple-attributes-sample.jsonld ${second_existing_entity_id} + + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot new file mode 100644 index 0000000000000000000000000000000000000000..8eeaff7baa64e2c8abf5eff346d6fa489a11923b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/failure.robot @@ -0,0 +1,32 @@ +*** Settings *** +Documentation Check that you cannot upsert a batch of entities with an invalid request +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library RequestsLibrary +Library JSONLibrary +Library OperatingSystem + +*** Variable *** +${batch_endpoint}= entityOperations/upsert +${endpoint}= entities + +*** Test Case *** +With invalid json document + [Documentation] Check that you cannot upsert a batch of entities with an invalid json document + [Tags] critical + + Batch Request Entities From File batch/invalid-json-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} + +With json-ld document containing a null value in any of its items + [Documentation] Check that you cannot upsert a batch of entities with a json-ld document containing a null value in any of its items + [Tags] critical + + Batch Request Entities From File batch/invalid-json-ld-sample.jsonld + + Check Response Status Code Set To 400 + Check Response Body Containing Problem Details Element Containing Detail Element ${response} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot new file mode 100644 index 0000000000000000000000000000000000000000..eee757008da7f3593ed36de87885a73108602472 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceMode.robot @@ -0,0 +1,69 @@ +*** Settings *** +Documentation Check that you can upsert a batch of entities +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/upsert +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Upsert a batch of non existing entities + [Documentation] Check that you can upsert a batch of non existing entities + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} + + Batch Upsert Entities @{entities_to_be_upserted} + + @{expected_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + +Upsert a batch of non existing and existing entities + [Documentation] Check that you can upsert a batch of non existing and existing entities + [Tags] critical + + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} + ${first_existing_entity}= Load Entity building-minimal-sample.jsonld ${first_existing_entity_id} + ${second_existing_entity}= Load Entity building-minimal-sample.jsonld ${second_existing_entity_id} + @{entities_to_be_upserted}= Create List ${new_entity} ${first_existing_entity} ${second_existing_entity} + + Batch Upsert Entities @{entities_to_be_upserted} + + @{expected_entities_ids}= Create List ${new_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${new_entity_id} + Delete Entity by Id ${first_existing_entity_id} + Delete Entity by Id ${second_existing_entity_id} + +*** Keywords *** +Setup Initial Entities + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} + Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot new file mode 100644 index 0000000000000000000000000000000000000000..a4f14d3d81073cac1613f65542077daa5131cdb1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessReplaceModeAllUpdated.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can upsert a batch of existing entities and they will be replaced +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/upsert +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Upsert a batch of existing entities + [Documentation] Check that you can upsert a batch of existing entities + [Tags] critical + + ${first_existing_entity}= Load Entity building-minimal-sample.jsonld ${first_existing_entity_id} + ${second_existing_entity}= Load Entity building-minimal-sample.jsonld ${second_existing_entity_id} + @{entities_to_be_upserted}= Create List ${first_existing_entity} ${second_existing_entity} + + Batch Upsert Entities @{entities_to_be_upserted} + + Check Response Status Code Set To 204 + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_existing_entity_id} + Delete Entity by Id ${second_existing_entity_id} + +*** Keywords *** +Setup Initial Entities + ${first_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${first_existing_entity_id} + Create Entity building-minimal-sample.jsonld ${second_existing_entity_id} + + Set Suite Variable ${first_existing_entity_id} + Set Suite Variable ${second_existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot new file mode 100644 index 0000000000000000000000000000000000000000..a6ff832246899d332a11b5e3b69bf1d2345d9d45 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/fullSuccessUpdateMode.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can upsert a batch of entities with update option +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +Suite Setup Setup Initial Entities + +*** Variable *** +${batch_endpoint}= entityOperations/upsert +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Upsert a batch of entities with update option + [Documentation] Check that you can upsert a batch of entities with update option + [Tags] critical + + ${new_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${new_entity}= Load Entity building-minimal-sample.jsonld ${new_entity_id} + ${existing_entity}= Load Entity building-minimal-sample.jsonld ${existing_entity_id} + @{entities_to_be_upserted}= Create List ${new_entity} ${existing_entity} + + Batch Upsert Entities @{entities_to_be_upserted} update_option=update + + @{expected_entities_ids}= Create List ${new_entity_id} + Check Response Status Code Set To 201 + Check Response Body Containing Array Of URIs set to @{expected_entities_ids} + + #TODO call Batch Delete Entities + Delete Entity by Id ${new_entity_id} + Delete Entity by Id ${existing_entity_id} + +*** Keywords *** +Setup Initial Entities + ${existing_entity_id}= Generate Random Entity Id ${building_id_prefix} + Create Entity building-minimal-sample.jsonld ${existing_entity_id} + + Set Suite Variable ${existing_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot new file mode 100644 index 0000000000000000000000000000000000000000..73e4d2515ea5505851327cafcef2c42eb5bdcf97 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/BatchEntities/UpsertBatchOfEntities/partialSucess.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that you can upsert a batch of entities where some will succeed and others will fail +Variables ../../../../../../resources/variables.py +Resource ../../../../../../resources/ApiUtils.resource +Resource ../../../../../../resources/AssertionUtils.resource +Resource ../../../../../../resources/JsonUtils.resource +Library REST ${url} +Library JSONLibrary +Library String +Library Collections + +*** Variable *** +${batch_endpoint}= entityOperations/upsert +${endpoint}= entities +${building_id_prefix}= urn:ngsi-ld:Building: + +*** Test Case *** +Upsert a batch of two valid entities and one invalid entity + [Documentation] Check that you can upsert a batch of two valid entities and one invalid entity + [Tags] critical + + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + ${first_entity}= Load Entity building-minimal-sample.jsonld ${first_entity_id} + ${second_entity}= Load Entity building-minimal-sample.jsonld ${second_entity_id} + ${third_entity}= Load Entity building-minimal-sample.jsonld ${third_entity_id} + ${invalid_entity}= Remove Entity Type ${third_entity} + + @{entities_to_be_upserted}= Create List ${first_entity} ${second_entity} ${invalid_entity} + + Batch Upsert Entities @{entities_to_be_upserted} + + @{expected_successful_entities_ids}= Create List ${first_entity_id} ${second_entity_id} + @{expected_failed_entities_ids}= Create List ${third_entity_id} + &{expected_batch_operation_result}= Create Batch Operation Result ${expected_successful_entities_ids} ${expected_failed_entities_ids} + Check Response Status Code Set To 207 + Check Response Body Containing Batch Operation Result ${expected_batch_operation_result} + + #TODO call Batch Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot new file mode 100644 index 0000000000000000000000000000000000000000..8541357748d8e4056c6a8b5a065fc8de9422878d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/AlreadyExists.robot @@ -0,0 +1,50 @@ +*** Settings *** +Documentation Check that the IUT refuses to create an entity if one exists with the same identifier +Variables ../../../../../../resources/variables.py +#Resource ../../../../../../resources/ApiUtils.resource +Library REST ${url} +Library JSONSchemaLibrary ${EXECDIR}/schemas +Library BuiltIn + +#Suite Setup Create Entity building-minimal.jsonld +#Suite Teardown Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + +*** Variable *** +${endpoint}= entities + +*** Test Case *** +AlreadyExists + [Documentation] Check that the IUT refuses to create an entity if one exists with the same identifier + [Tags] critical + Create Entity building-minimal.jsonld + Create Entity building-minimal.jsonld + Check HTTP Status Code Is 409 + Check HTTP Response Body Json Schema Is error_response + Delete Entity by Id urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + +*** Keywords *** +Create Entity + [Arguments] ${filename} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Check HTTP Status Code Is + [Arguments] ${status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${status} + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema}= Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + +Delete Entity by Id + [Arguments] ${id} + ${response}= DELETE ${endpoint}/${id} + Output request + Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot new file mode 100644 index 0000000000000000000000000000000000000000..d4a31dd4fd3ea9b2174240ccb0b1662ca7d13be5 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases-datadriven.robot @@ -0,0 +1,41 @@ +*** Settings *** +Documentation Check that the IUT accepts the creation of an entity +Variables ../../../../../../resources/variables.py +Library REST ${url} +Library JSONSchemaLibrary ${EXECDIR}/schemas + +Test Template Create Entity Scenarios + +*** Variable *** +${endpoint}= entities +${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + +*** Test Cases *** FILENAME +SuccessCases_MinimalEntity building-minimal.jsonld +SuccessCases_EntityWithSimpleProperties building-simple-attributes.jsonld + +*** Keywords *** +Create Entity Scenarios + [Arguments] ${filename} + Create Entity ${filename} + Check HTTP Status Code Is 201 + Delete Entity by Id ${id} + +Create Entity + [Arguments] ${filename} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Check HTTP Status Code Is + [Arguments] ${status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${status} + +Delete Entity by Id + [Arguments] ${id} + ${response}= DELETE ${endpoint}/${id} + Output request + Output response \ No newline at end of file diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot new file mode 100644 index 0000000000000000000000000000000000000000..35b647ab2b94837b292226e4746305632ef2b987 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that the IUT accepts the creation of an entity +Variables ../../../../../../resources/variables.py +#Resource ../../../../../../resources/ApiUtils.resource +Library REST ${url} + +*** Variable *** +${endpoint}= entities +${id}= urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + +*** Test Case *** +SuccessCases_MinimalEntity + [Documentation] Create an entity with a JSON-LD payload containing the minimal information + [Tags] critical + Create Entity building-minimal.jsonld + Check HTTP Status Code Is 201 + Delete Entity by Id ${id} + +SuccessCases_EntityWithSimpleProperties + [Documentation] Create an entity with a JSON-LD payload containing only simple properties + Create Entity building-simple-attributes.jsonld + Check HTTP Status Code Is 201 + Delete Entity by Id ${id} + + +*** Keywords *** +Create Entity + [Arguments] ${filename} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${EXECDIR}/data/entities/${filename} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Check HTTP Status Code Is + [Arguments] ${status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${status} + +Delete Entity by Id + [Arguments] ${id} + ${response}= DELETE ${endpoint}/${id} + Output request + Output response diff --git a/data/entities/batch/empty-sample.jsonld b/data/entities/batch/empty-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..0637a088a01e8ddab3bf3fa98dbe804cbde1a0dc --- /dev/null +++ b/data/entities/batch/empty-sample.jsonld @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/data/entities/batch/invalid-json-ld-sample.jsonld b/data/entities/batch/invalid-json-ld-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..1efd7f18053bc4744754c2619bf88dfbc698a047 --- /dev/null +++ b/data/entities/batch/invalid-json-ld-sample.jsonld @@ -0,0 +1,14 @@ +[ + { + "id":"urn:ngsi-ld:Building:randomUUID", + "type":"Building", + "name":{ + "type":"Property", + "value":null + }, + "@context":[ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/data/entities/batch/invalid-json-sample.jsonld b/data/entities/batch/invalid-json-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..dcbdb010b6149a81bca30da6d7af54953560ba81 --- /dev/null +++ b/data/entities/batch/invalid-json-sample.jsonld @@ -0,0 +1,10 @@ +[ + { + "id":"urn:ngsi-ld:Building:randomUUID",, + "type":"Building", + "@context":[ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + } +] \ No newline at end of file diff --git a/data/entities/building-location-attribute.jsonld b/data/entities/building-location-attribute.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..864d122eee3ac8df2d566b2ea75682080e003139 --- /dev/null +++ b/data/entities/building-location-attribute.jsonld @@ -0,0 +1,23 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.3986, 52.5547] + } + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-minimal-sample.jsonld b/data/entities/building-minimal-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..7034854b49363bc6292734956e2cf8bff6875d48 --- /dev/null +++ b/data/entities/building-minimal-sample.jsonld @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-minimal.jsonld b/data/entities/building-minimal.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..23fadf8a259fbceede20b91b522271b6ad4dd18c --- /dev/null +++ b/data/entities/building-minimal.jsonld @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-relationship-of-property-sample.jsonld b/data/entities/building-relationship-of-property-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..2becbdb451c2084b392db94459e4db46bd972880 --- /dev/null +++ b/data/entities/building-relationship-of-property-sample.jsonld @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z", + "hasWeatherObserved": { + "type": "Relationship", + "object": "urn:ngsi-ld:Sensor:43a1af27-4aa7-44fe-bee9-fe76d56978a4" + } + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-relationship-sample.jsonld b/data/entities/building-relationship-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..5c6a14807439993820bbc4f4526e2c78d2191749 --- /dev/null +++ b/data/entities/building-relationship-sample.jsonld @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-relationship.jsonld b/data/entities/building-relationship.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..ec4bb68b39b2d310058fc951b51b2cdbf292979a --- /dev/null +++ b/data/entities/building-relationship.jsonld @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "locatedAt": { + "type": "Relationship", + "object": "urn:ngsi-ld:City:Paris" + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-simple-attributes-sample.jsonld b/data/entities/building-simple-attributes-sample.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..4d88363d70117f782d61c1ef5b89395f71501958 --- /dev/null +++ b/data/entities/building-simple-attributes-sample.jsonld @@ -0,0 +1,26 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-simple-attributes.jsonld b/data/entities/building-simple-attributes.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..bc3dd7959a5683a2a1a0ec04ab8eaf24ba29b93e --- /dev/null +++ b/data/entities/building-simple-attributes.jsonld @@ -0,0 +1,26 @@ +{ + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": ["tourism"] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] +} \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..6a311f15a15cf307198a724dcc4507ba46ef8e90 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +robotframework==3.2.1 +RESTinstance==1.0.2 +robotframework-jsonschemalibrary==1.0 +robotframework-jsonlibrary==0.3.1 +robotframework-requests==0.7.0 \ No newline at end of file diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource new file mode 100644 index 0000000000000000000000000000000000000000..8c438520b45aeda42b6b17c4918b1b0344429fd7 --- /dev/null +++ b/resources/ApiUtils.resource @@ -0,0 +1,88 @@ +*** Settings *** +Variables ./variables.py + +Library REST ${url} + +*** Variables *** +${response} + +*** Keywords *** +Api POST request + [Arguments] ${api path} ${header} ${body} + ${response} POST ${api path}/ headers=${header} body=${body} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Api GET request + [Arguments] ${api path} ${header} + ${response} GET ${api path} headers=${header} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Api DEL request + [Arguments] ${header} ${api path} + ${response} DEL ${api path} headers=${header} + Output request + Output response + Output Schema + Set Test Variable ${response} + +Delete Entity by Id + [Arguments] ${id} + ${response}= DELETE ${endpoint}/${id} + Output request + Output response + +Create Entity + [Arguments] ${filename} ${entity_id} + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${filename} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${endpoint} body=${entity} headers=${headers} + Output request + Output response + +Batch Create Entities + [Arguments] @{entities_to_be_created} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${batch_endpoint} body=@{entities_to_be_created} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Upsert Entities + [Arguments] @{entities_to_be_upserted} ${update_option}=replace + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${batch_endpoint}?options=${update_option} body=@{entities_to_be_upserted} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Update Entities + [Arguments] @{entities_to_be_updated} ${overwrite_option}=overwrite + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${batch_endpoint}?options=${overwrite_option} body=@{entities_to_be_updated} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Delete Entities + [Arguments] @{entities_ids_to_be_deleted} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST ${batch_endpoint} body=@{entities_ids_to_be_deleted} headers=${headers} + Output request + Output response + Set Test Variable ${response} + +Batch Request Entities From File + [Arguments] ${filename} + ${file_content}= Get File ${EXECDIR}/data/entities/${filename} + Create Session BatchRequest ${url} + &{headers}= Create Dictionary Content-Type=application/ld+json + ${response}= POST Request BatchRequest ${batch_endpoint} data=${file_content} headers=${headers} + Set Test Variable ${response} ${response.json()} diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource new file mode 100644 index 0000000000000000000000000000000000000000..ab8faf9950f69ef663d223c40890c274d86578f8 --- /dev/null +++ b/resources/AssertionUtils.resource @@ -0,0 +1,59 @@ +*** Keywords *** +Check Response Status Code Set To + [Arguments] ${expected_status} + ${response_status}= convert to string ${response['status']} + Should Be Equal ${response_status} ${expected_status} + +Check Response Body Containing Array Of URIs set to + [Arguments] @{expected_entities_ids} + Lists Should Be Equal ${expected_entities_ids} ${response['body']} ignore_order=True + +Check Response Body Containing Batch Operation Result + [Arguments] ${expected_batch_operation_result} + @{expected_successful_entities_ids}= Get From Dictionary ${expected_batch_operation_result} success + @{expected_failed_entities_ids}= Get From Dictionary ${expected_batch_operation_result} errors + @{response_errors}= Get From Dictionary ${response['body']} errors + + ${expected_failed_entities_ids_length}= Get Length ${expected_failed_entities_ids} + ${response_errors_length}= Get Length ${response_errors} + + Lists Should Be Equal ${expected_successful_entities_ids} ${response['body']['success']} ignore_order=True + Should be Equal as Integers ${expected_failed_entities_ids_length} ${response_errors_length} + FOR ${response_error} IN @{response_errors} + List Should Contain Value ${expected_failed_entities_ids} ${response_error['entityId']} + Should Not Be Empty ${response_error['error']} + END + +Check Response Body Containing Problem Details Element Containing Detail Element + [Arguments] ${response_body} + Should Not Be Empty ${response_body['detail']} + +Assert response status code + [Arguments] ${code} + Should Be Equal ${response}[status] ${code} + +Check HTTP Response Status Code Is + [Arguments] ${expected_status} + ${status}= Convert To Integer ${expected_status} + Console + Should Be Equal ${response['status']} ${status} + Log Status code validated + +Check HTTP Response Body Json Schema Is + [Arguments] ${input} + Should Contain ${response['headers']['Content-Type']} application/json + ${schema} = Catenate SEPARATOR= ${input} .schema.json + Validate Json ${schema} ${response['body']} + Log Json Schema Validation OK + +Should Be Present In Json List + [Arguments] ${expr} ${json_field} ${json_value} + Log Check if ${json_field} is present in ${expr} with the value ${jsonvalue} + :FOR ${item} IN @{expr} + \ Exit For Loop If "${item['${json_field}']}" == "${json_value}" + Log Item found ${item} + [return] ${item} + +Check Result Contains + [Arguments] ${source} ${parameter} ${value} + Should Be Present In Json List ${source} ${parameter} ${value} \ No newline at end of file diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource new file mode 100644 index 0000000000000000000000000000000000000000..cda79d17cdda37c8e9f6d7931d8d991dee3c01e4 --- /dev/null +++ b/resources/JsonUtils.resource @@ -0,0 +1,30 @@ +*** Keywords *** +Load Entity + [Arguments] ${entity_file_name} ${entity_id} + + ${entity_payload}= Load Json From File ${EXECDIR}/data/entities/${entity_file_name} + ${entity}= Update Value To Json ${entity_payload} $..id ${entity_id} + + [return] ${entity} + +Remove Entity Type + [Arguments] ${entity} + + ${invalid_entity}= Delete Object From Json ${entity} $..type + + [return] ${invalid_entity} + +Generate Random Entity Id + [Arguments] ${id_prefix} + + ${random_id}= Generate Random String 16 [NUMBERS] + ${entity_id}= Catenate ${id_prefix}${random_id} + + [return] ${entity_id} + +Create Batch Operation Result + [Arguments] ${success} ${errors} + + &{batch_operation_result}= Create Dictionary success=${success} errors=${errors} + + [return] &{batch_operation_result} \ No newline at end of file diff --git a/resources/__pycache__/variables.cpython-37.pyc b/resources/__pycache__/variables.cpython-37.pyc new file mode 100644 index 0000000000000000000000000000000000000000..96f03c4e89ef1ad187891feb2553e9f1b1e4f9a6 Binary files /dev/null and b/resources/__pycache__/variables.cpython-37.pyc differ diff --git a/resources/__pycache__/variables.cpython-38.pyc b/resources/__pycache__/variables.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab03eeb393dba98563c96965a3aa31d68144baca Binary files /dev/null and b/resources/__pycache__/variables.cpython-38.pyc differ diff --git a/resources/variables.py b/resources/variables.py new file mode 100644 index 0000000000000000000000000000000000000000..b2ae5498d6533e6b8c80d5c77302ce416e328549 --- /dev/null +++ b/resources/variables.py @@ -0,0 +1,5 @@ +def get_variables(arg=None): + variables = { + 'url': 'http://10.5.1.214:9090/ngsi-ld/v1' + } + return variables diff --git a/results/log.html b/results/log.html new file mode 100644 index 0000000000000000000000000000000000000000..44f05930b4dbf14e0f1c8a8d17fd8dab620b3ba3 --- /dev/null +++ b/results/log.html @@ -0,0 +1,2137 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/results/output.xml b/results/output.xml new file mode 100644 index 0000000000000000000000000000000000000000..27b67026266f1dae58f0a66a99684f002dc02017 --- /dev/null +++ b/results/output.xml @@ -0,0 +1,1509 @@ + + + + + + + + + + + + + +building-minimal.jsonld + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.157198, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:50 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:51.029286+00:00", + "local": "2020-09-25T13:50:51.029286+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.157198, + "status": 201, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:50 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.157198, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:50 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... + + + + + + +building-minimal.jsonld + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.509346, 'status': 409, 'body': {'detail': 'Already Exists', 'type': 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists', 'title': 'The referred element already exists'}, 'headers': {'Ser... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:51.618156+00:00", + "local": "2020-09-25T13:50:51.618156+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.509346, + "status": 409, + "body": { + "detail": "Already Exists", + "type": "https://uri.etsi.org/ngsi-ld/errors/AlreadyExists", + "title": "The referred element already exists" + }, + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:51 GMT", + "Content-Type": "application/json", + "Content-Length": "132", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.509346, 'status': 409, 'body': {'detail': 'Already Exists', 'type': 'https://uri.etsi.org/ngsi-ld/errors/AlreadyExists', 'title': 'The referred element already exists'}, 'headers': {'Ser... + + + + + + +409 + + +Converts the given item to a Unicode string. + +${response['status']} + + +${response_status} + +${response_status} = 409 + + + +Fails if the given objects are unequal. + +${response_status} +${status} + + + + + + + +error_response + + +Fails if ``container`` does not contain ``item`` one or more times. + +${response['headers']['Content-Type']} +application/json + + + + +Catenates the given items together and returns the resulted string. + +SEPARATOR= +${input} +.schema.json + + +${schema} + +${schema} = error_response.schema.json + + + +Validates the sample JSON against the given schema. + +${schema} +${response['body']} + + + + +Logs the given message with the given level. + +Json Schema Validation OK + +Json Schema Validation OK + + + + + + +urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9 + + +Creates and returns a dictionary based on the given ``items``. + +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... + + + + +http + +*Sends a DELETE request to the endpoint.* + +${endpoint}/${id} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.650642, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:53 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "DELETE", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "query": {}, + "body": null, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:53.353383+00:00", + "local": "2020-09-25T13:50:53.353383+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.650642, + "status": 204, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:53 GMT", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + + +Check that the IUT refuses to create an entity if one exists with the same identifier + +critical + + + +Check that the IUT refuses to create an entity if one exists with the same identifier + + + + + + +building-minimal.jsonld + + + +${filename} + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.7107, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld/v... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:54.157780+00:00", + "local": "2020-09-25T13:50:54.157780+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.7107, + "status": 201, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:54 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.7107, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld/v... + + + + + + +201 + + +Converts the given item to a Unicode string. + +${response['status']} + + +${response_status} + +${response_status} = 201 + + + +Fails if the given objects are unequal. + +${response_status} +${status} + + + + + + + +${id} + + +Creates and returns a dictionary based on the given ``items``. + +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... + + + + +http + +*Sends a DELETE request to the endpoint.* + +${endpoint}/${id} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.359526, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:54 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "DELETE", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "query": {}, + "body": null, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:54.591366+00:00", + "local": "2020-09-25T13:50:54.591366+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.359526, + "status": 204, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:54 GMT", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + + + + + + + + + +building-simple-attributes.jsonld + + + +${filename} + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.805437, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": [ + "tourism" + ] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:55.461312+00:00", + "local": "2020-09-25T13:50:55.461312+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.805437, + "status": 201, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:55 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.805437, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location': '/ngsi-ld... + + + + + + +201 + + +Converts the given item to a Unicode string. + +${response['status']} + + +${response_status} + +${response_status} = 201 + + + +Fails if the given objects are unequal. + +${response_status} +${status} + + + + + + + +${id} + + +Creates and returns a dictionary based on the given ``items``. + +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... + + + + +http + +*Sends a DELETE request to the endpoint.* + +${endpoint}/${id} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.349996, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:55 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "DELETE", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "query": {}, + "body": null, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:55.862031+00:00", + "local": "2020-09-25T13:50:55.862031+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.349996, + "status": 204, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:55 GMT", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + + + + + + +Check that the IUT accepts the creation of an entity + + + + + + +building-minimal.jsonld + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.6256670000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:56.588451+00:00", + "local": "2020-09-25T13:50:56.588451+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.6256670000000001, + "status": 201, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:56 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.6256670000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... + + + + + + +201 + + +Converts the given item to a Unicode string. + +${response['status']} + + +${response_status} + +${response_status} = 201 + + + +Fails if the given objects are unequal. + +${response_status} +${status} + + + + + + + +${id} + + +Creates and returns a dictionary based on the given ``items``. + +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... + + + + +http + +*Sends a DELETE request to the endpoint.* + +${endpoint}/${id} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.338409, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:56 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-store, max-ag... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "DELETE", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "query": {}, + "body": null, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:56.975523+00:00", + "local": "2020-09-25T13:50:56.975523+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.338409, + "status": 204, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:56 GMT", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + + +Create an entity with a JSON-LD payload containing the minimal information + +critical + + + + + + +building-simple-attributes.jsonld + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/ld+json +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { Content-Type=application/ld+json | authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdC... + + + + +http + +*Sends a POST request to the endpoint.* + +${endpoint} +body=/home/poliveira/git/isg-cim-tpdl-demo/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/data/${filename} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.7369450000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:57 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "POST", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities", + "query": {}, + "body": { + "id": "urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "subCategory": { + "type": "Property", + "value": [ + "tourism" + ] + }, + "airQualityLevel": { + "type": "Property", + "value": 4, + "unitCode": "C62", + "observedAt": "2020-09-09T16:40:00.000Z" + }, + "almostFull": { + "type": "Property", + "value": false + }, + "@context": [ + "https://fiware.github.io/data-models/context.jsonld", + "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld" + ] + }, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/ld+json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:57.757931+00:00", + "local": "2020-09-25T13:50:57.757931+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.7369450000000001, + "status": 201, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:57 GMT", + "Content-Length": "0", + "Connection": "keep-alive", + "Location": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + +Makes a variable available everywhere within the scope of the current test. + +${response} + +${response} = {'seconds': 0.7369450000000001, 'status': 201, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:57 GMT', 'Content-Length': '0', 'Connection': 'keep-alive', 'Location':... + + + + + + +201 + + +Converts the given item to a Unicode string. + +${response['status']} + + +${response_status} + +${response_status} = 201 + + + +Fails if the given objects are unequal. + +${response_status} +${status} + + + + + + + +${id} + + +Creates and returns a dictionary based on the given ``items``. + +authorization=Bearer ${token} + + +&{headers} + +&{headers} = { authorization=Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1Z... + + + + +http + +*Sends a DELETE request to the endpoint.* + +${endpoint}/${id} +headers=${headers} + + +${response} + +${response} = {'seconds': 0.29047500000000004, 'status': 204, 'body': '', 'headers': {'Server': 'nginx/1.14.2', 'Date': 'Fri, 25 Sep 2020 12:50:58 GMT', 'Connection': 'keep-alive', 'Cache-Control': 'no-cache, no-st... + + + + +I/O + +*Outputs JSON to terminal or a file.* + +request + + +{ + "method": "DELETE", + "url": "https://stellio-dev.eglobalmark.com/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "scheme": "https", + "netloc": "stellio-dev.eglobalmark.com", + "path": "/ngsi-ld/v1/entities/urn:ngsi-ld:Building:3009ef20-9f62-41f5-bd66-92f041b428b9", + "query": {}, + "body": null, + "headers": { + "Accept": "application/json, */*", + "Content-Type": "application/json", + "User-Agent": "RESTinstance/1.0.2", + "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIS0xvcnlIcDN6VHlOY0EtNWYwQ19iVC1hbm5ldDFLSUhFT0U1VnN1NjRrIn0.eyJleHAiOjE2MDE4OTk1ODQsImlhdCI6MTYwMTAzNTU4NCwianRpIjoiMWM1OWM1ZGEtOTJiYy00YzlmLThjNzAtNmJjYjllMTVhNWE1IiwiaXNzIjoiaHR0cHM6Ly9zc28uZWdsb2JhbG1hcmsuY29tL2F1dGgvcmVhbG1zL3N0ZWxsaW8tZGV2IiwiYXVkIjoiYWNjb3VudCIsInN1YiI6ImYzZmVlOWFkLWI3NzItNDFmMy05ZmVmLTNhODIxODI3OTUwMyIsInR5cCI6IkJlYXJlciIsImF6cCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJzZXNzaW9uX3N0YXRlIjoiNDE0OWMwNzctNjMyOS00ODEzLTg1ZmItZGIwYTU1OGI5ZDcyIiwiYWNyIjoiMSIsInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJzdGVsbGlvLWNyZWF0b3IiLCJvZmZsaW5lX2FjY2VzcyIsInVtYV9hdXRob3JpemF0aW9uIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnsidHRmLWNpbS11Yml3aGVyZSI6eyJyb2xlcyI6WyJ1bWFfcHJvdGVjdGlvbiJdfSwiYWNjb3VudCI6eyJyb2xlcyI6WyJtYW5hZ2UtYWNjb3VudCIsIm1hbmFnZS1hY2NvdW50LWxpbmtzIiwidmlldy1wcm9maWxlIl19fSwic2NvcGUiOiJwcm9maWxlIGVtYWlsIiwiZW1haWxfdmVyaWZpZWQiOmZhbHNlLCJjbGllbnRJZCI6InR0Zi1jaW0tdWJpd2hlcmUiLCJjbGllbnRIb3N0IjoiMTAuNS4xLjEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJzZXJ2aWNlLWFjY291bnQtdHRmLWNpbS11Yml3aGVyZSIsImNsaWVudEFkZHJlc3MiOiIxMC41LjEuMSJ9.hVeuUUmH7jJ6h1Bj6voYzaE-513JMU5VNnjU5Fm1oQWkz2b9jElofSE_PB--JAVdk54hGuS9U_rD68Xwg-YHxkNeaGPyhZYXuiEwu9R7l4EApKDgqabNM_o_KO-jZjXlVLarym8Kz4Ucfp3F4AJ2DnLGKFhAUV4poTZV4s8LVXXboSHBFqRpKICPP_NkGwUxflDHwLi1Di5gEFU4EnFDJq5snSEug9YPlmHFyhXAFajqa25DFc1Qd2PwqIVBn37NTFhqq_vn8QeJZj3XS8kn2A_WrwggqnXWpoWUp_rXFLEs8kYlhibBGwDLImQlP1KUmMASCn9dwnCUzcWzPInRzQ" + }, + "proxies": {}, + "timeout": [ + null, + null + ], + "cert": null, + "sslVerify": true, + "allowRedirects": true, + "timestamp": { + "utc": "2020-09-25T12:50:58.109191+00:00", + "local": "2020-09-25T13:50:58.109191+01:00" + } +} + + + + +I/O + +*Outputs JSON to terminal or a file.* + +response + + +{ + "seconds": 0.29047500000000004, + "status": 204, + "body": "", + "headers": { + "Server": "nginx/1.14.2", + "Date": "Fri, 25 Sep 2020 12:50:58 GMT", + "Connection": "keep-alive", + "Cache-Control": "no-cache, no-store, max-age=0, must-revalidate", + "Pragma": "no-cache", + "Expires": "0", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + "X-XSS-Protection": "1 ; mode=block", + "Referrer-Policy": "no-referrer", + "Strict-Transport-Security": "max-age=31536000" + } +} + + + + +Create an entity with a JSON-LD payload containing only simple properties + + +Check that the IUT accepts the creation of an entity + + + + + + + + + + + + + + + + + + +Critical Tests +All Tests + + +critical + + +Isg-Cim-Tpdl-Demo +Isg-Cim-Tpdl-Demo.TP +Isg-Cim-Tpdl-Demo.TP.NGSI-LD +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.AlreadyExists +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.SuccessCases-datadriven +Isg-Cim-Tpdl-Demo.TP.NGSI-LD.ContextInformation.Provision.Entities.CreateEntity.SuccessCases + + + + + diff --git a/results/report.html b/results/report.html new file mode 100644 index 0000000000000000000000000000000000000000..f1f3c2cf4108138a4386159653850a026e24a6fa --- /dev/null +++ b/results/report.html @@ -0,0 +1,2434 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/schemas/error_response.schema.json b/schemas/error_response.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..56b64635e1ac4479d684b0539d3ae1ecaa696d6e --- /dev/null +++ b/schemas/error_response.schema.json @@ -0,0 +1,7 @@ +{ + "required": [ + "detail", + "type", + "title" + ] +} diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh new file mode 100755 index 0000000000000000000000000000000000000000..7a678f8603630af82bcbd2dd630c1efcd83ba002 --- /dev/null +++ b/scripts/run_tests.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +#run all tests +robot --outputdir ./results . + +#run all tests with base url overriden +#robot --variable url:"URL_HERE" --outputdir ./results . + +#specify which tests are critical +#robot --critical critical --outputdir ./results . + +#run by specific tag(s) +#robot --include critical --outputdir ./results . + +#run specific test suite +#robot --outputdir ./results ./TP/NGSI-LD/ContextInformation +#robot --outputdir ./results ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot + +#run specific test case +#robot --outputdir ./results -t "SuccessCases_MinimalEntity" +#robot --outputdir ./results -t "SuccessCases_MinimalEntity" ./TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/SuccessCases.robot + +#rerun failed tests +#robot --rerunfailedsuites ./results/output.xml --outputdir ./results . + +#stop the suite after a failed test +robot --exitonfailure --outputdir ./results .