aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2016-12-22lib/oe/utils: Drop python2 compatibility codeRichard Purdie
We've moved to python3, we don't need this compatibility code which just makes the code less readable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-22selftest/wic: extending test coverage for WIC script optionsJair Gonzalez
The previous WIC script selftest didn't cover all of its command line options. Some option variants were included in existing test cases and the following tests were added to complete covering them: 1552 Test wic --version 1553 Test wic help create 1554 Test wic help list 1555 Test wic list images 1556 Test wic list source-plugins 1557 Test wic listed images help 1558 Test debug 1563 Test skip build check 1564 Test build rootfs 1559 Test image vars directory selection 1562 Test alternate output directory Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-22selftest/wic: reorganizing test methods by functionalityJair Gonzalez
Part of the test methods were rearranged to group them by functionality and identify more easily opportunities to extend coverage. Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-22selftest/wic: code cleanupJair Gonzalez
The following changes were added to improve the code readability: - Removed redundant backlashes between brackets - Aligned continuation lines according to PEP8 style - Refactored command execution in the next methods for enhanced legibility: - test_build_image_name(self) - test_gpt_image(self) - test_qemux86_directdisk(self) - test_rootfs_indirect_recipes(self) - test_iso_image(self) - test_mkgummidisk(self) - test_mkefidisk(self) - test_directdisk_bootloader_config(self) - test_qemu(self) - test_bmap(self) - test_systemd_bootdisk(self) - test_sdimage_bootpart(self) Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-22selftest/wic: adding Testopia ID numbers to test cases missing itJair Gonzalez
The following test cases were assigned an ID number on Testopia: 1496 Test generation of .bmap file 1560 Test creation of systemd-bootdisk image 1561 Test creation of sdimage-bootpart image Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-22oeqa/utils/commands.py: allow use of binaries from native sysrootMaciej Borzecki
Tests may need to run a native tool that is not available on the host filesystem, but can be built using one of the *-native recipes. In such case, the tool will be available in native sysroot, and running in from that location will require adjustments to PATH. runCmd() can now take a path to native sysroot as one of its arguments and setup PATH accordingly. Signed-off-by: Maciej Borzecki <maciej.borzecki@rndity.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-20Revert "selftest/wic: extending test coverage for WIC script options"Richard Purdie
This reverts commit 68cb3180c1b0dcee50812b21f98850d188d8621b as this wasn't ready for merge and there are new better versions.
2016-12-19oe-selftest: import git module only when neededEd Bartosh
git module is not included into standard Python library and therefore causes import errors on the systems where PythonGit is not installed. As git module only used in the code implementing --repository functionality it's better to import git only in the scope that requires it. [YOCTO #10821] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-19selftest/wic: extending test coverage for WIC script optionsJair Gonzalez
The previous WIC script selftest didn't cover all of its command line options. The following test cases were added to complete covering them: 1552 Test wic --version 1553 Test wic help create 1554 Test wic help list 1555 Test wic list images 1556 Test wic list source-plugins 1557 Test wic listed images help 1558 Test wic debug, skip-build-check and build_rootfs 1559 Test image vars directory selection 1562 Test alternate output directory In addition, the following test cases were assigned an ID number on Testopia: 1560 Test creation of systemd-bootdisk image 1561 Test creation of sdimage-bootpart image Finally, part of the test methods were rearranged to group them by functionality, and some cleanup was made to improve the code's compliance with PEP8 style guide. Fixes [YOCTO 10594] (From OE-Core rev: 3d2ac67765020885a0996ebdd97a576ba37dbec0) Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-17lib/oe/package_manager: bail if createrepo can't be foundRoss Burton
If createrepo isn't found then the errors later are mysterious, so explicitly check and error out early if it isn't there. (From OE-Core rev: e09636bbb3ea8ec58984197fd9c691bb908efe00) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16utils: Always use datastore's PATH for host_gcc_versionRoss Burton
BUILD_CC may reference something like ccache and expect this to come from ccache-native, we at least have some selftests which assume this. Modify the code to use PATH when runnig BUILD_CC to ensure the tests continue to work as expected. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16meta: remove True option to getVarFlag callsJoshua Lock
getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16meta: remove True option to getVar callsJoshua Lock
getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16buildhistory-diff: report directory renamesEd Bartosh
The script detects directory renaming if two different directories with the same set of files are added and removed. [YOCTO #10691] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16uninative: rebuild uninative for gcc 4.8 and 4.9Ed Bartosh
Some c++ libraries fail to build if uninative is built with gcc 5.x and host gcc version is either 4.8 or 4.9. The issue should be solved by making separate uninative sstate directory structure sstate-cache/universal-<gcc version> for host gcc versions 4.8 and 4.9. This causes rebuilds of uninative if host gcc is either 4.8 or 4.9 and it doesn't match gcc version used to build uninative. [YOCTO #10441] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16postinst: Add a test case to verify postinst scripts behaviorJose Perez Carranza
Add test case that verify behavior of postinst scripts at roofts time and when is delayed to the first boot directly on the target. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16selftest: Test needed to verify postinst orderFrancisco Pedraza
It verifies the following: 1. Compile a minimal image. 2. The compiled image will add the layer with the recipe postinst, previously created at: "meta-selftest/recipes-test" 3. Run QEMU. 4. Validate the task execution order. [YOCTO #5319] Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16oeqa: move lib/oe tests to oe-selftestRoss Burton
These tests don't get ran often (as demonstrated by the fact that some were not ported to Python 3), so move them to oeqa/selftest so they get executed frequently and can be extended easily. [ YOCTO #7376 ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16selftest: buildoptions: skip read-only-image test depending on distroLeonardo Sandoval
Poky-tiny cannot build core-image-sato, so skip test (read-only-image) in this case. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16selftest: bblayers: remove linux kernel checks for show-recipes checkLeonardo Sandoval
Preferred kernel recipes depends on the distro, so remove the kernel checks to avoid failures on non-poky distros and make the test distro agnostic. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16selftest: bbtests: use minimal image so all distros can execute itLeonardo Sandoval
poky-tiny distro cannot build full-cmdline image, so use an image (core-image-minimal) that can be built in all distros. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-16selftest: base: new object member to store the DISTRO valueLeonardo Sandoval
Instead of quering it multiple times, query once and use it on test method skip checks. Also, rename current distro sstate object member to a more meaninful name. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14oeqa/utils/commands.py: Fix get_bb_vars() when called without argumentsMariano Lopez
Commit 9d55e9d489cd78be592fb9b4d6484f9060c62fdd broke calling get_bb_vars() when called without arguments. This fix this issue. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-14oe-selftest: add basic tinfoil testsPaul Eggleton
Add some tests to verify that the new tinfoil API is operating correctly. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14oe-selftest: devtool: improve test_devtool_modify slightlyPaul Eggleton
* Check that man .in file actually gets modified, since sed -i doesn't fail if it it doesn't * Use a variable for man file path Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14lib/oe/recipeutils: drop parse_recipe_simple()Paul Eggleton
This was intended to be used with tinfoil, but tinfoil now has its own parse_recipe() method to do this which works properly in the memres case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14classes/patch: move several functions to oe.patchPaul Eggleton
Move patch_path(), src_patches() and should_apply() to oe.patch, making them easier to call from elsewhere (particularly across the UI/server boundary). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14oe-selftest: use tinfoil.parse_recipe()Paul Eggleton
Use tinfoil.parse_recipe() in order to allow oe-selftest to be used in memres mode. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14oe-selftest: make tinfoil quiet when using to start QEMUPaul Eggleton
We don't need to see the parsing/cache loading message in the oe-selftest output, so use the newly added quiet option to disable it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14lib/oe/recipeutils: use cooker function instead of bb.providersPaul Eggleton
We now have a function in cooker itself that can do this lookup; additionally, the rewritten tinfoil's cooker adapter has its own implementation that can work remotely, so if we use it then this function can work in that scenario as well. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14classes/image: suppress log_check mechanism for warnings/errors logged ↵Paul Eggleton
through BitBake If you printed a warning through bb.warn() / bbwarn or an error through bb.error() / bberror, this was also being picked up by our log_check mechanism that was designed to pick up warnings and errors printed by other programs used during do_rootfs. This meant you saw not only the warning or error itself, you saw it a second time through log_check, which is a bit ugly. Use the just-added BB_TASK_LOGGER to access the logger and add a handler that we can use to find out if any warning or error we find in the logs is one we should ignore as it has already been printed. Fixes [YOCTO #8223]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14lib/oe/rootfs: fix log_check warnings being printed twice with RPM packagingPaul Eggleton
We were calling _log_check() in the RPM-specific rootfs class as well as in the base class; this is unnecessary and resulted in any errors/warnings generated during the actual package installation time triggering two warnings instead of one. Drop the call from RpmRootfs._create() to fix this. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-14oe-pkgdata-util: Make read-value handle override variablesOla x Nilsson
Some variables in pkgdata files have a package-name override. When the bare variable can not be found, try with the override-variant. PKGSIZE is one such variable, and already had special code to handle this. Test included. Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13parselogs.py: Don't clog QA with Joule errorsCalifornia Sullivan
The Joule is very new hardware and there is ongoing kernel and firmware work to fix these issues, which will be available in future kernel and firmware releases. In the meantime, don't clog QA reports. [YOCTO #10611] Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13buildstats.py: skip collecting unavailable /proc dataPatrick Ohly
Some virtualized environments like Linux-VServer do not have the entries under /proc that the new system usage sampling expected, leading to an exception when trying to open the files. Now the presence of these files is checked once before enabling the corresponding data collection. When a file is missing, the corresponding log file is not written either and pybootchart will not draw the chart that normally displays the data. Errors while reading or writing of data samples is intentionally still a fatal error, because that points towards a bigger problem that should not be ignored. Reported-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13recipetool: selftest: Add test for recipetool plugin loadingOla x Nilsson
Test that recipetool plugins are loaded in a well defined order. Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13devtool: selftest: add test for devtool plugin loadingOla x Nilsson
Test that devtool plugins are loaded in a well defined order. Signed-off-by: Ola x Nilsson <ola.x.nilsson@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13oeqa/utils/metadata.py: Add metadata libraryMariano Lopez
Adds functions to get metadata from the host running the tests. [YOCTO #9954] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-13oeqa/utils/commands.py: Make a copy of variables in get_bb_varsMariano Lopez
The function get_bb_vars will remove items for the list passed as the function argument, this will leave the caller with an empty list and the function never says it will consume the items. This hasn't been found before because only get_bb_var uses this function. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-12targetloader.py: drop test for ClassTypeJuro Bystricky
ClassType was removed from python3. The code testing for ClassType kept throwing AttributeError exceptions: module 'types' has no attribute 'ClassType' The exceptions prevented loading of any dynamically resolved target controllers. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08package_manager: remove strings and migrate to direct arraysStephano Cetola
When using subprocess call and check_output, it is better to use arrays rather than strings when possible to avoid whitespace and quoting problems. [ YOCTO #9342 ] Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07selftest: wic: fix test_qemuEd Bartosh
Setting WKS_FILE variable in qemux86-64 made wic test to use wrong wks file to produce an image and resulted in test_qemu failure. Used conditional assignment in qemux86-64 and explicitly set WKS_FILE in wic testing suite to make the suite to use wic-image-minimal.wsk. This should fix test_qemu failure. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07buildstats: reduce amount of data stored for system utilizationPatrick Ohly
Pre-processing /proc data during the build considerably reduces the amount of data written to disk: 176KB instead of 4.7MB for a 20 minuted build. Parsing also becomes faster. The disk monitor log added another 16KB in that example build. The overall buildstat was 20MB, so the overhead for monitoring system utilization is small enough that it can be enabled by default. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07buildstats: record disk space usagePatrick Ohly
Hooks into the new monitordisk.py event and records the used space for each volume. That is probably the only relevant value when it comes to visualizing the build and recording more would only increase disk usage. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07buildstats: add system state samplingPatrick Ohly
/proc/[diskstats|meminfo|stat] get sampled and written to the same proc_<filename>.log files as during normal bootchat logging. This will allow rendering the CPU, disk and memory usage charts. Right now sampling happens once a second, triggered by the heartbeat event.That produces quite a bit of data for long builds, which will be addressed in a separate commit by storing the data in a more compact form. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07parselogs: Whitelist GPT warnings as the device is fully functionalJair Gonzalez
The warning occurs when the GPT image is not the same size than the media into which it's being flashed, causing the backup GPT table not being at the end of the disk. However, this is expected as the image is created before having the information about the destination media. The error is harmless, so it will be whitelisted. Fixes [YOCTO 10481]. Signed-off-by: Jair Gonzalez <jair.de.jesus.gonzalez.plascencia@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-12-07parselogs.py: Whitelist iwlwifi firmware load error messagesCalifornia Sullivan
The iwlwifi module of any given kernel has a minimum and maximum supported firmware version. The kernel begins by attempting to load the maximum version, and decrements until it is successful. The 4.8 kernel's maximum supported firmware version is 24, but thus far only 22 has been released, meaning we get errors for 24 and 23. Filter out iwlwifi firmware load error messages, as they are not necessarily indicative of real problems. Signed-off-by: California Sullivan <california.l.sullivan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-30terminal.py: Pass string instead of bytes to ExecutionError to avoid exceptionMartin Vuille
Based on run() in bitbake/lib/bb/process.py, ExecutionError() expects strings not bytes. Passing bytes results in a "TypeError: Can't convert 'bytes' object to str implicitly" exception. Fixes Bug 10729 Signed-off-by: Martin Vuille <jpmv27@yahoo.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-30runtime: Update test cases numbers for runtime testsJose Perez Carranza
Update test case numbers on runtime tests to do match with templates defined on Testopia for 2.3 release Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-11-30oe-selftest: toaster Remove redundant Toaster testMichael Wood
This test has been ported to be run as part of Toaster's own tests. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>