summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
Commit message (Collapse)AuthorAgeFilesLines
* oeqa/targetcontrol: support wic image typeEd Bartosh2016-02-151-1/+1
| | | | | | | | | | | | | | | | Added 'wic' to the list image types supported by targetcontrol. This is a preparation for booting and testing wic images with oe-selftest. [YOCTO #8498] (From OE-Core rev: 7dda053fbd1ea1354b7720cfa691470ba88ef5b9) (From OE-Core rev: 4b84328d3cd0d87ad146f034b58f68a5158313d7) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: make ssh control optionalEd Bartosh2016-02-151-8/+10
| | | | | | | | | | | | | | Added new parameter 'ssh' to targetcontrol 'start' method to be able to test images without running ssh server. [YOCTO #8498] (From OE-Core rev: 1c3c66aadd43092bc19242b0651ee810cc31fe7c) (From OE-Core rev: 67ccf7413b2ac9f516dbdaa6a39d4cec38a6c94d) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Test failure/cleanup improvementsRichard Purdie2015-09-061-0/+3
| | | | | | | | | | | | | | | | | Currently, if qemu segfaults, the tests merrily continue trying to execute which takes time for them to timeout and is a bit silly. Worse, no logs about the segfault are shown to the user, its silent! This patch tries to unravel the tangled web of issues and ensures that we: * install a SIGCHLD handler which tells the user qemu exited * check if qemu is running, if it isn't fail the test outright * don't leave processes behind in sshcontrol which would hold bitbake.lock and block shutdown (From OE-Core rev: 5c04b1ca1e989f569d5755a646734d01a0c56cae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Added host dumps when there are errorsMariano Lopez2015-09-031-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | This adds an instance of HostDumper to qemurunner, with this instance now is possible to get dumps from the host when there is an error. This adds dump points in the next cases: - runqemu exits before seeing qemu pid - Fail to get qemu process arguments - Not reach login banner before timeout - qemu pid never appears This also modifies the constructors of BaseDumper, HostDumper and TargetDumper, they don't require the datastore anymore, but the feature to replace datastore variables has been lost (never used) [YOCTO #8118] (From OE-Core rev: b0af40fb76cd5035696e9d8a44f815f64214d23a) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* dump: Created new classes for dump host and targetMariano Lopez2015-08-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | It makes sense to separate the dump commands from the oeRuntimeTest class, this way it can be used in all the test context. These are the changes included in this patch: - Created classes: BaseDumper, HostDumper, TargetDumper - Create an instance of HostDumper in imagetest.bbclass and add it to TestContext class, this way any class that have access to the TestContext would be able to dump logs from the host - Create an instance of TargetDumper in QemuTarget class after get the runner, this way it is accessible during the tests. [YOCTO #8118] (From OE-Core rev: ad10af6be343b5425fde43055263b0744c161cb3) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage: Run commands in target and host when test failsMariano Lopez2015-08-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch modify three files altought two of them are minimal modifications. This version includes the changes proposed by Paul. testimage.bbclass: Create new vars for easy modification of the dump directory and commands to be run on host and target when a test fails TESTIMAGE_DUMP_DIR: Directory to save the dumps testimage_dump_target: Commands to run on target testimage_dump_host: Commands to run on host oetest.py: - Allow to use the vars defined in testimage class - Now able to run commands in the host and dump the results - Fix an issue with the condition where to run the dump commands (Before it run the commands every test after a failure, now it runs the commands only in tests that failed) - Fix the output to stdout [YOCTO #8118] (From OE-Core rev: 26fe645457633f90bb5ddbb12f5f7b9ca4a06cc5) (From OE-Core rev: 7b4fbbf979ed22434b8e3f83ae145139bb0d9fc7) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* targetcontrol: Improve logs by outputting qemu boot log in case of failureRichard Purdie2015-07-271-0/+3
| | | | | | | | | | We've had a few cases on the autobuilder where we've lost logs of the boot and been unable to debug it further. Show this information onto the console to be more useful. (From OE-Core rev: 5302b7b8fa1349ae99040fe8fdcc4e42c722cc10) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: write QemuRunner log output to a filePaul Eggleton2015-07-271-0/+11
| | | | | | | | | | | | If we use this outside of testimage we don't have a task log; so let's just explicitly write the log output to a file all the time so it's always there to look at (particularly useful when runqemu exits immediately with an error.) (From OE-Core rev: 09b7ed39df150257cfe2eb55a8f8c7475e73217e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: create test directory before copying rootfs imagePaul Eggleton2015-07-271-0/+1
| | | | | | | | | | The test directory might not exist at this point so just go ahead and create it. (From OE-Core rev: 7ef86ce62b52f0f3d0c51e3c20d7b4f37025bf41) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: Add explict getVar param for (non) expansionRichard Purdie2015-06-231-1/+1
| | | | | | | | | | | | | | Rather than just use d.getVar(X), use the more explict d.getVar(X, False) since at some point in the future, having the default of expansion would be nice. This is the first step towards that. This patch was mostly made using the command: sed -e 's:\(getVar([^,()]*\)\s*):\1, False):g' -i `grep -ril getVar *` (From OE-Core rev: ab7c1d239b122c8e549e8112c88fd46c9e2b061b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: Add support for poky-tiny in QemuTarget.Lucian Musat2015-04-101-9/+24
| | | | | | | (From OE-Core rev: 8f1a52a3f72506911154769e6ad4a44f32c3112e) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* machine/qemu: Switch from ext3 to ext4Richard Purdie2015-02-211-1/+1
| | | | | | | | | | There is no good reason not to use ext4 at this point, it has advantages and few drawbacks. Therefore switch the qemu machines over (and the default runqemu script options). (From OE-Core rev: 430b9ae71b1aa76f8421127d17e0e0723d4818d3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol.py: Separate the matching of supported image fstypes from ↵Corneliu Stoicescu2014-06-241-2/+9
| | | | | | | | | | | | | | the resulting value check. Because we used a bb.fatal call inside the get_image_fstype classmethod, this caused problems when accessed without instantiating the object with a valid bb environment. Separating the matching part of the classmethod(that is usable by outside scripts) from the check of the resulting value. The matching is done within a new classmethod and the latter keeps the old method name and internal functionality, this way we don't have to change any other target controllers code. (From OE-Core rev: 50ddd5d0149666ad60133d8eb6cc789c5b97e5e4) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* targetcontrol.py: Add a classmethod to get extra files needed by the target ↵Corneliu Stoicescu2014-06-131-0/+4
| | | | | | | | | | | | | | controllers YB: #6254 Add a new classmethod that can be used by outside scripts to get the extra files needed by the target controllers. An outside script can predict rootfs, manifest and kernel files needed by a target controller, but sometimes there are other files needed. (From OE-Core rev: fea627022473cfb73299d0988628962ad8e80f89) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* targetcontrol.py: make possible dynamical determination of rootfs typeCorneliu Stoicescu2014-06-131-2/+17
| | | | | | | | | | | | | | YB: #6375 Added a new method get_image_fstype() that autodetermines what fstype to use for the rootfs file. This method uses a new list variable 'supported_image_fstypes' that contains image fstypes supported by the target controller. This method is also a classmethod which means outside scripts can get the image fstype. (From OE-Core rev: 39d5aa5c9f2916700f81d15adc220a30c6b120d1) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/testimage: if start fails, don't try to stopPaul Eggleton2014-04-301-0/+1
| | | | | | | | | | | | If we couldn't start the target, it doesn't make sense to try and stop it here since logically it shouldn't now be in any kind of "started" state. (It's the start function's job to clean up after itself if it fails - to that end, fix up the QemuTarget class so that it does.) (From OE-Core rev: 819ebddae6b78120e5e082423793ff988419b5c4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: restart method shouldn't be abstractStefan Stanacar2014-04-301-5/+2
| | | | | | | | | | And drop the un-needed and un-used restart methods. Only qemu ever used this and actually does it safely. (From OE-Core rev: 1dd1edb5ea551c8a01538b130aa4d0c361eae14d) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: fix loading a controller using a class nameStefan Stanacar2014-03-111-1/+2
| | | | | | | | | | | | 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. (From OE-Core rev: 47d2049d13ab71e0310e9eedaf307d6c3e530b44) 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>
* oeqa/targetcontrol: allow a custom port for SimpleRemoteTargetStefan Stanacar2014-03-111-2/+7
| | | | | | | | | | | We had the ability to use a custom port for the ssh connection, but we weren't using it. (From OE-Core rev: c1f2a3c41969df0b7f08cf314b2cb7c9a6030092) 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>
* oeqa/targetcontrol: make BaseTarget an abstract classStefan Stanacar2014-02-281-0/+16
| | | | | | | | | | | This should make it clear what methods a subclass needs to redefine. (From OE-Core rev: a4e4de4189cec3076a863c32c98e02766187ab48) 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>
* oeqa/targetcontrol: properly get the host ipStefan Stanacar2014-02-251-1/+1
| | | | | | | | | | | | 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. (From OE-Core rev: 19af3ac53690b1bd2fee54827090f59c525d2236) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: allow multiple layers to provide their own TEST_TARGET classSipke Vriend2014-02-021-6/+7
| | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 3f25705f4a986e06cbd397aaea52b841c1a1e054) Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: allow a layer to provide it's own TEST_TARGET classStefan Stanacar2014-01-191-4/+19
| | | | | | | | | | | | 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. (From OE-Core rev: 9b81aff0aca42353d448b1e9522f89842e23c7b2) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: targetcontrol.py: add abstraction for running tests on different ↵Stefan Stanacar2013-12-031-0/+137
targets Add a new module which abstracts the target object used by testimage.bbclass The purpose of this module is to move the deployment of a target from testimage.bbclass, basically abstracting different implementations of how we setup a target and how it runs commands. It allows to select one implementation or another by setting TEST_TARGET (currently to: "qemu" and "simpleremote"). QemuTarget is used to start a qemu instance (as it's currently done in testimage.bbclass) SimpleRemoteTarget is meant for a remote machine (by setting TEST_TARGET_IP) that's already up and running with network and ssh. Simply put, it opens the door for running the tests on different types of targets by adding new classes (maybe qemu-nfsroot or remote-special etc.). One could also override BaseTarget which currently uses the existing SSHControl module and add a serial implementation. [ YOCTO #5554 ] (From OE-Core rev: c1bfd4017f6f6502a68ceb3edf7d2027d02a309d) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>