summaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2017-11-29distrodata.bbclass: make upstream version check more useful for git upstreamsAlexander Kanavin
Specifically: 1) remove +git${SRCPV} stuff from comparison and output; it's just unnecessary clutter; 2) write the commit id of the latest version tag into the output; this saves quite a bit of trouble of manually checking what that commit id is when doing version updates; 3) when UPSTREAM_CHECK_COMMITS is set, ignore the tags altogether; instead check if the latest commit is different to the one we use, and if so, report that the recipe can be updated to said commit (which is also written into the output, as in 2). Multiple recipes are failing the upstream check because they never issue tags, now we can fix them. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-21qemurunner: Simplify binary data handlingRichard Purdie
I have concerns that bad timing of the flow of data from the logger might corrupt the output due to the way binary strings are handled in qemurunner. This simplifies the code to do the same thing it did before but much more safely. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-10devtool: finish: add dry-run optionPaul Eggleton
If you're not sure what changes devtool finish is going to make, or you're not sure you're finished with your modifications, it is useful to be able to see what devtool finish is going to do beforehand, so add a -N/--dry-run option to make that possible. (It's also very useful for debugging devtool finish itself.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-10devtool: upgrade: handle recipes that use named SRC_URI checksumsPaul Eggleton
devtool upgrade did not properly handle setting SRC_URI checksums for recipes that use named SRC_URI entries and also use those names in the SRC_URI checksums. A further complication was where the name contained an expression that changed with the version e.g. ${PV} (probably quite rare, but the dnsmasq recipe in meta-networking is currently one such recipe.) All of these are now handled properly. Additionally, drop the _get_checksums() function that wasn't being called from anywhere in the code. Note that this now turns nowrap_vars in recipeutils.py to be a list of regexes, hence things such as [ and ] need to be appropriately escaped. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-10lib/oe/recipeutils: fix line splitting in patch_recipe_*Paul Eggleton
If a value was split over multiple lines (e.g. as SRC_URI usually is) then we were inserting the value as one item in the lines list with newlines between each line. There's nothing wrong with this if you're writing the list out to a file, but if you want to generate a patch (as patch_recipe_file() will do if the patch parameter is set to True) then the diff output looks a bit odd. Split the value before adding it to the lines list to resolve this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-10lib/oe/recipeutils: fix find_layerdir() to return absolute pathsPaul Eggleton
find_layerdir() should really return absolute paths, so make it do so. This fixes devtool finish not deleting files it should do after devtool upgrade if the specified path is relative, since the devtool finish code was assuming that find_layerdir() was returning an absolute path. Fixes [YOCTO #12318]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-10oeqa/runner: Pass the value of buffer, don't force to TrueRichard Purdie
The value could be False in which case we should pass that through. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-10oeqa: Markup further tests for stdout/stderr bufferingRichard Purdie
This further cleans up the output of oe-selftest so that runqemu output is hidden unless tests fail. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/target/ssh: Drop command/output logging to debug levelRichard Purdie
This ensures the console is kept clear of confusing output but that the main logs contain good debugging information. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa: Clean up logger handlingRichard Purdie
The logger handling in oeqa was confused at best. This patch: a) Passes in a logger through various qemu runner pieces b) Uses that logger consistently in the code c) Creates a logger for QemuRunner outside the bitbake namespace meaning we don't conflict with the tinfoil logging changes The result of this is more consistency. For runtime tests in testimage, the logs always contain the debug info, nothing is shwon on the console. For the oe-selftests, logs are intercepted and only shown if the test fails. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/qemurunner: Use logger.debug, not logger.infoRichard Purdie
Bitbake logs info messages to the console. These messages are really there as debugging information. At the debug level, they will be shown in failure logs and in the task logs but not on the console which is what we want in this case. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/targetcontrol: Drop unused get_target_controller functionRichard Purdie
This funciton appears completely unused, drop it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/runqemu: Only show stdout/stderr upon test failureRichard Purdie
In general we don't need to see the output of runqemu however if it fails we do. Use the buffer option that already exists in TestResult but allow us to trigger it on a per test basis. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09qemurunner: Ensure logging handler is removedRichard Purdie
If we don't remove the handler we end up with duplicate log messages which is undesireable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08sshcontrol.py: in copy_to() always use scpErik Botö
The current implementation is broken when the localpath is a link. Then only a symlink would be created on the target, instead of copying the actual file. [YOCTO #11524] Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08masterimage.py: rename parameter "params" in start() to "extra_bootparams"Erik Botö
This matches how it is called, and how it is named in qmeu target. [YOCTO #11524] Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08masterimage.py: fix stop()Erik Botö
The stop() function is called in the context of the masterimage, so self.master should be used instead of self.connection which is undefined at that time. [YOCTO #11524] Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08masterimage.py: fix issue with calling reboot on masterimage/DUTErik Botö
On systemd systems calling reboot over an ssh connection doesn't return as expected causing an exception, therefore wrap the call to reboot in order to avoid this issue. Also sync the filesystems before rebooting cause otherwise, it will be done as part of the reboot and could take a very long time and testimage will fail to access the machine. This issue was observed consistently with one of our rootfs at Pelagicore. [YOCTO #11524] Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08selftest/imagefeatures: add basic test for useradd-staticidsRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08lib/oeqa/selftest/cases/gotoolchain: add selftest for the Go toolchainJoshua Lock
Add a simple test case to being testing of the Go toolchain: 1) build meta-go-toolchain 2) create a temp directory and install the generated Go toolchain within 3) fetch an archive of the Go Dep tool 4) create an appropriately laid out GOROOT and inflate the dep archive there 5) build the dep command with the SDK's Go toolchain and check it returned successfully. [YOCTO #12152] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08oeqa/core/loader: Make _built_modules_dict() support packages correctlyPeter Kjellerstedt
For test modules in a package, e.g., oelib.license, running `oe-selftest -r oelib.license` or `oe-selftest -r oelib.license.TestSimpleCombinations` would fail with a message that the specified test cases could not be found. This was due to the parsing in _built_modules_dict(), which failed to distinguish between <package>.<module>.<class> and <module>.<class>.<testcase> and treated both cases as the latter. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08oeqa/selftest/runtime_test: use console in postinst_rootfs_and_bootRoss Burton
Use a console login not SSH for simplicity. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-07lib/oe/terminal.py: use an absolute path to execute oe-gnome-terminal-phonehomeMing Liu
A flaw was found on my Ubuntu 14.04.5 LTS, on which that gnome-terminal is the default terminal, when I run any of the tasks: bitbake busybox -c menuconfig/devshell/devpyshell bitbake virtual/kernel -c menuconfig/devshell/devpyshell I got a error as follows: "Failed to execute child process "oe-gnome-terminal-phonehome" (No such file or directory)" Seems the environment of the process calling Popen is not passed to the child process, this behaviour is a known issue in Python bug tracker: http://bugs.python.org/issue8557 It could be fixed by using an absolute path instead per test. Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-07oeqa/selftest/runtime_test: fix postinst_rootfs_and_bootRoss Burton
This test overrides IMAGE_FEATURES but failed to include package-management, which is essential for postinsts to work under dpkg. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05lib/oe/sstatesig: fix wildcard matching wrong task signature filesPaul Eggleton
With a '*' as a wildcard for the signature here we can also match a portion of the task name with the result that we may match a sigdata file for the wrong task. Luckily the signature is always the same length - 32 characters - so we can simply use 32 '?' characters instead. (A regex would have been another alternative, but the wildcard should be effective and I felt like a regex would complicate the code more than this solution). Fixes [YOCTO #11763]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-05oeqa/selftest/runtime: force empty root password, use helpers to access qemuRoss Burton
2017-11-05qemurunner: fix bad indentation in serial loginRoss Burton
2017-10-06lib/oe/package_manager.py (rpm): Allow use of non-signed packagesOtavio Salvador
When we wish to use the package feed for local development, it does not uses GPG signed feeds by default but dnf uses package signature check. We need to configure the GPG signature check out so it works out of box. With this patch, installing non-signed packages works: $: dnf install <package> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-10-06license.py: Correct selection of licenses in is_included()Peter Kjellerstedt
When faced with multiple sets of licenses combined with | (OR), it was possible for oe.license.is_included() to choose a set of licenses with a blacklisted license and then report failure, even if choosing another set of licenses would have resulted in a successful result. This happened when the chosen set still contained more whitelisted licenses than the other set. This change makes sure a set with any blacklisted license is always considered with a lower weight than a set with only whitelisted licenses. Example: Faced with the license string "GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary" and with "GPL-3.0" being blacklisted, the old code would report a failure since "GPL-3.0 & GPL-2.0 & LGPL-2.1" still contains more whitelisted licenses than "Proprietary" does. This change also adds a unit test for oe.license.is_included(). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-10-06package_manager: rpm: improve loggingMikko Ylinen
To be able to better debug remove() behaviour, add more logging to rpm calls via bb.note(). The change also makes remove() logging more consistent with other package managers' remove() (e.g., opkg). Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-10-06rootfs.py: remove update-alternatives correctlyMikko Ylinen
With "read-only-rootfs" in IMAGE_FEATURES, packages in ROOTFS_RO_UNNEEDED are removed when building the rootfs. The list of packages to remove is passed to the package manager and the list is sorted so that update-alternatives provider is the last entry. This is with the assumption that the last entry on the list/command line is removed last. However, it turns out rpm does not care about "last on the command line" and update-alternatives provider is removed before other the packages get to run their %preun scripts for update-alternatives. This leaves broken alternative symlinks in rootfs. The fix is to first remove all but update-alternatives provider and after that update-alternatives provider in its own remove() call. Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-26selftest/cases/runtime_test: ignore removal errors when cleaning temporary ↵Leonardo Sandoval
gpg directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.browser' This is the same fix as 7e3a7cd2426feac757def81850dc44156cd0f33e, but this applies to runtime (instead of signing). [YOCTO #11821] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25meta: drop True option to getVar callsMing Liu
Search made with the following regex: getVar ?\((.*), True\). Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25qemurunner: print tail qemu log in case bootlog is emptyLeonardo Sandoval
There are cases where the 'while loop' waiting for login prompt fails and the bootlog variable does not get populated, thus use the the new qemurunner member (self.msg) which stores all output coming from the qemu process. [YOCTO #12113] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-22meta/lib/oe/rootfs.py: clean up dnf cache after creating an imageAlexander Kanavin
It contains cached metadata for a transient repository that is used only when creating images on the host, and so is of no use on target images. Dnf will recreate the cache on target when needed. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-18oeqa/selftest/recipetool: use stable tarball for recipetool create testRoss Burton
GitHub dynamically generates the /archive/ tarballs but we're encoding checksums in the test suite. Change the URL to use a static tarball, and update the checksums. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-18devtool: rework source extraction so that dependencies are handledPaul Eggleton
Since it was first implemented, devtool's source extraction (as used by the devtool modify, extract and upgrade subcommands) ignored other recipe dependencies - so for example if you ran devtool modify on a recipe that fetches from svn or is compressed using xz then it would fail if those dependencies hadn't been built first. Now that we can execute tasks in the normal way (i.e. tinfoil.build_targets()) then we can rework it to use that. This is slightly tricky in that the source extraction needs to insert some logic in between tasks; luckily we can use a helper class that conditionally adds prefuncs to make that possible. Some side-effects / aspects of this change worth noting: * Operations are a little slower because we have to go through the task dependency graph generation and other startup processing. There's not really any way to avoid this though. * devtool extract didn't used to require a workspace, now it does because it needs to create a temporary bbappend for the recipe. (As with other commands the workspace be created on the fly if it doesn't already exist.) * I want any existing sysroot files and stamps to be left alone during extraction since we are running the tasks off to the side, and especially devtool extract should be able to be used without touching these. However, this was hampered by the automatic removal process in sstate.bbclass triggered by bb.event.ReachableStamps when the task signatures change, thus I had to introduce a way to disable this removal on a per-recipe basis (we still want it to function for any dependencies that we aren't working on). To implement this I elected to use a file written to tmp/sstate-control which gets deleted automatically after reading so that there's less chance of stale files affecting future sessions. I could have used a variable but this would have needed to be whitelisted and I'd have to have poked its value in using the setVariable command. Fixes [YOCTO #11198]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-13qemurunner.py: wait for PID to appear in procfsJuro Bystricky
We need QEMU PID in order to access "/proc/<qemupid>/cmdline" Having a valid QEMU PID does not mean we can access the proc entry immediately, we need to wait for the /proc/<qemupid> to appear before we can access it. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13oe-selftest: devtool: fix test_devtool_add hanging on some machinesPaul Eggleton
The code in scriptutils which implements the logic for running the editor used by devtool edit-recipe looks at the VISUAL environment variable before EDITOR, and thus if VISUAL is set in the environment it will override the EDITOR value we are setting here, the editor (usually vim) launches and there's nothing to stop it running forever short of manually killing it. Set VISUAL instead to fix this. Apparently VISUAL is in fact the variable we should really be preferring here - I don't think I knew that but somehow I got it right in the code, just not in the test. Here are the details for the curious: https://unix.stackexchange.com/questions/4859/visual-vs-editor-whats-the-difference Fixes [YOCTO #12074]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/cases/signing: ignore removal errors when cleaning temporary gpg ↵Leonardo Sandoval
directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: .. .. File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.browser' [YOCTO #11821] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/devtool: Avoid writing on TOPDIR on kernel test caseJose Perez Carranza
Use a tempdir to copy the .config file from the kernel instead of being copied to build directory. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11wic: selftest: add test_wic_rm_ext test caseEd Bartosh
Tested if 'wic rm' correctly removes files from the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_cp_ext test caseEd Bartosh
Tested if 'wic cp' correctly copies files to the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_ls_ext test caseEd Bartosh
Tested if 'wic ls' correctly lists directory contents of the ext* partition. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11rootfs: improve postinst intercept loggingRoss Burton
Ensure we capture stderr, always write the output to the log, and don't be so emotional in the warning message. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa: Replace "append +=" with normal "append =" in layerappend.pyRobert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa/selftest/case: Add recipeinc methodOla x Nilsson
The recipeinc method returns the absolute path of the test_recipe.inc file of a specified recipe. It replaces four instances of identical code, and make it possible to access the filename from a testcase for cleanup. The write_recipeinc and append_recipeinc methods are changed to return the path to the file in case that is useful. The test_recipe.inc file is usually cleaned up in a finally block, but that block executes before any teardown operations. This blocks any teardown that requires the presence of the test_recipe.inc file. Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa/selftest: Add missing IDs to various test casesJose Perez Carranza
Add decorator @OETestID() with Tesopia TC-ID to the test cases that did not have it properly set. [YOCTO #11873] Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-07qemurunner.py: refactor searching for QEMU PIDJuro Bystricky
Ask QEMU to store the QEMU process PID in a file, this way we don't have to parse running processes and analyze descendents. This is done via QEMU command line argument "-pidfile". [YOCTO #12001] Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-07oeqa/qemurunner: Improve loggingRichard Purdie
Python unittest intercepts stdout and stderr however qemurunner sets up a streamhandler before that interception occurs, hence the messages spam the unittest output. By moving the logging init to the class init time, we use the unittest stdout/stderr and this means unittest can only show the log output upon failure. This cleans up the selftest and testimage output whilst still showing logging upon failure. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>