5.17.2. Running Tests

You can start the tests automatically or manually:

Regardless of how you run the tests, once they start, the following happens:

All test files reside in meta/lib/oeqa/runtime in the Source Directory. A test name maps directly to a Python module. Each test module may contain a number of individual tests. Tests are usually grouped together by the area tested (e.g tests for systemd reside in meta/lib/oeqa/runtime/systemd.py).

You can add tests to any layer provided you place them in the proper area and you extend BBPATH in the local.conf file as normal. Be sure that tests reside in <layer>/lib/oeqa/runtime.

Note

Be sure that module names do not collide with module names used in the default set of test modules in meta/lib/oeqa/runtime.

You can change the set of tests run by appending or overriding TEST_SUITES variable in local.conf. Each name in TEST_SUITES represents a required test for the image. Test modules named within TEST_SUITES cannot be skipped even if a test is not suitable for an image (e.g. running the rpm tests on an image without rpm). Appending "auto" to TEST_SUITES causes the build system to try to run all tests that are suitable for the image (i.e. each test module may elect to skip itself).

The order you list tests in TEST_SUITES is important. The order influences test dependencies. Consequently, tests that depend on other tests should be added after the test on which they depend. For example, since ssh depends on the ping test, ssh needs to come after ping in the list. The test class provides no re-ordering or dependency handling.

Note

Each module can have multiple classes with multiple test methods. And, Python unittest rules apply.

Here are some things to keep in mind when running tests: