Oe-selftest

From Yocto Project
Jump to navigationJump to search

Introduction

Oe-selftest is a test framework used for testing the poky build system. Following are some key points in describing oe-selftest: - based on Python Unit Testing - designed to simulate poky external usage patterns - does not cover image run-time testing - implements a new layer that contains generic/specific metadata used only by tests

How to use

In order to use oe-selftest, you need the following(in this specific order): - the poky source (1.5 M2 or better) - source the build environment - add the meta-selftest layer added in conf/bblayers.conf

  • How to run all(except hidden) tests:

From the source build directory, issue the command 'oe-selftest'.

  • How to run specific tests

First you need to identify the test(s) that you want to run. You will need the following information: test module, test class, test method name. Look for the test modules inside /meta/lib/oeqa/selftest/ . After you have obtained the above information, issue from the command line: 'oe-selftest module1.Class1.test_1 module1.Class1.test_2 module2.Class2.test_3 ...'

  • How to run hidden tests

Hidden tests are located in test modules whose names begin with an underscore '_' . Example: '_test_hidden_module.py'. These tests can be run by specifying them as arguments like the above. Example: 'oe-selftest '_test_hidden_module.Class_1.test_1'

Important file locations

The following files and locations are relevant to oe-selftest:

  • the script itself

is located in the /scripts directory under the main poky tree.


You should be aware of the following: - oe-selftest uses the settings in conf/local.conf as a base for all test configurations. Any modifications made(like DISTRO) or not made here(like BB_NUMBER_THREADS) will impact all tests if the modifications are not overwritten s specifically by a test - running all tests can take a long time!

Related source files and locations

How to contribute