summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/targetcontrol.py
AgeCommit message (Collapse)Author
2020-07-03oeqa/targetcontrol: Attempt to fix log closure warning messageRichard Purdie
We continue to see the warning message: WARNING: lib/bb/daemonize.py:76: ResourceWarning: unclosed file <_io.TextIOWrapper name='build/tmp/work/qemux86_64-poky-linux/oe-selftest-image/1.0-r0/testimage/qemurunner_log.20200703011821' mode='a' encoding='UTF-8'> I've been unable to reprodue this but believe its caused by garbage collection of the FileHandler used in QemuTarget being delayed until after a new tinfoil instance is created by a subseqent test. Force the log file to be closed when we stop using it to avoid this. [YOCTO #13961] (From OE-Core rev: e15cc7801ec611f867f5b31028741722ac718c87) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-06-04oeqa/targetcontrol: Rework exception handling to avoid warningsRichard Purdie
We're seeing: WARNING: bitbake/lib/bb/cookerdata.py:136: ResourceWarning: unclosed file <_io.FileIO name='tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/testimage/qemurunner_log.20200601181912' mode='ab' closefd=True which can only be caused by the qemu.stop() method not being called. Tweak the error handling to fix the blanket exception handler which is likely meaning this function isn't getting called. (From OE-Core rev: ee707090848d793e3b2d82dd3861ae22222682c0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26targetcontrol: Fix leaking log handlerRichard Purdie
We had a mystery failure on the autobuilder where runqemu appeared to be failing as a logfile directory no longer existed. The key to reproducing was running a runqemu where the image was deleted (as devtool does), then running another runqemu test. E.g.: 'oe-selftest -r devtool.DevtoolExtractTests.test_devtool_deploy_target wic.Wic2.test_qemu_efi' This then tries to write to the logfile from the first test, the image directory was deleted and we get strange failures. The fix is to remove the logging handler when qemu is stopped. (From OE-Core rev: b59a2bbbf3c56b71f6118970ed2269dddfbdbe0c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-27oeqa/utils/qemurunner.py: Handle QEMU machines with a single serialNathan Rossi
Not all QEMU machines are capable of having more than one serial port, this is due to the machine emulating a physical device/board. Rework QemuRunner to handle machines that only have 1 serial port, where the serial port shares output of the kernel log buffer and a login console. In this case the output is mixed but enables the machine to boot and have QemuRunner detect the login prompt. QemuTarget uses SERIAL_CONSOLES to determine the number of available serial ports. (From OE-Core rev: 333897c4a00b41681ffe34312a08cae09274327e) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-08-06classes/lib: Remove bb.build.FuncFailedRichard Purdie
Whilst seemingly a good idea, this exception doesn't really serve any purpose that bb.fatal() doesn't cover. Wrapping exceptions within exceptions isn't pythonic. Its not used in many places, lets clean up those and remove usage of it entirely. It may ultimately be dropped form bitbake entirely. (From OE-Core rev: efe87ce4b2154c6f1c591ed9d8f770c229b044ad) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-15oeqa/targetcontrol.py: fix qemuparams not work in runqemu with launch_cmdHongxu Jia
As runqemu with launch_cmd means directly run the command, don't need set rootfs or env vars. Since commit [a847dd7202 runqemu: Let qemuparams override default settings] applied in oe-core, if launch_cmd contains "qemuparams='***'", it does not work, which is overridden by latter qemuparams="-serial tcp:127.0.0.1" in QemuRunner.launch(); So we set qemuparams as a parameter in runqemu, the fix makes it work (From OE-Core rev: 4f0a576fd5b9373cff4ca5ac92ec6af29499df89) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-11oeqa: make it work for multiple usersRobert Yang
There are failures when multiple users run oe-selftest on the same host: PermissionError: [Errno 13] Permission denied: '/tmp/oe-saved- tests/201812250324_qemu' This is because /tmp/oe-saved-tests was created by user A, while user B tries to write data in it, then the error will happen. This patch can fix the problem. Move the dumped data to ${LOG_DIR}/runtime-hostdump/ rather than /tmp/oe-saved-tests/ to fix the problem. (From OE-Core rev: e219fe5329599cd6c3682f521eaee3852a2c8980) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08oeqa: Fix for QEMU_USE_KVMRobert Yang
Fixed: MACHINE = "qemux86" QEMU_USE_KVM = "qemux86" IMAGE_CLASSES += "testimage" $ oe-selftest -r runqemu.RunqemuTests.test_boot_rootfs [snip] File "/buildarea1/lyang1/poky/meta/lib/oe/types.py", line 122, in boolean raise ValueError("Invalid boolean value '%s'" % value) ValueError: Invalid boolean value 'qemux86' Now QEMU_USE_KVM can only be boolean, can not contain MACHINE any more, kvm will be enabled if target_arch == build_arch or both of them are x86 archs. (From OE-Core rev: 7c1a8a624cad8d967635c6cb5f99cf655bde3d44) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-07oeqa/utils/qemurunner: set timeout to 60s for run_serialRobert Yang
The 5s timeout for non-kvm is too short, especially when the load is high, which leads to unexpected errors, so set timeout to 60s by default. (From OE-Core rev: 8197d0f638a760fc03062c7a9009117d083d7ead) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-12-18targetcontrol.py: use oe.types.boolean for QEMU_USE_KVMRobert Yang
So that both QEMU_USE_KVM = "True" and "1" will work. [YOCTO #12343] (From OE-Core rev: f28890ae2eb8a9cb2da39588e696a4b0c501bdf0) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa: Clean up logger handlingRichard Purdie
The logger handling in oeqa was confused at best. This patch: a) Passes in a logger through various qemu runner pieces b) Uses that logger consistently in the code c) Creates a logger for QemuRunner outside the bitbake namespace meaning we don't conflict with the tinfoil logging changes The result of this is more consistency. For runtime tests in testimage, the logs always contain the debug info, nothing is shwon on the console. For the oe-selftests, logs are intercepted and only shown if the test fails. (From OE-Core rev: 4ff678137a55b93c9ba2cbffda34335ba859f704) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/targetcontrol: Drop unused get_target_controller functionRichard Purdie
This funciton appears completely unused, drop it. (From OE-Core rev: f352ef37a27cb0871c87cf9991d8ad2e1d560fde) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28oeqa: allow persistent image writes in runqemu()Patrick Ohly
By default, QemuRunner avoids modifying the image files that it boots into by enabling the qemu snapshot mode. However, some tests may want to test changes that must persists across reboots, so this mode should be optional. This can be combined by copying the image file to a temporary location first and then booting with that copy. It's also useful when testing with additional drives attached to a virtual machine. QemuTinyRunner doesn't use the snapshot parameter and therefore ignores the new parameter. Long term, a better way of passing these various configuration parameters should be used, and perhaps QemuRunner and QemuTinyRunner can be merged into one again to avoid code duplication. But for now the patch follows the exiting style. Also beware that QemuTarget.start() now acts in two different modes (with or without explicit launch command), and depending on that mode parameters like discard_writes must be ignored, i.e. not get passed to launch(). (From OE-Core rev: 969d079a33a57f5a8f7af86d7bab04d35ab07584) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-28oeqa: QEMU_USE_KVM can list machinesPatrick Ohly
Previously, QEMU_USE_KVM=True enabled the use of kvm only when "x86" was in the MACHINE name. That is too limiting, because for example intel-corei7-64 can also use kvm but it wasn't possible to enable that without changing OE-core. That traditional usage is still supported. In addition, QEMU_USE_KVM can be set to a list of space-separated MACHINE names for which kvm is to be enabled. (From OE-Core rev: d5421dd00b9cf785fa77e77c6c739e8bd8822fa3) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27targetcontrol.py: use logger.info to replace of bb.noteRobert Yang
The bb.note prints multiple same lines when invoke this class again, but if we set mainlogger.propagate = False, nothing would be printed, according to logging's document: https://docs.python.org/3/library/logging.html Note If you attach a handler to a logger and one or more of its ancestors, it may emit the same record multiple times. In general, you should not need to attach a handler to more than one logger - if you just attach it to the appropriate logger which is highest in the logger hierarchy, then it will see all events logged by all descendant loggers, provided that their propagate setting is left set to True. A common scenario is to attach handlers only to the root logger, and to let propagation take care of the rest. We may need avoid using bb.note or bb.warn in oeqa since it attaches multiple log handlers which may cause confusions This patch only sets "mainlogger.propagate = False" in selftest/runqemu.py and use logger.info to replace bb.note in targetcontrol.py to minimize the impact. [YOCTO #10249] (From OE-Core rev: b139790422bc8e0d80bad063bb78bc1632731bc1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27oeqa/targetcontrol.py: modify it to test runqemuRobert Yang
Modify the following files to test runqemu: targetcontrol.py utils/commands.py utils/qemurunner.py We need simulate how "runqemu" works in command line, so when test "runqemu", the targetcontrol.py, utils/commands.py and utils/qemurunner.py don't have to find the rootfs or set env vars. [YOCTO #10249] (From OE-Core rev: 9305d816bdf8837ea3a407091cb7f24a9a3ae8dc) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-27qemurunner: configurable timeout for run_serial()Patrick Ohly
Some commands might need to run longer than the default timeout of five seconds. If that occurred, run_serial() returned with a status code of zero (sic!) and no other indication of what went wrong. Now the timeout is configurable (with five still the default) and an explicit warning ("<<< run_serial(): command timed out after 5 seconds without output >>>") gets appended at the end of the data returned to the caller. While at it, the logic for checking for the timeout was updated a bit because both implementations could overshoot the timeout when entering select() right before the final deadline. (From OE-Core rev: accf0362f964cc9d6330b6e52e83d748d890521f) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08targetcontrol: add image_fstype argument to commands.runqemuEd Bartosh
qemu runner picks up first fsimage type from the hard-coded list of supported types. This makes it impossible to test particular image type unless it's not ext4(first type in the hardcoded list of types). Added image_fstypes argument to commands.runqemu and QemuTarget __init__ to specify type of the image to run qemu with. This will be used to pass wic image type to test efi wic images. (From OE-Core rev: f1f224a2d4d3f2a760632c2254e91a8f94c8814f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-08qemurunner: add runqemuparams argument to commands.runqemuEd Bartosh
Added possibility to pass additional runqemu parameters down the stack of APIs: commands.runqemu -> QemuTarget.start -> QemuRunner.start This will be used to pass ovmf parameter in testing of efi wic images under qemu. (From OE-Core rev: 5aa4b5a10fb8191cd3453d09701c8beeff9a952f) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09oeqa: Use snapshot instead of copying the rootfs imageRichard Purdie
Rather than copying images, use the snapshot option to qemu. This fixes a regression caused by the recent runqemu changes where the wrong images were being testes since the image is copied without the qemuboot.conf file. This means the latest image is found by runqemu rather than the specified one, leading to various confused testing results. It could be fixed by copying more files but use snapshot mode instead. (From OE-Core rev: eab91997d415b0e690b3482749a32087e6a8b00a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18testimage: allow using kvm when running qemux86* machinesBill Randle
Using kvm can provide significant speedups when running qemux86* machines on an x86* host. Enabled by using the new QEMU_USE_KVM variable. [YOCTO #9298] (From OE-Core rev: ebac2c8d1fcd09ebce0659a4abb445e4f1c18571) Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10oeqa: start() add remaining args SimpleRemoteTarget and QemuTinyRunnerAníbal Limón
Now Runner's support extra_bootargs for the kernel so add extra_bootparams to the start() methods to avoid exception. (From OE-Core rev: 4c28c03a2322fbcb9a5c268b08eaeb71d940ee04) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20utils/qemurunner.py: QemuRunner.start() add support for specify extra kernel ↵Aníbal Limón
cmdline Add ability to specify extra_bootargs (kernel cmdline) in order to enable systemd debug log in images that enables systemd init. [YOCTO #9299] (From OE-Core rev: 09d62551c289b5607341a4f9c46eecd6390ad774) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. (From OE-Core rev: fcd6b38bab8517d83e1ed48eef1bca9a9a190f57) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15oeqa/targetcontrol: support wic image typeEd Bartosh
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>
2016-02-15oeqa/targetcontrol: make ssh control optionalEd Bartosh
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>
2015-09-06oeqa: Test failure/cleanup improvementsRichard Purdie
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>
2015-09-03qemurunner: Added host dumps when there are errorsMariano Lopez
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>
2015-08-30dump: Created new classes for dump host and targetMariano Lopez
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>
2015-08-30testimage: Run commands in target and host when test failsMariano Lopez
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>
2015-07-27targetcontrol: Improve logs by outputting qemu boot log in case of failureRichard Purdie
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>
2015-07-27oeqa/targetcontrol: write QemuRunner log output to a filePaul Eggleton
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>
2015-07-27oeqa/targetcontrol: create test directory before copying rootfs imagePaul Eggleton
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>
2015-06-23meta: Add explict getVar param for (non) expansionRichard Purdie
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>
2015-04-10oeqa/targetcontrol: Add support for poky-tiny in QemuTarget.Lucian Musat
(From OE-Core rev: 8f1a52a3f72506911154769e6ad4a44f32c3112e) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-02-21machine/qemu: Switch from ext3 to ext4Richard Purdie
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>
2014-06-24oeqa/targetcontrol.py: Separate the matching of supported image fstypes from ↵Corneliu Stoicescu
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>
2014-06-13targetcontrol.py: Add a classmethod to get extra files needed by the target ↵Corneliu Stoicescu
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>
2014-06-13targetcontrol.py: make possible dynamical determination of rootfs typeCorneliu Stoicescu
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>
2014-04-30classes/testimage: if start fails, don't try to stopPaul Eggleton
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>
2014-04-30oeqa/targetcontrol: restart method shouldn't be abstractStefan Stanacar
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>
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. (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>
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. (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>
2014-02-28oeqa/targetcontrol: make BaseTarget an abstract classStefan Stanacar
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>
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. (From OE-Core rev: 19af3ac53690b1bd2fee54827090f59c525d2236) Signed-off-by: Stefan Stanacar <stefanx.stanacar@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. (From OE-Core rev: 3f25705f4a986e06cbd397aaea52b841c1a1e054) Signed-off-by: Sipke Vriend <sipke.vriend@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-01-19lib/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. (From OE-Core rev: 9b81aff0aca42353d448b1e9522f89842e23c7b2) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03lib/oeqa: targetcontrol.py: add abstraction for running tests on different ↵Stefan Stanacar
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>