summaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2020-05-12selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFSYeoh Ee Peng
Add new testcase to check IMAGE_GEN_DEBUGFS. Test makes sure that debug filesystem is created accordingly. Test also check for debug symbols for some packages as suggested by Ross Burton. [YOCTO #10906] Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-09lib/oe/package_manager: update default rpm config %_prefer_colorChangqing Li
* %_prefer_color is used by rpm to determine which color's ELF file is preferred to be installed. Here are file colors: 0 is unknown or other 1 is Elf32 2 is Elf64 4 is MIPS64 n32 (this color is added by oe-core's patch) if default value set to 7, all colors are preferred color, always be last-in-wins. For this scenario, when we have 64bits python3 installed first, then install 32bits python3 later, 64bits python3 will be overwrited, and sys.path will point to /usr/lib, not /usr/lib64, this may cause some python3 modules not work. so fixed by remove setting of default value 7, and use default value 2 of rpm * other distro like fedora also use the default %_prefer_color 2 Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-07virgl: skip test on Debian 9Alexander Kanavin
Debian 9 has an older version of mesa, where dri drivers do not link against glapi explicitly, which causes problems when they are loaded by newer mesa-native: pokybuild@debian9-ty-2:~$ ldd -d /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so |grep undefined undefined symbol: _glapi_tls_Dispatch (/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so) undefined symbol: _glapi_tls_Context (/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so) compared to Debian 10: pokybuild@debian10-ty-2:~$ ldd -d /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so|grep undefined pokybuild@debian10-ty-2:~$ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-07testsdkext/devtool: initialize the test component's git repoAlexander Kanavin
Devtool is relying on externalsrc class, which, in order to determine if a rebuild is needed, relies on git to checksum files (if the component tree is a git repo), or sets a flag to always rebuild if the component tree is not a git repo. This is problematic in testsdkext scenario, where the test component is inside a build directory, which itself is inside the poky repo checkout, and listed in .gitignore. What happens is that git walks up the tree and uses the index of the poky repo. This works okay with older versions of git, but git 2.26 complains that we're inside a directory that is ignored, and returns an error. To fix the issue, the git repository is initialized directly in the component directory, just prior to running the tests. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-05-02oeqa/runtime: Use libdir to run ptest-runnerAnibal Limon
In multilib build configs libs can be installed in /usr/lib{32,64,x32} so use libdir to specify the correct ptest directory along with default /usr/lib. [YOCTO #12604] Signed-off-by: Aníbal Limón <anibal.limon@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-29image/packagegroup: Remove PACKAGE_GROUP_*, long since deprecatedRichard Purdie
This was deprecated in 2014 so we can safely remove the old code now. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26oeqa/qemurunner: Clean up failure handlingRichard Purdie
If you fail to setup the tap devices, runqemu will error quickly however stdout/stderr are not shown to the user, instead a SystemExit traceback is shown. This could explain some long since unexplained failures on the autobuilder. Rework the error handling so SystemExit isn't used and the standard log failure messages can be shown. The code could likely ultimatley need some restructuring to work effectively. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26targetcontrol: Fix leaking log handlerRichard Purdie
We had a mystery failure on the autobuilder where runqemu appeared to be failing as a logfile directory no longer existed. The key to reproducing was running a runqemu where the image was deleted (as devtool does), then running another runqemu test. E.g.: 'oe-selftest -r devtool.DevtoolExtractTests.test_devtool_deploy_target wic.Wic2.test_qemu_efi' This then tries to write to the logfile from the first test, the image directory was deleted and we get strange failures. The fix is to remove the logging handler when qemu is stopped. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26oeqa: wic: Add more tests for include_pathRicardo Ribalda Delgado
Make sure permissions are respected. Add new test for orig/destination option. Cc: Paul Barker <pbarker@konsulko.com> Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26oeqa: wic: Add tests for permissions and change-directoryRicardo Ribalda Delgado
Make sure that the permissions and username are respected when using all the rootfs modifiers. Add tests for change-directory command Cc: Paul Barker <pbarker@konsulko.com> Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26oeqa/selftest: Add test for conflicting sysroot providerRichard Purdie
sysroot-test depends on virtual/sysroot-test which we build for one machine, switch machine, switch provider of virtual/sysroot-test and check that the sysroot is correctly cleaned up. The files in the two providers overlap so can cause errors if the sysroot code doesn't function correctly. Yes, sysroot-test should be machine specific really to avoid this, however the sysroot cleanup should also work. This adds a test for bug: [YOCTO #13702] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-26selftest/package: Add test to ensure ownership is preservedDaisuke Yamane
Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13806 Add test_preserve_ownership to selftest/package. This test creates a file, a directory and a symbolic link and changes ownership, then compares with them installed in rootfs to ensure ownership is preserved. [Test without a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink'] | 2020-03-14 10:01:14,519 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests) | 2020-03-14 10:56:44,612 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file | 2020-03-14 10:56:44,770 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir | 2020-03-14 10:56:44,822 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink | 2020-03-14 10:56:44,879 - oe-selftest - ERROR - Incrrect ownership /etc/selftest-chown/symlink [root:root] | 2020-03-14 10:56:45,884 - oe-selftest - INFO - ... FAIL [Test with a commit 'bitbake: lib/bb/utils.py: Preserve ownership of symlink'] | 2020-03-14 10:58:49,599 - oe-selftest - INFO - test_preserve_ownership (package.PackageTests) | 2020-03-14 11:51:39,947 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/file | 2020-03-14 11:51:40,013 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/dir | 2020-03-14 11:51:40,063 - oe-selftest - INFO - Check ownership of /etc/selftest-chown/symlink | 2020-03-14 11:51:41,118 - oe-selftest - INFO - ... ok Signed-off-by: Daisuke Yamane <daisuke.yamane@cybertrust.co.jp> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-25oeqa/runtime/weston: Enhance weston testsYeoh Ee Peng
Existing weston test available make sure that a process for weston-desktop-shell exist when image boot up. Enhance weston tests by: - execute weston-info to make sure weston interface(s) are initialized - execute weston and make sure it can initialize a new wayland compositor (retry checking for wayland processes up to 5 times) - enable weston logging for debugging when fail to initialize wayland compositor [YOCTO# 10690] Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-24testimage: enable ovmf supportKonrad Weihmann
Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-24parselogs.py: ignore pulseaudio startup warning messagesChangqing Li
If set default syslog to rsyslog, we can see below messages in user.log, [pulseaudio] authkey.c: Failed to open cookie file [pulseaudio] authkey.c: Failed to load authentication key They are only warnings when cookie file is not found. And PulseAudio will create it if it doesn't exist. refer: https://wiki.archlinux.org/index.php/PulseAudio/Configuration https://lists.freedesktop.org/archives/pulseaudio-discuss/2014-December/022719.html Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-07parselogs.py: update network interface related messagesChangqing Li
along with systemd upgrade, error message related change network interface have changed, update it. Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-02prservice.py: fix do_package with newer Python in Ubuntu 20.04Martin Jansa
* with Ubuntu 20.04 which is using python 3.8 I'm seeing a lot of errors like: ERROR: libxml2-2.9.10-r0 do_package: Can NOT get PRAUTO, exception No module named '_sysconfigdata' not sure what caused this from python 3.8, but this seems to work * PRserv is enabled with: PRSERV_HOST = "localhost:0" Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: don't try to rm /var/lib/opkgJan Luebbe
As opkglibdir starts with a /, os.path.join will ignore self.target_rootfs, leading to an attempt to remove /var/lib/opkg. This only fails if it exists on the host, explaining why this remained undiscovered for long. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: avoid installing provided packages via aptJan Luebbe
If there already is a package providing (and conflicting against) packages what should be installed, apt will try remove the conflicting package (target-sdk-provides-dummy) and any that depend on it (like apt and dpkg). This usually fails because of the protection of essential packages. In that case, no -dev/-dbg packages are installed to the SDK. Avoid this problem by checking which packages are already provided and removing them from the list to be installed. Also sort the list to make it easier to read when debugging. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: collect provided package names when using debsJan Luebbe
This is needed for a later change to avoid installing packages which are already provided by an installed package. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: fix handling of last packageJan Luebbe
In commit 7d214b34e11dc57316ed5c1c7747c4601286f6d2, only the code in the for loop was modified to store the pkgarch value. The code used if there was no empty line at the end was not modified. Instead of fixing the duplicated code, remove it and just make sure that a final empty line is processed. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/package_manager: make sure to not remove packages in apt installJan Luebbe
apt install can decide to remove already installed packages if there are conflicts. Avoid this by explicitly specifying --no-remove. This will then cause a "E: Packages need to be removed but remove is disabled." message. Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-04-01lib/oe/utils.py: add get_host_compiler_version()Tim Orling
Add helper function to get the host compiler and version. Do not assume compiler is gcc. NOTE: cannot set env to d.getVar("PATH") as that does not contain the session PATH which was set by environment-setup-... which breaks the install-buildtools use-case Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-30prservice.py: Use "with" to control file handle lifetimePeter Kjellerstedt
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-28utils: fix gcc 10 version detectionCharles-Antoine Couret
Utils can not detect GCC 10 correctly due to wrong regex. It generates this error "ERROR: Can't get compiler version from gcc --version output" Sub-version numbers should be 1 or more digits instead of 1 only. Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@mind.be> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-28oeqa: default runtime json results for testexportStefan Kral
Set the json result output dir in the oeqe runtime context to create testresults.json file by default for exported runtime test runs. Use current datetime for the json result property name (not DATETIME from build) to allow multiple result entries. Signed-off-by: Stefan Kral <sk@typedivision.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-28oeqa/runtime/cases: Disable and stop systemd-timesyncdAlex Kiernan
Stopping systemd-timesyncd doesn't prevent it being restarted by a different transaction within systemd. Disable the service instead during the date test to ensure it can't be restarted. Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-26oe/recipeutils: Drop obsolete GITDIR referenceRichard Purdie
The fetcher GITDIR variable wase dropped a while back, drop the obsolete reference to it (thanks Robert Day). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24oeqa/commands: Fix runqemu after tinfoil data connector changesRichard Purdie
Poking changes into config_data and expecting them to appear in the recipe is a bad idea, place the data in recipedata directly instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24oeqa/selftest/tinfoil: Drop test for functionality removed upstreamRichard Purdie
bitbake dropped support for this piece of functionality (the test was the only user), drop the test too. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24archiver.py: fix typo of "ARCHIVER_MIRROR_EXCLUDE" in commentrpjday@crashcourse.ca
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-24oeqa/qemurunner: Don't print a warning for harmless exceptionRichard Purdie
Printing a warning for something which is harmless just causes the people monitoring the autobuilder more work. Silently ignore this race. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-19oeqa/manual/bsp-hw.json: fix syntax errorYi Zhao
Remove the redundant comma to fix the json decode error: $ resulttool manualexecution ../meta/lib/oeqa/manual/bsp-hw.json Traceback (most recent call last): [snip] File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 948 column 1 (char 39810) Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-12oeqa/qemuarm64: Ignore logind: failed to get session seatKhem Raj
When booting weston images this error is seen commonly, but Qemu boots the image fine, session seat error is thrown by libweston perhaps using --seat option or setting XDG_SEAT variable in weston.ini could fix it [YOCTO #13828] Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-12oeqa: enable testresults.json for testexportStefan Kral
Add the option --json-result-dir to oeqa core context to enable testresults.json creation for test runs via testexport. Eg. oe-test runtime --json-result-dir . Signed-off-by: Stefan Kral <sk@typedivision.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-12oeqa/runtime/context.py: fix typoStefan Kral
Signed-off-by: Stefan Kral <sk@typedivision.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-11oeqa/testsdk: Use original PATHRichard Purdie
We want to test the SDK with PATH from the original host, not with our own tools injected via HOSTTOOLS. It even uses some tools which aren't in HOSTTOOLS. This is necessary after changing the SDK to not reset PATH to the system default which is bad for other reasons and brings the testing into sync with that change. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-10oeqa/selftest: Ensure buildtools in environment variables isn't replacedRichard Purdie
This avoids the seeing broken replacements like: oe-selftest-centos/build/build-st-926tools/sysroots/x86_64-pokysdk-linux/etc/ssl/certs/ca-certificates.crt which understandably break builds. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-07parselogs.py: ignore rdrand initialization failureMingli Yu
On the system whose cpu doesn't support rdrand, there comes below message when start rngd service #systemctl status rngd [snip] Feb 25 05:08:14 qemux86-64 rngd[133]: [rdrand]: Initialization Failed [snip] Actually the failed message doesn't matter as it only indicates one entropy source as rdrand fails to initialize and won't affect rngd function. So add to ignore the failure message to fix below error during do_testimage: NOTE: ====================================================================== NOTE: FAIL: test_parselogs (parselogs.ParseLogsTest) NOTE: ---------------------------------------------------------------------- NOTE: Traceback (most recent call last): File "/buildarea/layers/oe-core/meta/lib/oeqa/core/decorator/__init__.py", line 36, in wrapped_f return func(*args, **kwargs) File "/buildarea/layers/oe-core/meta/lib/oeqa/runtime/cases/parselogs.py", line 370, in test_parselogs self.assertEqual(errcount, 0, msg=self.msg) AssertionError: 1 != 0 : Log: /buildarea/tmp/work/qemux86-64-wrs-linux/wrlinux-image-std/1.0-r5/target_logs/daemon.log Central error: 2020-03-06T09:45:12.774286+00:00 qemux86-64 rngd[134]: [rdrand]: Initialization Failed Reference: https://github.com/nhorman/rng-tools/pull/84 Signed-off-by: Mingli Yu <mingli.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-06oeqa-runtime: add missing import os to ptest caseStefan Kral
Add missing import os statement to the oeqa runtime ptest.py Signed-off-by: Stefan Kral <sk@typedivision.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-06lib/oe/utils: allow to set a lower bound on returned cpu_count()André Draszik
This will be needed for making xz compression more deterministic, as xz archives are created differently in single- vs multi-threaded modes. This means that due to bitbake's default of using as many threads as there are cores in the system, files compressed with xz will be different if built on a multi-core system compared to single-core systems. Allowing cpu_count() here to return a lower bound, will allow forcing xz to always use multi-threaded operation. Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-03-02ltp: Update to 20200120Petr Vorel
Removed ffsb copying file and associated runtest file fs_ext4 (both removed in this release). Added LIBS=-lfts for MUSL. Removed patches (accepted upstream) * 0001-mkswap01.sh-Add-udevadm-trigger-before-swap-verifica.patch * 0001-testcases-fix-an-absent-format-string-issue.patch * 0001-nm01-Remove-prefix-zeros-of-the-addresses-output-by-.patch Merged patches * 0006-rt_tgsigqueueinfo-disable-test-on-musl.patch (into 0001-build-Add-option-to-select-libc-implementation.patch as they touch the same files) Refreshed patches (some tests have been fixed for musl) * 0001-Add-more-musl-exclusions.patch * 0001-build-Add-option-to-select-libc-implementation.patch * 0002-kernel-controllers-Link-with-libfts-explicitly-on-mu.patch IMHO this one shouldn't be needed not, but CI still fails without it Updated status * 0008-testcases-network-nfsv4-acl-acl1.c-Security-fix-on-s.patch * 0001-syscalls-Check-for-time64-unsafe-syscalls-before-usi.patch Signed-off-by: Petr Vorel <petr.vorel@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-25abi_version/sstatesig: Introduce HASHEQUIV_HASH_VERSIONRichard Purdie
We've found we need a way to cause a change in signatures and move to a new hash 'namespace' with hashequiv. This introduces a variable which allows us to do this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-25ptest: add an option to enforce a failure (e.g. ptests are required to pass)Alexander Kanavin
This can be useful with a more specific, targeted and robust set of ptest packages; the benefit is that ptest regressions are caught as they happen and can be more easily traced to changes that caused them. The existing AB ptest image continues to be expected to fail, my observation of the AB runs is that the full set of ptests is not robust enough (particularly around socket/network related tests) and sporadically fails in random places. This can probably be addressed by making ptests exclusive to a worker (e.g. there is no other workload happening at the same time as ptests). Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-22oeqa/logparser: correctly set test result markersAlexander Kanavin
I spotted this by noticing ptests started to unexpectedly pass, which shouldn't happen yet. Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-21oeqa/logparser: Fix performance issues with ptest log parsingRichard Purdie
On the autobuilder a ptest log with 2.1 million lines took around 18 hours to process. This is clearly crazy. We can tweak the processing code to: a) Stop repeatedly joining large strings together (append to a list instead) b) Use one startswith expression instead of multiple re.search() operations With this change it takes 18 hours down to around 12s. [YOCTO #13696] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-21oeqa/selftest: Drop 'backup' code and SIGTERM handlerRichard Purdie
Now selftest is using its own copied build directory, we can stop worrying about copying files around as backup, and drop the SIGTERM handler to try and restore them, simplifying the code. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-21oeqa/selftest: Standardise seperate builddir for concurrent and ↵Richard Purdie
non-concurrent selftest Currently oe-selftest reuses the current build directory and the concurrent version run with -j does not. Standardise and use a separate new build directory in both cases. This will lead to simpler code and more reliable user run tests. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-21selftest/context: Avoid tracebacks from tests using multiprocessingRichard Purdie
We can see tracebacks where the SIGTERM handler catches things it shouldn't. Avoid exit(1) unless we're the process that it was intended for. [YOCTO #13664] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-19oescripts.py: use unittest.SkipUnless for class skipTrevor Gamblin
Yocto Bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=13663 Prior to this fix, the try/except block in OEScriptTests' setUpClass did both the import and the raise unittest.SkipTest for the subsequent OEPybootchartguyTests. The consequence of the this meant that, when cairo was not available on the test host, the raise was counted only once as a class setup issue, instead of once for each of the tests to be run, resulting in incorrect skip counts in the test results. Instead of raising unittest.SkipTest in setUpClass, the more proper method is to use the unittest.skipUnless method along with importlib.util.find_spec to check for the presence of the python3-cairo module. This allows the entire class to be skipped if cairo is not present, while also correctly passing along the skip state for each of the class's tests, and avoiding the UNKNOWN results to appear in cases where the -j option was provided to oe-selftest, but the tests were still skipped. Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>