diff --git a/README.md b/README.md index 45f30139462d200b94c154e4f32f5902f56c0ff6..3c0126f67e6b7635268eff42393d99249717b138 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ * Confirm its installation with: -```$ python --version``` (Ubuntu) +```$ python3 --version``` (Ubuntu) ```$ python3 --version``` (MacOS) * At this point, you can launch Python3 interpreter: -```$ python``` (Ubuntu) +```$ python3``` (Ubuntu) ```$ python3``` (MacOS) @@ -28,6 +28,15 @@ * In case pip is not installed, [follow the official pip installation guide](https://pip.pypa.io/en/latest/installing/). +## Install IDE (PyCharm) + +* Install [PyCharm](https://www.jetbrains.com/fr-fr/pycharm/download) + +* Install [Robot Framework Language Server](https://plugins.jetbrains.com/plugin/16086-robot-framework-language-server) + +* Define as variable the path of the working directory: in Settings > Languages & Frameworks > Robot Framework (Project), +insert the following: `{"EXECDIR": "{path}/auth-test-suite"}` + ## Install IDE (VSCode) * Install [Visual Studio Code](https://code.visualstudio.com/docs/setup/linux) @@ -41,14 +50,16 @@ ## Configure the environment In the `resources/variables.py` file, configure the following: -* URL of the context broker under test (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1) -* Notification server host and port (an address accessible from the context broker) +* `url` : It is the url of the context broker which is to be tested (including the `ngsi-ld/v1` path, e.g., http://localhost:8080/ngsi-ld/v1). +* `notification_server_host` and `notification_server_port` : This is the address and port used to create the local server to listen to notifications (the address must be accessible by the context broker). +* `send_notification_server_host` and `send_notification_server_port` : This is the address and port used when creating the subscription on the context broker (generally it is the same information as `notification_server_host` and `notification_server_port`). +* `context_source_host` and `context_source_port` : The address and port used for the context source. ## 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``` (Ubuntu) ```$ python3 -m pip install -r requirements.txt``` (MacOS) diff --git a/resources/ApiUtils.resource b/resources/ApiUtils.resource index e4e35282a6fe33ba80b661168890af0d46dc431e..fe594ea9202ca112f016bea79d10a3ea584aded5 100755 --- a/resources/ApiUtils.resource +++ b/resources/ApiUtils.resource @@ -5,6 +5,7 @@ Library REST ${url} Library RequestsLibrary Library OperatingSystem Library Collections +Library JSONLibrary *** Variables *** ${BATCH_CREATE_ENDPOINT_PATH} entityOperations/create diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 5a422f3b2c95de945f0d7324c54caff260b0522c..5f60fae0a8cca47ba49d51fa5a727ce8d141dee4 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -1,5 +1,10 @@ *** Settings *** Library ${EXECDIR}/libraries/assertionUtils.py +Library RequestsLibrary +Library Collections +Library JSONLibrary +Library REST +Library String *** Variable *** ${id_regex_expr}= root\\['id'\\] diff --git a/resources/JsonUtils.resource b/resources/JsonUtils.resource index 726f3bd379828c4c16df70b9e201668f0935b8dd..0617a81647b23e091a9f61985a23cea233ce79f1 100644 --- a/resources/JsonUtils.resource +++ b/resources/JsonUtils.resource @@ -2,6 +2,7 @@ Library String Library DateTime Library JSONLibrary +Variables ${EXECDIR}/resources/variables.py *** Variable *** ${date_format}= %Y-%m-%dT%H:%M:%SZ diff --git a/resources/MockServerUtils.resource b/resources/MockServerUtils.resource index fa46cdd3614f3d0b547b2110f157c540099f62ff..8290f67d6af5208d01701a6f4737d58bab585eb9 100644 --- a/resources/MockServerUtils.resource +++ b/resources/MockServerUtils.resource @@ -1,6 +1,7 @@ *** Settings *** Documentation Mock http server for subscriber Library HttpCtrl.Server +Variables ${EXECDIR}/resources/variables.py *** Keywords *** Start Context Source Mock Server diff --git a/resources/NotificationUtils.resource b/resources/NotificationUtils.resource index f12791b9b381a3740344fbd825db7b2d123f207f..43af2820d4e8a2fb4faa163226bf5332ef2dbf15 100644 --- a/resources/NotificationUtils.resource +++ b/resources/NotificationUtils.resource @@ -5,13 +5,13 @@ Library Collections Library HttpCtrl.Server Library ${EXECDIR}/libraries/assertionUtils.py Library ${EXECDIR}/libraries/dateTimeUtils.py +Variables ${EXECDIR}/resources/variables.py *** Variable *** ${notification_type}= ContextSource Notfication ${date_format}= %Y-%m-%dT%H:%M:%SZ ${date_format_with_millis}= %Y-%m-%dT%H:%M:%S.%fZ - *** Keywords *** Start Local Server [Arguments] ${host}=${notification_server_host} ${port}=${notification_server_port} diff --git a/resources/variables.py b/resources/variables.py index f24138c4ee655249db4b9e66af67c97996ec275b..f0c933b8e5528cd7b0fea055c0ed0fd1ac722f4c 100644 --- a/resources/variables.py +++ b/resources/variables.py @@ -1,13 +1,8 @@ -def get_variables(arg=None): - variables = { - 'url': 'localhost:8080/ngsi-ld/v1', - 'ngsild_test_suite_context': 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld', - 'notification_server_host': '0.0.0.0', - 'notification_server_port': 8085, - 'send_notification_server_host': '0.0.0.0', - 'send_notification_server_port': 8085, - 'context_source_host': '0.0.0.0', - 'context_source_port': 8086 - } - return variables - \ No newline at end of file +url = 'localhost:8080/ngsi-ld/v1' +ngsild_test_suite_context = 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' +notification_server_host = '0.0.0.0' +notification_server_port = 8085 +send_notification_server_host = '0.0.0.0' +send_notification_server_port = 8085 +context_source_host = '0.0.0.0' +context_source_port = 8086