Commit Graph

14 Commits

Author SHA1 Message Date
Ross Burton 09705a4af0 oeqa/selftest: support sets in devtool comparisons
The devtool and recipetool tests do literal string comparisons, but for some
fields the ordering could be irrelevant and potentially non-deterministic.  For
example, the recipetool_create_simple test started failing with:

AssertionError: 'GPLv2 Unknown' != 'Unknown GPLv2' : values for LICENSE do not match

The ordering of the LICENSE field isn't relevant.  So, if the expected value is
a set(), split the string into a set too and compare those.

(From OE-Core rev: dab1b0ad42f08eb547732e854ba28a4cf0a23107)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:20 +00:00
Paul Eggleton c2435b1181 oe-selftest: add tests for simple devtool add / recipetool create URL case
Add an oe-selftest test case for the newly supported syntax with only
the remote URL specified (auto-detecting name and version).

(From OE-Core rev: 7c7df9f62fe15578af0420c63e320c317e058708)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:14 +00:00
Paul Eggleton db5f9645ad recipetool: create: support extracting name and version from build scripts
Some build systems (notably autotools) support declaring the name and
version of the program being built; since we need those for the recipe
we can attempt to extract them. It's a little fuzzy as they are often
omitted or may not be appropriately formatted for our purposes, but it
does work on a reasonable number of software packages to be useful.

(From OE-Core rev: 3b3fd33190d89c09e62126eea0e45aa84fe5442e)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-28 09:25:13 +00:00
Daniel Istrate 426a9b78d0 oeqa/selftest: Added testcase decorators.
Added testcase decorators for testopia integration.

(From OE-Core rev: 9c7ffd397c8232d53c87017e58e03e3056863edf)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-27 07:24:28 +00:00
Paul Eggleton 21f9844fa9 oe-selftest: replace assertTrue(False, ...) with fail(...)
I'd somehow missed the existence of fail() when I wrote these. It's
preferable here so you don't get the somewhat useless "false is not
true" message in the case of failure.

(From OE-Core rev: 173a5896fff57136e1f15e15f90961416aadde94)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-24 23:47:02 +01:00
Christopher Larson 3108e00d92 oeqa/recipetool: allow templayerdir override
This is provided for use by subclasses.

(From OE-Core rev: 95330664826e80c56360645ea90b59d265c2c50e)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 7eb55b442b oeqa/recipetool: add tests for appendsrcfile(s)
(From OE-Core rev: a6d63b8b4a8a436897bfd29f5de647152149e832)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Christopher Larson 6e7ee4e9bf oeqa/recipetool: refactor / split out RecipetoolBase
(From OE-Core rev: 2de348bcc5b015c64c4be7f538a7abd434434ed6)

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-27 23:29:13 +01:00
Costin Constantin 68f546e6cb oeqa/recipetool: add useful failure messages to test cases
(From OE-Core rev: e555646ecb1ee9c7b00ec22f0d40bdd9da1b4dfd)

Signed-off-by: Costin Constantin <costin.c.constantin@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-23 08:48:38 +01:00
Daniel Istrate ffa54b94b6 oeqa/selftest: Added @testcase decorators to oeselftest testcases.
Added decorator to some testcases missing this feature.

(From OE-Core rev: 2a9009583fd498df94a55f21a149e302180f19cc)

Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-07-08 00:01:19 +01:00
Richard Purdie e77c23cc35 oeqa/recipetool: Fix symlink resolution
Instead of readlink we need to use realpath to resolve any possible
symlink in the file name. I'd got the two confused in the previous
patch. This should really fix selftest failures on the autobuilder.

(From OE-Core rev: 878764ab7252f9b5b67b697dcd51b961b673fda0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-27 22:42:56 +01:00
Richard Purdie ffd7cac8f6 oeqa/selftest/recipetool: Fix appendfile_binary test on opensuse131
On OpenSUSE 13.1, /bin/ls is a symlink to /usr/bin/ls. This means the
test doesn't use a binary file an fails on that system.

Ensure we resolve any symlink using readlink to avoid this failure.

======================================================================
FAIL: test_recipetool_appendfile_binary (oeqa.selftest.recipetool.RecipetoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/recipetool.py", line 115, in test_recipetool_appendfile_binary
    self.assertIn('WARNING: ', result.output)
AssertionError: 'WARNING: ' not found in 'Parsing recipes..done.\nNOTE: Writing append file /tmp/recipetoolqai0NY8l/recipes-core/coreutils/coreutils_8.23.bbappend\nNOTE: Copying /bin/ls to /tmp/recipetoolqai0NY8l/recipes-core/coreutils/coreutils/ls'

[YOCTO #7920]

(From OE-Core rev: 792107de1586336f4a734557c0c3fa36a1174e9e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:31 +01:00
Paul Eggleton fbfc06a969 recipetool: add appendfile subcommand
Locating which recipe provides a file in an image that you want to
modify and then figuring out how to bbappend the recipe in order to
replace it can be a tedious process. Thus, add a new appendfile
subcommand to recipetool, providing the ability to create a bbappend
file to add/replace any file in the target system. Without the -r
option, it will search for the recipe packaging the specified file
(using pkgdata from previously built recipes). The bbappend will be
created at the appropriate path within the specified layer directory
(which may or may not be in your bblayers.conf) or if one already exists
it will be updated appropriately.

Fairly extensive oe-selftest tests are also provided.

Implements [YOCTO #6447].

(From OE-Core rev: dd2aa93b3c13d2c6464ef0fda59620c7dba450bb)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00
Paul Eggleton c63adf5c5b oe-selftest: move recipetool tests to their own module
These tests really belong in their own module; if we refactor
out a base class from DevtoolTests with shared functions then we can
move them out easily. Also create temp directory in setupLocal() so we
don't have to do that in individual tests anymore.

(From OE-Core rev: 2f88f6e7b2e54b13376338354aae1d61c0c0db60)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-20 21:41:04 +01:00