summaryrefslogtreecommitdiffstats
path: root/meta/lib
Commit message (Collapse)AuthorAgeFilesLines
* qemurunner: Simplify binary data handlingRichard Purdie2017-12-041-12/+8
| | | | | | | | | | | | | | | | I have concerns that bad timing of the flow of data from the logger might corrupt the output due to the way binary strings are handled in qemurunner. This simplifies the code to do the same thing it did before but much more safely. (From OE-Core rev: 20bc247316ab915465a4b1add6d09b48e07202ac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 1e87283e92a2765bb5d54d17138b208bc395953b) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/recipeutils: fix line splitting in patch_recipe_*Paul Eggleton2017-12-041-0/+5
| | | | | | | | | | | | | | | | | If a value was split over multiple lines (e.g. as SRC_URI usually is) then we were inserting the value as one item in the lines list with newlines between each line. There's nothing wrong with this if you're writing the list out to a file, but if you want to generate a patch (as patch_recipe_file() will do if the patch parameter is set to True) then the diff output looks a bit odd. Split the value before adding it to the lines list to resolve this. (From OE-Core rev: dbf68220e451a43830fe680c86b34b9bd127cad3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/recipeutils: fix find_layerdir() to return absolute pathsPaul Eggleton2017-12-041-1/+1
| | | | | | | | | | | | | | | | find_layerdir() should really return absolute paths, so make it do so. This fixes devtool finish not deleting files it should do after devtool upgrade if the specified path is relative, since the devtool finish code was assuming that find_layerdir() was returning an absolute path. Fixes [YOCTO #12318]. (From OE-Core rev: 8d028508bfd68ad272739cab5495811927936ef2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runner: Pass the value of buffer, don't force to TrueRichard Purdie2017-12-041-1/+1
| | | | | | | | | | The value could be False in which case we should pass that through. (From OE-Core rev: 5b4b7bfe33630d73b5b53fc754cd45563fcbfd4d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Markup further tests for stdout/stderr bufferingRichard Purdie2017-12-042-0/+4
| | | | | | | | | | | This further cleans up the output of oe-selftest so that runqemu output is hidden unless tests fail. (From OE-Core rev: 22f224965ac93da0b37affc4998fc0644f14462d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/target/ssh: Drop command/output logging to debug levelRichard Purdie2017-12-041-1/+1
| | | | | | | | | | | This ensures the console is kept clear of confusing output but that the main logs contain good debugging information. (From OE-Core rev: 3727fae1e420a60ef8c62da546e1065045b163ff) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Clean up logger handlingRichard Purdie2017-12-046-41/+26
| | | | | | | | | | | | | | | | | | | | The logger handling in oeqa was confused at best. This patch: a) Passes in a logger through various qemu runner pieces b) Uses that logger consistently in the code c) Creates a logger for QemuRunner outside the bitbake namespace meaning we don't conflict with the tinfoil logging changes The result of this is more consistency. For runtime tests in testimage, the logs always contain the debug info, nothing is shwon on the console. For the oe-selftests, logs are intercepted and only shown if the test fails. (From OE-Core rev: ba8babc45141891d0624f9a181a580fa416e87ec) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Use logger.debug, not logger.infoRichard Purdie2017-12-041-37/+37
| | | | | | | | | | | | | Bitbake logs info messages to the console. These messages are really there as debugging information. At the debug level, they will be shown in failure logs and in the task logs but not on the console which is what we want in this case. (From OE-Core rev: 5c1cdd4f3ea59a202fff853e0390b9aa5859dc74) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/targetcontrol: Drop unused get_target_controller functionRichard Purdie2017-12-041-27/+2
| | | | | | | | | | This funciton appears completely unused, drop it. (From OE-Core rev: 31ccc70c4ea58e3781ea14eb534e00e9e06e131a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/runqemu: Only show stdout/stderr upon test failureRichard Purdie2017-12-042-0/+10
| | | | | | | | | | | | In general we don't need to see the output of runqemu however if it fails we do. Use the buffer option that already exists in TestResult but allow us to trigger it on a per test basis. (From OE-Core rev: 1826a8cb8cf4c51307003617864d2ffab273eb0b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: Ensure logging handler is removedRichard Purdie2017-12-041-1/+3
| | | | | | | | | | | If we don't remove the handler we end up with duplicate log messages which is undesireable. (From OE-Core rev: 39e6194615b139e2b772084641940fffa2c9380f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sshcontrol.py: in copy_to() always use scpErik Botö2017-12-041-6/+3
| | | | | | | | | | | | | | | | The current implementation is broken when the localpath is a link. Then only a symlink would be created on the target, instead of copying the actual file. [YOCTO #11524] (From OE-Core rev: a9d446d9c42a67109ae87a156ae43dcbb0f56e1e) Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* masterimage.py: rename parameter "params" in start() to "extra_bootparams"Erik Botö2017-12-041-1/+1
| | | | | | | | | | | | | | This matches how it is called, and how it is named in qmeu target. [YOCTO #11524] (From OE-Core rev: 4e376d0658fe8315cfcca927ea275e1260bcc02f) Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* masterimage.py: fix stop()Erik Botö2017-12-041-1/+1
| | | | | | | | | | | | | | | | The stop() function is called in the context of the masterimage, so self.master should be used instead of self.connection which is undefined at that time. [YOCTO #11524] (From OE-Core rev: 1871d61b75f2fbc0df1368960b7746371fd875f5) Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* masterimage.py: fix issue with calling reboot on masterimage/DUTErik Botö2017-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | On systemd systems calling reboot over an ssh connection doesn't return as expected causing an exception, therefore wrap the call to reboot in order to avoid this issue. Also sync the filesystems before rebooting cause otherwise, it will be done as part of the reboot and could take a very long time and testimage will fail to access the machine. This issue was observed consistently with one of our rootfs at Pelagicore. [YOCTO #11524] (From OE-Core rev: 6f5c4a8e07f8cdf3f6352e9e85d7376937bb32d2) Signed-off-by: Erik Botö <erik.boto@pelagicore.com> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/imagefeatures: add basic test for useradd-staticidsRoss Burton2017-12-041-0/+10
| | | | | | | | (From OE-Core rev: cb20382d85f5758ac9fb7cd7df085d07005f1337) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/core/loader: Make _built_modules_dict() support packages correctlyPeter Kjellerstedt2017-12-041-36/+14
| | | | | | | | | | | | | | | | | For test modules in a package, e.g., oelib.license, running `oe-selftest -r oelib.license` or `oe-selftest -r oelib.license.TestSimpleCombinations` would fail with a message that the specified test cases could not be found. This was due to the parsing in _built_modules_dict(), which failed to distinguish between <package>.<module>.<class> and <module>.<class>.<testcase> and treated both cases as the latter. (From OE-Core rev: 8d5eb5498975fd0d73ac20e2c4d938c1f85317d7) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: use console in postinst_rootfs_and_bootRoss Burton2017-12-041-2/+1
| | | | | | | | | | Use a console login not SSH for simplicity. (From OE-Core rev: 35ecbe834290f346a8acf1e926e3104a8ac6edb0) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime_test: fix postinst_rootfs_and_bootRoss Burton2017-12-041-1/+1
| | | | | | | | | | | | This test overrides IMAGE_FEATURES but failed to include package-management, which is essential for postinsts to work under dpkg. (From OE-Core rev: 5e68e80a45c29dd7b337d9500733b18a19cd930b) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/sstatesig: fix wildcard matching wrong task signature filesPaul Eggleton2017-12-041-1/+1
| | | | | | | | | | | | | | | | | | | With a '*' as a wildcard for the signature here we can also match a portion of the task name with the result that we may match a sigdata file for the wrong task. Luckily the signature is always the same length - 32 characters - so we can simply use 32 '?' characters instead. (A regex would have been another alternative, but the wildcard should be effective and I felt like a regex would complicate the code more than this solution). Fixes [YOCTO #11763]. (From OE-Core rev: 8565391a4ebb574141b5d09bff710fc02c73ba34) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/runtime: force empty root password, use helpers to access qemuRoss Burton2017-12-041-4/+5
| | | | | | | (From OE-Core rev: 25a2db0c4e1c558cd14b2e7b7bce46f7d1ea02a7) Signed-off-by: Armin Kuster <akuster@mvista.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/terminal.py: use an absolute path to execute oe-gnome-terminal-phonehomeMing Liu2017-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | A flaw was found on my Ubuntu 14.04.5 LTS, on which that gnome-terminal is the default terminal, when I run any of the tasks: bitbake busybox -c menuconfig/devshell/devpyshell bitbake virtual/kernel -c menuconfig/devshell/devpyshell I got a error as follows: "Failed to execute child process "oe-gnome-terminal-phonehome" (No such file or directory)" Seems the environment of the process calling Popen is not passed to the child process, this behaviour is a known issue in Python bug tracker: http://bugs.python.org/issue8557 It could be fixed by using an absolute path instead per test. (From OE-Core rev: 84514d0aaf28028b7862d247debbcdcce58fdada) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 2117c148ef07d84bc605768e3b3671b0126b9337) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: fix bad indentation in serial loginRoss Burton2017-12-041-3/+3
| | | | | | | | (cherry picked from commit c4f57aed7a29000067c63a2821fddf18a88a23ce) (From OE-Core rev: 2de7ffd9f0656ffd5b6fa002213e5f619480aba8) Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package_manager.py (rpm): Allow use of non-signed packagesOtavio Salvador2017-10-071-3/+5
| | | | | | | | | | | | | | | | | When we wish to use the package feed for local development, it does not uses GPG signed feeds by default but dnf uses package signature check. We need to configure the GPG signature check out so it works out of box. With this patch, installing non-signed packages works: $: dnf install <package> (From OE-Core rev: bceafe23cbe12a1ab0628b70865cb8867c7d7ee1) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* license.py: Correct selection of licenses in is_included()Peter Kjellerstedt2017-10-072-5/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | When faced with multiple sets of licenses combined with | (OR), it was possible for oe.license.is_included() to choose a set of licenses with a blacklisted license and then report failure, even if choosing another set of licenses would have resulted in a successful result. This happened when the chosen set still contained more whitelisted licenses than the other set. This change makes sure a set with any blacklisted license is always considered with a lower weight than a set with only whitelisted licenses. Example: Faced with the license string "GPL-3.0 & GPL-2.0 & LGPL-2.1 | Proprietary" and with "GPL-3.0" being blacklisted, the old code would report a failure since "GPL-3.0 & GPL-2.0 & LGPL-2.1" still contains more whitelisted licenses than "Proprietary" does. This change also adds a unit test for oe.license.is_included(). (From OE-Core rev: 312b4d6175e189852c0787ca2fe99b99ce92d1bd) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: rpm: improve loggingMikko Ylinen2017-10-071-1/+3
| | | | | | | | | | | | To be able to better debug remove() behaviour, add more logging to rpm calls via bb.note(). The change also makes remove() logging more consistent with other package managers' remove() (e.g., opkg). (From OE-Core rev: 1a90c97616698050529e169a83e6f07a255687df) Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs.py: remove update-alternatives correctlyMikko Ylinen2017-10-071-5/+12
| | | | | | | | | | | | | | | | | | | | | | | With "read-only-rootfs" in IMAGE_FEATURES, packages in ROOTFS_RO_UNNEEDED are removed when building the rootfs. The list of packages to remove is passed to the package manager and the list is sorted so that update-alternatives provider is the last entry. This is with the assumption that the last entry on the list/command line is removed last. However, it turns out rpm does not care about "last on the command line" and update-alternatives provider is removed before other the packages get to run their %preun scripts for update-alternatives. This leaves broken alternative symlinks in rootfs. The fix is to first remove all but update-alternatives provider and after that update-alternatives provider in its own remove() call. (From OE-Core rev: 0a8639593c11ef0cfb3a3a514b17e36318b8e8f2) Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/cases/runtime_test: ignore removal errors when cleaning temporary ↵Leonardo Sandoval2017-09-261-3/+7
| | | | | | | | | | | | | | | | | | | | | | | gpg directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.browser' This is the same fix as 7e3a7cd2426feac757def81850dc44156cd0f33e, but this applies to runtime (instead of signing). [YOCTO #11821] (From OE-Core rev: f28e8131f69913ff90ed210c7a58726d3ef37db6) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta: drop True option to getVar callsMing Liu2017-09-261-1/+1
| | | | | | | | | Search made with the following regex: getVar ?\((.*), True\). (From OE-Core rev: dbc0eaf478feb3f752ae22fd184984494fc85d0a) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner: print tail qemu log in case bootlog is emptyLeonardo Sandoval2017-09-251-1/+6
| | | | | | | | | | | | | | There are cases where the 'while loop' waiting for login prompt fails and the bootlog variable does not get populated, thus use the the new qemurunner member (self.msg) which stores all output coming from the qemu process. [YOCTO #12113] (From OE-Core rev: 39ffa0f3779305c5e8ef86fe4572e961c5912021) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* meta/lib/oe/rootfs.py: clean up dnf cache after creating an imageAlexander Kanavin2017-09-221-1/+2
| | | | | | | | | | | | It contains cached metadata for a transient repository that is used only when creating images on the host, and so is of no use on target images. Dnf will recreate the cache on target when needed. (From OE-Core rev: 89ddf2516b713e6622df95ab391423b033d4271a) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/recipetool: use stable tarball for recipetool create testRoss Burton2017-09-181-6/+6
| | | | | | | | | | | GitHub dynamically generates the /archive/ tarballs but we're encoding checksums in the test suite. Change the URL to use a static tarball, and update the checksums. (From OE-Core rev: 9c668f9ff989a34e615e2ecc051dadbfe24a5bb4) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* devtool: rework source extraction so that dependencies are handledPaul Eggleton2017-09-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since it was first implemented, devtool's source extraction (as used by the devtool modify, extract and upgrade subcommands) ignored other recipe dependencies - so for example if you ran devtool modify on a recipe that fetches from svn or is compressed using xz then it would fail if those dependencies hadn't been built first. Now that we can execute tasks in the normal way (i.e. tinfoil.build_targets()) then we can rework it to use that. This is slightly tricky in that the source extraction needs to insert some logic in between tasks; luckily we can use a helper class that conditionally adds prefuncs to make that possible. Some side-effects / aspects of this change worth noting: * Operations are a little slower because we have to go through the task dependency graph generation and other startup processing. There's not really any way to avoid this though. * devtool extract didn't used to require a workspace, now it does because it needs to create a temporary bbappend for the recipe. (As with other commands the workspace be created on the fly if it doesn't already exist.) * I want any existing sysroot files and stamps to be left alone during extraction since we are running the tasks off to the side, and especially devtool extract should be able to be used without touching these. However, this was hampered by the automatic removal process in sstate.bbclass triggered by bb.event.ReachableStamps when the task signatures change, thus I had to introduce a way to disable this removal on a per-recipe basis (we still want it to function for any dependencies that we aren't working on). To implement this I elected to use a file written to tmp/sstate-control which gets deleted automatically after reading so that there's less chance of stale files affecting future sessions. I could have used a variable but this would have needed to be whitelisted and I'd have to have poked its value in using the setVariable command. Fixes [YOCTO #11198]. (From OE-Core rev: 830dbd66992cbb9e731b48d56fddf8f220349666) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: wait for PID to appear in procfsJuro Bystricky2017-09-131-3/+4
| | | | | | | | | | | | We need QEMU PID in order to access "/proc/<qemupid>/cmdline" Having a valid QEMU PID does not mean we can access the proc entry immediately, we need to wait for the /proc/<qemupid> to appear before we can access it. (From OE-Core rev: d2d069fa9910d1c7a94c898355a63fca03ec5ad8) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oe-selftest: devtool: fix test_devtool_add hanging on some machinesPaul Eggleton2017-09-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | The code in scriptutils which implements the logic for running the editor used by devtool edit-recipe looks at the VISUAL environment variable before EDITOR, and thus if VISUAL is set in the environment it will override the EDITOR value we are setting here, the editor (usually vim) launches and there's nothing to stop it running forever short of manually killing it. Set VISUAL instead to fix this. Apparently VISUAL is in fact the variable we should really be preferring here - I don't think I knew that but somehow I got it right in the code, just not in the test. Here are the details for the curious: https://unix.stackexchange.com/questions/4859/visual-vs-editor-whats-the-difference Fixes [YOCTO #12074]. (From OE-Core rev: 6a7c50def569b5e86aa17bd9b287e8c63781dcb0) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/cases/signing: ignore removal errors when cleaning temporary gpg ↵Leonardo Sandoval2017-09-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | directory The high-level method tempfile.TemporaryDirectory give us no way to ignore erros on removal thus use tempfile.mkdtemp instead. Ignoring possible issues on removal is neccesary because it contains gpg sockets that are automatically removed by the system once the process terminates, otherwise the following log is observed: .. .. File "/usr/lib/python3.5/shutil.py", line 436, in _rmtree_safe_fd os.unlink(name, dir_fd=topfd) FileNotFoundError: [Errno 2] No such file or directory: 'S.gpg-agent.browser' [YOCTO #11821] (From OE-Core rev: 7e3a7cd2426feac757def81850dc44156cd0f33e) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/devtool: Avoid writing on TOPDIR on kernel test caseJose Perez Carranza2017-09-121-4/+5
| | | | | | | | | | Use a tempdir to copy the .config file from the kernel instead of being copied to build directory. (From OE-Core rev: ccccf975c75055639c0ed5052ac0ad53ebbf53ca) Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: selftest: add test_wic_rm_ext test caseEd Bartosh2017-09-111-0/+23
| | | | | | | | | | | Tested if 'wic rm' correctly removes files from the ext4 partition of the wic image. (From OE-Core rev: 693b555e4f419b5d24f9f86c44354866492f8bb0) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: selftest: add test_wic_cp_ext test caseEd Bartosh2017-09-111-0/+30
| | | | | | | | | | | Tested if 'wic cp' correctly copies files to the ext4 partition of the wic image. (From OE-Core rev: 7970907c72d9533fd63d2c8796bbeb9be86b3fc3) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* wic: selftest: add test_wic_ls_ext test caseEd Bartosh2017-09-111-0/+16
| | | | | | | | | | | Tested if 'wic ls' correctly lists directory contents of the ext* partition. (From OE-Core rev: 6ae3ff957b5c28c7853966cd5a7665772c594546) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* rootfs: improve postinst intercept loggingRoss Burton2017-09-111-3/+4
| | | | | | | | | | Ensure we capture stderr, always write the output to the log, and don't be so emotional in the warning message. (From OE-Core rev: 87110e971c548d9d3eb7296ea6772d18e0226e53) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa: Replace "append +=" with normal "append =" in layerappend.pyRobert P. J. Day2017-09-111-1/+1
| | | | | | | | (From OE-Core rev: 0fae16b67542c59b059aa359146c38040785f200) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest/case: Add recipeinc methodOla x Nilsson2017-09-111-7/+13
| | | | | | | | | | | | | | | | | | | | The recipeinc method returns the absolute path of the test_recipe.inc file of a specified recipe. It replaces four instances of identical code, and make it possible to access the filename from a testcase for cleanup. The write_recipeinc and append_recipeinc methods are changed to return the path to the file in case that is useful. The test_recipe.inc file is usually cleaned up in a finally block, but that block executes before any teardown operations. This blocks any teardown that requires the presence of the test_recipe.inc file. (From OE-Core rev: cdb431676456f47da1a3b70caddf49f083948798) Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/selftest: Add missing IDs to various test casesJose Perez Carranza2017-09-115-1/+25
| | | | | | | | | | | | | Add decorator @OETestID() with Tesopia TC-ID to the test cases that did not have it properly set. [YOCTO #11873] (From OE-Core rev: aa5b9edbd9c4495befe1912a5b401b536be39d5b) Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* qemurunner.py: refactor searching for QEMU PIDJuro Bystricky2017-09-111-167/+136
| | | | | | | | | | | | | Ask QEMU to store the QEMU process PID in a file, this way we don't have to parse running processes and analyze descendents. This is done via QEMU command line argument "-pidfile". [YOCTO #12001] (From OE-Core rev: 67612dcd2a8a1aa1d683dddb0bd2f592886ff020) Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/qemurunner: Improve loggingRichard Purdie2017-09-111-45/+45
| | | | | | | | | | | | | | | Python unittest intercepts stdout and stderr however qemurunner sets up a streamhandler before that interception occurs, hence the messages spam the unittest output. By moving the logging init to the class init time, we use the unittest stdout/stderr and this means unittest can only show the log output upon failure. This cleans up the selftest and testimage output whilst still showing logging upon failure. (From OE-Core rev: 9099cecc727fe0ae5f1559582426d30ba7a9f4d3) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* package_manager: Clean up horrible 'None' return valuesRichard Purdie2017-09-021-15/+4
| | | | | | | | | If this fails the exception will now be raised. Lets use that and drop all this 'None' return value ugliness. (From OE-Core rev: b3c63b3b816179b96f1ed9b5baaf6e1f1c3c7b80) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/utils: Handle exceptions in multiprocess_execRichard Purdie2017-09-021-8/+13
| | | | | | | | | | | | Currently exceptions that happen in pool commands are ignored. Any errors would be printed on the console but everything else is silent. Switch to use pool.map_async which allows for an error_callback which we can use to detect exceptions and make sure these errors are handled. (From OE-Core rev: 7f2f9b3ff011b340b5d23bb7c47b12c357dc9f02) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oe/package: Improve filedeprunner subprocess handlingRichard Purdie2017-09-021-8/+3
| | | | | | | | | | | | | | | Currently the exit code of the spawned program isn't checked so it can fail and the do_package task will continue merrily upon its way. Use subprocess.check_output() to ensure we check the exit code and redirect stderr to stdout so if it fails, we see the error output. We can then drop the existing exception handling as the subprocess exception gives a much better error. (From OE-Core rev: ce11cb449222bc47fea4f6d66ff1cc7cdc529ab9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* selftest/prservice: Adapt to BB_SERVER_TIMEOUTRichard Purdie2017-08-311-1/+1
| | | | | | | | | | | | | In the memory resident mode, the user may not see a message about the server starting, it would be in the cookerdeamon logfile. We don't need this to test the server is functioning correctly so just drop the test. Add in an extra check that the file we expected to be created was created when exporting PR values. (From OE-Core rev: 811edd95420e907e71b5c7646bde5013b43d4c73) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>