aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib
AgeCommit message (Collapse)Author
2016-06-12oe/distro_check.py: Fixes for python3Aníbal Limón
create_socket: Use urllib because urllib2 is now urllib in python3 and proxies as argument are deprecated so export them in the environ instead. get_links_from_url: Change usage of sgmllib for parsing HTML because is deprecated in python 3, use instead bs4 that is already imported in the bitbake tree. [YOCTO #9744] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-12lib/oe/terminal.py: decode bytes variable before rstrip/splitLeonardo Sandoval
On python 3, bytes variable types must be decoded if these are intended to be used as strings, otherwise we get the following error exception: TypeError: Type str doesn't support the buffer API Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-06-06selftest/testexport.py: Add test test_testexport_basicMariano Lopez
Exported tests is not been tested right now and it get broken very easily with import errors from bitbake. This adds a new test in order to verify in the CI if the testexport gets broken. [YOCTO #8384] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-06testexport.bbclass: Add support for testexport-tarballMariano Lopez
Add support to export the SDK tarball needed when a test system doesn't have the required software to perform runtime tests. The support is when exporting the test and when running the test on a remote system. The user of this feature just need to set TEST_EXPORT_SDK_ENABLED to "1" and declare the sdk packages in TEST_EXPORT_SDK_PACKAGES. [YOCTO #7850] (From OE-Core rev: a6041f81b81baa7564e4c712fc88de2b997e52e4) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-06oetest.py: Add install/uninstall functionality for DUTsMariano Lopez
Add the functionality to install/unistall packages in the DUTs without the use of the package manager. This is possible with the extraction introduced in package manager class. testimage and testexport bbclasses has been modified in order to support this new feature. [YOCTO #8694] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-06lib/oeqa/otest.py: Fix import tests from other layers with python3Mariano Lopez
In python3 the functionality to import modules has been changed and this broke the capability to add runtime tests from other layers. This commit returns this capability to testimage and testexport. [YOCTO #9705] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-06oe/lib/pacakge_manager.py: Update missing pipeline decodingMariano Lopez
Adds decoding needed by some commands output later used as strings. [YOCTO #9702] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-05lib/oe/package_manager: adapt for Python 3Ross Burton
string.rstrip() doesn't exist in Python 3, so use the .rstrip method on the object itself instead. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03lib/oe/buildhistory_analysis: fix for Python 3Joshua Lock
The read method of the data_stream File object now returns bytes, not a str, so we must decode it. Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-03testexport.bbclass: Update to use python3Mariano Lopez
Remove deprecated attributes in order to use python3. runexported was changed to use python3. [YOCTO #9702] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02distro_check.py: Don't mix tabs and spacesJussi Kukkonen
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02oeqa/selftest/recipetool.py: Tweak matching of warning lineLeonardo Sandoval
We are observing cases (see below) where the 'WARNING:' prefix is not at the beginning of a line, so instead of expecting it in the beginning, match it within the string. ====================================================================== FAIL: test_recipetool_appendfile_patch (oeqa.selftest.recipetool.RecipetoolTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 109, in wrapped_f return func(*args, **kwargs) File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/recipetool.py", line 285, in test_recipetool_appendfile_patch self.fail('Patch warning not found in output:\n%s' % output) AssertionError: Patch warning not found in output: Parsing recipes..WARNING: File /etc/selftest-replaceme-patched is added by the patch /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta-selftest/recipes-test/recipetool/files/add-file.patch - you may need to remove or replace this patch in order to replace the file. NOTE: Writing append file /tmp/recipetoolqaug0kdb4x/recipes-test/recipetool/selftest-recipetool-appendfile.bbappend NOTE: Copying /tmp/recipetoolqagci9tita/testfile to /tmp/recipetoolqaug0kdb4x/recipes-test/recipetool/selftest-recipetool-appendfile/testfile done. Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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-02devtool.py: Fix parsing of bitbake-layers' outputLeonardo Sandoval
Current parsing was picking wrong targets, leading to the following problem: AssertionError: Command 'bitbake Parsing recipes..done. -e' returned non-zero exit status 1: Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02buildhistory_analysis: Convert stream data (bytes) to stringsLeonardo Sandoval
The bytes type variables are threat different as strings variables in python3, so convert bytes to strings. This was found when using the script buildhistory-diff, where the interpreter was yielding this error TypeError: Type str doesn't support the buffer API Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02selftest/devtool: Compare sets instead of arrays on AssertEqualLeonardo Sandoval
Sets are safer when comparing internal elements and positions are not important. This commit avoid errors observed on python3 builds as reported on the below bugzilla entry. [YOCTO #9661] Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> 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-02scripts: Fix encoding errors for python3Ed Bartosh
Moved call of decode('utf-8') as close as possible to call of subprocess API to avoid calling it in a lot of other places. Decoded binary data to utf-8 where appropriate to fix devtool and recipetool tests in python 3 environment. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
2016-06-02scripts: Fix deprecated dict methods for python3Ed Bartosh
Replaced iteritems -> items, itervalues -> values, iterkeys -> keys or 'in' Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
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 xrange -> range for python3Richard Purdie
xrange() no longer exists in python 3, use range() 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-06-02classes/lib: Convert to use python3 octal syntaxRichard Purdie
The syntax for octal values changed in python3, adapt to it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30recipetool / devtool: set a fixed SRCREV by default when fetching from gitPaul Eggleton
If fetching source from a git repository, typically within OpenEmbedded we encourage setting SRCREV to a fixed revision, so change to do that by default and add a -a/--autorev option to use "${AUTOREV}" instead. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30lib/oe/recipeutils: fix insertion of variable valuesPaul Eggleton
Add some more variables in appropriate places in recipe_progression such that the patch_recipe_* functions are able to insert variables in the right place within a recipe. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30lib/oe/recipeutils: patch_recipe_lines: allow omitting trailing newlinesPaul Eggleton
This function was assuming that what you wanted was that output lines had trailing newline characters. If you're just outputting each line verbatim to a text file then that's fine, but sometimes you start with the assumption that the lines don't have trailing newlines; thus we shouldn't allow for the possibility that the caller doesn't want them and add a parameter to control it. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30lib/oe/recipeutils: split out patch_recipe_lines()Paul Eggleton
Split out a function from patch_recipe_file() that takes just the lines as input so we can edit recipe lines in memory. This will be used within recipetool to ensure we insert new values in the right place. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30lib/oe/package_manager.py: Add pkgpath to dict returned by package_infoMariano Lopez
Having the package path with all the other package info allows to reuse more code and have this information outside the package manager, without additional processing. [YOCTO #8536] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30oetest.py: Add support to copy unextracted packages for runtime testingMariano Lopez
Sometimes is needed to have a package without extraction when running a test. This patch adds the functionality. [YOCTO #8536] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30oetest.py: Add extract_packages() to RuntimeTestContext classMariano Lopez
This new method extracts the content of package (RPM, DEB, or IPK) to a directory inside of WORKDIR. The extraction is needed for later install in the DUTs without using a package manager. [YOCTO #8694] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-30oetest.py: Add json file support to specify packages needed in runtime testsMariano Lopez
This adds the functionality to use a json file to specify the packages needed for a particular test. The content of the json file is a dictionary with dictionaries inside, using the test name as the hash. The json file must have the same name as the class module name and must be in the same path. [YOCTO #7850] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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-30oetest.py: Move getTests() outside loadTests() methodMariano Lopez
The method getTests() can be useful to all the class, not just to loadTests(). [YOCTO #8694] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2016-05-22package_manager: no need to output Note: in bb.note() callsRoss Burton
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-21meta/scripts: python3: rename file -> openRichard Purdie
file() API doesn't exist in python 3, convert to open(). Also handle some cases where files aren't closed. Compatible with python 2.7. [Contributions from Ed and Richard] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21meta/selftest/scripts: Use print function for python3 compatibilityRichard Purdie
Used print function instead of print statement to make the code work in python 3. [Changes from both Ed and Richard] Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-21devtool: sdk-update: drop support for local updatesPaul Eggleton
Having two code paths here makes maintenance difficult, and it doesn't seem likely that you would use the local case in real usage anyway, so drop the local support entirely. This should allow us to resolve [YOCTO #9301]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-20lib/oe/rootfs: Fix DEBUGFS generation, without opensslAnders Darander
In commit 20ea6d274bb0a9a5addb111f32793de49b907865, debugfs generation for images using opkg, which included openssl was fixed. However, that broke the generation of the opkg-based images, that lacks openssl. The error is a python stack trace, showing that shutil.copytree tries to copy a non-existing directory. This relates to [YOCTO #9040]. Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Unify _log_check_warn() and _log_check_error()Peter Kjellerstedt
Use a common _log_check_common() function (based on the old _log_check_warn() function) to implement the logic for both _log_check_warn() and _log_check_error(). The main benefit of this is that now all error messages will be reported again, not just the first one found. Additionally the output will now look the same for both error and warning messages. This removes the context for the error messages. However, since there was no indication in the output that some of the lines were context, they were more confusing than helping. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Reduce spam from _log_check_warn()Peter Kjellerstedt
For each warning found in the log, _log_check_warn() would output a line stating that it had found a warning, then the actual warning and finally an empty line. This is quite excessive when there are many warnings in the log. With this change the output is instead a line stating how many warnings were found, followed by the warnings. This makes the output much more compact and actually much more readable. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Exclude lines in _log_check_warn() as wellPeter Kjellerstedt
This will make _log_check_warn() exclude the same lines as _log_check_error() does. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Use one way to exclude lines in _log_check_error()Peter Kjellerstedt
Before there were three different ways to exclude a line from being searched for error messages in _log_check_error(). Now there is only one: an array of regular expressions. This should make it easy to add more excludes if nedded. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Simplify the regular expression used in _log_check_warn()Peter Kjellerstedt
In commit 0387d095 lines with "NOTE:" in them were excluded from the log check for warnings. However, those lines were only there in the first place since the regular expression that is used to find warning messages explicitly included those lines... Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19rootfs.py: Remove _log_check_error() from the RpmRootfs classPeter Kjellerstedt
The fact that this function was overridden in the RpmRootfs class seems to have led to a number of misstakes when changes have been made to the base function in the Rootfs class. E.g., this change will properly solve ticket 7789, which was supposedly solved in 38871dc0, but that change had no effect in practice as the log_check_regex that was modified for RpmRootfs class was not used by the RpmRootfs version of _log_check_error()... The only thing _log_check_error() in RpmRootfs did that the base function in Rootfs did not do was to skip lines in the log that begin with a + sign. This has now been moved to the base function instead. [YOCTO #7789] Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19Revert "rootfs.py: add more info to the warning message"Peter Kjellerstedt
The reverted commit added a warning with the log line that triggered the log check for error messages before the warning that states that an error has been found in the log. However, the error line is output by the call to bb.fatal() that follows immediately after the original warning, which makes it redundant. Additionaly, having two warnings contradicts the intent of commit 8dfdd329 where the log warnings were tidied up. This reverts commit f9cf31525fc885e1a0f65bd55654631257f87078. Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-19oe-selftest: wic: add test_bmap test caseEd Bartosh
Tested generation of .bmap file using wic --bmap command line option. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-18oetest.py: Use the real ExportTestContext in exported testsMariano Lopez
There are parts of the fuctionallity missing when using the dummy ExportTestContext class in runexported.py. This changes the use of ExportTestContext dummy class from runexported.py to the real class in oetest.py. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>