aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2019-01-03oeqa/utils/qemurunner: set timeout to 60s for run_serialrbt/timeRobert Yang
The 5s timeout for non-kvm is too short, especially when the load is high, which leads to unexpected errors, so set timeout to 60s by default. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2018-12-27oeqa/utils/qemurunner: Print output when failed to loginRobert Yang
This is useful for debugging. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26base.bbclass, classextend.py: Drop catering to gcc-initialKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-26oeqa/concurrencytest: fix for locating meta-selftestRobert Yang
The previous code assumed builddir and meta-selftest are in the same dir, but this isn't always true, builddir can be anywhere, use get_test_layer() to locate meta-selftest can fix the problem. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-18oeqa/selftest/distrodata: Drop now unneeded distrodata inheritRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15oe: Fix opkg status list parse - Missing postinstRaul Martins
While parsing opkg package status, last package status was not properly handled, resulting in final image without postinst and pkg depends Signed-off-by: Raul Martins <raul.martins@alta-rt.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15lib/oe/elf.py: Add powerpc64 architecture definition for muslSerhey Popovych
Add the ELF definition for the powerpc64 architecture when building with musl as libc. Signed-off-by: Serhey Popovych <serhe.popovych@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15oeqa/selftest/distrodata: Port to use the new ↵Richard Purdie
recipeutils.get_recipe_upgrade_status() function Rather than use the obsolete do_checkpkg function, use the new recipeutils function which uses tinfoil to get the data rather than needing csv file manipulation. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-15lib/oe/recipeutils: Add a new function to mimic do_checkpkgRichard Purdie
The code in distrodata.bbclass related to the do_checkpkg task is rather dated, has holes in it (ignoring some recipes) and has horrible locking and csv related issues. We should use modern APIs such as tinfoil to make the calls we need directly against bitbake, cutting out the middleman and clarifing the code. This change imports the bits of distrodata.bbclass that are needed by the automated upgrade helper (AUH) into a standalone function which uses the tinfoil API. This can then be used by AUH and by the tests in oeqa/selftest/distrodata as well as by any other standalone script that needs this functionality. Its likely it can be further improved from here but this is a good start and appears to function as before, with slightly wider recipe coverage as some things skipped by distrodata are not skipped here (images, pieces of gcc, nativesdk only recipes). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-14oe-selftest: distrodata: change test_maintainers() to use tinfoilPaul Eggleton
Use tinfoil to enumerate recipes and get the value of RECIPE_MAINTAINER to make it a bit more reliable in the face of do_checkpkg issues we are currently seeing on the Yocto Project autobuilder. This also makes it a little less painful to re-execute test_maintainers() since you don't have to wait for bitbake -c checkpkg to complete every time. Note that the new test has been written in such a way that it will still function if RECIPE_MAINTAINER values are ever moved to the recipes. Also, the test still currently fails as there are recipes that don't have an assigned maintainer. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-14lib/oe/utils: Set stderr for host_gcc_version()Robert Yang
Fixed: $ ln -s /usr/bin/ccache /folk/lyang1/bin/gcc $ rm -fr tmp/hosttools/ && bitbake -p [snip] ERROR: Error running gcc --version: It didn't print the error message, now it is: ERROR: Error running gcc --version: ccache: error: Could not find compiler "gcc" in PATH For the error itself, it is because ccache is not in my HOSTTOOLS, so this is an expected error. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13oeqa/sdk: rewrite cpio testRoss Burton
Don't use the helper class as it gets in the way more than it helps, exercise the out-of-tree paths, and verify the installed files match the expected architecture. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13oeqa/sdk: rewrite lzip testRoss Burton
Don't use the helper class as it gets in the way more than it helps, exercise the out-of-tree paths, and verify the installed files match the expected architecture. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13oeqa/sdk: clean up galculator testRoss Burton
Drop redundant imports and variables, and use os.makedirs() instead of bb.utils.mkdirhier(). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13oeqa/sdk: show output if run() failsRoss Burton
Use oeqa.utils.subprocesstweak to monkey-patch the subprocess exception so that any output is shown, and remove any explicit try/catch handling that would have hidden this. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13oeqa/sdk: clarify ELF assertion messageRoss Burton
For example, instead of saying "3 != 62", say "Binary was x86-64 but expected i586". Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-13selftest/package: Correct format arguments in test_gdb_hardlink_debugOla x Nilsson
Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/sdk/galculator: rewrite to use new helpersRoss Burton
2018-12-08oeqa/sdk/python: fix version typoRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2018-12-08oeqa/sdk/assimp: use helpersRoss Burton
2018-12-08oeqa/sdk/case: add fundamental helper methodsRoss Burton
2018-12-08oeqa/selftest/runcmd: Increase timeout deltaRichard Purdie
Expecting 1s accuracy on a 2s timeout on a heavily loaded system has proven to be unreliable. Update this to a 5s timeout with a 3s delta which should be achievable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/selftest/context: ensure log directory existsChen Qi
Ensure log directory exists to avoid the following error. FileNotFoundError: [Errno 2] No such file or directory: '/.../build-selftest/tmp/log/oe-selftest-results-20181207043431.log' Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-07oeqa/selftest/esdk: Ensure parent directory existsRichard Purdie
INFO - ====================================================================== INFO - ERROR: setUpClass (eSDK.oeSDKExtSelfTest) INFO - ---------------------------------------------------------------------- INFO - Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass clss.setUpClassMethod() File "/home/pokybuild/yocto-worker/oe-selftest-debian/build/meta/lib/oeqa/selftest/cases/eSDK.py", line 76, in setUpClass cls.tmpdirobj = tempfile.TemporaryDirectory(prefix="selftest-esdk-", dir=bb_vars["WORKDIR"]) File "/usr/lib/python3.5/tempfile.py", line 929, in __init__ self.name = mkdtemp(suffix, prefix, dir) File "/usr/lib/python3.5/tempfile.py", line 507, in mkdtemp _os.mkdir(file, 0o700) FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/yocto-worker/oe-selftest-debian/build/build/tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/selftest-esdk-q7ln84gc' Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-06oeqa/selftest/esdk: Fix typo causing test failureRichard Purdie
2018-12-06 23:19:24,564 - oe-selftest - INFO - Traceback (most recent call last): File "/media/build1/poky-sumo/meta/lib/oeqa/core/case.py", line 32, in _oeSetUpClass clss.setUpClassMethod() File "/media/build1/poky-sumo/meta/lib/oeqa/selftest/cases/eSDK.py", line 78, in setUpClass cls.tmpdir_eSDKQA = cls.tempdirobj.name AttributeError: type object 'oeSDKExtSelfTest' has no attribute 'tempdirobj' Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa/selftest/esdk: run selftest inside workdir not /tmpRoss Burton
We've seen issues with rootfs size calculations and we've seen systems like opensuse which have btrfs mounted on /tmp causing selftest failures. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa: don't litter /tmp with temporary directoriesRoss Burton
If we need to create a temporary directory in targetbuild or buildproject use tempfile.TemporaryDirectory so that when the test case is finished, the directory is deleted. Also synchronise the logic and don't possibly store the temporary directory in self.tmpdir as nothing uses that. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa/utils/qemurunner: Avoid tracebacks on closed filesRichard Purdie
Reorder the shutdown/teardown to avoid: File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 224, in launch op = self.getOutput(output) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/utils/qemurunner.py", line 90, in getOutput fl = fcntl.fcntl(o, fcntl.F_GETFL) ValueError: I/O operation on closed file Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa/selftest/runqemu: Improve testcase failure handlingRichard Purdie
assertTrue doesn't give good debug information when things fail. Update several to use assertIn which gives information upon failure, for the others print the log information upon failure. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05lib/oe/utils: Improve multiprocess_lauch exception handlingRichard Purdie
We've seen a cryptic: "ERROR: Fatal errors occurred in subprocesses, tracebacks printed above" message from oe-selftest with no other traceback information. Improve the traceback logging to try and give a better indication of any errors that is ocurring. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-05oeqa/oelib/path: don't leak temporary directoriesRoss Burton
setUp() is used to populate a directory of temporary files, and deleted in __del__. However setUp() is called once *per test* so __del__ would only be able to remove the last directory created. Fix the code by using the natural counterpart to setUp, tearDown(), to clean up. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03oeqa/sdk/python: add Python 2 and fix detectionRoss Burton
Add a Python 2 form to exercise that if present, and fix the setUp() so it actually looks for a package that exists (nativesdk-python3 is a virtual package, the interpretter is in nativesdk-python3-core). Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03oe-selftest: add some tests for recipeutils modulePaul Eggleton
Add some tests for functions in meta/lib/oe/recipeutils.py, in particular for a few issues I've just fixed. I haven't added tests for all of the functions - some of them are already being tested via devtool in any case. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03lib/oe/recipeutils: drop obsolete functionsPaul Eggleton
These date from the time before Tinfoil's API covered this functionality (back when you could actually access cooker from a tinfoil-based script). Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03lib/oe/recipeutils: patch_recipe(): fix replacing varflag valuesPaul Eggleton
The code here wasn't correctly getting the variable history for varflags, so for example if you did a devtool upgrade on a recipe where the SRC_URI checksums were in the .inc file (typical for python recipes in order to support both python 2 and 3) then after the upgrade the new values would be set in the recipe and the old values were left in the .inc, which is not right. Teach the code here how to get the history for varflags so it works properly. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-03lib/oe/recipeutils: patch_recipe(): fix handling of values across ↵Paul Eggleton
includes/classes If we were setting a variable and part of the variable's value was being set in a class or a .inc file, we were still just setting the value outright on the assumption that it was too hard to do otherwise. With some careful use of the variable history we can do better for certain situations i.e. when the recipe does not currently set the value outright. Additionally, correctly remove _appends for variables we are changing if we're trying to remove the value added in the _append. Fixes [YOCTO #12623] and partially fixes [YOCTO #9360]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/selftest/context: Improve log file handlingRichard Purdie
The existing logfile is simply placed in the current directory. Since the test changes cwd to BUILDDIR, the symlink to the log can be placed in an invalid directory. We also see trackbacks if the symlink is invalid. Improve things by: * Placing logs in LOG_DIR (or BUILDDIR if unset). * Using a full path to the log meaning the log and link are placed in the same directory. * Using lexists instead of exists so invalid symlinks are handled correctly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/selftest/buildoptions: Ensure diskmon tests run consistentlyRichard Purdie
Heartbeat events default to once a second and we need to ensure we have enough time in the task to see them. Add a nostamp delay task 5s long so we can have a consistently timed task which doesn't need cleanup or have unneeded dependencies. This ensures we should deterministically see the disk moinitor events regardless of the state of the build. This is done in a way which doesn't corrupt build state or need cleanup and is efficient. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/selftest/buildoptions: Improve ccache testRichard Purdie
This test occisionally fails as m4 doesn't recompile, meaning the logfile test then doesn't find mention of ccache. To ensure m4 does recompile, clean m4 before force compiling it. (Reading the test is confusing due to the test cleanup also involving a clean) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/qemurunner: Remove resource python warningsRichard Purdie
If runqemu fails it would leak an unclosed socket and file. Ensure we close these in all cases to remove the resource warning. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/utils/commands: Avoid log message duplicationRichard Purdie
Each time a runqemu() fails, the log handler would be left behind meaning messages from any subsequent run would be duplicated (or worse/more). This ensures we remove the handler regardless and means we no longer have the duplication. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed fileRichard Purdie
Fixes: Stderr: /media/build1/poky/meta/lib/oeqa/utils/qemurunner.py:381: ResourceWarning: unclosed file <_io.BufferedWriter name=16> self.runqemu = None Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-01oeqa/utils/commands: Add extra qemu failure loggingRichard Purdie
Rather than just referring the user to the logs containing the failure, print them on the console. This aids debugging with oe-selftest with parallelisation as the logs may otherwise be lost. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-27oeqa/selftest/buildoptions: Improve ccache test failure outputRichard Purdie
The current failure mode doesn't show us what the logs actually looked like and later cleans can lose them. Show the whole log in case of failure to aid debugging intermittent problems on the autobuilder. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-27oeqa/selftest/case: Use bb.utils.remove() instead of shutil.remove()Richard Purdie
This avoids problems where shutil.remove will error with: 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.extra' when there are races over file deletion (gpg agent may be slow to exit). We already worked around speed and race issues in bb.utils. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-26oeqa/selftest/signing: Use do_populate_lic target instead of do_packageRichard Purdie
This should speed the test up signficiantly without any loss of functionality for the purposes of the test. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-26oeqa/selftest/signing: Allow tests not to need gpg on the hostRichard Purdie
We ideally don't want to use gpg from the host. This is straightforward for package management but not for sstate. For sstate, create a second build directory to run the test in using gnupg-native from the original build directory. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-26oeqa/selftest/signing: Skip tests if gpg isn't foundRichard Purdie
Raising an assertionError in the class setup isn't a particuarly good way to indicate gpg isn't installed. Instead skip the tests if the required binary isn't present. For the signing tests we do require it to be present and can't use a prebuilt one. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-22terminal: Cope with unreleased versions of tmuxMike Crowe
When tmux is built from a non-release Git version, its version number is "next-X" where X appears to be the expected version number for the next release. For example, when built from the current state of master, running "tmux -V" yields: tmux next-2.9 Currently check_tmux_pane_size only checks for the version being less than 1.9, so it seems unfair to fail with an obscure Python error in this case. Let's just use the version number after the "next-" prefix if it is present. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-22oeqa/qemu: Add support for slirpYeoh Ee Peng
Enable qemu for slirp. Initialize Qemurunner with slirp. Setup ip and port attribute to enable connection with qemu running with slirp. [YOCTO#10713] Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>