summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* lib/oe/reproducible.py: Fix git HEAD checkJoshua Watt2020-11-221-2/+2
| | | | | | | | | | | | | | | | | The check for a git HEAD still wasn't quite correct because it was using the .git directory as the current working directory. Instead, it should be passed as the --git-dir argument when running git. Running `git rev-parse HEAD` in a .git directory with no HEAD reports 'HEAD' and exits with success but then 'git log' will fail, which is not what we want. (From OE-Core rev: 31f00ec9c6ab5fe74f1ba59f79322497ef8f4dc7) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit cdbd47dd7e1657b91b65a0940b7cbf119764240f) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/reproducible: Fix error when no git HEADJoshua Watt2020-11-221-8/+17
| | | | | | | | | | | | | | | Fixes an error that occurs when attempting to get the timestamp of the latest commit when there is no HEAD in the git repository. The easiest way to trigger this condition is to use the 'subdir=' option when specifying a 'git://' SRC_URI. (From OE-Core rev: 02e42107e1c6145c215bfd74fe17fd8abc2db04f) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a64caca5b5dbe4a76acd0b5709b2c3e75b245863) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/reproducible: Move to library codeJoshua Watt2020-11-221-0/+95
| | | | | | | | | | | | | Moves most of the python code used for dealing with the source date epoch to library code. (From OE-Core rev: bb957547fbd3f6670220706642b49fee560c6b75) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a7ede90955bc0c8bec1cbb3cab498ef2583b2f4e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/context: initialize _run_end_timeKonrad Weihmann2020-11-201-0/+1
| | | | | | | | | | | | | with _run_start_time as value. For partial results of interrupted runs, this info might be otherwise missing for at least one testcase (From OE-Core rev: 4ebf97e36d9def38fb869cbbbd5ce10f5d2669a3) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1c5e8baf57fa2a33b9ef507b11d9ea9acaa77238) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/context: expose results as variableKonrad Weihmann2020-11-201-0/+3
| | | | | | | | | | | | | | | register an unittest handler for testresults and expose it as variable result. With this even partial results from an interrupted test suite run can be made available (From OE-Core rev: 07a3ea1aece5c67d75b60417ee0978cc0e15719a) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit a97ae47525157871b6c098ffc352293e365a4335) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sstatesig: Log timestamps for hashequiv in reprodubile builds for do_packageRichard Purdie2020-11-121-0/+6
| | | | | | | | | | | | | | | | Currently if a task generates the same output with different timestamps, hasequiv won't detect it but reproducibile builds will fail tests due to the different timestamps. Add do_package timestamps to the hash when reproducibile builds are enabled to avoid this. (From OE-Core rev: cda769ed7c120edd7db0ff77e34fa1aa611a3082) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 11e8200ccec765ff6a4263e06512e5751eca261a) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Revert "lib/oe/patch: fix handling of patches with no header"Martin Jansa2020-11-121-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * This reverts commit d9971f5dc8eb7de551fd6f5e058fd24770ef5d78. * With the missing Subject line fixed in GitApplyTree.prepareCommit() we should be able to revert, the fix which was trying to help it by parsing GitApplyTree.patch_line_prefix ("%% original patch:") also from Subject line, now GitApplyTree.patch_line_prefix should always end on separate line which is then skipped when copying the lines to resulting patch, see original commit message from Paul: lib/oe/patch: fix handling of patches with no header If a patch applied by a recipe has no header and we turn the recipe's source into a git tree (when PATCHTOOL = "git" or when using devtool extract / modify / upgrade), the commit message ends up consisting only of the original filename marker ("%% original patch: filename.patch"). When we come to do turn the commits back into a set of patches in extractPatches(), this first line ends up in the "Subject: " part of the file, but we were ignoring it because the line didn't start with the marker text. The end result was we weren't able to get the original patch name. Strip off any "Subject [PATCH x/y]" part before looking for the marker text to fix. This caused "devtool modify openssl" followed by "devtool update-recipe openssl" (without any changes in-between) to remove version-script.patch because that patch has no header and we weren't able to determine the original filename. (From OE-Core rev: 419d45ad6a72c6e296e27f9ae36ddf2a45671bfe) 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>
* lib/oe/patch: GitApplyTree: save 1 echo in commit-msg hookMartin Jansa2020-11-121-2/+1
| | | | | | | | | | | | | | | | | * also remove the extra blank lines which is often added to patches when refreshed with devtool (GitApplyTree.patch_line_prefix lines are ignored when refreshing .patch files, but newly added blank lines aren't - the leading blank line wasneeded for patches with just the subject line (to prevent the GitApplyTree.patch_line_prefix line ending appended to the commit summary), but we can add it in prepareCommit instead (From OE-Core rev: bbd467c393af5fa34a0b92d5461ff0bf427b3933) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.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>
* lib/oe/patch: prevent applying patches without any subjectMartin Jansa2020-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * this was discovered with $ devtool finish --force-patch-refresh where it was removing some patches and replacing them with patch in filename called "patch:" e.g. this .patch file: https://github.com/OSSystems/meta-browser/blob/311067d2d8a50cee5c836892606444f63f2bb3ab/dynamic-layers/rust-layer/recipes-browser/firefox/firefox/fixes/fix-camera-permission-dialg-doesnot-close.patch confuses devtool which results to create new .patch file called "patch:" $ devtool finish --force-patch-refresh firefox meta-browser NOTE: Starting bitbake server... WARNING: Host distribution "ubuntu-20.04" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution. Loading cache: 100% |###################################################################################################################################################################################################################################| Time: 0:00:00 Loaded 2480 entries from dependency cache. Parsing recipes: 100% |#################################################################################################################################################################################################################################| Time: 0:00:00 Parsing of 1718 .bb files complete (1717 cached, 1 parsed). 2480 targets, 68 skipped, 0 masked, 0 errors. Summary: There was 1 WARNING message shown. INFO: Updating patch 0001-Bug-1554949-Fix-WebRTC-build-failure-with-newer-linu.patch ... INFO: Updating patch pre-generated-old-configure.patch INFO: Adding new patch patch: INFO: Updating recipe firefox_68.0esr.bb INFO: Removing file /OE/build/test-oe-build-time/poky/meta-browser/dynamic-layers/rust-layer/recipes-browser/firefox/firefox/fixes/fix-camera-permission-dialg-doesnot-close.patch INFO: Cleaning sysroot for recipe firefox... INFO: Leaving source tree /OE/build/test-oe-build-time/poky/build/workspace/sources/firefox as-is; if you no longer need it then please delete it manually this looked like incorrect parsing of the git format-patch files exported from workspace/sources (the git format-patch version of fix-camera-permission-dialg-doesnot-close.patch starts like this: $ head 0008-original-patch-fix-camera-permission-dialg-doesnot-c.patch From 37dfa11961b48024bedcfb9336f49107c9535638 Mon Sep 17 00:00:00 2001 From: Takuro Ashie <ashie@clear-code.com> Date: Mon, 20 Aug 2018 10:16:20 +0900 Subject: [PATCH 08/34] %% original patch: fix-camera-permission-dialg-doesnot-close.patch so first I've modified GitApplyTree.extractPatches() to be able to parse the original patch name correctly even in this case where subject is wrapped, but then it still wasn't right, because we ended with correctly named .patch file, but all we could use for Subject line was the name of the original .patch file (instead of the Subject from metadata commit which introduced this .patch files as some other .patch files get when refreshed with devtool. In the end the issue happens even sooner in GitApplyTree.prepareCommit() where it correctly found the Subject from metadata commit, but then didn't apply it when there weren't any other outlines from patch headers. (From OE-Core rev: f4349c395749c30e70587fc276913530e518836b) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.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: Add sync call to command executionRichard Purdie2020-10-302-9/+15
| | | | | | | | | | | | | | | 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>
* bitbake-bblayers/create: Make the example recipe print its messageYoann Congal2020-10-221-1/+3
| | | | | | | | | | | | | | | | | The example recipe is setup to print a message using bb.plain() in the "do_build" task but this task is "noexec" so the message never prints. This might be confusing. This moves the message printing into another "do_display_banner" task and add it to the do_build "before" list. (From OE-Core rev: 2387f968b8dd90de9f0907ee571ec6207ffa9a19) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 252385bef9b226f32691b8513869ea3e41813b40) 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/qemurunner: Increase serial timeoutRichard Purdie2020-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | Increase the serial login timeout from 60 to 120s. This seems like a long time, however for a qemumips image with systemd+PAM and openssh, (e.g. core-image-sato-sdk + DISTRO=poky-altcfg), the getty connects to systemd's pam module which waits on logind and 45s for all this to happen at the same time as things like ssh key generation happens is not unknown. Increase the timeout to match the longer times we know these things can take in the worst case scenarios since we're tired of intermittent issues related to the serial login affecting the autobuilder. (From OE-Core rev: 1c5f304ad8d7d5deb85b3a5135556f9e38a9326b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d8b4292db741de660f756dfb766210814d587b7a) 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: sdk: Capture stderr outputJoshua Watt2020-09-106-6/+6
| | | | | | | | | | | | | | 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: cf6cab12ca7ff40ac484cdaf27ea91ed49b901b0) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 7cb4e9ab8c1596281060e94a216966060103956e) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/manual/bsp-hw.json : remove X_server_can_start_up_with_runlevel_5_boot testTeohJayShen2020-09-021-22/+0
| | | | | | | | | | | | remove the test as graphical mode is already being validated (From OE-Core rev: 2de541adc2dfc11be72446d3f80a9874f8be86c1) Signed-off-by: TeohJayShen <jay.shen.teoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad5b5ca9ec1d9106911a610bb36fb98e3f17748d) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/manual/bsp-hw.json : remove shutdown_system testTeohJayShen2020-09-021-22/+0
| | | | | | | | | | | | remove the test as shutdown function is already being validated (From OE-Core rev: a0d678cd3b7b0193450abe00e58f71692a75360e) Signed-off-by: TeohJayShen <jay.shen.teoh@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 58281082fbed57298247c019c3d8149e688de161) 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: write @OETestTag content into json test reports for each caseAlexander Kanavin2020-08-121-0/+14
| | | | | | | | | | | | | | | | | This allows using these tags for classification and filtering of test results according to various organization-specific criteria, such as teams responsible for the test, internal test ids, feature domains and so on. Test name itself meanwhile can stay short and human-readable. (From OE-Core rev: 3801b126eb52cd46efe417111afcd27f05d8f72b) (From OE-Core rev: 9eaf11657cc8304af5cb75f98decbc64cca37801) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.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>
* ltp: make copyFrom scp command non-fatalMatthew2020-08-122-4/+8
| | | | | | | | | | | | | | | [YOCTO #13802] Make the scp failure non-fatal so the ltp tests continue to run and the rest of the logs will be available to see afterwards. (From OE-Core rev: 9390846e2abdd6837094a619ba4703a1be4a04cf) Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0f7d093038274f4f21f6cca39a96aac4f6c32ee3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Add priority/nice information for running processesRichard Purdie2020-07-312-2/+2
| | | | | | | | | | | | | We're seeing failures due to system load. In theory we've set process nice levels which should compensate for this. Add debugging so we can find out if they're being correctly applied. (From OE-Core rev: 693dc285164eb6cc88cc7174238fd59f0393b5c3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1e4e345bba8216b9b5623682206a7dae7cad261c) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: Fix missing pid file tracebacksRichard Purdie2020-07-221-1/+1
| | | | | | | | | | | | One element of the error message guarded against None as a value but I missed the other, fix this. (From OE-Core rev: 9e23163016b7a8fea0dbfe2111f9493017e5a7b2) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dbce6baec68d7658453b8c44159e1d1fef746151) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Add extra debug info when qemu fails to startRichard Purdie2020-07-221-0/+9
| | | | | | | | | | | | | | | When qemu fails to start we're struggling to work out why. Add more debug info which can at least confirm/rule out various things. This code is only on the error handling path and more info shoudl help us debug issues. (From OE-Core rev: 797f7e0c3ff0610a4de321eaf82f84bca610624e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3001d0d8f3429e5ff0c37ea7192e85e7001cdb32) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Ensure pid location is deterministicRichard Purdie2020-07-221-2/+4
| | | | | | | | | | | | | | | The pid location could vary due to changes in cwd as only a filename is specified, not a full path. This in theory could be resulting in some of our autobuilder failures. Whilst its difficult to know if this is causing a problem, Using a full path removes any question of such an issue. (From OE-Core rev: a03c85fe0704a457bd2d92dd58cbbb4d37453f2a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 55c186ff410c99570242478b99ac24ebc40aa6bd) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/recipeutils.py: add AUTHOR; BBCLASSEXTENDTim Orling2020-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | If you try to create a plugin for recipetool that adds the AUTHOR field, it is impossible to put it in the recommended position [1] without adding to the recipe_progression variable. While we are at it, also add BBCLASSEXTEND at the end, as also recommended by [1]. [1] http://www.openembedded.org/wiki/Styleguide (From OE-Core rev: 2a1ae8c12cb0d6fd9d57c98caa97a10f3b6d3388) Signed-off-by: Tim Orling <timothy.t.orling@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d687c5b7b10b3decdd80d5c2fd61072a87f061f2) 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/core/loader: fix regex to include numbersVacek, Patrick2020-07-161-1/+1
| | | | | | | | | | | | | | The previous version only included the numbers 1 and 2 in the allowed characters for the module name. In the past, this was (\w+) so all numbers were allowed. Now it explicitly includes all numbers again. (From OE-Core rev: eab35415bb2cd68872707693afcf7705675fa87e) Signed-off-by: Patrick Vacek <patrickvacek@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f241fa493536ac953c1dac303917c6e75b459e28) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* logrotate.py: fix testimage occasionally failureChangqing Li2020-07-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | testcase test_systemd_failed occasionally failed with below error: Failed to start Rotate log files. logrotate.service: Failed with result 'exit-code'. logrotate.service: Main process exited, code=exited, status=1/FAILURE error: stat of /var/log/logrotate_test failed: No such file or directory error: logrotate_test:1 lines must begin with a keyword or a filename (possibly in double quotes) above failure caused since testcase test_logrotate_wtmp add /etc/logrotate.d/logrotate_test, which need /var/log/logrotate_test, but there is no such file. so when logrotate.service is triggerd by logrotate.timer after testcase test_logrotate_wtmp is runned, the testcase test_systemd_failed will fail. these 3 lines are useless, so remove them to fix above problem. (From OE-Core rev: 198fe0d64e4bdeda84c0f3e44afcc1d99ca9dbbe) Signed-off-by: Changqing Li <changqing.li@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 22f5f7f86a4d47624c476be00e5121009c48cb7b) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: Attempt to fix log closure warning messageRichard Purdie2020-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | We continue to see the warning message: WARNING: lib/bb/daemonize.py:76: ResourceWarning: unclosed file <_io.TextIOWrapper name='build/tmp/work/qemux86_64-poky-linux/oe-selftest-image/1.0-r0/testimage/qemurunner_log.20200703011821' mode='a' encoding='UTF-8'> I've been unable to reprodue this but believe its caused by garbage collection of the FileHandler used in QemuTarget being delayed until after a new tinfoil instance is created by a subseqent test. Force the log file to be closed when we stop using it to avoid this. [YOCTO #13961] (From OE-Core rev: fa2cca514f4b03aeeedb14dbffd26bc98ed74d29) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit e15cc7801ec611f867f5b31028741722ac718c87) 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>
* oeqa/core/loader: refine regex to find moduleLee Chee Yang2020-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | test case in format <module name>.<class name>.<test case name> this is clear when test cases is only 3 item deep. but confused when it is 4 item deep, eg, oelib.types.TestList.test_list_nosep in this case, oelib and oelib.types can both be treated as module since module name contains only lower cases and class name should contain atleast one upper case. so, always treat leading item without upper case as module also allow module name to contain dot. [YOCTO #13941] (From OE-Core rev: 838646da741cda2059ee2bd64fd1e59980fbf945) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ad81ea90a815389e45ff302a85151724c71f71c3) 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-022-22/+37
| | | | | | | | | | | | | | | | | | | | | 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>
* testimage: enable ovmf supportKonrad Weihmann2020-07-022-3/+8
| | | | | | | | | | | | | Add support for running wic images with EFI as testimage. Introduces a variable called QEMU_USE_OVMF for configuration. (From OE-Core rev: 458a860b45c0fb5bb3162b5a112b518c3339c1dd) Signed-off-by: Konrad Weihmann <kweihmann@outlook.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 3af8aaff68ed332d812ea7dc184d392700ad7882) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runtime/cases/ptest: Make output content path absoluteAndrej Valek2020-07-021-0/+4
| | | | | | | | | | | | | | The output content is created in current directory, because json content has no defined absolute path to WORKDIR as in bitbake. (From OE-Core rev: 394d90efdc8d06dc61114bf6279ba6d094667289) Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 14203b2cb9aa62f55cb12230ac8012b3cd995be7) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/command: Improve stdin handling in runCmdRichard Purdie2020-07-021-1/+3
| | | | | | | | | | | | | | | | | | | | | Occasionally we've been seeing leftover threads from runCmd. The stdin test assumes we clean up all threads but the code assumes that the daemonic thread can be left behind. The issue can be reproduced by adding a time.sleep(10) to the end of writeThread() which will mean it stays resident past the end of the command. We may as well add it to the threads list and clean it up properly, hopefully removing the race in the tests from the autobuilder. [YOCTO #13055] (From OE-Core rev: 9034ac93518b74dae5e05776c0bce085171cdd1f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 9b251dcaffe52d32c1faf41ab57ab414fbc29722) 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>
* oeqa/targetcontrol: Rework exception handling to avoid warningsRichard Purdie2020-06-182-5/+5
| | | | | | | | | | | | | | | | | | | We're seeing: WARNING: bitbake/lib/bb/cookerdata.py:136: ResourceWarning: unclosed file <_io.FileIO name='tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/testimage/qemurunner_log.20200601181912' mode='ab' closefd=True which can only be caused by the qemu.stop() method not being called. Tweak the error handling to fix the blanket exception handler which is likely meaning this function isn't getting called. (From OE-Core rev: bd2d32903f208b6a70abaa29b980db1498b84a02) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ee707090848d793e3b2d82dd3861ae22222682c0) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>