summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
Commit message (Collapse)AuthorAgeFilesLines
* selftest/reproducible: Don't call sync between each file compareRichard Purdie2021-03-041-1/+1
| | | | | | | | | | | | | Calling sync between each file compare is horrible performance wise as we compare thousands of files. We don't care about IO latency here so disable. (From OE-Core rev: dd893279f352e290c23577a0f91df1b8c6232f10) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 25f78abd8bbeb201fd9452e7983e015027954948) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: reproducible: Add more loggingJoshua Watt2021-03-041-0/+3
| | | | | | | | | | | | | | The reproducible build tests can take a long time, so having more logging messages at various points in the build can help debug where the build is taking a long time. (From OE-Core rev: 60a9e095297b756175e4a414bbee297b74547a7a) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6b792afe8759d62af8e713b86dad8f6721961a05) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: reproducible: Fix SSTATE_MIRRORS variableJoshua Watt2021-03-041-1/+1
| | | | | | | | | | | | | The SSTATE_MIRRORS variable was misspelled, which allowed the "clean" test build to pull from the mirror. (From OE-Core rev: f81fa4cf7ff1e48f7499f2cb5e2c7d7f9ea438be) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e42497bd84d0bb370a9f7b0448bff29f01fd1b0c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic/selftest: test_permissions also test bitbake imageLee Chee Yang2021-02-101-0/+16
| | | | | | | | | | | | | | | | existing test case test_permissions use Wic command as standalone tools to create wic image and check that wic image for permissions. add extra steps to the test case to also check against image build using bitbake do_image_wic. (From OE-Core rev: 9efabaff73090b08233b4fcef22142b9ac0c11aa) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 551ce73a90757ba43501fe5cf9ac84a7b77de549) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: wic: Add tests for permissions and change-directoryRicardo Ribalda Delgado2021-02-101-0/+90
| | | | | | | | | | | | | | | | 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> (From OE-Core rev: 5a3ce870ff54e73543caba5899aabd6c872691b0) Signed-off-by: Ricardo Ribalda Delgado <ricardo@ribalda.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 4aad9531df44d1b0637bd559161702ad86861b46) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package.bbclass: hash equivalency and pr serviceMark Hatle2021-02-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the PR service is enabled a number of small changes may happen to variables. In the do_package step a call to package_get_auto_pr will end up setting PRAUTO and modifying PKGV (if AUTOINC is there). PRAUTO is then used by EXTENDPRAUTO, which is then used to generate PKGR. Since this behavior typically happens BEFORE the BB_UNIHASH is calculated for do_package, we need a way to defer the expansion until after we have the unihash value. Writing out the pkgdata files w/o AUTOPR and PKGV (AUTOINC) expanded to placeholder values is the easiest way to deal with this. All other variables are expanded as expected. In the next task, typically do_packagedata, we will then use the UNIHASH from the do_package to get the PR (AUTOPR) as well as generate the AUTOINC replacement value (now PRSERV_PV_AUTOINC). The do_packagedata then translates the placeholders to the final values when copying the data from pkgdata to pkgdata-pdata-input. Also update the prservice test case. With unihash, just changing the do_package (via a _append) will not change the PR. So write the date to a specific file that is incorporated into the unihash to ensure it is always different for the test. Various assert messages were also updated to make it easier to figure out where/why a problem occured. (From OE-Core rev: 0c28edf4bf0d2f92bf3a47406041c63acd90bacf) Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2e32f37b0e4abc438c8f60e673cd18a5cc110768) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve_check: add CVE_VERSION_SUFFIX to indicate suffix in versioningLee Chee Yang2021-02-101-1/+10
| | | | | | | | | | | | | | | | | | | | | add CVE_VERSION_SUFFIX to indicate the version suffix type, currently works in two value, "alphabetical" if the version string uses single alphabetical character suffix as incremental release, blank to not consider the unidentified suffixes. This can be expand when more suffix pattern identified. refactor cve_check.Version class to use functools and add parameter to handle suffix condition. Also update testcases to cover new changes. (From OE-Core rev: 37a40c30709bf80c74948f47361b2be2c646c9d8) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5dfd5ad5144708b474ef31eaa89a846c57be8ac0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* cve-check: replace Looseversion with custom version classLee Chee Yang2021-02-101-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | The way distutils.version.LooseVersion compare version are tricky, it treat all these ( "1.0-beta2", "1.0-rc1", "1.0A", "1.0p2" and "1.0pre1") as greater version than "1.0". This might be right for "1.0A" and "1.0p1" but not for the rest, also these version could be confusing, the "p" in "1.0p1" can be "pre" or "patched" version or even other meaning. Replace Looseversion with custom class, it uses regex to capture common version format like "1.1.1" or tag format using date like "2020-12-12" as release section, check for following known string/tags ( beta, rc, pre, dev, alpha, preview) as pre-release section, any other trailing characters are difficult to understand/define so ignore them. Compare release section and pre-release section saperately. included selftest for the version class. [YOCTO#14127] (From OE-Core rev: 294baea424472341d2ec880f13699076315d8274) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6ced85e9ddd3569240f1e8b82130d1ac0fffbc40) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/devtool: Add modify_localfiles_only test checking symlink pathTomasz Dziendzielski2021-02-051-0/+37
| | | | | | | | | | | | | | | | If recipe uses only file:// fetcher devtool unpacks sources under oe-local-files/ and adds symlink in source root directory. We need to verify if the symlink in subdirectory has correct path. See [YOCTO #13738] for details. (From OE-Core rev: d9d8a04c9564b2801a1f613ffb6471de3cabdb03) Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 044c90d152bfd1b2a23272df39327ba4cd862dff) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/tinfoil.py: increase timeout 10->60s test_wait_eventYi Fan Yu2021-02-051-2/+4
| | | | | | | | | | | | | | | | | | The test would timeout on autobuilders. This patch increases the timeout to 60s The test will now also exit as soon as we receive the 2 expected events Expected runtime is around 1s if successful Bug 14158 (From OE-Core rev: cbc72203c82e56ebf4a6a685fbeb27679ed9a2e0) Signed-off-by: Yi Fan Yu <yifan.yu@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit be02aa9283f805de718badd5ea12c4968da8774f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake.conf: Prevent pyc file generation in pseudo contextPaul Barker2021-02-031-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | This also effectively reverts commit b6d30c21b0: bitbake.conf: Extend PSEUDO_IGNORE_PATHS to ${COREBASE}/meta The contents of ${COREBASE}/meta were ignored as pyc files could be generated for the contents of the lib subdirectory if python modules were imported within a pseudo context. However this doesn't protect us from pyc files being generated in the lib directories for other layers. It's far better to tell python not to produce pyc files when running under pseudo (by setting the PYTHONDONTWRITEBYTECODE variable) as this will cover any location where pyc files could possibly be created. This variable is set in FAKEROOTBASEENV so that it applies to the bitbake-worker instance for fakeroot tasks, preventing pyc files from being generated for imports in python tasks themselves. Also add a test case to ensure that pyc files are not created in tasks which are executed under pseudo. (From OE-Core rev: 109406724d29b289d19f87dfdf6604767157277a) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 73d538f20743017a44cea4c20dbe09a0327cfc71) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: Exclude gpg directory from pseudo databaseRichard Purdie2021-02-031-0/+1
| | | | | | | | | | | | Avoid pseudo abort()s like: path mismatch [1 link]: ino 6295376 db '/tmp/oeqa-feed-sign-2mw7z81v/S.gpg-agent.yocto-native' req '/tmp/jwkivmu6'. (From OE-Core rev: 4909fa31a4faabb1add10ded69f29cb27d5e1fb7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 189630ca6cdf7ceb6cf9b8f9d86c58997f505efc) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest: Add argument to keep build dirPaul Barker2021-01-131-4/+13
| | | | | | | | | | | | | | | | The oe-selftest code already keeps the selftest build directory in place if any tests failed. By default the build directory is deleted if all tests pass but there may be cases where it's desirable to keep this directory around, for example to compare intermediate files between passing and failing test runs. (From OE-Core rev: 51fa76c699517ad63f8d6c4db4b6938d894f5c6c) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 67aa7069dbe8f5f5f186eb67708ece5c4bd42976) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-pkgdata-util: Added a test to verify oe-pkgdata-util without parametersMilan Shah2021-01-131-0/+6
| | | | | | | | | | | | | | | | A test is implemented on poky/meta/lib/oeqa/selftest/pkgdata.py to test the scenario when oe-pkgdata-util is executed without parameters and help is displayed. See [YOCTO #10726] for detailed bug information. (From OE-Core rev: 59272d46d61b3328ebd5c72d702d7e5b368afeb4) Signed-off-by: Milan Shah <mshah@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 6b4e2eafa6eb71ca94ccc8a18d05b473b352367c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/qa: handle the 'no specific instruction set' ELF e_machine valueRoss Burton2021-01-091-1/+1
| | | | | | | | | | | [RP: Update OEQA selftest to match change] (From OE-Core rev: a4339b1c958b736be951ae3142e6be72702ecad2) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit b7cfc0f51cc0b4866f913f6eae4fcc6f72d2578c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/devtool.py: fix typo in ignore_patterns callSteve Sakoman2021-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Causes intermittent autobuilder errors: 2020-12-21 19:34:23,035 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py", line 68, in setUpModule bb.utils.edit_bblayers_conf(bblayers_conf, None, None, bblayers_edit_cb) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1460, in edit_bblayers_conf (updated, newlines) = edit_metadata(newlines, ['BBLAYERS'], handle_bblayers) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1290, in edit_metadata if handle_var_end(): File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1215, in handle_var_end (newvalue, newop, indent, minbreak) = varfunc(in_var, full_value, op, newlines) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/bitbake/lib/bb/utils.py", line 1425, in handle_bblayers res = edit_cb(layer, canonicalise_path(layer)) File "/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py", line 60, in bblayers_edit_cb shutil.copytree(pth, destdir, ignore=ignore_patterns('*.pyc', '__pycache__')) NameError: name 'ignore_patterns' is not defined (From OE-Core rev: 8bfc666b7cddf37b7681e45dd0f87365014ac5a3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c2d9612279fce9cbcb738913b2042949f692c4a5) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/devtool: use Yocto mirror for pv-1.5.3 tarballRoss Burton2020-12-181-1/+1
| | | | | | | | | | | | | | Some of the selftests failed over the weekend with "access denied" errors fetching this tarball. Instead of relying on upstream when fetching the tarball, use the Yocto source mirrors instead. (From OE-Core rev: ab3a9bd56d86ed22515906b2d23e6a83053fcd37) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 988e0ff4131f46dfed14516ff5f61d72b9fb6941) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Add sync call to command executionRichard Purdie2020-10-301-8/+8
| | | | | | | | | | | | | | | We previously put a sync call into devtool to try and combat the bitbake timeout issues on the autobuilder. It isn't enough as the timeouts occur mid test. They are also occurring on non-devtool tests. Add in sync calls around command execution instead. (From OE-Core rev: ed912771ea98c42f61bf927b1ca708650b0bed4c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ceca5ed121e2b54415a7ab3a217882e4ea86923a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/cases/devtool.py: avoid .pyc raceTim Orling2020-10-091-1/+2
| | | | | | | | | | | | | | | | | | In certain conditions, most likely under heavy load on the AutoBuilder, the prebuilt .pyc files are attempting to be executed before they have been completely copied. Avoid this by not copying the .pyc files (nor the __pycache__ directory). The impact of python3-native recreating the .pyc files should hopefully be negligible. YOCTO#13421 YOCTO#13803 (From OE-Core rev: 1facb696140cc95ea3478654aedf1220459c825f) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add 512 Byte alignment to --offsetJoshua Watt2020-10-061-0/+24
| | | | | | | | | | | | | | | | Allows the --offset argument to use the "s" or "S" suffix to specify that it is reporting the number of 512 byte sectors. This is required for some SoCs where the mask ROM looks for an item at a sector that isn't aligned to a 1KB boundary. (From OE-Core rev: b9296bdeaacc1dce97aac9c9bf0d70555bb36646) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 938595d1dc4abaf5f7f3a7900add3f0492b805d0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Fix --extra-space argument handlingJoshua Watt2020-10-061-0/+15
| | | | | | | | | | | | | | 467f84e12b ("wic: Add --offset argument for partitions") broke the --extra-space argument handling in wic. Fix the option and add a unit test for the argument. (From OE-Core rev: 62a7a10c31bcf133cbd99d4de928f15a30e45ab1) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 87722a92c18f94917c8f70afc8cd0763462a5c25) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: Add --offset argument for partitionsJoshua Watt2020-10-061-25/+93
| | | | | | | | | | | | | | | | | | | | | | | Add support for an --offset argument when defining a partition. Many SoCs require that boot partitions be located at specific offsets. Prior to this argument, most WKS files were using the --align attribute to specify the location of these fixed partitions but this is not ideal because in the event that the partition couldn't be placed in the specified location, wic would move it to the next sector with that alignment, often preventing the device from booting. Unlike the --align argument, wic will fail if a partition cannot be placed at the exact offset specified with --offset. Changes in V2: * Fixed a small typo that prevented test_fixed_size_error from passing (From OE-Core rev: 897aaff8961f7fe83634a3b0b94e19b43aea5857) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 467f84e12b96bc977d57575023517dd6f8ef7f29) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/containerimage: Update to match assumptions in configurationRichard Purdie2020-10-061-0/+3
| | | | | | | | | | | | | Assumptions in the test mean it doesn't work with ssh-pregen-hostkeys. It also doesn't work with systemd. Update the configuration to make sure neither of these effect the test. (From OE-Core rev: 7dc649ba9abef2f9f2f863f568f8f808adbbff38) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e2f277657f1db6a0f805ac07d318a3850535d695) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/incompatible_lib: Fix append usageRichard Purdie2020-10-061-1/+1
| | | | | | | | | | | It's pure luck this has worked so far, add a missing space to the append. (From OE-Core rev: 0c9437beb64aa294a1863de10a6c4b44612fa9e4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 793e0575b1cebb953276b5f93ff31e48c19779c8) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/concurrencytest: Improve builddir path manipulationsRichard Purdie2020-09-171-1/+3
| | | | | | | | | | | | | Its possible some patterns may cause problems with the current path manipulations, make a small tweak to try and avoid potential pathname overlap issues. (From OE-Core rev: b90c8e041a9a2daa9472ed37630d8e0fdec18d36) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 889005dc17d3e3b8eadee907ee2c05b8ff613285) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/signing: Ensure build path relocation is safeRichard Purdie2020-09-171-1/+3
| | | | | | | | | | | | Similarly to 04ee0e8b95cd8ed890374e0007f976684206b630, ensure only full build paths are replaced in the environment to avoid breaking buildtools. (From OE-Core rev: 3be3740d0239f2eb198ccd2b75597cdccbdd1efc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit fcd0a9683af1a9155eabbd9056e3b46d4a931b2e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/prservice: Improve test failure messageRichard Purdie2020-09-101-2/+2
| | | | | | | | | | | | When failing, give more information about why exactly a failure is happening such as the PR values in question. (From OE-Core rev: 86eb281069334020c5fd93ba6fce69c67d7c8056) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bdd3abcc210e8f58b7b411da6bbd9c5314819908) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: runtime_tests: Extra GPG debuggingJoshua Watt2020-09-021-1/+1
| | | | | | | | | | | | | This patch enables extra debugging for gpg to try and get more debugging information when [YOCTO #14003] occurs (From OE-Core rev: b1fa60c791e759f7171862db68dbad2687e83812) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f24d7be1fb863006b5414fa8f9c9a37bb48d5a6f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/tinfoil: Increase wait event timeoutRichard Purdie2020-08-271-2/+3
| | | | | | | | | | | | | | | | We're seeing this on the autobuilder when IO load is high. Increase the timeout to give this a better chance of working out ok since there is no particular reason we only need to wait 5s and searching for files is IO sensitive. [YOCTO #14001] (From OE-Core rev: c0292d36dc79d0b1864eccddaa48b033c183d2dc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit c847ed207795bc03f791ee5a3348fa5860c53e70) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/sstatetests: Avoid polluting DL_DIRRichard Purdie2020-07-221-1/+4
| | | | | | | | | | | | Every selftest run is currently polluting the autobuilder DL_DIR. Avoid this by using a temporary directory for the test which is cleaned up. (From OE-Core rev: 3f2971c2fa94970057cd4260aa1147a165d70fa9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 002d321e02b3ce4f34c8a54211b109a5416c8a0e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: recipetool/devtool: Avoid load_plugin test raceRichard Purdie2020-07-072-2/+10
| | | | | | | | | | | | | | | | | | | | This bug has plagued the autobuilder for a couple of years and we've struggled to reproduce/debug it. The problem is the "lib" directory in meta-poky used during the load_plugin tests for recipetool and devtool can race and one can delete the files from the other leading to test failures. Deleting the lib directory only if empty will avoid this. [YOCTO #13070] (From OE-Core rev: a31c694be5267c004b691e6374cc800222f19940) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d603e2fd589e1edbc67c8c2fefb6337e728b9d01) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oescripts: ignore whitespaces when comparing linesChen Qi2020-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | list-packageconfig-flags.py determines the whitespace numbers according to the longest package name. This is reasonable for the tool as it's trying to generate pretty output. However, in this selftest case, the output is hardcoded. This results in "pinentry gtk2 libcap ncurses qt secret" not recognized as correct as the expected line is: "pinentry gtk2 libcap ncurses qt secret". The difference is only about whitespaces. So we should ignore the whitespaces when comparing lines. (From OE-Core rev: 80bdd59c8fa8b20a5a1fe7b5e3f1ddb95ad13af6) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 17c89ad1596dbc7cefdd2c01dcd95aa9e93c5dc6) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oescripts.py: fix typoChen Qi2020-07-071-1/+1
| | | | | | | | | | (From OE-Core rev: 9793d9b885195a1a917b2209b2bc8070a3df733d) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 115d44958806a2c73d0bf140f45c11db462cc7db) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Clean up separate builddir in success case when non-threadedRichard Purdie2020-07-021-3/+33
| | | | | | | | | | | | | | | | | | | | | If oe-selftest is run without -j, the separate build directory "build-st" isn't cleaned up afterwards. Mirror the behaviour of the -j option to handle this the same way, only preserve upon failure. To do this, the remove function needs to be moved to the selftest context module so that it can be accessed without requiring the testtools and subunit modules the -j option requires. A dummy wrapper class is used to wrap the tests and clean up afterwards. [YOCTO #13953] (From OE-Core rev: 20e7b1eeeb12f1cf4bd9934e0a5733c6bbe64372) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1b376ade430d40d3cfe9c18f200c764d622710e5) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runcmd: Add better debug for thread count mismatch failuresRichard Purdie2020-07-021-4/+5
| | | | | | | | | (From OE-Core rev: 773f97c6f56ed98a7b0821358d7435ed3ea7a3d6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d15d0177d328fa3a126b9942bda177f6fae68505) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: Recursively patch test case pathsPaul Barker2020-06-181-2/+12
| | | | | | | | | | | | | | This ensures that builddir is updated correctly to point to the new selftest build directory when we're given a list of test suites instead of a list of test cases. (From OE-Core rev: 6812affe76ee2704a8008d58ffc6a2e87b543f1d) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 56e211d0f3c6cb84f5982e5de00faeeed69c1912) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: Allow overriding the build directory used for testsPaul Barker2020-06-181-2/+8
| | | | | | | | | | | | | This may be useful if the parent directory of the original builddir is not writable, on a lower performance drive, etc. (From OE-Core rev: 27cec9c111bca84554d94eeb71fb3d3fe9a77481) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dab719e5f1964fd48e9a35e6b9db1508b5414540) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver: Fix test case for srpm archiver modePaul Barker2020-06-181-0/+1
| | | | | | | | | | | | | | We can't assume that rpm packaging will always be enabled when running oe-selftest. In particular when using nodistro instead of poky this is not enabled by default. (From OE-Core rev: b69ec712c690aa279996d5a9395dc16ae8402a3e) Signed-off-by: Paul Barker <pbarker@konsulko.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 23df3024664ec56dbbe8865ef3953d2c33a7a2cb) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/imagefeatures: Enable sanity test for IMAGE_GEN_DEBUGFSYeoh Ee Peng2020-05-221-0/+32
| | | | | | | | | | | | | | | | 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] (From OE-Core rev: 1038195fe9823c93cf20e2d256865171e0c915c4) 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> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Add test for conflicting sysroot providerRichard Purdie2020-05-071-0/+37
| | | | | | | | | | | | | | | | | | | | 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] (From OE-Core rev: 31a8b4935e673aba8a1147c4a2fb510b1a8bc3ce) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/tinfoil: Drop test for functionality removed upstreamRichard Purdie2020-03-241-13/+0
| | | | | | | | | bitbake dropped support for this piece of functionality (the test was the only user), drop the test too. (From OE-Core rev: 9ba0708e34eb038dc3ea5a877a5837c534cf165f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* archiver.py: fix typo of "ARCHIVER_MIRROR_EXCLUDE" in commentrpjday@crashcourse.ca2020-03-241-1/+1
| | | | | | | (From OE-Core rev: 7bd0bb37ed98b7b8c2ce05f1434fe5ff12f8efc9) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Ensure buildtools in environment variables isn't replacedRichard Purdie2020-03-101-1/+1
| | | | | | | | | | 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. (From OE-Core rev: 04ee0e8b95cd8ed890374e0007f976684206b630) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Drop 'backup' code and SIGTERM handlerRichard Purdie2020-02-212-73/+4
| | | | | | | | | | 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. (From OE-Core rev: b8ea8a910267fee4bb9e57f24ba829064e22d016) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Standardise seperate builddir for concurrent and ↵Richard Purdie2020-02-211-0/+50
| | | | | | | | | | | | | | 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. (From OE-Core rev: 50238b0717b04e0a1fa69d618e8c8aa8445a80b0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/context: Avoid tracebacks from tests using multiprocessingRichard Purdie2020-02-211-1/+5
| | | | | | | | | | | | 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] (From OE-Core rev: d9c62ffac611310efd47ed6397d31dccb72fe868) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oescripts.py: use unittest.SkipUnless for class skipTrevor Gamblin2020-02-201-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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. (From OE-Core rev: 10c2216cb6fb61c74babd8bd17cb3481754b7475) Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: reproducible: Include jquery in resultsJoshua Watt2020-02-191-3/+10
| | | | | | | | | | Includes jquery in the output directory to make the diffoscope output easier to navigate (From OE-Core rev: ff7c386455848e497ef40f9fee2be87d5171e203) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fix various, innocuous typosRobert P. J. Day2020-02-182-2/+2
| | | | | | | | | | | | | | 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>
* selftest: wic: Add APPEND to the optional variables listKevin Hao2020-02-151-1/+2
| | | | | | | | | | The APPEND is an optional variable, so add it to the optional variables list to make the wic selftest happy. (From OE-Core rev: 7c8b3a1b920fd4cc1598357985eef0e5e0e0ac79) Signed-off-by: Kevin Hao <kexin.hao@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>