summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/utils/metadata.py
AgeCommit message (Collapse)Author
2023-04-20oeqa/utils/metadata.py: Fix running oe-selftest running with no distro setThomas Roos
This will use default values when no distribution is set. [YOCTO #15086] (From OE-Core rev: 888fe63b46efceeff08dbe8c4f66fec33d06cb7a) Signed-off-by: Thomas Roos <throos@amazon.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. (From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-03-07metadata.py: return info after fallback methodsChen Qi
If python3 git module is not installed, we fall back to some git command to get info. A previous commit (b8d22ed6) accidently deleted the return statement, causing errors like below. Exception: UnboundLocalError: local variable 'InvalidGitRepositoryError' referenced before assignment (From OE-Core rev: cd8aedc408afa4f8589f79e4d85befc7cac76ac6) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-28oeqa/utils/metadata: Add commit_count to fallback logicRichard Purdie
Currently if python3-git isn't installed we can get odd behaviours when the commit_count is absent. Avoid this set of bugs by adding a fallback here. (From OE-Core rev: b8d22ed681141ce360d742a96cec5f2925a20222) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-29oeqa/utils/metadata: Allow to function without the git moduleRichard Purdie
The python git module may or may not be enabled, allow this code to function without it, falling back to the same method as metadata_scm.bbclass uses. This will be cleaned up in the next round of feature development. (From OE-Core rev: 6350586ba9f4a4107a2d457590824cd4d662d5b9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-16oe.lsb: add get_os_release()Markus Lehtonen
Move get_os_release() from oeqa.utils.metadata to oe.lsb, merging the code with release_dict_osr() from oe.lsb. This removes some code duplication and makes get_os_release() more robust. (From OE-Core rev: 56b883f7765f6bd72e83dec26a5db8c7108c835d) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: include BB_NUMBER_THREADS and PARALLEL_MAKEMarkus Lehtonen
Inlude values of BB_NUMBER_THREADS and PARALLEL_MAKE in the metadata. [YOCTO #10590] (From OE-Core rev: 97c07a55815c2fc3915705317b6f30d212fa1d45) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: allow storing any bitbake config variablesMarkus Lehtonen
Make it possible to store any bitbake config variables in the metadata. Config values will be stored under a new config element in the xml report: <config> <variable name="MACHINE">qemux86</variable> </config> The value of MACHINE is moved there instead of having a dedicated <machine> element. [YOCTO #10590] (From OE-Core rev: 6e7e6e37664b0a86111272f5f6f4a4e1d0f23302) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: add bitbake revision informationMarkus Lehtonen
[YOCTO #10590] (From OE-Core rev: 71ca7dab08fc500b231054249aacc90ae4aa85da) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: have layer name as an attribute in xmlMarkus Lehtonen
Have the layer name as an attribute instead of of the name of the element itself. That is, have <layer name="layer_name"/> instead of <layer_name/>. A bit better XML design. [YOCTO #10590] (From OE-Core rev: 50ea44c19005b536a2791113f8b536fd10548ead) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: add commit count informationMarkus Lehtonen
Makes it easier to put the commits into a timeline. [YOCTO #10590] (From OE-Core rev: 7757970bced4ecd6503991c0cf11f4d9158f650c) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: rename 'revision' to 'commit'Markus Lehtonen
Revision is a bit vague and could point to a tag, for example. Git commit objects are unambiguous and persistent so be explicit that the element should contain git commit hash. [YOCTO #10590] (From OE-Core rev: a6521b89e86ddba6bd646dd3974d7b0390323b56) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: fix retrieval of git branch and revisionMarkus Lehtonen
Always return a valid branch name, or, '(nobranch)' if the current HEAD is detached. Also, always return the hash of the commit object that HEAD is pointing to. Previous code returned an incorrect branch name (or crashed) e.g. in the case of detached HEAD. [YOCTO #10590] (From OE-Core rev: 02d3ba17a8090bd088beb973980651d664f713bb) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: drop 'unknown' git data elementsMarkus Lehtonen
It's better just to not have the xml elements than to have elements with faux data. One could have git branch named 'unknown', for example. [YOCTO #10590] (From OE-Core rev: fce531c21f5e56d0f416b3405a0b0fc5ba567679) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: re-organise distro informationMarkus Lehtonen
Use the same format, based on /etc/os-release, as for host distro information. [YOCTO #10590] (From OE-Core rev: 0156ef46ccf5334ee72f0202f1089249c62af37b) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-19oeqa.utils.metadata: re-organise host distro informationMarkus Lehtonen
Put all host distro data under one <host_distro> element. In addition take the data directly from /etc/os-release instead of the "lsb API". The /etc/os-release file is virtually ubiquitous, now, and using its field names and values provides a more standardized and extensible format. [YOCTO #10590] (From OE-Core rev: 98cad0b4063772dad94fea96edce1a5422256c32) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-20oe-selftest: import git module only when neededEd Bartosh
git module is not included into standard Python library and therefore causes import errors on the systems where PythonGit is not installed. As git module only used in the code implementing --repository functionality it's better to import git only in the scope that requires it. [YOCTO #10821] (From OE-Core rev: 66be32c1a075201d6ee0e9b9e10b84e6a2ace745) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-13oeqa/utils/metadata.py: Add metadata libraryMariano Lopez
Adds functions to get metadata from the host running the tests. [YOCTO #9954] (From OE-Core rev: 10b05794254886e55c76f29f7778d783c550befa) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>