aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2018-07-02oe.path: add which_wild functionChristopher Larson
This is a function much like shutil.which or bb.utils.which, retaining shutil.which-like function semantics, bb.utils.which's support for returning available candidates for signatures, and most importantly, supports wildcards, returning only the first occurrance of each found pathname in the search path. Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-07-02lib/oe/sstatesig: Fix task mappings from multilib<->non-multilib contextsRichard Purdie
If we're in a multilib context already and want a non-multilib context this function returned incorrect values. Try and retain optimisations for the common case not needing to request a datastore but allow the different multilib/non-multilib combinations to work too. This fixes bugs where rootfs generation of a multilib image would write into incorrect locations, or be unable to find sstate manifest files due to incorrect data stores being used to expand data. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02lib/oe/utils: Improve get_multilib_datastoreRichard Purdie
Currently this function assumes that no multilib is applied and that we're applying a multilib. This means if we're in multilib context and want the non-multilib context we can't obtain it (and no other function exists for this either). Improve the function to allow this to be requested. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02oe-selftest: Add bitbake-layer create-layer testJoshua Watt
Adds a test that creates a layer, adds it to bblayers.conf, then ensure that it appears properly in bitbake-layers show-layers. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02postinst-intercepts: do not execute any variant of delay_to_first_bootJoe Slater
As of commit 2c5c6e3ff we create multilib variants of intercept hooks but we did not account for delay_to_first_boot variants. This was covered up until commit a335e7867, but will now cause an error. Signed-off-by: Joe Slater <joe.slater@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-07-02oeqa/runtime: Add testcases for kernel sampleHongzhi.Song
We are going to let runtime test support kernel tests. Now we just add kernel self-contained sample tests. And we plan to add overall kernel tests in the future. This patch is just add kernel samples test which contains about 13 tests enabled by kernel-sample.scc. So it needs statement, KERNEL_FEATURES_append += " features/kernel-sample/kernel-sample.scc" in local.conf. Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-28bitbake-bblayers/create: Fix layer name generationJoshua Watt
The path to where the layer was being created was taken verbatim as the name of the layer when generating the layer.conf and README files from templates. This causes problems in the layer.conf file because it would result in strangely named variables like BBFILE_PATTERN_../my-layer = "..." Instead of blindly taking the path, use the name of the last component of the path as the layer name. Additionally, rework the template files to use python format strings with named parameters so that the same argument doesn't have to be repeated multiple times. [YOCTO #12808] Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-27oeqa: add Git mirror testRoss Burton
Add an automated test to exercise that fetching a git: recipe... 1) works over git without mirrors 2) fails without git connectivity or mirrors 3) works without git connectivity but with a mirror (2) is done by setting GIT_PROXY_COMMAND to 'false' which should break any git network operations. [ YOCTO #12805 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-06-21oe/types: Allow boolean to accept an existing booleanRichard Purdie
Exception: TypeError: boolean accepts a string, not '<class 'bool'> is a bit annoying if you pass in True/False. Tweak the function to make it forgive that situation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18bitbake-layers/create: add LAYERSERIES_COMPATAnuj Mittal
Derive the value for template layer.conf from core layer and add dependendency on it too. Fixes [YOCTO #12767] Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18package_manager.py: rework postinst_intercept failuresAlexander Kanavin
Previously a warning was printed regardless of context and nature of the failure, and because it was only a warning, it was mostly ignored. Now, the following is considered when a failure happens: 1) whether we are installing packages into a target image, or populating a SDK with host or target packages. 2) whether the failure was due to qemu not supporting the target machine. Accordingly, warnings, notes, and failures are printed, and postponing to first boot happens if possible. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18rootfs.py: for dpkg/opkg, don't install postinsts if package management is ↵Stefan Agner
present If package management is present opkg/dpkg will bring the original copy of the postinsts scripts with the metadata and will be able to handle postinsts just fine. In fact, it is preferred to let package management handle the postinsts scripts in this case since it will keep the package managers database up-to-date too. The run-postinsts scripts will make sure the package manager gets invoked instead of the scripts directly. Note: Before commit 5aae19959a44 ("rootfs.py: Change logic to unistall packages") rootfs.py did not install /etc/$pm-postinsts too. It is not clear whether that change was intentionally or just a bug. This commit fixes/reverts that aspect of the commit. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18oeqa/runtime/cases/rpm.py: change to use base-passwd-docChen Qi
The test cases assume that rpm-doc is built out, as it says it its comment. This is not always true. And it sometimes results in following error. | cls.tc.target.copyTo(test_file, dst) | UnboundLocalError: local variable 'test_file' referenced before assignment Change to use base-passwd-doc, as this package is more likely to be built out than rpm-doc. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18oeqa/runtime/cases/parselogs.py: ignore a message from watchdogChen Qi
The following message from watchdog is not an error. "error retry time-out = 60 seconds" Checking watchdog's source codes, we have: src/watchdog.c: log_message(LOG_INFO, "error retry time-out = %d seconds", retry_timeout); It's clear this is an info message, so parselogs should ignore it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18oeqa/runtime/cases/parselogs.py: extend common_errors listChen Qi
Add the following line to common_errors list. Failed to read /var/lib/nfs/statd/state: Success This message is not harmful, it does not result in rpc.statd starting failure. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-18populate_sdk_ext.bbclass: fix corebase identificationDamien Riegel
When generating the extended SDK, there is a copy step where this class goes through the layers and other stuff that have been copied to generate the SDK. The corebase; ie. the folder that contains the core layer 'meta' is treated in a special way. Unfortunately in our tree, we have: sources/meta/meta | `- core layer `------- corebase In populate_sdk_ext's copy_buildsystem, the heuristic to determine which element of the list returned by copy_bitbake_and_layers is corebase is fooled by such layout. In copy_bitbake_and_layers, corebase is already handled specifically and reliably, so we should let that function tell us which folder is corebase instead of trying to determine it. To do so, change the return type of copy_bitbake_and_layers to a tuple that contains (corebase, copied_layers). It also simplifies the code on the caller side. Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-15bitbake-blayers/create: add version for example recipeAnuj Mittal
Add version field in recipe name for example recipe created by bitbake-layers. Fixes [YOCTO #12767] Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-06-07oeqa/runtime/dnf: Fix test error when static libs are enabledRichard Purdie
The test works by excluding curl-dev which curl-staticdev depends upon. When static libraries aren't disabled, this leads to an odd looking test failure. Simply exclude curl-staticdev as well in case its enabled to make sure the test always works. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-07oeqa: replace Alex Kanavin's @intel email address with a personal oneAlexander Kanavin
As I will be leaving Intel, this address will no longer be valid, so swap it for my personal one for now. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/core/target/ssh.py: increase maximum read bytes from 1024 to 4096Chen Qi
When running testimage task for core-image-sato-sdk, the following error appeared. UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 at position 0: invalid start byte Checking the codes, I found it's caused by setting a 1024 limit for the read method of the StreamReader object. Comments from the manual: """ The chars argument indicates the number of decoded code points or bytes to return. The read() method will never return more data than requested, but it might return less, if there is not enough available. """ When running `systemctl status --full' on target, this error occurs. This patch increase the bytes limit to 4096 to fix the error. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/runtime/cases/multilib.py: fix test_file_connman skipping logicChen Qi
The test_file_connman should be executed only when 'lib32-connman' is installed and 'connman' is not installed. When lib32-connman and connman are both installed, the /usr/sbin/connmand could be from connman or lib32-connman, depending on the installation order. What we want to check is the connmand command from lib32-connman, so we need to make sure that connman is not there to cause chaos. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/runtime/cases/multilib.py: skip if needed packages are not availableChen Qi
1) The test cases use 'readelf' command to do the check. This command is from binutils. So skip the test if the needed binutils package is not installed. The related error message in log.do_testimage is like below. Output: sh: readelf: not found 2) The test case tests /lib/libc.so.6 from lib32-libc6. So skip the test if lib32-libc6 is not installed. The related error message in log.do_testimage is like below. Output: readelf: Error: 'lib/libc.so.6': No such file Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/runtime/cases/rpm.py: skip if rpm not availableChen Qi
This test case should only run when rpm package is installed. So skip it if rpm package is not installed. This fixes: RESULTS - rpm.RpmBasicTest.test_rpm_help - Testcase 1059: FAILED Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/core/decorator/data.py: fix skipIfNotInDataVarChen Qi
The var might not be set, resulting in unexpected error. RESULTS - multilib.MultilibTest.test_check_multilib_libc - Testcase 1593: ERROR The above error is due to MULTILIBS being not set, which is the default for OE. This patch fixes this problem. Also, the debugging message in skipIfNotInDataVar is currently confusing. Instead of DEBUG: Checking if 'MULTILIBS' value is in 'multilib:lib32' to run the test it should be DEBUG: Checking if 'MULTILIBS' value contains 'multilib:lib32' to run the test This patch also fixes it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/core/decorator/__init__.py: use 'cls' instead of 'obj'Chen Qi
Use 'cls' instead of 'obj' to better reflect that registerDecorator actually serves as a class decorator. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/core/decorator/__init__.py: set metaclass to ABCMetaChen Qi
OETestFilter is a subclass of OETestDecorator. It wants to make use of @abstractmethod decorator. But such decorator requires metaclass to be ABCMeta to have effect. So add it now to achieve the designed behaviour. Comments from python's manual: """ Using this decorator requires that the class's metaclass is ABCMeta or is derived from it. """ Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-04oeqa/core/loader.py: support the 'auto' keywordChen Qi
In previous OEQA, having 'auto' in TEST_SUITES results in executing as many test cases as possible. This behaviour is broken for now. From the codes in core/loader.py, I can see that it tries to use another keyword 'all'. But in fact, it does not work. I've checked the current manual. The manual says using 'auto'. Below is the current information in manual. """ Alternatively, you can provide the "auto" option to have all applicable tests run against the image. TEST_SUITES_append = " auto" """ So we should restore this behaviour. This patch does so. Also, output warning message is some module is named as 'auto', as this is a reserved keyword. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-29package_manager.py: get rid of ROOTFS_RPM_DEBUG in RpmPM()Alexander Kanavin
This was undocumented, and it's better to just always enable full debug output, as this allows immediate generation of logs with full diagnostics when things go not as expected. Also, change the output of dnf from note to debug level; this does not affect what is written to log file, but does reduce the verbosity of bitbake -v. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-05-29oeqa/sdk/cases/buildgalculator.py: skip if gettext not availableChen Qi
We need to skip this testcase when gettext is not available. Otherwise, we will have the following error at configure. error: possibly undefined macro: AM_NLS Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-05-22rootfs: only use dnf to cleanup if package management is enabledRoss Burton
If package management has been disabled then we've already removed all the state, and running 'dnf clean all' again will simply recreate a lot of the files. (From OE-Core rev: 4524068ad2248b37fb08a24828d018e2f7e6a761) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22package_manager: expand the removal list for RPMRoss Burton
If package management is disabled we remove the state and configuration for the package manager after the rootfs has been populated. This list wasn't complete and the DNF/RPM configuration files were left behind. As we've added files to the list (and not just directories), expand the backup/restore package management state code to handle this. Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-05-14runtime/dnf: Add new dnf test casesJose Perez Carranza
Add test cases to test “exclude” and “installroot“ options, also modify the logic of filtering packages on the feed to have all the packages needed by the tests. [YOCTO #10744] Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-11oeqa/selftest/case: fix typoHongxu Jia
s/meta-sefltest/meta-selftest/g Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-05-04oeqa/runtime/cases/python: use python 3 rather than python 2Alexander Kanavin
For example, core-image-sato skipped the test alltogether, as it no longer pulls in Python 2.x at all. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04btrfs-tools: update to 4.15.1Alexander Kanavin
Drop upstreamed 0001-Fix-build-with-musl-missing-header-include-for-dev_t.patch Add ftw-subdir-walk.patch as it resolves the RECIPE_NO_UPDATE_REASON. Add --disable-zstd as libzstd isn't provided in oe-core. Fix wic testcase, as the minimal fs size is now bigger. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-04logrotate: update to 3.14.0Yi Zhao
Since the wtmp and btmp definitions had been moved from logrotate.conf to logrotate.d in this release, we also need to install them to /etc/logrotate.d/. Also update oeqa runtime logrotate test case. Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-20oeqa/selftest/runqemu: qemu nfs testing not ready for deploymentRichard Purdie
This test shouldn't have merged yet since we don't run portmap/rpcbind on the autobuilder infrastructure and the test therefore cannot succeed. We need to document this, set it up, then enable the test. The test itself is fine and good to have so its left in the code but disabled for now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-19oe-selftest: runqemu: add tests for qemu boot and shutdownYeoh Ee Peng
QA team were testing qemu boot image and shutdown on each qemu architecture manually. Add automated test to test qemu boot on ext4 and nfs, finally check that it can shutdown properly. Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-04-19package.py: use single quotes for path passed to file in is_elf()Andre McCurdy
Align package.py is_elf() with recent changes in package.bbclass isELF(): http://git.openembedded.org/openembedded-core/commit/?id=7877761534b0c2492da6289e9f2269d41b6ed464 Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-04-18package.bbclass: Add '-b' option to file call in isELFMark Hatle
The isELF function works by running: result = file <pathname> if 'ELF' in result By default 'file' will prepend the result with the path name of the file that is being checked. This usually works fine, such as: $ file /home/foo/openembedded-core/meta/classes/package.bbclass /home/foo/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines However, if the path includes 'ELF', ELF will end up in the result, and then the check will return positive. $ file /home/ELF/openembedded-core/meta/classes/package.bbclass /home/ELF/openembedded-core/meta/classes/package.bbclass: Python script, ASCII text executable, with very long lines This will then result in the isELF coming back true, and possibly causing the checks that use isELF, such as the 'is it already stripped' check, to do the incorrect thing. Adding the '-b' option to file will result in the path being omitted in the result: $ file /home/ELF/openembedded-core/meta/classes/package.bbclass Python script, ASCII text executable, with very long lines Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-04-18oeqa/runtime/stap.py: add runtime test for systemtapVictor Kamensky
Add runtime test for stap to test basic SystemTap operations: can compile very basic module and run on target device. Note we disable (-DSTP_NO_VERREL_CHECK) SystemTap additional kernel release check since during OE testing mismatching kernel-devsrc and kernels are used. Signed-off-by: Victor Kamensky <kamensky@cisco.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-04-07devtool: Ensure added layer sets LAYERSERIES_COMPATRichard Purdie
Now that we see warnings if LAYERSERIES_COMPAT is unset, the auto generated code from devtool needs to set this to avoid warnings which break various tests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-07devtool/oeqa: Ensure added layers set LAYERSERIES_COMPATRichard Purdie
Now that we see warnings if LAYERSERIES_COMPAT is unset, the auto generated code from devtool/oeqa needs to set this to avoid warnings which break various tests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05sdk.py: run postinst interceptsAlexander Kanavin
Previously this wasn't done, and so any packages installed from populate_sdk would not have the postinsts fully executed (particularly generation of various caches via running nativesdk or target binaries with qemu wasn't working). [YOCTO #12630] Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05package_manager.py: do not hardcode the task name when referring to log filesAlexander Kanavin
This can be do_rootfs or do_populate_sdk, or anything else. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05package_manager.py: move intercept running logic from rootfs class to ↵Alexander Kanavin
PackageManager class This allows running the intercepts when creating SDKs, which previously wasn't possible, as SDK code does not use the rootfs class, and calls into PackageManager methods directly. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05package_manager.py: move postinst_intercept dir initialization from RootFS ↵Alexander Kanavin
to PackageManager class This will allow handling postinst_intercepts when populating SDKs (which use PackageManager class directly, and do not utilize RootFS class). Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05package_manager.py: move target_rootfs property to common ancestor classAlexander Kanavin
This will be useful when also moving postinst_intercept handling to package manager class from rootfs class. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-05package_manager.py: Skip gpgcheck while using dnf on targetManjukumar Matha
By default, RPM_SIGN_PACKAGES is not defined. Add gpgcheck=0 to oe-remote-repo.repo file, otherwise dnf will complain during install operation on target Note, RPM_SIGN_PACKAGES is set only when you inherit sign_rpm explicitly Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-04-03buildhistory_analysis.py: Check if RPROVIDES changed orderAmanda Brindle
Instead of assuming order has changed if no package has been added or removed, loop through packages to check if order has changed. This will prevent the script from falsely reporting "changed order" if a version has increased. Fixes [YOCTO #12334] Signed-off-by: Amanda Brindle <amanda.r.brindle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>