aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
AgeCommit message (Collapse)Author
2017-11-14oeqa/dnf.py/rpm.py: add MLPREFIX to package namerbt/mlqaRobert Yang
The package name is lib32-foo (e.g., lib32-dnf) when run "bitbake lib32-core-image-sato -ctestimage", add MLPREFIX to package name can fix the problem, otherwise the test cases would be failed. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2017-11-14oeqa: make OEHasPackage() check multilib packageRobert Yang
Make OEHasPackage() check multilib package when test multilib image, for example, OEHasPackage(['dnf']) should check lib32-dnf when test lib32-core-image-sato, this can make "bitbake lib32-core-image-sato -ctestimage" work, otherwise the testcases would be skipped. Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
2017-11-10oeqa/runner: Pass the value of buffer, don't force to TrueRichard Purdie
The value could be False in which case we should pass that through. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-10oeqa: Markup further tests for stdout/stderr bufferingRichard Purdie
This further cleans up the output of oe-selftest so that runqemu output is hidden unless tests fail. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/target/ssh: Drop command/output logging to debug levelRichard Purdie
This ensures the console is kept clear of confusing output but that the main logs contain good debugging information. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa: Clean up logger handlingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/qemurunner: Use logger.debug, not logger.infoRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/targetcontrol: Drop unused get_target_controller functionRichard Purdie
This funciton appears completely unused, drop it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09oeqa/runqemu: Only show stdout/stderr upon test failureRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-09qemurunner: Ensure logging handler is removedRichard Purdie
If we don't remove the handler we end up with duplicate log messages which is undesireable. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-08sshcontrol.py: in copy_to() always use scpErik Botö
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] 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>
2017-11-08masterimage.py: rename parameter "params" in start() to "extra_bootparams"Erik Botö
This matches how it is called, and how it is named in qmeu target. [YOCTO #11524] 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>
2017-11-08masterimage.py: fix stop()Erik Botö
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] 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>
2017-11-08masterimage.py: fix issue with calling reboot on masterimage/DUTErik Botö
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] 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>
2017-11-08selftest/imagefeatures: add basic test for useradd-staticidsRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08lib/oeqa/selftest/cases/gotoolchain: add selftest for the Go toolchainJoshua Lock
Add a simple test case to being testing of the Go toolchain: 1) build meta-go-toolchain 2) create a temp directory and install the generated Go toolchain within 3) fetch an archive of the Go Dep tool 4) create an appropriately laid out GOROOT and inflate the dep archive there 5) build the dep command with the SDK's Go toolchain and check it returned successfully. [YOCTO #12152] Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08oeqa/core/loader: Make _built_modules_dict() support packages correctlyPeter Kjellerstedt
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. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-08oeqa/selftest/runtime_test: use console in postinst_rootfs_and_bootRoss Burton
Use a console login not SSH for simplicity. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-11-07oeqa/selftest/runtime_test: fix postinst_rootfs_and_bootRoss Burton
This test overrides IMAGE_FEATURES but failed to include package-management, which is essential for postinsts to work under dpkg. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-05oeqa/selftest/runtime: force empty root password, use helpers to access qemuRoss Burton
2017-11-05qemurunner: fix bad indentation in serial loginRoss Burton
2017-10-06license.py: Correct selection of licenses in is_included()Peter Kjellerstedt
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(). Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-26selftest/cases/runtime_test: ignore removal errors when cleaning temporary ↵Leonardo Sandoval
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] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-25qemurunner: print tail qemu log in case bootlog is emptyLeonardo Sandoval
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] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-18oeqa/selftest/recipetool: use stable tarball for recipetool create testRoss Burton
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. Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-18devtool: rework source extraction so that dependencies are handledPaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2017-09-13qemurunner.py: wait for PID to appear in procfsJuro Bystricky
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. Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-13oe-selftest: devtool: fix test_devtool_add hanging on some machinesPaul Eggleton
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]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/cases/signing: ignore removal errors when cleaning temporary gpg ↵Leonardo Sandoval
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] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-12selftest/devtool: Avoid writing on TOPDIR on kernel test caseJose Perez Carranza
Use a tempdir to copy the .config file from the kernel instead of being copied to build directory. Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11wic: selftest: add test_wic_rm_ext test caseEd Bartosh
Tested if 'wic rm' correctly removes files from the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_cp_ext test caseEd Bartosh
Tested if 'wic cp' correctly copies files to the ext4 partition of the wic image. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11wic: selftest: add test_wic_ls_ext test caseEd Bartosh
Tested if 'wic ls' correctly lists directory contents of the ext* partition. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa: Replace "append +=" with normal "append =" in layerappend.pyRobert P. J. Day
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa/selftest/case: Add recipeinc methodOla x Nilsson
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. Signed-off-by: Ola x Nilsson <olani@axis.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-11oeqa/selftest: Add missing IDs to various test casesJose Perez Carranza
Add decorator @OETestID() with Tesopia TC-ID to the test cases that did not have it properly set. [YOCTO #11873] Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2017-09-07qemurunner.py: refactor searching for QEMU PIDJuro Bystricky
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] Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-07oeqa/qemurunner: Improve loggingRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31selftest/prservice: Adapt to BB_SERVER_TIMEOUTRichard Purdie
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31oe-selftest: tinfoil: add a test for variable historyPaul Eggleton
I recently found that variable history wasn't working properly for recipes when we enable history tracking, resulting in minor functionality loss in devtool upgrade, so add a test to ensure this doesn't regress now that it's fixed. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-31oe-selftest: devtool: test find-recipe and edit-recipePaul Eggleton
We weren't testing the devtool find-recipe and edit-recipe subcommands, with the result that when they regressed recently we didn't notice. Add some code into the test_devtool_add to test this (since we need a recipe in the workspace, and adding a new test with all that preamble would seem a bit excessive for these simple checks). Also take the opportunity to refactor the test a little bit so that the recipe name and version are variables rather than hardcoding them everywhere. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-29qemurunner: Tweak qemu pid starting timeout codeRichard Purdie
We're seeing timeouts in the autobuilder testing code. Increase these timeouts to 120, print the length of time we're having to wait, change the error messages to really be errors and don't print empty logs, its not helpful, print a message about the empty log instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-27wic: setlftest: test expanding MBR imageEd Bartosh
Added test_expand_mbr_image test case to the wic oe-selftest suite. The test expands directdisk wic image to 1Gb target, checks if it's expanded correctly and boots it in qemu to make sure the image is bootable, i.e. bootloader, kernel, boot and root partitions are still functional. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-24core/target/ssh.py: use reader to handle partial dataRobert Yang
This can avoid UnicodeDecodeError error. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23core/target/ssh.py: replace decode errorsRobert Yang
There might be wild strings when read from target (especially when reading ptest results), replace the errors to avoid breaking the test. Fixed: (Not always happen) $ bitbake core-image-sato -ctestimage [snip] status, output = self.target.run('ptest-runner', 0) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 84, in run status, output = self._run(sshCmd, processTimeout, True) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 55, in _run status, output = SSHCall(command, self.logger, timeout) File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 258, in SSHCall run() File "/buildarea/lyang1/poky/meta/lib/oeqa/core/target/ssh.py", line 236, in run output = process.communicate()[0].decode("utf-8") UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 4906: invalid continuation byte [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23utils/logparser.py: fix section checkRobert Yang
The section might be None or '', so use "if section" for it. Fixed: File "/buildarea/lyang1/poky/meta/lib/oeqa/utils/logparser.py", line 113, in log_as_files prefix += section TypeError: Can't convert 'NoneType' object to str implicitly [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23runtime/cases/_ptest.py: rename it to ptest.pyRobert Yang
It works now. [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23runtime/cases/_ptest.py: add skip statusRobert Yang
The packages' test cases maybe skipped, check and save them. [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23oeqa/utils/logparser.py: add skip statusRobert Yang
Some test cases maybe skipped, let's parse it. [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23runtime/cases/_ptest.py: revive itRobert Yang
* Make it work with current oeqa * Skip the test if ptest is not in DISTRO_FEATURES * Skip the test if ptest-pkgs is not in IMAGE_FEATURES * The logs are saved to: testimage/ptest_log -> testimage/ptest_log.<datetime> * This provides data that could be used to detect regressions in ptest results [YOCTO #11547] Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>