summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils
Commit message (Collapse)AuthorAgeFilesLines
* lib/oeqa/utils: targetbuild: Add helper class for building packages on targetMihai Prica2013-08-261-0/+63
| | | | | | | | | | | | This class can be used for test cases that configure and build packages on target. (From OE-Core rev: 4b15e82c4fcb0c40b0e316ef2050944eee4418ef) Signed-off-by: Mihai Prica <mihai.prica@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: make it possible to restart the targetStefan Stanacar2013-08-261-7/+21
| | | | | | | | | | | | | Tweak QemuRunner so we can actually restart the qemu target in a test (if we want more memory for example). Also add a restart method to the base test class so that tests can use it. (From OE-Core rev: 9de7fe11967576f4a8b24e653c6b9a02e5f6d85b) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils: decorators: return the decorated methodMihai Lindner2013-08-261-3/+3
| | | | | | | | | | | Decorators should return whatever the decorated methods return. (From OE-Core rev: c92513d6ff3f8f06d937a5cdf4d94708f27c3850) Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils: qemurunner: save host IP addressMihai Lindner2013-08-261-8/+3
| | | | | | | | | | | | | | Save host IP address to host_ip. Read /proc/PID/cmdline on host to look for IPs of target and host; instead of running 'ps'. Also removed some extra empty lines from file. (From OE-Core rev: 1fcf10db10fa36430e37c95c9fee27197e73f7a5) Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils: new file: httpserver.py useful for serving files over HTTP ↵Mihai Lindner2013-08-261-0/+32
| | | | | | | | | | | | | to the target It can be used by smart repo/channel tests to serve deploy_dir. (From OE-Core rev: e38e18d6923cc3db50b56fa3fc64081fe4aa8669) Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: get ip old fashioned way and use tcp serial consoleStefan Stanacar2013-08-132-87/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | The way we read data from the serial console was unreliable and blocking (AutoBuilder seems to hit that often), so change the serial console type from unix socket to tcp and reverse the connection - don't let qemu act as server (wait for a connection). So now the serial console is used to save the boot log and make sure that we reached the login prompt. Until a better way is found this should solve some of the AutoBuilder failures (one being YB#4904). Also we need to use the same method as the old qemuimagetest to get the ip (from the qemu process arguments), because that it's more reliable. The first version used here was to log into the target and use the output of "ip addr show eth0" but then systemd decides that it should rename interfaces, so that was changed to get the ip of the interface that has the default gw, but if there is no default gw we'll get the loopback ip and we end up trying to ssh into the host machine (some recent AutoBuilder runs showed that). Changed in V2: - use -ww for ps, as output might get truncated (From OE-Core rev: 55e78185110937b7e2b143cf1020426d8df58b72) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: fix wrong var in messageStefan Stanacar2013-08-061-1/+1
| | | | | | | | | | | | | | If nothing matches we should print the text not the match, else we get a nice traceback. Changed in V2: - commit message (From OE-Core rev: 601738fee3e9b7909b63714ca725576c10eec1e3) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: tweak console bootparam and ip commandStefan Stanacar2013-08-031-2/+2
| | | | | | | | | | | | | | Sync serial baud rate with default inittab which should help with apparent boot fails. Also keep a console on tty1. Also we shouldn't assume eth0 it the right interface. (systemd images can rename interfaces to something else). (From OE-Core rev: d5620c0b6782b88f3e6de97b1ddadcf21207fc57) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/qemurunner: add comment and headerStefan Stanacar2013-08-031-0/+7
| | | | | | | | | | One of the files was missing comment/header, unlike the others. (From OE-Core rev: 054dba3b7b96349e1e20e3a58acd98bb68ab2536) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* oeqa/utils/sshcontrol: increase and log timeout in outputStefan Stanacar2013-08-031-4/+6
| | | | | | | | | | | | Increase a bit the timeout for ssh commands and also write in the output that the command timed out (it's easier to see that in a test fail than checking the ssh log) (From OE-Core rev: 652a1762c8adc3b8cb1c6db2ee4a5234a7436c8d) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa: fix dependecy checkStefan Stanacar2013-07-161-1/+3
| | | | | | | | | | | Adds missing skip for smart test and fix the check (which I somehow broke a while ago). (From OE-Core rev: cf1790d992f067be8d5f9894458f55f6f1bdc61f) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass, lib/oeqa: add headers and commentsStefan Stanacar2013-07-162-0/+17
| | | | | | | | | | | Adds some comments to testimage.bbclass and the files it calls, just to give an ideea of what it does. (From OE-Core rev: 8bbb7116cf02466dfc59a17dc7bb51287aeea55b) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/testimage.bbclass: use a copy of rootfs for testsStefan Stanacar2013-07-161-1/+1
| | | | | | | | | | | Make a copy of the rootfs and test that. We can now drop the snapshot option. (From OE-Core rev: ba58f1fe8fb7a0e3ff9320dfc108235d484da6a1) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* testimage.bbclass, lib/oeqa/utils/qemurunner.py: make boot timeout ↵Stefan Stanacar2013-07-161-5/+5
| | | | | | | | | | | | | | configurable and increase it On a loaded host (such as an AB setup where multiple builds run) the 200 seconds timeout might not be enough to reach the login prompt. Also make it configurable so we can set it from local.conf/auto.conf (From OE-Core rev: e828571683333e6f18ed56a84e114b5e54975bc7) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/sshcontrol.py: fix passing command to subprocessStefan Stanacar2013-07-161-23/+17
| | | | | | | | | | | | | | | Don't use shlex.split in subprocess call and also prepend . /etc/profile, because PATH over ssh is always /usr/bin:/bin which isn't what many tests expect. Changed in v2: We now need to use a separate call for scp command. (From OE-Core rev: 1988de2fad86e8e34070ed6573a7be09fff5c0a2) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/decorators.py: decorators for test methodsRadu Moisan2013-07-091-0/+40
| | | | | | | | | | | | | Some skip decorators meant only for test methods, providing some kind of test methods dependency. They are used together with a test method name not a condition. These are complementary to python's unittest skip decorators. (From OE-Core rev: 79cb89648702aa80ec986e0026c62948de905b87) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/qemurunner.py: class to handle qemu instanceRadu Moisan2013-07-091-0/+164
| | | | | | | | | | | | | Handles qemu instances (launch, kill, restart, serial connection, logging) Launch is blocking until login prompt and returns to the task. A qemu serial connection is used to save the boot log and get the ip from the image. Changed runqemu script not to error out when using custom serial option. (From OE-Core rev: ee7d64dfcc02ba8f568b17d181e0a58d3c810076) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/oeqemuconsole.py: handle qemu serial console connectionStefan Stanacar2013-07-091-0/+45
| | | | | | | | | | | | | Python's telnetlib Telnet class connects only to AF_INET sockets, but we want to use Unix domain socket for the qemu serial connection, so that's why we override it. Also we add a new read_all_timeout method similar to Telnet's read_all, that read until a match or timeout and logs all output. (From OE-Core rev: 1cfec2f0a1a1ee84cc6b2b6ad890688da85c5e81) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* lib/oeqa/utils/sshcontrol.py: helper module for running remote commandsStefan Stanacar2013-07-092-0/+100
Provides a class for setting up ssh connections, running commands and copying files to/from a target. (From OE-Core rev: 683cac9768e0d38fa15ddc5451e6b2333f184033) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>