4.28.3. Exporting Tests

You can export tests so that they can run independently of the build system. Exporting tests is required if you want to be able to hand the test execution off to a scheduler. You can only export tests that are defined in TEST_SUITES.

If your image is already built, make sure the following are set in your local.conf file:

     INHERIT +="testexport"
     TEST_TARGET_IP = "IP-address-for-the-test-target"
     TEST_SERVER_IP = "IP-address-for-the-test-server"
                

You can then export the tests with the following BitBake command form:

     $ bitbake image -c testexport
                

Exporting the tests places them in the Build Directory in tmp/testexport/image, which is controlled by the TEST_EXPORT_DIR variable.

You can now run the tests outside of the build environment:

     $ cd tmp/testexport/image
     $ ./runexported.py testdata.json
                

Here is a complete example that shows IP addresses and uses the core-image-sato image:

     INHERIT +="testexport"
     TEST_TARGET_IP = "192.168.7.2"
     TEST_SERVER_IP = "192.168.7.1"
                

Use BitBake to export the tests:

     $ bitbake core-image-sato -c testexport
                

Run the tests outside of the build environment using the following:

     $ cd tmp/testexport/core-image-sato
     $ ./runexported.py testdata.json