aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/commands.py
AgeCommit message (Collapse)Author
2016-07-01oeqa/utils/commands: fix single-character variable matching in get_bb_vars()Ross Burton
(From OE-Core rev: 2f7e4d0636ce1647edf2d82c65b82be0eb2c1db1) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01oeqa.utils.commands: runCmd: return stderr output, tooMarkus Lehtonen
Useful if one wants to separate stdout and stderr. (From OE-Core rev: de9744c91a997a5ab0e7a19dbe13d8def8d62800) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01oeqa.utils.commands: use get_bb_vars() in get_bb_var()Markus Lehtonen
Get rid of duplicate code. (From OE-Core rev: cdd6b7386afd460337705d8117a4328d4993ecef) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01oeqa.utils.commands: Introduce get_bb_vars()Markus Lehtonen
A new function for getting values of multiple bitbake variables at the same time. (From OE-Core rev: fe3039322e2f846b336ac5af5177e9da27d79695) Signed-off-by: Markus Lehtonen <markus.lehtonen@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-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. (From OE-Core rev: bb4685af1bffe17b3aa92a6d21398f38a44ea874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-12oeqa/runexported.py: Fix exported testMariano Lopez
With the changes introduced to test the eSDK the runexported test failed during the execution. This change fix runexported test in the least invasive way, because of the release cycle. (From OE-Core rev: da0abb9679cb1fd639859a2fdbd82101d0a81259) Signed-off-by: Mariano Lopez <mariano.lopez@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>
2016-02-15oe-selftest: remove unused parameterEd Bartosh
Removed unused parameter 'test' from runqemu function. (From OE-Core rev: c688b3bcbb57099fa72a9728bc708b109802f7fc) (From OE-Core rev: a7af1eb28fab515180c0fa01a003ac7b2ce0cff4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10oeqa: setup bitbake logger after tinfoil.shutdownEd Bartosh
Bitbake logger stops working after tinfoil.shutdown removes console handler from it. This makes bb.{error,warn,note,critical} messages disappear from the console. Adding console handler to bitbake logger again should fix this issue. (From OE-Core rev: ef372c1829b5818fd20224d305f6e20fba643acc) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-01oeqa/commands: Increase qemu boot timeout to match testimage.bbclassRichard Purdie
This matches the value in testimage.bbclass, which makes sense since the autobuilders are usually contended. (From OE-Core rev: dd5c87900b73bf44cf96735706d7d06e56b4d20e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/selftest/imagefeatures: Use QemuTarget codeRichard Purdie
Create a runqemu function which uses the QemuTarget() code from oeqa.targetcontrol to setup the QEMU instance, with all of the added robustness that that gives us. To do this, a datastore is needed for the recipe in question (core-image-minimal) so we do the work needed to set this up. We then use this runqemu function within the imagefeatures tests instead of a hand-rolled implementation. We can then use SSHControl to run the SSH tests rather than rolling our own code to do that as an added bonus. Fixed and extended by Paul Eggleton <paul.eggleton@linux.intel.com>. Part of the fix for [YOCTO #7994]. (From OE-Core rev: 7d18d1169204ee80f1c00b35998f10fffaefa107) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-18lib/oeqa/utils/commands: ensure get_bb_var() works when value contains =Paul Eggleton
Only split on the first equals character so that values that contain equals characters (such as FAKEROOTENV) can be retrieved. (From OE-Core rev: ff720dd3b77130b2c485d7acad63735fd8751a7d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20recipetool: add appendfile subcommandPaul Eggleton
Locating which recipe provides a file in an image that you want to modify and then figuring out how to bbappend the recipe in order to replace it can be a tedious process. Thus, add a new appendfile subcommand to recipetool, providing the ability to create a bbappend file to add/replace any file in the target system. Without the -r option, it will search for the recipe packaging the specified file (using pkgdata from previously built recipes). The bbappend will be created at the appropriate path within the specified layer directory (which may or may not be in your bblayers.conf) or if one already exists it will be updated appropriately. Fairly extensive oe-selftest tests are also provided. Implements [YOCTO #6447]. (From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14oeqa/utils: Fixed a problem with get_bb_var not returning right variable.Lucian Musat
It searches using regex now and should be more accurate. (From OE-Core rev: 1ae7e1cc4a5c7a217dee937c330539e5c8ac794d) Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-03oeqa/utils: Allow ~ in bblayersEd Bartosh
Bitbake can parse ~ in bblayer's paths. Added this functionality to oeqa code. (From OE-Core rev: b4dc5b271247a1894d66908c5f20973be2a60d43) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-03-20oe-selftest: support getting unexported variable valuesPaul Eggleton
Allow get_bb_var() to work with unexported variable values such as MACHINE - the workaround is a little crude but should suffice for now. (From OE-Core rev: 48b58466bba084fd3439706d47e0cfbb7e951ee4) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-25oeqa/utils: replace some tabs with spacesPaul Eggleton
Python code should use spaces only for indentation. (From OE-Core rev: a1e22121e521aabf454a850cd7c8be60b7b1adc3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-12-23oeqa/utils: make get_bb_var() more reliablePaul Eggleton
* Enable querying exported variables * Use strip() to remove quotes so any internal quotes are not disturbed (From OE-Core rev: 418cdf1ca37e06165ebaec86a0098d4750208539) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-06-10oeqa/utils/commands.py: add support for postconfig optionCorneliu Stoicescu
Adding support for postconfig option to the bitbake() and related methods. This enables us to use 'bitbake -R postconfig_file <command>'. Usage: bitbake(cmd, postconfig="some confguration") 'postconfig_file' would contain what we add in 'postconfig' Other methods affected: get_bb_env(), get_bb_var() (From OE-Core rev: 4fe771940a8f59a0d5f1541978d6d9ff73b222f4) Signed-off-by: Corneliu Stoicescu <corneliux.stoicescu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-30oeqa: add proper handling for command errors where neededPaul Eggleton
For use outside of tests themselves, we want a better error than AssertionError, so create one and allow us to request it when calling runCmd(). This enables us to avoid tracebacks during master image operations if the power control command fails. (From OE-Core rev: 89868383685091b0d3723fb8f29590f3f6610078) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03scripts/oe-selftest: script to run builds as unittest against bitbake or ↵Stefan Stanacar
various scripts The purpose of oe-selftest is to run unittest modules added from meta/lib/oeqa/selftest, which are tests against bitbake tools. Right now the script it's useful for simple tests like: - "bitbake --someoption, change some metadata, bitbake X, check something" type scenarios (PR service, error output, etc) - or "bitbake-layers <...>" type scripts and yocto-bsp tools. This commit also adds some helper modules that the tests will use and a base class. Also, most of the tests will have a dependency on a meta-selftest layer which contains specially modified recipes/bbappends/include files for the purpose of the tests. The tests themselves will usually write to ".inc" files from the layer or in conf/selftest.inc (which is added as an include in local.conf at the start and removed at the end) It's a simple matter or sourcing the enviroment, adding the meta-selftest layer to bblayers.conf and running: oe-selftest to get some results. It would finish faster if at least a core-image-minimal was built before. [ YOCTO #4740 ] (From OE-Core rev: 41a4f8fb005328d3a631a9036ceb6dcf75754410) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>