5.21.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. Be sure to provide the IP address you need:

     TEST_EXPORT_ONLY = "1"
     TEST_TARGET = "simpleremote"
     TEST_TARGET_IP = "192.168.7.2"
     TEST_SERVER_IP = "192.168.7.1"
                

You can then export the tests with the following:

     $ bitbake core-image-sato -c testimage
                

Exporting the tests places them in the Build Directory in tmp/testimage/core-image-sato, which is controlled by the TEST_EXPORT_DIR variable.

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

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

Note

This "export" feature does not deploy or boot the target image. Your target (be it a Qemu or hardware one) has to already be up and running when you call runexported.py

The exported data (i.e. testdata.json) contains paths to the Build Directory. Thus, the contents of the directory can be moved to another machine as long as you update some paths in the JSON. Usually, you only care about the ${DEPLOY_DIR}/rpm directory (assuming the RPM and Smart tests are enabled). Consequently, running the tests on other machine means that you have to move the contents and call runexported.py with "--deploy-dir path" as follows:

     ./runexported.py --deploy-dir /new/path/on/this/machine testdata.json
                

runexported.py accepts other arguments as well as described using --help.