aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2015-09-22oeqa/utils/qemurunner.py: Remove duplicate message on LoggingThread startAníbal Limón
The Starting logging thread message is also executed on run() inside LoggingThread class. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22oeqa/utils/qemurunner.py: Fix HIGH CPU usage on LoggingThreadAníbal Limón
LoggingThread is used for receive console output from QEMU over TCP, so add filter to only wake poll on read events, also change the event mask variable name to be more descriptive. This fixes HIGH CPU consume caused by wake on ready to write events. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool: build-image: delete bbappend at end of buildPaul Eggleton
Upon further reflection, it seems to me that this bbappend ought to just be deleted at the end of the build. This keeps things simple; you never have to remember to delete any files to get back to where you were before with the image. This means we can also drop the slightly awkward message reminding the user how to do that. I've also updated the test to look at the image manifest to determine if the command has worked instead of looking for the (now deleted) bbappend. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22devtool / lib/oe/recipeutils: ensure we can parse without bbappendsPaul Eggleton
These functions ostensibly allowed parsing a recipe without bbappends but this clearly hadn't been tested because a variable was unassigned in both of them in that case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22lib/oe/patch: fix for git am not cleaning up after itselfPaul Eggleton
Unfortunately it appears that under certain circumstances, a failed git am followed by git am --abort won't clean up any changes the patch might have made - this was seen when running "devtool extract" on the unzip recipe; unzip-6.0_overflow3.diff has a malformed date as far as git am is concerned but it triggers this condition. Add a git reset --hard HEAD followed by git clean -f in order to recover from this scenario. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22lib/oe/recipeutils: properly split unexpanded variable valuesPaul Eggleton
Variables such as SRC_URI which are space-separated may also contain Python expressions (${@...}) which themselves contain spaces that shouldn't be split when splitting the value into items. In order to ensure this we need to use a custom splitting function instead of just string.split(). This issue could be seen when doing "devtool modify sudo", adding a commit to the resulting source repository then "devtool update-recipe" - the Python expression in SRC_URI was being unnecessarily broken onto multiple lines. Fixes [YOCTO #8046]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-22oeqa/selftest: buildoptions.py Removed unused importsDaniel Istrate
Removed unused imports: unittest, logging, pexpect Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-21oeqa/testimage: Enhance -v switch in testimageLucian Musat
When testimage is run with -v switch now individual test progress can be seen directly in bitbake console. [YOCTO #6841] Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-16oeqa/sstatetests: Add test for nativesdk stamp invariance with MACHINERichard Purdie
nativesdk-glbic should not rebuild when you change MACHINE but it was. We've fixed that, now add tests to ensure this doesn't happen again. Rather than add yet another stamps test, extend one of the existing ones to cover this instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-16image.py: Ensure base image size is an integerPatrick Williams
There is a floating point multiplication done of a base image size and an "overhead factor", which is currently rounded up to the next integer. If the multiplication results in a whole number, the value will still be a float. When this float is used to generate a shell script, a buggy script is generated. Fix this by always forcing to an integer. Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-15oeqa/decorators: Added decorator to restart the DUT in case of test hang.Lucian Musat
Once the DUT is hanged during testing, currently all the following test cases have to wait for default timeout to exit. Using this decorator the user can choose a timeout at case by case basis and what happens when the timeout is reached by overwriting the self.target.restart method. [YOCTO #7853] Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12image.py: Allow IMAGE_LINK_NAME to be emptyMike Looijmans
When IMAGE_LINK_NAME is empty, OE will try to create a "blank" link instead of just skipping it. The code checks for "link_name is not None" which will never evaluate to true. Change the test to a simple "if link_name:" so it no longer attempt to create links when the variable is an empty string. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12oeqa/targetbuild: Ensure we run gnu-configize so config files are up to dateRichard Purdie
On aarch64 we need to do this as the versions in the upstream source don't recognise the target triplet causing SDK test failures. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-12classes/sstate: break out function to get sstate manifest filenamePaul Eggleton
It is useful in a few different contexts to see which files have been written out by an sstate task; break out a function that lets us get the path to the manifest file easily. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-12oeqa: 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: 77e9363feba53b72429154be5713c46b007ae0a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-11oeqa/runtime/date: stop systemd-timesyncd during testRoss Burton
There's a race between systemd-timesyncd manipulating the system time (with NTP lookups) and the test case's time manipulation. Prevent this by stopping systemd-timesyncd for the duration of the test case. Thanks to Khem Raj for root-causing this. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-09-10rootfs: Conditionally uninstall update-rc.dKhem Raj
update-rc.d is now needed by systemd to interact with sysv scripts, so if we have a mixed system, then we can not uninstall update-rc.d as it is going to break systemd functionality, we check for sysvinit and sytemd in distro and also ensure that its not building an image with readonly rootfs Signed-off-by: Khem Raj <raj.khem@gmail.com>
2015-09-10Revert "rootfs: Do not uninstall update-rc.d"Richard Purdie
This reverts commit acf90b6c299afe9e9c8fa33c3c6992bfcf40fbbf. (Reverted to apply the better v2 of the patch)
2015-09-09oeqa/sstatettests: Improve output of assertRichard Purdie
Currently if this fails you see: "AssertionError: 1 != 0" which is useless. Add the output of the failed command so we can stand some chance of debugging what went wrong. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: update-recipe: better 'auto' modeMarkus Lehtonen
Enhance the logic behind the 'auto' mode a bit by only updating the SRCREV if the changes are already found upstream. The logic is simple: update SRCREV only if the current local HEAD commit is found in the remote branch (i.e. 'origin/<branch_name>'). Otherwise resort to patching. This affects a couple of the oe-selftest tests so update those as well. [YOCTO #7907] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09devtool: add upgrade featureLeonardo Sandoval
Upgrades a recipe to a particular version and downloads the source code into a folder. User can avoid patching the source code. These are the general steps of the upgrade function: - Extract current recipe source code into srctree and create a branch - Extract upgrade recipe source code into srctree and rebase with previous branch. In case the rebase is not correctly applied, source code will not be deleted, so user correct the patches - Creates the new recipe under the workspace [YOCTO #7642] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09oeqa/parselogs: Updated log error whitelist.Cristina Agurida
[YOCTO #7898] [YOCTO #7761] [YOCTO #7804] Signed-off-by: Cristina Agurida <cristina-danielax.agurida@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09qemurunner: Fix killpg pid usageRichard Purdie
killpg should be being called with a pgid, not a pid. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09qemurunner: Ensure runqemu doesn't survive SIGKILLRichard Purdie
Currently, we see runqemu and qemu-system-* processes left behind when bitbake is killed by buildbot. This is due to the use of setpgrp() in the runqemu subprocess call. We need the setpgrp call so that all runqemu processes can easily be killed (by killing their process group). This presents a problem if this controlling process itself is killed however since those processes don't notice the death of the parent and merrily continue on. Rather than hack runqemu to deal with this, we add something to qemurunner, at least for now to resolve the issue. Basically we fork off another process which holds an open pipe to the parent and also is setpgrp. If/when the pipe sees EOF from the parent dieing, it kills the process group. This is like pctrl's PDEATHSIG but for a process group rather than a single process. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09rootfs.py: show intercept script output in log.do_rootfsMartin Jansa
* without this the output wasn't shown anywhere even when the bb.warn says: "See log for details!" Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-09package_manager.py: search provides when not found by pkgnameRobert Yang
Fixed when: PACKAGE_CLASSES = "package_rpm" IMAGE_INSTALL_append = " perl-module-warnings-register" $ bitbake core-image-minimal [snip] ERROR: perl-module-warnings-register not found in the base feeds [snip] And it works well when PACKAGE_CLASSES = "package_ipk" since perl provides perl-module-warnings-register, the "smart install perl-module-warnings-register" also works well, this was because _search_pkg_name_in_feeds() only searched pkg name, but no provides, this patch fixes the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07rootfs: Do not uninstall update-rc.dKhem Raj
update-rc.d is now needed by systemd to interact with sysv scripts, so if we have a mixed system, then we can not uninstall update-rc.d as it is going to break systemd functionality Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07qemurunner: Drop error to a warning to improve user feedbackRichard Purdie
If a task shows an error, the full log is surpressed since bitbake assumes the user has been shown what is wrong. In this code path that isn't the case and its much more helpful to show the user the full error. Therefore show a warning instead to aid usability. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07copy_buildsystem: make sure bitbake directory is copiedQi.Chen@windriver.com
The previous code assumes that bitbake/ directory is under the core layer. This is the case for Yocto project. But users might clone oe-core and bitbake separately. So we use bb.__file__ to locate the bitbake directory to make sure it's copied into the extensible SDK. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07testimage: handle SIGTERM to conclude runqemuMariano Lopez
In the current state if a SIGTERM is sent to the testimage worker, the worker will exit but runqemu and qemu won't exit and the processes need to be killed manually to free the bitbake lock. This allows to catch the SIGTERM signal in testimage, this way it is possible to stop runqemu and qemu and allow to free the bitbake lock. Also this allows to skip the rest of the tests when running the tests in qemu or real hardware. This also solves minimal breaks in the setup of the runtime test when checking if qemu is alive. [YOCTO #8239] Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-07rootfs.py: Allow to override postinst-intercepts locationMartin Jansa
* useful when we need to overlay/extend intercept scripts from oe-core Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-06oeqa/decorators: Fixed a problem with tests having the same names.Lucian Musat
When two or more tests had the same name but different classes then the decorator log whould have the output all wrong. This was because a comparison which was made only between method names but now it compares classes too. [YOCTO #8029] Signed-off-by: Lucian Musat <george.l.musat@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-05oeqa: 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 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03testimage: filter proper test cases by tagszjh
If a test case is decorate by oeqa.utils.decorators.tag, this case will by add a tag, testrunner will filter these tags by TEST_SUITES_TAGS [YOCTO #7849] Signed-off-by: zjh <junhuix.zhang@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03lib/oe/package_manager: Include PACKAGE_FEED_PREFIX instead of hardcode pathsLeonardo Sandoval
Instead of hardcode paths (/rpm/, /ipk/, /deb/), use a user-defined prefix when creating the URI feeds. URIs now will have the following syntax: PACKAGE_FEED_URIS_1/PACKAGE_FEED_PREFIX PACKAGE_FEED_URIS_2/PACKAGE_FEED_PREFIX . where PACKAGE_FEED_URIS = "PACKAGE_FEED_URIS_1 PACKAGE_FEED_URIS_2 ...." [YOCTO #5407] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-03sdk.py: fix conflicts of packagesJian Liu
If packages are conveyed to smart to install at the same time, conflicts will not happen. Try to install packages into sdk image at the same time. This patch is not so perfect. For example, IMAGE_INSTALL += "lib32-ncurses" IMAGE_INSTALL += "ncurses-dev" ncurses-dev and lib32-ncurses-dev will have conflicts during packages installation. Signed-off-by: Jian Liu <jian.liu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02qemurunner: Handle lack of data on run serial gracefullyMariano Lopez
This changes the behavior when data was not received over the serial console when a command is run. With this the socket is no longer closed but it throws and exception that can handled in upper layers. With this the test can continue without throwing errors for not having the socket anymore. [YOCTO #8118] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02image.py: rename _write_env -> _write_wic_envEd Bartosh
Renamed this function as it's too generic name for it. It writes variables, which are used by wic to .env file, so _write_wic_env is better name for it. Thanks Christopher Larson for poining out to this. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02wic: add test cases for 3 imagesEd Bartosh
Added test cases to build qemux86_directdisk, mkgummidisk and mkefdisk images. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-02oe-selftest: wic: configure a buildEd Bartosh
Added MACHINE_FEATURES and IMAGE_FSTYPES variables to the build config to ensure that bootimg and efi artifacts are built. This is needed to build canned wic images that are using those artifacts. Introduced class variable Wic.image_is_ready to avoid building image more than once. It would be better to build image in setUpClass, which is called only once, but add_config method can't be called in class method, so we have to use this trick with class variable in setUp method. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01package_manager: support for signed RPM package feedsMarkus Lehtonen
This change makes it possible to create GPG signed RPM package feeds - i.e. package feed with GPG signed metadata (repodata). All deployed RPM repositories will be signed and the GPG public key is copied to the rpm deployment directory. In order to enable the new feature one needs to define four variables in bitbake configuration. 1. 'PACKAGE_FEED_SIGN = "1"' enabling the feature 2. 'PACKAGE_FEED_GPG_NAME = "<key_id>"' defining the GPG key to use for signing 3. 'PACKAGE_FEED_GPG_PASSPHRASE_FILE = "<path_to_file>"' pointing to a file containing the passphrase for the secret signing key 4. 'PACKAGE_FEED_GPG_PUBKEY = "<path_to_pubkey>"' pointing to the corresponding public key (in "armor" format) The user may define "GPG_BIN" in the bitbake configuration in order to specify a specific the gpg binary/wrapper to use for signing. [YOCTO #8134] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01package_rpm: support signing of rpm packagesMarkus Lehtonen
This patch adds a new bbclass for generating rpm packages that are signed with a user defined key. The packages are signed as part of the "package_write_rpm" task. In order to enable the feature you need to 1. 'INHERIT += " sign_rpm"' in bitbake config (e.g. local or distro) 2. Create a file that contains the passphrase to your gpg secret key 3. 'RPM_GPG_PASSPHRASE_FILE = "<path_to_file>" in bitbake config, pointing to the passphrase file created in 2. 4. Define GPG key name to use by either defining 'RPM_GPG_NAME = "<key_id>" in bitbake config OR by defining %_gpg_name <key_id> in your ~/.oerpmmacros file 5. 'RPM_GPG_PUBKEY = "<path_to_pubkey>" in bitbake config pointing to the public key (in "armor" format) The user may optionally define "GPG_BIN" variable in the bitbake configuration in order to specify a specific gpg binary/wrapper to use. The sign_rpm.bbclass implements a simple scenario of locally signing the packages. It could be replaced by a more advanced class that would utilize a separate signing server for signing the packages, for example. [YOCTO #8134] Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01runexported: Make it compatible with host dumpMariano Lopez
Currently it is not possible to run a exported test, but this patch will allow to use the HosDumper class when running a exported test, otherwise the HostDumper class will break runexpored test. [YOCTO #8118] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01qemurunner: 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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-09-01opkg: upgrade to v0.3.0Alejandro del Castillo
Changes required: - Rename opkg-cl to opkg - Add libarchive dependency - Drop backport patches - Drop obsolete directory options - Add patch to handle empty index files Based on initial work by Paul Barker. Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com> CC: Paul Barker <paul@paulbarker.me.uk> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31oe-selftest: test devtool build-image pluginEd Bartosh
Added test case to test functionaly of build-image plugin: Add two packages to workspace and run 'devtool build-image core-image-minimal'. Checked if command is successful. Checked if expected package is added to generated core-image-minimal.bbappend file. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2015-08-31oe-selftest: wic: fix test19_image_env test caseEd Bartosh
This test case fails on qemu machines as not all expected bitbake variables are present in .env file. Fixed by filtering out optional variables. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-31oeqa: Add allarch sstate sig testRichard Purdie
"allarch" targets should be MACHINE invariant. This means their sstate signature should not change regardless of which MACHINE is built. Errors keep creeping in around this area so automating this as part of self test seems the best way to maintain this. The "do_build" stamps are known to differ and are harmless so those are excluded from the test. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30oe-selftest: test building wic image by bitbakeEd Bartosh
Added test case to verify building of wic-image-minimal recipe and produced artifacts: manifest and bzipped partitioned image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30oe-selftest: test generation of <image>.envEd Bartosh
Added test case to check if <image>.env file is generated and contains bitbake variables used in wic code. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>