aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2015-08-01rootfs.py: fix PRE/POSTPROCESS_COMMANDS for rpm and debRobert Yang
The rpm didn't run RPM_PREPROCESS_COMMANDS or RPM_POSTPROCESS_COMMANDS, the similar to deb, this patch fix the problem. And fix a typo: DEB_POSTPROCESS_COMMAND -> DEB_POSTPROCESS_COMMANDS Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31oeqa/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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31oeqa/sstatetests.py: add annotator to test_sstate_32_64_same_hash [YOCTO #6006]Costin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-31oeqa/sstatetests.py: add decorator to test_sstate_nativelsbstring_same_hashCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-31oe-selftest: devtool: fix teardown warning in test_devtool_update_recipe_appendPaul Eggleton
We don't need to run bitbake -c cleansstate on this because it's being cleaned out as part of "devtool reset". Addresses [YOCTO #8031]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-31sshcontrol: Use os.environ.copy() instead of copy.copy()Richard Purdie
os.environ is special and copy.copy() doesn't do what we'd expect, changes in the child object change the parent. copy.deepcopy() is also known to have issues with it. Use the dedicated .copy() method which will not influence the parent. This fixes selftest failures where the DISPLAY variable disappears. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-29lib/oe/classextend: Fix nativesdk double name mappingRichard Purdie
Handle the case a name has already been extended in the nativesdk case (avoids double name extensions which can happen with nativesdk-gcc). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/qemurunner: Fix AttributeError: QemuRunner instance has no attribute ↵Richard Purdie
'server_socket' If start() returns False due to create_socker() failing, stop() may still get called and currently this gives a track back since server_socket doesn't exist. Avoid this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27qemurunner: Show last 25 line of log, not 5Richard Purdie
For debugging purposes, 5 lines often isn't useful as it doesn't even cover a full backtrace. Show 25 instead. 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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/selftest/devtool: use new runqemu functionPaul Eggleton
Use the common code we now have to run QEMU instead of running it ourselves, avoiding reliance on the machine showing up at 192.168.7.2. This also makes a copy of the image rather than using -snapshot so if we need to inspect the image after a failure, we can. Fixes [YOCTO #7928]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/selftest/imagefeatures: remove gummiboot testsPaul Eggleton
These tests were _deleting_ meta-intel if it happened to appear under COREBASE, which could have been catastrophic if there was any work in progress in that directory. It turns out we don't even need meta-intel, but we do need a machine that's set up appropriately (e.g. genericx86-64). Tests that involve layers outside of OE-Core don't really belong in OE-Core, and genericx86-64 is in meta-yocto-bsp; however we will soon have the capability to have selftest tests in other layers, so remove this here so we can add a fixed version in meta-yocto-bsp after that happens. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/selftest/imagefeatures: fix RPM4 testPaul Eggleton
* Use our new runqemu function * Don't hard-code the RPM4 version * Double-check the native version is RPM4 * Check that an rpm 4.x package is in the image manifest (this isn't strictly necessary, but "belt-and-braces" and it serves as an example of how to do that) * Check that the database is working on the target * Ensure the image actually has openssh in it so we can connect to it Initial runqemu adaptation by Richard Purdie <richard.purdie@linuxfoundation.org> Part of the fix for [YOCTO #7994]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/selftest/imagefeatures: fix SSH without password testsRichard Purdie
* We need to set EXTRA_IMAGE_FEATURES outright or existing values will affect the test * For test case 1107 we need "empty-root-password" to match the behaviour described in the test case * For test case 1115 we shouldn't be able to connect as root with the features we are setting Test cases 1107 and 1115 have been updated in Testopia to match. 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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> 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.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/utils/qemurunner: fix error handling if runqemu exits with an errorPaul Eggleton
* Don't wait for QEMU to start if it's never going to (because runqemu exited with an error) * Don't error out if killing the process fails with "no such process" (we don't care if it's already dead) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/utils/qemurunner: avoid blocking on stty when running under oe-selftestPaul Eggleton
runqemu-internal runs stty to return the terminal to its previous state in case QEMU hasn't done that properly (which it at least used to do when it crashed). For some reason I have yet to determine, stty blocks (on tcsetattr() according to gdb) when run within QemuRunner() under oe-selftest, with the result that we always wait until the timeout and then we kill the script, which adds an extra delay after QEMU is stopped. Naturally you would assume that this is something to do with the nature of the terminal under which it is being run; however no amount of playing around with stdin/stdout/stderr seemed to fix the issue, apart from passing in subprocess.PIPE as stdin which makes stty error out with "stty: standard input: Inappropriate ioctl for device". I was also unable to come up with a reliable test for the terminal which we could use inside runqemu-internal to avoid calling stty. For now, go with the stdin=subprocess.PIPE workaround to at least avoid the delay with minimal ill effect. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/utils/qemurunner: fix loggingPaul Eggleton
OE-Core commit 519e381278d40bdac79add340e4c0460a9f97e17 unfortunately broke logging in two different ways: 1) it prevented logging to the task log from working within bitbake -c testimage. This is due to the logger object being set up too early which interferes with BitBake's own logging. If we prefix the name with "BitBake." everything works (and we don't need to set the logging level). 2) Additionally because it called the log functions on the logging module and not the logger object it set up, this caused the oe-selftest logging to start printing everything from that point forward. Fix these two issues and return us to the desired behaviour for do_testimage. 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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27oeqa/recipetool: allow templayerdir overrideChristopher Larson
This is provided for use by subclasses. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27oeqa/recipetool: add tests for appendsrcfile(s)Christopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-27oeqa/recipetool: refactor / split out RecipetoolBaseChristopher Larson
Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-25oeqa: Add exception handling around qemu process cleanupRichard Purdie
The qemu processes may no longer exist at the end of the test so don't error if that is the case by ignoring any exceptions. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-24oeqa/qemurunner: don't assume hostname starts with qemuRoss Burton
It's possible to customise the hostname trivially so don't assume that the hostname hasn't been configured. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-24oeqa/runtime/parselogs: don't use uname to get MACHINERoss Burton
Instead of running "uname -n" on the target (which actually returns the hostname) to get something approximating the hostname (or not, if that has been overriden), simply fetch MACHINE from the datastore. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-24oeqa/selftest/imagefeatures: handle killpg victim not existingRoss Burton
If Pexpect throws an exception it may be because the child has already died, in which case killpg will fail. Catch the latter exception silently, and output the exception from Pexpect. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-24oeqa/runtime/parselogs: add more x86 log exceptionsRoss Burton
Move "fail to add MMCONFIG..." to qemux86_common as we started to also see it on x86-64 with Linux 4.1. Add "can't claim BAR..." to qemux86_common. Generalise "Failed to access perfctr MSR" as the MSR number can change. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-24oeqa/sshcontrol: Ensure we don't trigger ssh-askpassRichard Purdie
If DISPLAY is set, ssh-askpass can be triggered which is not what we want in the middle of sanity tests. We can disable this by unsetting DISPLAY. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/buildoptions.py: automate test case 926, archive work dir and export sourceCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/buildoptions.py: automate test case 563; build directfb imageCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/QemuRunner: don't use bb for loggingRoss Burton
Instead of using bb.note() etc for logging use logging.Logger directly, allowing the use of QemuRunner outside of bitbake. Also clean up the logging/errors by moving create_socket() out of __init__()/restart() and into start(). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/syslog: Removed a pointless testcase and added skip for another.Lucian Musat
The testcase syslog --help was rather useless and also causing problems on images where syslog was non-busybox, like LSB images so I removed it. Added a skip condition for TC 202 for the same reason. If syslog is non-busybox then the test skips. 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-07-22oeqa/runtime: Added decorators for the remaining auto tests.Lucian Musat
This helps for the automatic completion of the results in testopia. 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-07-22oeqa/runtime: Added a new automated rpm test.Daniel Istrate
testcase 195: Check rpm install/removal log file size Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/prservice: add useful failure messages to test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/recipetool: add useful failure messages to test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/pkgdata: add useful failure messages to test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oeqa/runtime: Added one runtime testcase in connman.Daniel Istrate
(testcase 223) Check that only one connmand runs in background. Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pvAníbal Limón
Some recipes uses v or r prefixes in versions that makes wrong comparisions over recipes like lz4 r123 > 128. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oe/recipeutils.py: get_recipe_upstream_info update to get revisionAníbal Limón
Bitbake fetcher latest_versionstring now returns a tuple with (version, revision) that helps SCM's like git to build current upstream version. [YOCTO #7605] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-22oe/recipeutils.py: get_recipe_upstream_info only use sfx and pfx when exitsAníbal Limón
Don't use pfx and sfx when not exist because cause formatting errors like 2.9HASH instead of 2.9+gitAUTOINC+HASH. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-21oeqa/selftest: Fix imagefeature testcases not to interfere with testimage on ABDaniel Istrate
[YOCTO #8017] - selftest does not use pkill qemu [YOCTO #7976] - tests do not touch .ssh/known_hosts - don't hardcode qemu IP [YOCTO #8027] - use qemu nographic Extra: removed unnecessary assert for bitbake and runCmd status Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-20lib/oe/package_manager: Use log-level warning instead of quietRichard Purdie
quiet means that no warnings are shown on the console and really is too quiet for our needs. This is more verbose but that is better than too little and does aid debugging things when they go wrong. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16lib/oe/recipeutils: fix replace_dir_vars to return the correct variablesPaul Eggleton
If we sort by length of name here we get the variables we are interested in first. I've tested this with all of the variables we care about (the ones at the top of bitbake.conf) and it returns the right results. This fixes the failures we've been seeing in the oe-selftest test_recipetool_appendfile_* tests. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16oeqa/devtool: add useful failure messages for some test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16oeqa/buildoptions: add useful failure messages for all test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16oeqa/bblayers.py: add useful failure messages to all test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-16oeqa/bbtests: add useful failure messages for all test casesCostin Constantin
Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-07-12oe/recipeutils.py: get_recipe_upstream_version returns 1.0 when not SRC_URIAníbal Limón
Recipes that don't have SRC_URI means that don't use upstream sources so returns 1.0. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>