aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
AgeCommit message (Collapse)Author
2014-02-08testimage: add ability to export testsStefan Stanacar
Add the ability to export the tests so that they can run independently of the build system, as is required if you want to be able to hand the test execution off to a scheduler. Booting/deployment of the target is still handled by the build system, as before, only the execution of the tests happens outside of the build system. Tests exported are the ones defined in TEST_SUITES. No tests have been changed as interesting parts of the data store have been exported and tests can continue to query them as before. Small adjustments were made for a couple of oeqa modules though. [YOCTO #5613] Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-29oeqa/runtime: drop restartTarget methodStefan Stanacar
Restart is a property of a specific target, not of a test class, should a test really need to restart the target the direct method should be called. Also some tests used this to enforce more ram, which makes sense only for qemu targets only (and the inital reason this was needed isn't valid anymore, qemu machines had the default ram size bumped a while ago). Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03testimage: use the new targetcontrol.py module for running testsStefan Stanacar
This patch makes the necessary changes for using the targetcontrol.py module so that one can run the same tests on a qemu instance or a remote machine based on the value of TEST_TARGET variable: "qemu" or "simpleremote". The default value is "qemu" which starts a qemu instance and it's the with what we currently have. With "simpleremote", the remote machine must be up with network and ssh and you need to set TEST_TARGET_IP with the IP address of the remote machine (it can still be a qemu instance that was manually started). Basically testimage.bbclass now does something along the lines of: - load tests -> deploy (prepare) / start target -> run tests. There were a couple of changes necessary for tests and also some cleanups/renames that were needed to adjust this change. (use ip everywhere when refering to target and server_ip when refering to host/build machine) Also two unnecessary and unsed methods were dropped from sshcontrol. [ YOCTO #5554 ] Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03lib/oeqa: use the new manifest file for determining if a package is installedStefan Stanacar
Use the new manifest file instead of ${WORKDIR}/installed_pkgs.txt for determining if an image has a certain package, because installed_pkgs.txt goes away with rm_work enabled. We can't use the IMAGE_MANIFEST var for the file path because that relies on IMAGE_NAME which changes at every run (because of date), so we use the link which points to the last one built. [ YOCTO #5072 ] Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-04lib/oeqa: add oeTest superclassStefan Stanacar
Add oeTest superclass, make oeRuntimeTest inherit that and make the necesarry adjustments. Tests in lib/oeqa/runtime don't change, they still inherit oeRuntimeTest. We should do this because oetest.py in the future can be a base module for more stuff than oeRuntimeTest. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-09-06oeqa/oetest: oeRuntimeTest: enable long messagesMihai Lindner
Set longMessage to True for all tests derived from oeRuntimeTest, in order to have somewhat info on assertions with cryptic or no messages. Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26lib/oeqa: change behaviour for unskippable testsStefan Stanacar
When a test module wants to be skipped because it doesn't apply to the image but it was nevertheless a required test (one in TEST_SUITES), we issued an warning that it was a required test and went on with running the module. Usually all tests in the module failed (e.g gcc tests on a non-sdk image), but this allowed us to know that something went wrong with the image (some package/feature didn't make it). However, instead of just issuing an warning and running the tests it's better to throw an exception. The traceback will tell us what's wrong, and we don't run every single test method. Output will look like this: --snip-- | NOTE: Test modules ['oeqa.runtime.ping', 'oeqa.runtime.ssh', 'oeqa.runtime.gcc'] | NOTE: Found 5 tests | test_ping (oeqa.runtime.ping.PingTest) ... ok | test_ssh (oeqa.runtime.ssh.SshTest) ... ok | ERROR | | ====================================================================== | ERROR: setUpModule (oeqa.runtime.gcc) | ---------------------------------------------------------------------- | Traceback (most recent call last): | File "/mnt/back/yocto/poky/meta/lib/oeqa/runtime/gcc.py", line 8, in setUpModule | skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES") | File "/mnt/back/yocto/poky/meta/lib/oeqa/oetest.py", line 108, in skipModule | "\nor the image really doesn't have the requred feature/package when it should." % (modname, reason)) | Exception: | Test gcc wants to be skipped. | Reason is: Image doesn't have tools-sdk in IMAGE_FEATURES | Test was required in TEST_SUITES, so either the condition for skipping is wrong | or the image really doesn't have the requred feature/package when it should. | | ---------------------------------------------------------------------- | Ran 2 tests in 1.036s | | FAILED (errors=1) | NOTE: Sending SIGTERM to runqemu --snip-- Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-08-26lib/oeqa: make it possible to restart the targetStefan Stanacar
Tweak QemuRunner so we can actually restart the qemu target in a test (if we want more memory for example). Also add a restart method to the base test class so that tests can use it. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15testimage.bbclass, lib/oeqa: add headers and commentsStefan Stanacar
Adds some comments to testimage.bbclass and the files it calls, just to give an ideea of what it does. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/oetest.py: provide a ps command for all testsStefan Stanacar
Many tests will use 'ps' but we need to know if it's busybox or standard ps. Drop the existing check from the connman test. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-09lib/oeqa/oetest.py: base module for all runtime unittestsStefan Stanacar
This module contains the base class for all runtime tests and some helper methods. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Radu Moisan <radu.moisan@intel.com>