aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
AgeCommit message (Collapse)Author
2016-10-07oeqa/sshcontrol: Handle interrupted system call errorRichard Purdie
Deal with an interrupted system call gracefully: | File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-systemd/build/meta/lib/oeqa/utils/sshcontrol.py", line 55, in _run | if select.select([self.process.stdout], [], [], 5)[0] != []: | InterruptedError: [Errno 4] Interrupted system call Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-30oeqa/utils: Add StreamHandler to loggerFrancisco Pedraza
StreamHandler was added due missing log information on the console in oe-selftest with Qemu Runner Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-16qemurunner: print out the runqemu commandbavery
This logs the launch command that was used for runqemu while running -c testimage. This way, if I'd like to easily launch qemu manually in order to debug a failed test, I know what commmand was run to create the qemu instance. Signed-off-by: bavery <brian.avery@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-09-15oeqa/utils/decorators: LogResults fix race condition in linkfileAníbal Limón
In order to avoid race condition when test if exists the linkfile use bb.utils.lock, the best solution is to create a unique name for the link file. There is no way to create a unique linkfile name at this decorator because is needed the machine and image variables, those variables can't be passed easily in this code. To avoid broke test export functionality use a try/except because bb isn't available when use test export [YOCTO #10225] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09oeqa: Use snapshot instead of copying the rootfs imageRichard Purdie
Rather than copying images, use the snapshot option to qemu. This fixes a regression caused by the recent runqemu changes where the wrong images were being testes since the image is copied without the qemuboot.conf file. This means the latest image is found by runqemu rather than the specified one, leading to various confused testing results. It could be fixed by copying more files but use snapshot mode instead. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09qemurunner.py/qemutinyrunner.py: remove runqemu-internalRobert Yang
There is no runqemu-internal any more. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25oeqa.utils.git: implement init() methodMarkus Lehtonen
Method for doing 'git init'. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git.GitRepo: new arg to require topdirMarkus Lehtonen
Add a new 'is_topdir' argument to the GitRepo init method which validates that the given path is the top directory of a Git repository. Without this argument GitRepo also accepts subdirectories of a Git repository (in which case GitRepo will point to the parent directory that is the top directory of this repository) which may have undesired in some cases. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git: implement GitRepo.get_current_branch()Markus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git: introduce GitRepo.rev_parse()Markus Lehtonen
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-25oeqa.utils.git: support git commands with updated envMarkus Lehtonen
Extend GitRepo.run_cmd so that the caller may redefine and/or define additional environment variables that will be used when the git command is run. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-18devtool/recipetool/meta: Adapt to bitbake API changes for ↵Richard Purdie
multi-configuration builds Unfortunately to implenent multiconfig support in bitbake some APIs had to change. This updates code in OE to match the changes in bitbake. Its mostly periperhal changes around devtool/recipetool [Will need a bitbake version requirement bump which I'll make when merging] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18testimage: allow using kvm when running qemux86* machinesBill Randle
Using kvm can provide significant speedups when running qemux86* machines on an x86* host. Enabled by using the new QEMU_USE_KVM variable. [YOCTO #9298] Signed-off-by: Bill Randle <william.c.randle@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-10oeqa: start() add remaining args SimpleRemoteTarget and QemuTinyRunnerAníbal Limón
Now Runner's support extra_bootargs for the kernel so add extra_bootparams to the start() methods to avoid exception. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-10oeqa/utils/httpserver.py: HTTPServer enable thread connection handlingAníbal Limón
HTTPServer now supports multiple connections using Python threads. Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-04oeqa/utils/sshcontrol.py: Allows to copy symlinks to targetMariano Lopez
Currently when copying a symlink to the target it will fail throwing an exception. This will recreate symlinks from the system performing the tests to the device under tests. [YOCTO #9932] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-08-01oeqa/utils/commands.py: Command class improve validations/decoding in outputAníbal Limón
When run a command sometimes the output isn't provided so validate before trying to encode to utf-8, also some output like BIOS/EFI contains characters that can't be codified into utf-8 for this reason set errors='replace'. [YOCTO #10019] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-25lib/oeqa/decorators: handle broken links when creating new symlinkRoss Burton
When checking if a link exists before creating it, use os.path.lexists() as otherwise os.path.exists() on a broken link will return False. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-20lib/oeqa/utils/commands.py: Move updateEnv() from runexported.pyMariano Lopez
updateEnv() can be used in other places so move the function to utils/commands.py Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-20utils/qemurunner.py: QemuRunner.start() add support for specify extra kernel ↵Aníbal Limón
cmdline Add ability to specify extra_bootargs (kernel cmdline) in order to enable systemd debug log in images that enables systemd init. [YOCTO #9299] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa/utils/commands: fix single-character variable matching in get_bb_vars()Ross Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.utils: add git moduleMarkus Lehtonen
A new helper module for easier interaction with Git repositories. Provides GitRepo class that represents one local Git repository clone. The GitRepo class currently only has one method, run_cmd(), for running arbitrary git commands in the repository. More specialized methods for commonly used git operations can be added later. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.utils.commands: runCmd: return stderr output, tooMarkus Lehtonen
Useful if one wants to separate stdout and stderr. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.utils.commands: use get_bb_vars() in get_bb_var()Markus Lehtonen
Get rid of duplicate code. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-07-01oeqa.utils.commands: Introduce get_bb_vars()Markus Lehtonen
A new function for getting values of multiple bitbake variables at the same time. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-23oeqa/targetbuild: use os.path.join instead of string concatenationRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-23oeqa/targetbuild: add extra_cmds argument to run_configureRoss Burton
Some upstreams need more than just gnu-configize ran before ./configure works, such as ./autogen.sh or autoreconf. Add extra_args (defaulting to gnu-configize) so that this can be done in test cases. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-23oeqa/targetbuild: fix folder name estimate logicRoss Burton
The re.sub() used to transform a tarball into a best guess folder name wasn't right, as there isn't enough escaping and tar.xz was missing. Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-02qemurunner: Use surrogateescape decodingRichard Purdie
Since the stream can contain invalid binary characters (e.g. from ppc's bootloader) use surrogateescape decoding to ensure we do process the character stream, else it can hang/timeout. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Complete transition to python3Richard Purdie
This patch contains all the other misc pieces of the transition to python3 which didn't make sense to be broken into individual patches. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02qemurunner: convert data when working with socketEd Bartosh
Converted str to bytes before sending to socket. Converted bytes to str after receiving from socket. This should fix TypeError: 'str' does not support the buffer interface for qemurunner.run_serial method. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to explictly create lists where neededRichard Purdie
Iterators now return views, not lists in python3. Where we need lists, handle this explicitly. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to match python3 iter requirementsRichard Purdie
python3 standardises its use of iteration operations. Update the code to match the for python3 requires. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02classes/lib: Update to use python3 command pipeline decodingRichard Purdie
In python3, strings are unicode by default. We need to encode/decode from command pipelines and other places where we interface with the real world using the correct locales. This patch updates various call sites to use the correct encoding/decodings. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30oeqa/utils/package_manager.py: Add get_package_manager()Mariano Lopez
This new file just contain one function to return an OE package manager, this depends in the current packaging method. [YOCTO #8694] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-21meta: Update to modern exception syntaxRichard Purdie
Update older exception syntax to modern one required by python 3. Compatible with python 2.7. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-16classes/oeqa: Update for print statements and file() -> open() for python3Richard Purdie
Found some more syntax cleanups needed for python3. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-14oeqa/decorators: Use wraps consistentlyRichard Purdie
We want the decorator to leave the function names of the test unchanged. Some decorators are already using wraps for this but not all. Fix this to be consistent allowing inspection of the test to give the wanted values. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-09sshcontrol.py: Add methods to copy dirs and delete filesMariano Lopez
This patch add new methods to SSHControl class. These methods include: - Copy a dir to DUT - Delete a file in the DUT - Delete a directory in the DUT (if empty) - Delete a directory structure in the DUT [YOCTO #9565] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-04-12oeqa/runexported.py: Fix exported testMariano Lopez
With the changes introduced to test the eSDK the runexported test failed during the execution. This change fix runexported test in the least invasive way, because of the release cycle. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28oeqa/utils/ftools: improve remove_from_file algorithmRoss Burton
The algorithm was sub-optimal so replace it with something more elegant. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-20oeqa/utils/testexport.py: add functionality for exporting binariesCostin Constantin
This new file is encapsulating functionality for both running tests with binaries support via TestNeedsBin() decorator and exporting these binaries via testimage.bbclass file. Addresses [YOCTO #7850], [YOCTO #8478], [YOCTO #8481], [YOCTO #8536], [YOCTO #8694]. Signed-off-by: Costin Constantin <costin.c.constantin@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-28classes/testsdk: Move code for avoid PATHs to oeqa.utilsAníbal Limón
Due to the neeed to use in other modules. Signed-off-by: Aníbal Limón <limon.anibal@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-28oeqa/utils: added new network moduleFrancisco Pedraza
A network module was added, and will contain network utility funcions for now. with get_free_port that returns available network port in the system. Signed-off-by: Francisco Pedraza <francisco.j.pedraza.gonzalez@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-02-15oeqa/targetcontrol: make ssh control optionalEd Bartosh
Added new parameter 'ssh' to targetcontrol 'start' method to be able to test images without running ssh server. [YOCTO #8498] (From OE-Core rev: 1c3c66aadd43092bc19242b0651ee810cc31fe7c) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15qemurunner: add parameter to method 'start'Ed Bartosh
QemuRunner requires pair of ip addresses provided through kernel commandline for method 'start' to work. These ip addresses are used to connect to the image using ssh and run tests there. However, this functionality should not be mandatory as testing doesn't always require ssh connection. Some tests can be run using serial console. Added new parameter 'get_ip' to QemuRunner.start to make it possible to skip getting pair of ip addresses from kernel command line. This should allow oe-selftest to test images without modifying kernel command line. [YOCTO #8498] (From OE-Core rev: 3f8b734ebb81d035849288091bb0b97b9c4fba34) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-15oe-selftest: remove unused parameterEd Bartosh
Removed unused parameter 'test' from runqemu function. (From OE-Core rev: c688b3bcbb57099fa72a9728bc708b109802f7fc) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10oeqa: setup bitbake logger after tinfoil.shutdownEd Bartosh
Bitbake logger stops working after tinfoil.shutdown removes console handler from it. This makes bb.{error,warn,note,critical} messages disappear from the console. Adding console handler to bitbake logger again should fix this issue. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-01oeqa/sshcontrol: don't source profileRoss Burton
Instead of sourcing /etc/profile to get $PATH including /usr/sbin, just assign to PATH in the ssh invocation. The remote /etc/profile may not actually be manipulating PATH as we expect, and there may be other commands which can interfere with the tests (such as resize emitting a series of control characters on connection). Signed-off-by: Ross Burton <ross.burton@intel.com>
2015-12-01oeqa/qemurunner: pass nographic to runqemu if DISPLAY isn't setRoss Burton
Not everyone wants to run the tests with a qemu that has a graphical output, so allow display to be None and pass nographic to runqemu in that case. Signed-off-by: Ross Burton <ross.burton@intel.com>