aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
AgeCommit message (Collapse)Author
2014-03-31lib/oeqa: add a test target controller for EFI targetsStefan Stanacar
The purpose of this module is to deploy a test image on a EFI-enabled hardware and run our runtime tests. A bit of background: - testimage.bbclass uses the concept of TEST_TARGET which is a class name that is responsible for target deploying. A layer can provide it's own TEST_TARGET. Right now has OE-core has a QemuTarget and a SimpleRemoteTarget (ssh into an already up and running machine and run tests), the default one being qemu. - basically testimage does something like: target.deploy() try: target.start() runTests() finally: target.stop() This module assumes a running EFI machine with gummiboot as bootloader and core-image-testmaster installed (or similar). Also your hardware under test has to be in a DHCP-enabled network that gives it the same IP for each reboot. One time setup (master image): - build core-image-testmaster with EFI_PROVIDER = "gummiboot" - install the image on the target Test image setup: - build your test image, e.g core-image-sato as you usually do, but with these in local.conf: IMAGE_FSTYPES += "tar.gz" - Now run the tests: INHERIT += "testimage" TEST_TARGET = "GummibootTarget" TEST_TARGET_IP = "192.168.2.3" bitbake core-image-sato -c testimage Other notes: - TEST_POWERCONTROL_CMD (togheter with TEST_POWERCONTROL_EXTRA_ARGS) can be a command that runs on the host and does power cycling. The test code passes one argument to that command: off, on or cycle (off then on). In my case I use something like TEST_POWERCONTROL_CMD="powercontrol.exp test 10.11.12.1 nuc1" in local.conf. Basically my expect script does: 'ssh test@10.11.12.1 "pyctl nuc1 <arg>" and runs a python script there that controls power for a label called nuc1'. The reason why my expect script has to ssh into another machine is because of network topology, and that machine is the one actually connected to the test rack and the power strip. That's why TEST_POWERCONTROL_CMD and _ARGS need to be customized for one's setup, the only requirement being that it accepts: on/off/cycle as the last argument. - if no command is defined it would use classic reboot. This is fine as long as the machine actually reboots (as in the ssh test hasn't failed), but it's useful for "simple-setup-with-one-board-on-the-desk" scenario, where some manual interaction is okay from time to time. [YOCTO #5614] Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-27selftest/bbtests.py: Fixed regex and added bitbake output to ↵Corneliu Stoicescu
test_warnings_errors The test failed when more than 1 error or 1 warning is present. Also pasting the bitbake output when the test fails. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11oeqa/utils/qemurunner: search for login string in the entire boot logStefan Stanacar
If some service is to spammy we might miss the login, so search in the entire log instead of just the last few lines. Use qemu in regex too (to avoid a login string from some service). Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11oeqa/targetcontrol: fix loading a controller using a class nameStefan Stanacar
This was wrong and if one would do TEST_TARGET = "SimpleRemoteTarget" instead of TEST_TARGET = "simpleremote" it would complain that there is no such controller when there is. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11oeqa/targetcontrol: allow a custom port for SimpleRemoteTargetStefan Stanacar
We had the ability to use a custom port for the ssh connection, but we weren't using it. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-11oeqa/utils/qemurunner: use the right kill call so we don't send SIGTERM to ↵Stefan Stanacar
bitbake-worker After recent bitbake-worker changes [1] this was killing the bitbake-worker, which isn't what we want and kill(-pid) was the wrong call anyway. runqemu.pid is the right PGID as the process was started with preexec_fn=setpgrp (so no need to do os.getpgid(self.runqemu.pid)) [1] http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=15688798520896690561824b2fdc227c8a365c82 Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07oe-selftest: force some values in local.conf for _sstatetests_noauto.pyCorneliu Stoicescu
1) Some values should have default values in order for tests like sstate relocation to be relevant - SSTATE_DIR needs to have default value - SSTATE_MIRRORS need to be unset (we need the sstate files to be created) - TMPDIR needs to be in default location 2) Added conf/auto.conf to list of ported files to secondary build directories Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07oe-selftest: optimize code in _sstatetests_noauto.py moduleCorneliu Stoicescu
1) Some of the checks made when creating new directories are unnecessary beacause the test will fail anyway if os.mkdir() fails, with the appropriate error message. Removing this code. 2) Moved the adding to tracked paths for deletion of temporary build directories and sstate-cache directories to after they are created. This makes more sense and prevents deletion of these directories if they allready exist and may contain useful data. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-07core-image-basic / packagegroup-core-basic: rename to *-full-cmdlinePaul Eggleton
This more accurately represents what this image and packagegroup are intended to provide (a more complete command-line environment similar to what you would find on a traditional Linux system), and avoids confusion with the similarly named core-image-base and packagegroup-base. Fixes [YOCTO #2424]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-05oe-selftest: add test for image manifest file creationAlexandru Palalau
Signed-off-by: Alexandru Palalau <alexandrux.palalau@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-02oeqa/runtime/dmesg: Ignore DMA timeout errorsRichard Purdie
We see these from qemu images on servers under load. They're not interesting and clutter the build output so lets ignore them. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-28oe-selftest: Fix test_sstate_cache_management_script*Corneliu Stoicescu
Fixed tests for sstate-cache-management.sh that ware failing due to: - recent changes to sstate-cache structure - recent changes to the script itself Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-28oeqa/targetcontrol: make BaseTarget an abstract classStefan Stanacar
This should make it clear what methods a subclass needs to redefine. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-28oe-selftest: Fix for test_rm_old_imageCorneliu Stoicescu
After recent changes in poky this test was not working as it should. This commit fixes and improves the test logic. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-25oeqa/targetcontrol: properly get the host ipStefan Stanacar
For the SimpleRemote target where we need the host ip and it wasn't set in conf, we tried to determine it automatically. However ip route output isn't the same for every network, we need the last field from the first line. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-12oeqa/runtime: smart: don't run in auto mode when rpm is not the pmStefan Stanacar
TEST_SUITES = "auto" would run smart tests even for non-rpm images, which is pointless. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-11oeqa/utils: targetbuild: take proxy into accountStefan Stanacar
A previous commit broke downloads when proxies are involved, let's fix it. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-08oeqa/utils: targetbuild: don't use bb.fetch anymoreStefan Stanacar
When running tests outside of the build system we can't use bb.fetch anymore. It was nice but tests and their modules need to rely on the data storage only as that gets exported. This module is used by the oeqa/runtime/build* tests. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-08lib/oeqa: add module for running tests outside of the build systemStefan Stanacar
This script will run the exported tests outside of the build system. Simplest way to test this is with a qemu image that you manually start. For an already build image use this in local.conf: TEST_EXPORT_ONLY = "1" TEST_TARGET = "simpleremote" TEST_TARGET_IP = "192.168.7.2" TEST_SERVER_IP = "192.168.7.1" Export the tests: bitbake core-image-sato -c testimage Then: runqemu core-image-sato And: cd build/tmp/testimage/core-image-sato ./runexported.py testdata.json The contents of build/tmp/testimage/core-image-sato can be moved on another machine as long as some paths are updated in the json. The exported data contains paths to the build dir. We only care about DEPLOY_DIR/rpm ( if the rpm and smart tests are enabled), so running the tests on other machine means that the user has to move the contents and call runexported with --deploy-dir PATH: ./runexported.py --deploy-dir /path/on/another/machine testdata.json runexported.py accepts other arguments as well, see --help. [YOCTO #5613] Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
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-02-04oeqa/runtime/systemd: remove race in settle()Ross Burton
The settle() function had a race where services could still be activating at two minutes but then when the final log is output, they've activated. Remove this race and generally clean up the code. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02lib/oeqa: allow multiple layers to provide their own TEST_TARGET classSipke Vriend
Use a python module "folder" rather than a single module within layers to ensure multiple layers can define a TEST_TARGET class. Current implementation using controllers.py module will only allow a single layer to define test targets. Add a controllers folder as well as a TestTargetLoader class whose job is to load the given TEST_TARGET class from any number of python modules within the oeqa/controllers/ directory of any layer. The only condition will be that layers will need to ensure the TEST_TARGET class name they provide is unique otherwise there is no guarantee which class is instantiated. a bb.warn is used to alude to this if it happens. Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-02-02oeqa/runtime: syslog: update --help testStefan Stanacar
busybox 1.22 now returns exitcode 0 instead of 1 for --help options, so this test needs to be updated when busybox gets upgraded to 1.22. https://bugs.busybox.net/show_bug.cgi?id=5612 http://git.busybox.net/busybox/commit/?id=efd0698f74caab0a0c8a51228b923ee142e8e278 Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-02-02oeqa/utils: sshcontrol: rewrite the SSHControl classStefan Stanacar
Split the class in two, one to handle the process and the timeout based on output and one for the actual ssh/scp commands. The ssh/scp methods now use the same run method. It does the same thing as before but: - it looks cleaner. - adds support for using a different user than root - optionally, raises an exception when exit code != 0 (that's useful for code outside of tests, where you wouldn't want to check the return code every time as the tests do) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-29oeqa/runtime: smart: fix adding channelsStefan Stanacar
Without this it won't add core2-64 and similar channels, as the directory name in deploy_dir/rpm uses _ not - as the package arch. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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>
2014-01-28oeqa/runtime: rpm: fix finding the test rpm fileStefan Stanacar
Translate TUNE_PKGARCH to find the right file (this used to work because tune for qemux86-64 used to be x86_64 now it's core2-64) Also, while using packagedata was nice, it's harder to make the test exportable and runnable outside of the build system. (where oe.packagedata isn't available) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28lib/oeqa: sshcontrol: Allow alternate port for SSHControlSipke Vriend
Add an optional parameter to SSHControl so the user can specify and alternate port to the default (22). Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-28oe-selftest: New tests for sstate relocationCorneliu Stoicescu
Added new tests: - sstate relocation stress testing - rebuild from sstate stress testing Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-22lib/oeqa: sshcontrol: fix false timeout failuresStefan Stanacar
Ocasionally AB shows odd false fails like: http://autobuilder.yoctoproject.org/main/builders/nightly-arm/builds/1/steps/Running%20Sanity%20Tests/logs/stdio This should fix that by checking for eof instead of polling the return code of the ssh process, because the process might still be there. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-17oe-selftest: Patch sstate tests to work with new sstate-cache naming and contentCorneliu Stoicescu
Made modifications to account for: - .siginfo files present in sstate-cache from non sstate-enabled tasks - new naming format for sstate files Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-16lib/oeqa: allow a layer to provide it's own TEST_TARGET classStefan Stanacar
Allows a layer to define new classes in <layer>/lib/oeqa/utils/controllers.py and completely control or extend deployment of a target. (core currently has QemuTarget and SimpleRemoteTarget). The value of TEST_TARGET must be the name of the new class. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-16oe-selftest: separated the SStateBase and SStateTests in different modulesCorneliu Stoicescu
- SStateBase now has its own module to be imported by itself by other modules like sstatetests.py Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-16oe-selftest: renamed sstate.py module to sstatetests.pyCorneliu Stoicescu
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-16oe-selftest: New object SStateBase cut off from SStateTests.Corneliu Stoicescu
- SStateBase object contains basic methods used to run sstate related tests - SStateTests now contains only sstate-related tests Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-14oeqa/runtime/systemd: wait for services to start/failRoss Burton
When checking that no services have failed to start, actually wait for services to finish starting by waiting for there not be no units in the "activating" state. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-06lib/oeqa/runtime: add test for pythonTing Wang
Run a python script on the target 1)checks the output. 2)Call os.system method create a testfile Signed-off-by: Saul Wold <sgw@linux.intel.com>
2014-01-06oe-selftest: New tests for sstate related operationsCorneliu Stoicescu
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-20lib/oeqa/runtime: rewrite the systemd test moduleStefan Stanacar
They are basically the same tests but: - they look cleaner, using one single method / assert - output from unittest will be cleaner (and includes a verbose status when needed) - they are better grouped and use a real, active, enabled service (machineid will be dropped and hostnamed was a static service) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-20oe-selftest: added buildhistory buildtime tests in module buildoptions.pyCorneliu Stoicescu
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-20oe-selftest: New test module for OE scripts.Corneliu Stoicescu
Added a new module meta/lib/oeqa/selftest/oescripts.py containing tests for scripts from ${COREBASE}/scripts Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-20oe-selftest: New BuildhistoryBase object for buildhistory testing.Corneliu Stoicescu
Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-14lib/oeqa/runtime: systemd failure case improvementsRoss Burton
If the hostnamed service can't be started or stopped, show the output from systemctl status to assist debugging. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-14oe-selftest: Add track_for_cleanup method to be used in cleanup tasksCorneliu Stoicescu
Added a track_for_cleanup(path) method that removes the given path in the tearDown method. This mechanism can be used to make sure a file or directory we created will be removed at the end of a test, regardless of what happens. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-14oe-selftest: implement add_command_to_tearDown methodCorneliu Stoicescu
Add a new method that can be used by the tester to add a command to the executed in the tearDown stage of the test. This mechanism can be used to make sure certain test-specific cleanup tasks are done in the case of a test failure. Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-12-05lib/oeqa/runtime: output more logging from systemd when services have failedRoss Burton
If some services have failed to start, get the status of them and some of their log to help debug the problem. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-05lib/oeqa/runtime: print connman status if connman failed to startRoss Burton
If connman isn't running and we're running under systemd, use systemctl to get the state according to systemd and the end of the connman log. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-05lib/oeqa/selftest: add tests for PR serviceCorneliu Stoicescu
Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-05lib/oeqa/selftest: buildoptions: small fixes for some testsStefan Stanacar
While harmless, we should overwrite the config not append to it, and use m4 as target, otherwise the WARN check will build an entire image and we are not interested in that. Also add an output check for the WARN_QA test. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-04lib/oeqa/selftest/base, scripts/oe-selftest: fix wrong remove path and do a ↵Stefan Stanacar
complete cleanup at the end The script should clean-up all the .inc files that might have been created by tests regardless of the outcome or if the script is interrupted. (currently the last test will leave a conf/selftest.inc around, even if it's not included anywhere) Also fix delete_recipeinc to actually delete what's supposed to. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>