Search code examples
fiwarefiware-health

Executing a single Sanity Test in a FIWARE Lab node


I was checking the FIWARE Sanity Checks status portal and I was wondering if it is possible to execute a single test on a FIWARE Lab node.


Solution

  • The feature available on the FIWARE Sanity Checks Dashboard for node administrators to re-run Sanity Checks will always run all tests on the given node, but you can execute individual test by yourself in your own local environment.

    The provided sanity_test script let you run all designed Sanity Checks on a given node or a set of them. This script runs all tests using the nosetests tool and, so far, you cannot specify which ones must be executed or not as parameters of this script. It is something that it is not implemented in the current version of the component.

    If you want to run specific test, you will have to execute the tool manually (after setting the OpenStack credential variables in your environment for your Node and configuring all needed Sanity Check properties). For instance:

       $ nosetests tests.regions.test_spain2:TestSuite.test_deploy_instance_with_new_network_and_e2e_connection_using_public_ip
    

    The command above will execute only the test test_deploy_instance_with_new_network_and_e2e_connection_using_public_ip on Spain2 and will show by console if any error or exception is raised. You can use all available options given by nosetests to run a custom set of sanity tests with your own configuration (output formats and reports, logger, etc).