aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
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>
2015-08-30image.py: write bitbake variables to .env fileEd Bartosh
Write set of bitbake variables used by wic into build/tmp/sysroots/<machine>/imagedata/<image>.env List of variables is defined in WICVARS variable in meta/classes/image_types.bbclass. This is needed for wic to be able to get bitbake variables without running 'bitbake -e'. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30oeqa/utils/dump: Handle empty commandlist gracefullyRichard Purdie
If the commandlist isn't available, the code currently gives a backtrace. At least stop doing that and return more gracefully. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-30oeqa/runtime/multilib: add test for libcRoss Burton
Add a basic test to verify that /lib/libc.so.6 and /lib32/libc.so.6 have the right ELF class. Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30oetest: Fix regresion when testing real hardwareMariano Lopez
This fix the regresion introduced in commit 9c72c1a5aa0b49d3895bbefee7a264adfcc6f4ca when testing with real hardware. This regression happens when a test in real hardware fails. [YOCTO #8203] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
2015-08-30dump: allow to have datastore vars on dump commandsMariano Lopez
This allows to have datastore variables in the dump commands and will get the data when a new instance it's created. Also this remove special cases from the commands. [YOCTO #8118] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
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] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
2015-08-30image.py: add script output to the rootfs logEd Bartosh
Let's add output of image creation script to the bitbake log as it can contain useful information. One good example of such an information is wic report about artifacts and .wks file used for image creation. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30image.py: set bitbake variable ROOTFS_SIZEEd Bartosh
This variable is going to be used by wic to set partition size. Setting it in image.py makes it possible for wic to use it without calculating it again. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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) 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-08-30lib/oe/patch: handle patches that delete files with older gitPaul Eggleton
When running "git add" on a directory with older git versions, deleted files aren't added to what is to be committed unless you explicitly specify the -A option. The result of this is that when applying a patch from a recipe which doesn't apply with "git am" (and we fall back to applying the patch through other means then "git add" following by a "git commit") these deletes weren't committed with the patch, leaving them sitting deleted but not committed at the end. This should fix test_devtool_modify_native (which unwittingly exercises this scenario by attempting to run "devtool modify" on apt-native) on machines with older git versions. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-08-30oeqa: Optimise sstate testsRichard Purdie
We can use "none" here instead of printdiff for some small performance gains. This also means we can remove the ignore exit code hack which leads to safer code. Also drop an unused variable. (From OE-Core rev: e2b8d6fa45b1ae530be2ffabf48ea61d4c467066) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29Empty image: package list splitting and iterationAlex Franco
A few short fixes to splitting/iteration done over package lists in license.bbclass, package_manager.py and rootfs.py. [YOCTO #7664] Signed-off-by: Alex Franco <alejandro.franco@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29oeqa/runtime/multilib: fix and improve multilib testRoss Burton
Replace the previous shell magic with a Python function to parse the readelf output, and fix the package names to include the lib32- prefix. [ YOCTO #8219 ] Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-29qemurunner: Don't loop on EWOULDBLOCK in logging thread.Randy Witt
EAGAIN/EWOULDBLOCK can be followed by no data. So don't tight loop waiting for data. Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>