Commit Graph

210 Commits

Author SHA1 Message Date
Stefan Stanacar 44c3f72684 lib/oeqa/runtime: smart: add checks for smart output
Sometimes smart throws:

    Committing transaction...
    Preparing...                    ######################################## [  0%]
       1:Removing psplash-default   ######################################## [100%]
    error: Couldn't fork %postun: Cannot allocate memory

and returns a 0 exit code (it thinks it succesfully removed the package,
when in reality it didn't), so we need to catch those specifically.

Also, sometimes output from download command is:
    Saving cache...http://192.168.7.1:49456/rpm/x86_64_x32/psplash-default-0.1+git0+afd4e228c6-r15.x86_64_x32.rpm
and that tricks our smart download test, so use a regex there.

(From OE-Core rev: 2ac7783e04f5e8e6005f967e1a6dd65d2fc6a19a)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 16:29:18 +01:00
Stefan Stanacar a855180fe6 lib/oeqa/runtime: multilib: fix typo
The check was obviously wrong and it surfaced
with the recent change in behaviour for skipping tests.

(From OE-Core rev: 4a14535cd493cb2bdd46b2a5f2a1cd2b38161f0a)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 16:29:18 +01:00
Stefan Stanacar 2dfc0e1cc7 lib/oeqa: change behaviour for unskippable tests
When a test module wants to be skipped because it doesn't
apply to the image but it was nevertheless a required
test (one in TEST_SUITES), we issued an warning that it
was a required test and went on with running the module.
Usually all tests in the module failed (e.g gcc tests on a non-sdk image),
but this allowed us to know that something went wrong with the image
(some package/feature didn't make it).

However, instead of just issuing an warning and running the tests
it's better to throw an exception. The traceback will tell us what's wrong,
and we don't run every single test method.
Output will look like this:
--snip--
| NOTE: Test modules  ['oeqa.runtime.ping', 'oeqa.runtime.ssh', 'oeqa.runtime.gcc']
| NOTE: Found 5 tests
| test_ping (oeqa.runtime.ping.PingTest) ... ok
| test_ssh (oeqa.runtime.ssh.SshTest) ... ok
| ERROR
|
| ======================================================================
| ERROR: setUpModule (oeqa.runtime.gcc)
| ----------------------------------------------------------------------
| Traceback (most recent call last):
|   File "/mnt/back/yocto/poky/meta/lib/oeqa/runtime/gcc.py", line 8, in setUpModule
|     skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
|   File "/mnt/back/yocto/poky/meta/lib/oeqa/oetest.py", line 108, in skipModule
|     "\nor the image really doesn't have the requred feature/package when it should." % (modname, reason))
| Exception:
| Test gcc wants to be skipped.
| Reason is: Image doesn't have tools-sdk in IMAGE_FEATURES
| Test was required in TEST_SUITES, so either the condition for skipping is wrong
| or the image really doesn't have the requred feature/package when it should.
|
| ----------------------------------------------------------------------
| Ran 2 tests in 1.036s
|
| FAILED (errors=1)
| NOTE: Sending SIGTERM to runqemu
--snip--

(From OE-Core rev: fd51cecf8b258d9f839a0ecebde69d09f75dc468)

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>
2013-08-26 11:47:21 +01:00
Mihai Prica d7077bc8e5 lib/oeqa/runtime: add iptables, cvs and sudoku projects build tests on target
Downloads iptables/cvs/sudoku-savant sources and builds them on target.

(From OE-Core rev: df4568205c3a7e0b20c6299e29f96bd30560146b)

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>
2013-08-26 11:47:21 +01:00
Mihai Prica c70bf6531c lib/oeqa/utils: targetbuild: Add helper class for building packages on target
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>
2013-08-26 11:47:21 +01:00
Stefan Stanacar 51588936d4 lib/oeqa: make it possible to restart the target
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>
2013-08-26 11:47:21 +01:00
Mihai Lindner ecb21fd7f8 lib/oeqa/runtime: smart: add new smart tests
Add class to be inherited by smart tests, along with more basic tests and tests
using a rpm repository.

(From OE-Core rev: f6186b4204dcc421b4e616774315c8a2a77fb5c5)

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>
2013-08-26 11:47:21 +01:00
Mihai Lindner 2c83398940 lib/oeqa/utils: decorators: return the decorated method
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>
2013-08-26 11:47:21 +01:00
Mihai Lindner a9dab56e5d lib/oeqa/utils: qemurunner: save host IP address
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>
2013-08-26 11:47:21 +01:00
Mihai Lindner f16cc25bbc lib/oeqa/utils: new file: httpserver.py useful for serving files over HTTP 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>
2013-08-26 11:47:21 +01:00
Stefan Stanacar db7e4849c3 lib/oeqa/runtime: rpm: add install and erase tests
Copies to target rpm-doc file from deploy_dir
and tries to install and then remove that package.
rpm-doc was chosen because it's small, it only adds
a few files to target, and it's almost always found in
deploy_dir for images with package-management/rpm.

(From OE-Core rev: a2d2f2b7b111863d3c50dedded37aab813d9634f)

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>
2013-08-26 11:47:20 +01:00
Mihai Prica 3d30fd2eb0 lib/oeqa/runtime: add vncserver for target test
(From OE-Core rev: 56bc5d717b34563ed36c0618305e4ec5080c3a27)

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>
2013-08-26 11:47:20 +01:00
Mihai Prica 5e1b0cb2e4 lib/oeqa/runtime: add adjust date and time test
(From OE-Core rev: ede300f44f1770b1e3e5c59f65cf5079379a2bc1)

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>
2013-08-26 11:47:20 +01:00
Alexandru Palalau 0ecc510b92 lib/oeqa/runtime: add new scp test
Copies a 5MB to target using scp, more of an
network test than a scp one.

(From OE-Core rev: 2ec4a0686b9a91e56dfba3fa2e574c0c531508ff)

Signed-off-by: Alexandru Palalau <alexandrux.palalau@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>
2013-08-26 11:47:20 +01:00
Alexandru Palalau 4ea9e94f55 lib/oeqa/runtime: add new PAM support test
New test which verifies some usual commands functionality with PAM support

(From OE-Core rev: 06c7914e3354ff4e430a6b664f40e5a71e212761)

Signed-off-by: Alexandru Palalau <alexandrux.palalau@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>
2013-08-26 11:47:20 +01:00
Alexandru Palalau 748ddc39e5 lib/oeqa/runtime: add new skeletoninit test
New test which verifies the usage of skeleton init script available with meta-skeleton layer

(From OE-Core rev: fcc59cbcdb1550489d372edf9f465efa7165245f)

Signed-off-by: Alexandru Palalau <alexandrux.palalau@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>
2013-08-26 11:47:20 +01:00
Alexandru Palalau b91969e4f7 lib/oeqa/runtime: add new logrotate test
New logrotate test which verifies the log directory change in logrotate.conf.
Needs an image with logrotate installed.

(From OE-Core rev: 186d79a603b5cbf5a93e6f5dbba5f62ed8d4d8d8)

Signed-off-by: Alexandru Palalau <alexandrux.palalau@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>
2013-08-26 11:47:20 +01:00
Cornel Stoicescu 3b47a0a4bc lib/oeqa/runtime: add a test for ldd
This test checks that at least one path in RTLDLIST exists.

(From OE-Core rev: d53ffbf21a6b17f0f0537929a95a502958d82a09)

Signed-off-by: Cornel Stoicescu <corneliux.stoicescu@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>
2013-08-26 11:47:20 +01:00
Cornel Stoicescu dfd627d7ac lib/oeqa/runtime: add test for perl
This test runs a perl script on the target and checks the output.

(From OE-Core rev: 95abdbf2d715c9e7e3368f5193167feb5efc6261)

Signed-off-by: Cornel Stoicescu <corneliux.stoicescu@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>
2013-08-26 11:47:20 +01:00
Alexandru Georgescu ec8aea9c01 lib/oeqa/runtime: add basic test for x32 images
Checks that an x86-64-x32 image has the right binaries.

(From OE-Core rev: da42e38b2bc4a606b717ac302cfc77aefb1a5795)

Signed-off-by: Alexandru Georgescu <alexandru.c.georgescu@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>
2013-08-26 11:47:19 +01:00
Christopher Larson 66eac2df0c oe.types: add 'path' type
- path normalization ('normalize' flag, defaults to enabled)
- existence verification for paths we know should exist ('mustexist' flag)
- supports clean handling of relative paths ('relativeto' flag)

(From OE-Core rev: a598242197312fa6d43179c283da2d0873de2919)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-08-26 11:47:18 +01:00
Alexandru Palalau dbee00c9e9 lib/oeqa/runtime: add new systemd tests
New systemd runtime tests for enable/disable service, start/stop service and list services.

(From OE-Core rev: 6386dc718f85210c9b6b9f69878ec9a7847b78de)

Signed-off-by: Alexandru Palalau <alexandrux.palalau@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>
2013-08-13 23:06:00 +01:00
Stefan Stanacar 1990a6c507 lib/oeqa/runtime: rework syslog test
Add separate tests for restarting syslog and using logger, and
skip the configuration test for systemd images which always fail
because syslog's systemd service doesn't read a config by default
(see YB#4860).

(From OE-Core rev: c75f3e2385dde44ee96e33f4e5d064894dfb7d52)

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>
2013-08-13 23:06:00 +01:00
Stefan Stanacar 0ba78c1162 oeqa/utils/qemurunner: get ip old fashioned way and use tcp serial console
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>
2013-08-13 23:05:59 +01:00
Stefan Stanacar 76f8dfe2ad oeqa/utils/qemurunner: fix wrong var in message
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>
2013-08-06 12:39:57 +01:00
Stefan Stanacar b8962edd6b oeqa/runtime/xorg: use the right ps command for xorg test
Use our determined ps command, otherwise test fails for images with procps.

(From OE-Core rev: 18e4d014bea3a5748f42e6dac648fa9b02230344)

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>
2013-08-03 10:33:03 +01:00
Stefan Stanacar 26d67b98f8 oeqa/utils/qemurunner: tweak console bootparam and ip command
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>
2013-08-03 10:33:02 +01:00
Stefan Stanacar fce0c9906f oeqa/utils/qemurunner: add comment and header
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>
2013-08-03 10:33:02 +01:00
Stefan Stanacar e678a4552a oeqa/utils/sshcontrol: increase and log timeout in output
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>
2013-08-03 10:33:02 +01:00
Andre McCurdy cc94000792 lib/oe/terminal.py: add support for MATE desktop terminals
A simple clone of the corresponding Gnome class. Without this, devshell
fails completely on a default installation of MATE desktop Linux Mint 15.

(From OE-Core rev: 8cc078a9c679845464c59028f584d7aba098cc1f)

Signed-off-by: Andre McCurdy <andre.mccurdy@entropic.com>
Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-31 06:59:55 +01:00
Stefan Stanacar 3dee534f1e lib/oeqa: fix dependecy check
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>
2013-07-16 10:04:17 +01:00
Stefan Stanacar 656a8b97c1 testimage.bbclass, lib/oeqa: add headers and comments
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>
2013-07-16 10:04:17 +01:00
Stefan Stanacar 655da29dac classes/testimage.bbclass: use a copy of rootfs for tests
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>
2013-07-16 10:04:16 +01:00
Alexandru Palalau 2079a30b1f lib/oeqa/runtime: add tests for syslog and df
Add tests for free space and syslog.

Changed in v2:
    - limit df's output to /
    - syslog: fix restart in case of systemd

(From OE-Core rev: 1b39d57e7b5c9b69d565cf4d188ebc2f14e66ae6)

Signed-off-by: Alexandru Palalau <alexandru.palalau@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>
2013-07-16 10:04:16 +01:00
Stefan Stanacar 7f57d3c524 lib/oeqa/oetest.py: provide a ps command for all tests
Many tests will use 'ps' but we need to know if it's busybox
or standard ps.
Drop the existing check from the connman test.

(From OE-Core rev: 1515d33d2c5b7275a3ac20e07c1db1d8273de796)

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>
2013-07-16 10:04:16 +01:00
Stefan Stanacar b69f91f786 lib/oeqa/runtime/multilib.py: use readelf instead of file
file was pulled by rpm in sato images, readelf comes with binutils
so it's in ipk/deb too.
Also the test was looking at connmand instead of connman-applet
(which is what the testcase says and the AB nightly-multilib target installs)

(From OE-Core rev: c2c47a002996b8dbcf9b311dff677202b1f11a64)

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>
2013-07-16 10:04:15 +01:00
Stefan Stanacar 9c4a02b6c6 testimage.bbclass, lib/oeqa/utils/qemurunner.py: make boot timeout 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>
2013-07-16 10:04:15 +01:00
Stefan Stanacar 1552f33a3e lib/oeqa/utils/sshcontrol.py: fix passing command to subprocess
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>
2013-07-16 10:04:15 +01:00
Stefan Stanacar 46d3bb502f lib/oeqa/runtime/dmesg.py: whitelist dmesg message for systemd net interface name
Messages such as:
"systemd-udevd[79]: error changing net interface name eth0 to enp0s3: Device or resource busy"
are harmless as systemd can't rename interfaces in qemu (the interface is already active).
Alternatively, passing net.ifnames=0 to the kernel will stop systemd renaming the interfaces.

(From OE-Core rev: c072fed6531f2ce3c687f8342a97f593ebf37653)

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>
2013-07-16 10:04:15 +01:00
Stefan Stanacar 4285e856aa lib/oeqa/runtime: add gcc test
gcc compile test and support files.

(From OE-Core rev: ccbce75335971abf5098a492755e92ca60cf67bd)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-09 10:53:45 +01:00
Stefan Stanacar 06d6f9d52e lib/oeqa/runtime: image sanity tests
These are basic sanity tests. A test can be force run by setting
TEST_SUITES = "ping ssh <module-name>" in local.conf.
By default there are suites for minimal, sato and sato-sdk images.

(From OE-Core rev: dd3dc2804395f050df74fa936e65ce5e911442eb)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-09 10:53:45 +01:00
Radu Moisan 54f3848397 lib/oeqa/utils/decorators.py: decorators for test methods
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>
2013-07-09 10:53:45 +01:00
Radu Moisan 88a6eb8027 lib/oeqa/utils/qemurunner.py: class to handle qemu instance
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>
2013-07-09 10:53:45 +01:00
Stefan Stanacar 962c0a1fc0 lib/oeqa/utils/oeqemuconsole.py: handle qemu serial console connection
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>
2013-07-09 10:53:44 +01:00
Stefan Stanacar ac341af8fa lib/oeqa/utils/sshcontrol.py: helper module for running remote commands
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>
2013-07-09 10:53:44 +01:00
Stefan Stanacar 12bf6262f6 lib/oeqa/oetest.py: base module for all runtime unittests
This module contains the base class for all runtime tests
and some helper methods.

(From OE-Core rev: 7765c27705e90381975fb2b89ea2181287517761)

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Radu Moisan <radu.moisan@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-09 10:53:43 +01:00
Tyler Hall 85186302de TmuxRunning: handle multi-word commands
Just as in f8ed7446755eeb88191e16749350efa1e7e6197c, tmux wants a single
argument for its command. This applies to the "split-window" command as
well as "new."

Note that this alone is not enough to fix the TmuxRunning devshell when
using pseudo because tmux does not preserve the environment that pseudo
requires.

(From OE-Core rev: 36fb9799d6a449d86acca3be354af56ad87c3151)

Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-02 22:23:51 +01:00
Paul Eggleton 785b49e5c2 lib/oe/lsb.py: fall back to /etc/os-release for host distro ID
The new standard for host distribution identification [1] is
/etc/os-release, and a number of newer distributions provide this file,
so add support for this in order to pick up more distributions.
Additionally, handle "rolling release" style distributions that don't
report a version number, e.g. Arch Linux.

With this change we can identify the most common distributions, so this
should satisfy [YOCTO #4271]. Note that this doesn't imply support for
these distros as build hosts, just that we can identify them.

[1] http://www.freedesktop.org/software/systemd/man/os-release.html

(From OE-Core rev: bff50b747cde04007ead65dde4207b16a8e1bf08)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-02 22:23:48 +01:00
Peter Seebach 1f99e74e00 handle two-word commands with tmux
Trying to make a devshell using tmux can fail because "tmux new"
expects a single command, not a series of arguments. It does, however,
split strings in a suitable way. So you can quote the command.

The failure mode is particularly arcane, in that you end up
with a message like:

	ERROR: Unable to spawn terminal auto: \
	Execution of 'pseudo /bin/bash' failed with exit code 1:
	usage: new-session [-d] [-n window-name] [-s session-name] \
	[-t target-session] [command]

which is confusing because there's no "new-session" anywhere in
sight (that's actually "tmux new"), and because what failed to execute
wasn't either pseudo or bash.

(From OE-Core rev: f8ed7446755eeb88191e16749350efa1e7e6197c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-11 15:55:58 +01:00
Ross Burton 81c378287b test_utils: import functions directly for conciseness
(From OE-Core rev: 2a147008cf81838cfc569640a30df0c1bfd74e08)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-07 16:48:25 +01:00