summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk
AgeCommit message (Collapse)Author
2024-02-27lib/oeqa: share get_json_result_dir helperAlexis Lothoré
Multiple places in oeqa need to get the log output path, and redefine a small helper to accomplish this Define this helper in lib/oeqa/utils/__init__.py and import it wherever needed to allow using it. (From OE-Core rev: 01b1a6a5a4e7cede4d23a981b5144ae9c8306274) Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-18testsdk: Avoid PATH contaminationRichard Purdie
The autobuilder has been seeing increasing numbers of testsdk failures where xz was 'missing': ERROR: core-image-sato-1.0-r0 do_testsdk: Couldn't install the SDK: Error: xz is required for installation of this SDK, please install it first This is probably due to xz and it's libraries not being in the sysroots in a way which works without races. Since the SDK should be using the host, fix this. The eSDK already does this to solve a similar problem so copy the code from there. (From OE-Core rev: 39ac3439dfdf2afa67abed4bd32aeb3c14979ded) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08oeqa: replace deprecated assertEqualsAdrian Freihofer
assertEquals is deprecated since Python 2.7: https://docs.python.org/2/library/unittest.html#deprecated-aliases It throws errors at least on Python 3.12. Replace it by assertEqual. (From OE-Core rev: 68286d0b70cf09a0d2950b48945c9192fb8c8769) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-08buildcpio.py: Switch to using cpio-2.15Khem Raj
This helps in getting it building with newer architectures like riscv32 since it has upgraded gnulib over 2.14 which has the needed fixes. Drop the -fno-common workaround as it is already applied to cpio drop --disable-maintainer-mode Fixes configure: WARNING: unrecognized options: --disable-maintainer-mode (From OE-Core rev: 18d303497089d3a7a893ee0eec5b0f0c78cca06d) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2024-02-05sdk/assimp.py: Fix build on 32bit arches with 64bit time_tKhem Raj
This testcase does not work properly with 32bit systems as it houses an older version of zlib which needs to be patched to work with 32bit systems with 64bit time_t e.g. mips o32. Apply a needed patch via sed logic to fix this issue. Enable bundled zlib in build, which means we do not require zlib to be available in SDK and it can be built for more variety of images. Upgrade the testcase to use 5.3.1 release of assimp and add cmake option to enable bundled zlib explicitly. (From OE-Core rev: 3c922fb61aa4f3bbb5c4ef35639acdf263c4313c) Signed-off-by: Khem Raj <raj.khem@gmail.com> Cc: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17oeqa: add "maturin develop" SDK test caseTim Orling
'maturin develop' first checks that a virtual environment has been created, which is a good test for our python3 SDK environment ;) Source for guessing-game lifted from https://www.maturin.rs/tutorial The test case is expected to fetch any necessary crates, build a development version of the crate and package it as a wheel Needs at a minimum the following in e.g. local.conf: TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin" SDK_INCLUDE_TOOLCHAIN = '1' SDK_TOOLCHAIN_LANGS += 'rust' The output of 'maturin develop' should be something like: ... 🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8 🐍 Not using a specific python interpreter 📡 Using build options features from pyproject.toml ... Compiling guessing-game v0.1.0 (/path/to/guessing-game) Finished dev [unoptimized + debuginfo] target(s) in 7.14s 📦 Built wheel for abi3 Python ≥ 3.8 to /path/to/tmpdir/guessing_game-0.1.0-cp38-abi3-linux_x86_64.whl 🛠 Installed guessing-game-0.1.0 (From OE-Core rev: 5265dd0b102cd7f3c6bb2ae1b18e9f625b834b39) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-12-17oeqa: add simple 'maturin' SDK (testsdk) test caseTim Orling
We expect 'maturin' will be used in SDKs, so it makes sense to also test it in the testsdk environment. To run this test case, you can add the following to local.conf: TOOLCHAIN_HOST_TASK:append = " nativesdk-python3-maturin" And then build and test the SDK: bitbake -c populate_sdk core-image-full-cmdline bitbake -c testsdk core-image-full-cmdline You can substitute a different image recipe for "core-image-full-cmdline" (From OE-Core rev: 7ceff48625d01a0e60eb761a9a668d0c942cda89) Signed-off-by: Tim Orling <tim.orling@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-19oeqa/sdk/rust: Add build and run test of rust binary with SDK hostSean Nyekjaer
Add a QA test to the SDK to test that a basic cargo build works for the SDK host. (From OE-Core rev: 7f05760debd3aeb69c3294f3ceb92d4f1aceec1f) Signed-off-by: Sean Nyekjaer <sean@geanix.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-26oeqa: Use 2.14 release of cpio instead of 2.13Khem Raj
2.13 may not be buildable with latest compilers without patching (From OE-Core rev: 406a33f896accc35a9cb6ab156f1e0f42dda67d8) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-05-05oeqa/sdk/assimp: run only when zlib is in the SDKAlexander Kanavin
Otherwise assimp will silently fall back to a vendored copy of zlib which will fail with -D_TIME_BITS=64 due to https://github.com/madler/zlib/pull/764 This was exposed by multilib mips core-image-minimal SDKs, where the default 64 bit sysroot has zlib, but 32 bit sysroot does not. (From OE-Core rev: c0fb603c9e26e91388320c02842b42cc7b091d6c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-03-06oeqa/sdk: Improve Meson testTom Hochstein
The meson wrapper setup command detection is broken in the case of an implicit setup command with an option with a space-separated argument, but the test was not detecting it since the case was not covered. Add the option `--warnlevel 1` to the meson command line to cover this case. (From OE-Core rev: 54e9ee8a0c6c9fc89cbb743f0e4fc18607d503cf) Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-09-03oeqa/sdk: extend rust test to also use a build scriptPeter Bergin
The test for rust in the SDK is extended with the simplest possible build script. This will make use of the host toolchain for building build.rs before building the rust package for target. (From OE-Core rev: 85a676da586f9b1085e62ef1325c9a58168390ae) Signed-off-by: Peter Bergin <peter@berginkonsult.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12lib: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-01oeqa/sdk/rust: Fix file deletion for multilib SDKsRichard Purdie
We need to use shutil.rmtree here since removedirs() only covers directories. Make the exception for specific too to make errors easier to catch. (From OE-Core rev: 9d2a661e46123a2292f7887658e6fa54923dbcc0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28oeqa/sdk: allow epoxy/galculator tests to run in esdk and direct yocto buildsAlexander Kanavin
Other tests already have similar tweaks. (From OE-Core rev: 3134d19ba15bb783389c40617d5e2b568c7cd81c) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28oeqa/sdk: add a test class for running SDK tests directly in a Yocto buildAlexander Kanavin
This is a simpler version of the same class in testsdk.py, as it does not need to unpack and set up the SDK, and can proceed to the tests straight away. (From OE-Core rev: be21c62e5bd96164aab9e01168b7a43c6de44c17) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-07-28oeqa/sdk: Add basic rust cargo testOtavio Salvador
Add a QA test to the SDK to test that a basic cargo build works. [RP: Tweaked to work for multilibs and updated to match toolchain changes] (From OE-Core rev: d0cfe587bc897e79ef01805cc9a42fbca28c883c) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-06-25oeqa/sdk: drop the nativesdk-python 2.x testAlexander Kanavin
Python 2.x has been EOL for a while, and so this test never runs. (From OE-Core rev: b687627e9cffb8123c156413f55ea1929f1a7831) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-04-26cases/buildepoxy.py: fix typoChen Qi
(From OE-Core rev: 3a9b6e71d1e7e8e2ebc0ed047841e36f09300387) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-18buildtools-docs-tarball: Add test for building documentation using sphinxRichard Purdie
(From OE-Core rev: 26b224a1bbe27b5d9886be4552147e1d66e34519) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-02-12oeqa/buildtools: Switch to our webserver instead of example.comRichard Purdie
Similarly to the sanity connectivity check, switch away from example.com for the buildtools tests. (From OE-Core rev: ed10f3c2b4c678069fe1cee73f79f6e388c7777e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-10-16oeqa: Update cleanup code to wait for hashserv exitRichard Purdie
We sometimes see exceptions from code seeing the hashserv DB files being removed at directory cleanup time. Add a check to ensure the hashserv has written the data base journal (and hence likely exited) before cleaning up. This will hopefully avoid errors like: Traceback (most recent call last): File "[...]/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 30, in test_libc delay = delay - 1 File "/usr/lib/python3.6/tempfile.py", line 948, in __exit__ self.cleanup() File "/usr/lib/python3.6/tempfile.py", line 952, in cleanup _rmtree(self.name) File "/usr/lib/python3.6/shutil.py", line 486, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/usr/lib/python3.6/shutil.py", line 424, in _rmtree_safe_fd _rmtree_safe_fd(dirfd, fullname, onerror) File "/usr/lib/python3.6/shutil.py", line 444, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/usr/lib/python3.6/shutil.py", line 442, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'hashserv.db-wal' (From OE-Core rev: 0b07d9add687d78495176cda0f3011c10ffa4d4b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-09-01oeqa/buildtools-cases: Allow bitbake time to shutdownRichard Purdie
bitbake may still be shutting down when the UI exits. Wait for the lock to disappear before trying to delete the directory to avoid errors. Traceback (most recent call last): File "/home/pokybuild/yocto-worker/buildtools/build/meta/lib/oeqa/sdk/buildtools-cases/build.py", line 23, in test_libc self._run('. %s/oe-init-build-env %s && bitbake virtual/libc' % (corebase, testdir)) File "/usr/lib64/python3.7/tempfile.py", line 807, in __exit__ self.cleanup() File "/usr/lib64/python3.7/tempfile.py", line 811, in cleanup _shutil.rmtree(self.name) File "/usr/lib64/python3.7/shutil.py", line 494, in rmtree _rmtree_safe_fd(fd, path, onerror) File "/usr/lib64/python3.7/shutil.py", line 452, in _rmtree_safe_fd onerror(os.unlink, fullname, sys.exc_info()) File "/usr/lib64/python3.7/shutil.py", line 450, in _rmtree_safe_fd os.unlink(entry.name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'bitbake.sock' (From OE-Core rev: 94df60cc97058444188ec8372c2d9849e74b76c6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-18oeqa/sdk: add HTTPS test for buildtoolsRoss Burton
Verify that HTTPS connections work in both wget and Python, as this depends on variables correctly pointing to the certificate chain. (From OE-Core rev: 5c2b1fb09e786ec392979d21dc7884ca23cd84f0) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-18oeqa/sdk: add relocation test for buildtoolsRoss Burton
The buildtools-extended tarball includes GCC, which relies on being relocated correctly to work. Add a test case that verifies that the loader paths have all been relocated, as otherwise there are hard-to-debug errors at build time. (From OE-Core rev: fe1f675ea156722a3709b13cd751479c9528134d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-12oeqa/sdk: add some buildtools testsRoss Burton
These two tests are designed to exercise the buildtools-tarball. SanityTests simply verifies that inside the SDK, some commands are used from the SDK. BuildTests creates a new OE build directory and builds virtual/libc to verify that a basic build works correctly. DL_DIR is reused to avoid needless downloading, but sstate is not shared to ensure a build does happen. (From OE-Core rev: 6157d6ffa32d6df383c29d4b6de07feb9d619913) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-02oeqa: sdk: Capture stderr outputJoshua Watt
Redirect stderr to stdout when running subcommands while doing the SDK tests. The tests will show stdout when CalledProcessError is raised, but any output to stderr was lost. (From OE-Core rev: 7cb4e9ab8c1596281060e94a216966060103956e) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-18buildgalculator: Patch to fix build with -fno-commonKhem Raj
We need to apply a patch to galculator for it to build with gcc-10+ Remove double definition of 'prefs' variable (From OE-Core rev: 93a62e6b35d1a6ed3c678f8e27508dd0cdbdbbe4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-08-18buildcpio.py: Apply patch to fix build with -fno-commonKhem Raj
This sed expression implements the needed patch to fix compilation with -fno-common, hopefully this patch will get included in 2.14 release and we can remove this operation (From OE-Core rev: 77b2e00c37c661a502bb47fcbbeb2e71aca5b9ce) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-18fix various, innocuous typosRobert P. J. Day
Corrections: - environment - accommodate - conversion - compatible (From OE-Core rev: 9797d3b45b4e1b9d77f0f2ee299c17b48d8d3cf6) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-14oeqa: Use --disable-maintainer-mode configure optionKhem Raj
since the versions of autotools might differ on target and build host, plus difference in timestamps for configure and system can result in reconfigure lets avoid that by disabling maintainer mode Avoids error: newly created file is older than distributed files! [YOCTO #13779] Suggested-by: Andre McCurdy <armccurdy@gmail.com> (From OE-Core rev: 3dc4e27e7633ce3ca6b9647810d0996bdee48771) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-02-08oeqa: Use cpio 2.13 as testcaseKhem Raj
cpio 2.12 was released in 2015 and might have used older autotools which could result in errors like https://bugzilla.yoctoproject.org/show_bug.cgi?id=13779 Bumping to 2.13 will help in matching the tool versions A good change on top would be to run aclocal -I .; autoheader; autoconf; automake --add-missing -c before running configure step perhaps [YOCTO #13779] (From OE-Core rev: 84eb1dc4fe8a11cd2d05b703070a6fb6de05b873) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-09oeqa/sdk: improve Meson testRoss Burton
Verify that the build inside the SDK is detected as a cross compilation. (From OE-Core rev: 3dc75ab44c23c4ff26502b96abded3c1c0b94e38) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09oeqa/sdk: use bash to execute SDK test commandsMikko Rapeli
The commands only work with with bash. If /bin/sh is dash like in Debian, the command execution fails with errors like: Standard Output: /bin/sh: 5: export: --sysroot: bad variable name and all SDK tests fail. (From OE-Core rev: ba5bee46131bbb31efba766c4d29e5bf71c664a7) Signed-off-by: Mikko Rapeli <mikko.rapeli@bmw.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08oeqa/sdk: add test to exercise MesonRoss Burton
(From OE-Core rev: 29359493e391d68a5a6b4fa4d09ffdc1fe6db620) (From OE-Core rev: 237ed166f48b0e32684a5307d3b47b9485238ed9) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08oeqa/sdk/assimp: cleanupRoss Burton
Unify style with the other tests. (From OE-Core rev: 545cde27b13f9d68211fd3a671182203ac47756d) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08oeqa/sdk/cases: clean up DL_DIR handlingRoss Burton
(From OE-Core rev: f56c62b9feacd6e08fee3507185261ab3f0180e0) Signed-off-by: Ross Burton <ross.burton@intel.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. (From OE-Core rev: 6d666b0413336de2e556b2722c5be97ae5cd40ad) 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. (From OE-Core rev: 920ae8c6537c2469f21ab9439587fd094ecc40f6) 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(). (From OE-Core rev: 2de9b1e611e5047afb540f98756994925c22e446) 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. (From OE-Core rev: 55964b33b561397287779ee474170790dfd03e85) 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". (From OE-Core rev: 9ab94cea589fca4394ec1fd8dc06b23fd8e990b9) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/sdk/galculator: rewrite to use new helpersRoss Burton
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/sdk/python: fix version typoRoss Burton
(From OE-Core rev: 581b43d7b3566624e6b17d516755d8e7a5142ebf) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/sdk/assimp: use helpersRoss Burton
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-08oeqa/sdk/case: add fundamental helper methodsRoss Burton
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). (From OE-Core rev: d286c2ad3eec24978557e16a8fa599476791109f) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-21classes/testsdk: Split implementation into classesJoshua Watt
Splits the SDK test implementation into configurable Python classes. The classes used for the normal and extensible SDKs are ${TESTSDK_CLASS_NAME} and ${TESTSDKEXT_CLASS_NAME} respectively. This allows SDK machines to override the classes used to implement the tests. For the traditional SDK, a common "run()" function is provided by the class (oeqa.sdk.testsdk.TestSDK), with several hook member functions that can be overridden in child classes, making it easier to have consistent behavior. The extensible SDK class (oeqa.sdkext.testsdk.TestSDKEXT) also has a common "run()" function, but no hooks have yet been added as there is not currently a known use case for create derived classes. These changes should be purely organizational; no functional changes have been made to either the standard SDK or extensible SDK tests. [YOCTO #13020] (From OE-Core rev: a06d53928b22d5f88276023c4d57b206db2f27f9) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-14testsdk: fix skipped testcase output "UNKNOWN" status while multiprocess ↵Hongxu Jia
execution Usually skipped testcase output "SKIPPED" [snip serial execution] |RESULTS - buildgalculator.GalculatorTest.test_galculator - Testcase -1: SKIPPED (0.01s) |RESULTS - python.PythonTest.test_python3 - Testcase -1: SKIPPED (0.01s) [snip serial execution] But if enable multiprocess execution, skipped testcase output "UNKNOWN" status [snip enable multiprocess execution] |RESULTS - buildgalculator.GalculatorTest.test_galculator - Testcase -1: UNKNOWN |RESULTS - python.PythonTest.test_python3 - Testcase -1: UNKNOWN [snip enable multiprocess execution] Here is my investigation: There is a class pairs TestProtocolClient and TestProtocolServer provided by python3-subunit. The TestProtocolClient generates a subunit stream of TestResult from a test run, and TestProtocolServer parses the stream of subunit TestResult. The class ProtocolTestCase is a unittest.TestCase adapter and it uses TestProtocolServer to parse the stream of subunit TestResult. In Yocto testsdk, it forks multiple processes to execute testcases and use TestProtocolClient to generate TestResult stream; and then it creates multiple threads to use ProtocolTestCase to parse stream of subunit TestResult through pipe; finally it passes multiple ProtocolTestCase as TestCase instance to main process and output status result. The problem point is TestProtocolServer parses `skip:' directive after reading a `test:' directive. Without `test:' directive, `skip:' directive will be ignored. All above requires SkipTest should be raised inside a test method rather than setUpClass method. Throwing SkipTest inside setUp works correctly (From OE-Core rev: 4828a88556d59e4d06933164c2ebeb9361b7450e) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>