To check everything is properly configured and running, you can run the following set of tests.
Infrastructure servers test¶
To validate that all services are up and running (Redis, MongoDB and PubSub), you can access to the following catalog page:
In this screen you can check the status independently for each Sentilo main service. In each case it will be indicated, through a green status message, the correct operation of the same. In the event either it is not possible to connect to the service or there is an error, an error message will be displayed .
Next screenshot shows to you an error connecting to the API:
Deactivating the status page¶
By default, the status page is enabled in your Sentilo instance.
To disable it, you must provide a JVM Tomcat parameter:
Then, the status page will be inaccessible:
newman run postman-script.json -e postman-script-env.json --delay-request 5000 --reporters cli,json --reporter-json-export outputfile.json
where files postman-script.json and postman-script-env.json are located in subdirectory scripts/test from your local copy of Sentilo.
This script provides tests all Sentilo REST API resources and can serve you also as example of the API usage.
Before executing tests with newman, you should review the values of the variables api_url, api_port, provider and provider_token in the environment file postman-script-env.json so that they match your Sentilo instance
Before executing the postman script / or you should replace default values (extracted from the init_test_data.js file) with the ones that you want to use to execute it (api_url, api_port, provider and provider_token)