Commit Graph

15 Commits

Author SHA1 Message Date
Ed Bartosh 7066f1671e oeqa/targetcontrol: make ssh control optional
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-15 16:28:44 +00:00
Ed Bartosh d083fec6d1 oe-selftest: remove unused parameter
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-15 16:28:44 +00:00
Ed Bartosh 947e5260f9 oeqa: setup bitbake logger after tinfoil.shutdown
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>
2016-02-10 15:51:15 +00:00
Richard Purdie 18dfdb0840 oeqa/commands: Increase qemu boot timeout to match testimage.bbclass
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-08-01 07:34:08 +01:00
Richard Purdie 76d8c4e97c oeqa/selftest/imagefeatures: Use QemuTarget code
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-07-27 23:29:14 +01:00
Paul Eggleton e22c18113b lib/oeqa/utils/commands: ensure get_bb_var() works when value contains =
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-06-18 09:14:06 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
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-20 21:41:04 +01:00
Lucian Musat 3e7dde7d16 oeqa/utils: Fixed a problem with get_bb_var not returning right variable.
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-14 11:44:00 +01:00
Ed Bartosh 8bc5ccb7a6 oeqa/utils: Allow ~ in bblayers
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-05-03 11:43:48 +01:00
Paul Eggleton a0b774e43f oe-selftest: support getting unexported variable values
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>
2015-03-20 11:27:47 +00:00
Paul Eggleton d4d73b0139 oeqa/utils: replace some tabs with spaces
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-25 08:27:12 +00:00
Paul Eggleton d7aec8c5f4 oeqa/utils: make get_bb_var() more reliable
* 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-12-23 10:18:15 +00:00
Corneliu Stoicescu a934aebcb8 oeqa/utils/commands.py: add support for postconfig option
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-06-10 17:24:17 +01:00
Paul Eggleton 3a4bb1aa60 oeqa: add proper handling for command errors where needed
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>
2014-04-30 21:52:33 +01:00
Stefan Stanacar 645dd61cd2 scripts/oe-selftest: script to run builds as unittest against bitbake or 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>
2013-12-03 17:45:50 +00:00