aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2013-08-01oeqa/utils/sshcontrol: increase and log timeout in outputStefan Stanacar
Increase a bit the timeout for ssh commands and also write in the output that the command timed out (it's easier to see that in a test fail than checking the ssh log) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-30lib/oe/terminal.py: add support for MATE desktop terminalsAndre McCurdy
A simple clone of the corresponding Gnome class. Without this, devshell fails completely on a default installation of MATE desktop Linux Mint 15. Signed-off-by: Andre McCurdy <andre.mccurdy@entropic.com> Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa: fix dependecy checkStefan Stanacar
Adds missing skip for smart test and fix the check (which I somehow broke a while ago). Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15testimage.bbclass, lib/oeqa: add headers and commentsStefan Stanacar
Adds some comments to testimage.bbclass and the files it calls, just to give an ideea of what it does. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15classes/testimage.bbclass: use a copy of rootfs for testsStefan Stanacar
Make a copy of the rootfs and test that. We can now drop the snapshot option. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/runtime: add tests for syslog and dfAlexandru Palalau
Add tests for free space and syslog. Changed in v2: - limit df's output to / - syslog: fix restart in case of systemd Signed-off-by: Alexandru Palalau <alexandru.palalau@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/oetest.py: provide a ps command for all testsStefan Stanacar
Many tests will use 'ps' but we need to know if it's busybox or standard ps. Drop the existing check from the connman test. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/runtime/multilib.py: use readelf instead of fileStefan Stanacar
file was pulled by rpm in sato images, readelf comes with binutils so it's in ipk/deb too. Also the test was looking at connmand instead of connman-applet (which is what the testcase says and the AB nightly-multilib target installs) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15testimage.bbclass, lib/oeqa/utils/qemurunner.py: make boot timeout ↵Stefan Stanacar
configurable and increase it On a loaded host (such as an AB setup where multiple builds run) the 200 seconds timeout might not be enough to reach the login prompt. Also make it configurable so we can set it from local.conf/auto.conf Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/utils/sshcontrol.py: fix passing command to subprocessStefan Stanacar
Don't use shlex.split in subprocess call and also prepend . /etc/profile, because PATH over ssh is always /usr/bin:/bin which isn't what many tests expect. Changed in v2: We now need to use a separate call for scp command. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-15lib/oeqa/runtime/dmesg.py: whitelist dmesg message for systemd net interface ↵Stefan Stanacar
name Messages such as: "systemd-udevd[79]: error changing net interface name eth0 to enp0s3: Device or resource busy" are harmless as systemd can't rename interfaces in qemu (the interface is already active). Alternatively, passing net.ifnames=0 to the kernel will stop systemd renaming the interfaces. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-09lib/oeqa/runtime: add gcc testStefan Stanacar
gcc compile test and support files. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
2013-07-09lib/oeqa/runtime: image sanity testsStefan Stanacar
These are basic sanity tests. A test can be force run by setting TEST_SUITES = "ping ssh <module-name>" in local.conf. By default there are suites for minimal, sato and sato-sdk images. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Radu Moisan <radu.moisan@intel.com>
2013-07-09lib/oeqa/utils/decorators.py: decorators for test methodsRadu Moisan
Some skip decorators meant only for test methods, providing some kind of test methods dependency. They are used together with a test method name not a condition. These are complementary to python's unittest skip decorators. Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
2013-07-09lib/oeqa/utils/qemurunner.py: class to handle qemu instanceRadu Moisan
Handles qemu instances (launch, kill, restart, serial connection, logging) Launch is blocking until login prompt and returns to the task. A qemu serial connection is used to save the boot log and get the ip from the image. Changed runqemu script not to error out when using custom serial option. Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
2013-07-09lib/oeqa/utils/oeqemuconsole.py: handle qemu serial console connectionStefan Stanacar
Python's telnetlib Telnet class connects only to AF_INET sockets, but we want to use Unix domain socket for the qemu serial connection, so that's why we override it. Also we add a new read_all_timeout method similar to Telnet's read_all, that read until a match or timeout and logs all output. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
2013-07-09lib/oeqa/utils/sshcontrol.py: helper module for running remote commandsStefan Stanacar
Provides a class for setting up ssh connections, running commands and copying files to/from a target. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
2013-07-09lib/oeqa/oetest.py: base module for all runtime unittestsStefan Stanacar
This module contains the base class for all runtime tests and some helper methods. Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Radu Moisan <radu.moisan@intel.com>
2013-07-02TmuxRunning: handle multi-word commandsTyler Hall
Just as in f8ed7446755eeb88191e16749350efa1e7e6197c, tmux wants a single argument for its command. This applies to the "split-window" command as well as "new." Note that this alone is not enough to fix the TmuxRunning devshell when using pseudo because tmux does not preserve the environment that pseudo requires. Signed-off-by: Tyler Hall <tylerwhall@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-07-02lib/oe/lsb.py: fall back to /etc/os-release for host distro IDPaul Eggleton
The new standard for host distribution identification [1] is /etc/os-release, and a number of newer distributions provide this file, so add support for this in order to pick up more distributions. Additionally, handle "rolling release" style distributions that don't report a version number, e.g. Arch Linux. With this change we can identify the most common distributions, so this should satisfy [YOCTO #4271]. Note that this doesn't imply support for these distros as build hosts, just that we can identify them. [1] http://www.freedesktop.org/software/systemd/man/os-release.html Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-11handle two-word commands with tmuxPeter Seebach
Trying to make a devshell using tmux can fail because "tmux new" expects a single command, not a series of arguments. It does, however, split strings in a suitable way. So you can quote the command. The failure mode is particularly arcane, in that you end up with a message like: ERROR: Unable to spawn terminal auto: \ Execution of 'pseudo /bin/bash' failed with exit code 1: usage: new-session [-d] [-n window-name] [-s session-name] \ [-t target-session] [command] which is confusing because there's no "new-session" anywhere in sight (that's actually "tmux new"), and because what failed to execute wasn't either pseudo or bash. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07test_utils: import functions directly for concisenessRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-06-07test-utils: handle import bb failing and skip the testRoss Burton
Instead of reporting an error when bb cannot be imported, skip the test instead. This makes it a lot easier to iterate a test suite when we don't care about this particular test. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-30utils: add trim_version() functionRoss Burton
Add a helper function that returns just the first <num_parts> of <version>, split by periods. For example, trim_version("1.2.3", 2) will return "1.2". This should help reduce the spread of numerous copies of this idea across classes and recipes. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-15cachedpath.py: global name 'error' is not definedRobert Yang
The error is not global since we don't use "from os import *", so it should be os.error. [YOCTO #4489] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-10classes/buildhistory: track contents of selected files in imagesPaul Eggleton
Add a BUILDHISTORY_IMAGE_FILES variable specifying a space-separated list of files within an image to copy into buildhistory, so that changes to them can be tracked. Typically this would be used for configuration files, and by default this includes /etc/passwd and /etc/group, but the user is free to extend this list by setting the variable in local.conf. Implements [YOCTO #4154]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09class/lib: Fix up various file access methodsRichard Purdie
There are various bits of cruft that have built up around our file accesses. This patch cleans some of them up, specifically: * Remove pointless "from __builtin__ import file" * Use open(), not file() * Wrap file usage in a with container to ensure files are closed * Add missing .close() calls in some cases Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/lib: Fix getcmdstatus breakageRichard Purdie
I mistakenly thought subprocess had getcmdstatus in python 2. It doesn't so lets add a wrapper and have this work in both worlds. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09image/kernel-module-split/eglibc-ld.inc: Remove has_key() usageRichard Purdie
The has_key() attribute has been removed in python 3 since there is better syntax available. Use the improved syntax. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09sanity/patch.py: Remove commands module usageRichard Purdie
The commands module is removed in python3. Use the subprocess module instead and the pipes module to replace the mkargs usage. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09meta/lib/oe: Replace StandardError with ExceptionRichard Purdie
StandardError is removed in python3, replace with Exception class instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/lib: Update to use print as a function callRichard Purdie
In python 3 print is a function call. In some cases bb.note is a more appropriate call to make. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09classes/recipes/lib: Fix various python whitespace issuesRichard Purdie
There are some left over tab characters in the python functions. This removes them and resolves python 3 errors. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-09clases/lib: Use modern exception syntaxRichard Purdie
Update older code to use modern exception handling syntax which is the form accepted by python 3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03path.py: Deal with race issueRichard Purdie
The change to use copyhardlinktree in some of the sstate code instead of copytree exposed a race condition. This is due to cp failing if it finds a directory doesn't exist yet some other process creates it while cp was trying to create it itself. tar doesn't error in this case. To fix this we need to create the directory structure with tar, then use cp to hardlink the files. Messy but probably worth doing. I also took the opportunity to remove src_bak since the code is neater without it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-01sstate.bbclass: make hard links for staging filesRobert Yang
Make hard links for staging files instead of copy to save the disk space (3G will be saved for a core-image-sato build), and it doesn't affect much on the build time. The following directories are affected: 1) The sysroot 2) The DEPLOY_DIR 3) The pkgdata [YOCTO #4372] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-04-15oe.terminal: add tmux classesChristopher Larson
This adds two new Terminal classes. It's separated into two, so that opening a split inside a tmux window is preferred to the other terminal types, but opening a tmux session is prioritized only slightly higher than screen. - tmuxrunning: Open a new pane in the current running tmux window. Requires that the TMUX variable be added to the env whitelist to use it. - tmux: Open a new tmux session Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-05lib/oe/classextend.py: avoid extending any kernel packagePaul Eggleton
For multilib and other uses of classextend, we don't want any dependencies on kernel packages to be extended since there should only be one kernel variant. Fixes [YOCTO #2918] (where kernel-dev was being extended.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04utils: add helper to get all non-system packagesRoss Burton
For example if PACKAGES is "foo foo-data foo-dev foo-doc", this will return "foo-data". Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04oe.terminal: add tmux classesChristopher Larson
This adds two new Terminal classes. It's separated into two, so that opening a split inside a tmux window is preferred to the other terminal types, but opening a tmux session is prioritized only slightly higher than screen. - tmuxrunning: Open a new pane in the current running tmux window. Requires that the TMUX variable be added to the env whitelist to use it. - tmux: Open a new tmux session Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29meta/lib/oe/lsb.py: extract only the needed info from lsb-releaseCristian Iorga
Instead of running lsb_release -a, a lsb_release -ir will be run. This will prevent issue with distros that don't have all the needed info in /etc/lsb-release file, in which case lsb_release won't generate an error code. Partial fix for [YOCTO #4071] Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-29meta/lib/oe/lsb.py: fix data extraction from /etc/lsb-releaseCristian Iorga
In some cases, /etc/lsb-release file is used to extract info about poky build host machine. But the strings are not stripped of end of line special characters. As such, when this info is concatenated and used as a directory entry in sstate_cache, this is an issue. Usually, this issue is masked by the fact that distro related info is extracted from the output of lsb_release command. In case of Yocto Linux, running "lsb_release -a" will give an error code because CODENAME info is not present. As such, bitbake will extract the info from /etc/lsb-release, running into the above issue. Consequence is that building under BA will crash. Partial fix for [YOCTO #4071] Signed-off-by: Cristian Iorga <cristian.iorga@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-18package: Add cachedpath optimisationRichard Purdie
Currently, various standard library operations like os.walk(), os.path.isdir() and os.path.islink() each call stat or lstat which involves a syscall into the kernel. There is no caching since they could conceivably have changed on disk. The result is that for something like the do_package task of the kernel we're spending over two minutes making 868,000 individual stat calls for 23,000 files. This is suboptimal. This patch adds lib/oe/cachedpath.py which are a set of replacement functions for these operations which use cached stat data rather than hitting the kernel each time. It gives a nice performance improvement halving the build time of the kernel do_package. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-12lib/oe/lsb: enable getting distro ID when lsb_release is not installedPaul Eggleton
If lsb_release is not installed (as it may not be on headless/minimal installations on distros whose LSB package has a long list of dependencies) we need to gather the information directly from files in /etc. Fixes [YOCTO #4012]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-09base.bbclass: don't backfill features that already existRoss Burton
It's too easy to cause rebuilds because the DISTRO_FEATURES have changed in meaningless ways (such as re-ordering or duplicate items). Help stop this by checking if the feature to be back-filled is already present. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-12distro_check: Remove creation of empty Meego filelist.Anders Roxell
This fixes permissions errors when running distrodata. Signed-off-by: Anders Roxell <anders.roxell@enea.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-02-11lib/oe/path.py: support missing directory components in realpath()Enrico Scholz
Some use cases in OE operate on symlinks which dangling path components. Assume that these are directories instead of raising ENOENT. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11lib: implemented oe.path.realpath()Enrico Scholz
Various parts of the buildsystem have to work with symlinks. Resolving them is not trivial because they are always relative to a sysroot directory. Patch adds a function which returns the destination of a symlink by assuming a given path as the / toplevel directory. A testsuite was added too. Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11buildhistory_analysis: handle more R* variablesPaul Eggleton
Report changes to RPROVIDES, RREPLACES, and RCONFLICTS. As RSUGGESTS isn't widely used and isn't of huge concern if it changes, it is not reported by default. Implements [YOCTO #3391]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06package: Process package stripping in parallelRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>