summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/incompatible_lic.py
AgeCommit message (Collapse)Author
2024-02-05conf: Move selftest config to dedicated inc fileRichard Purdie
Create a no-gplv3.inc file based upon knowledge currently encoded into one of the selftests. There is a risk that people try and take this idea too far, or have unrealistic expectations. That said, it would be better to collect this knowledge together in one location rather than handling it piecemeal. Therefore move the configuration information from the test into a common incude file. (From OE-Core rev: fb822fb2029c69934cf43073f95b396c2d60298e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-02selftest/incompatible_lic: Ensure create_sdpx isn't used with the testsRichard Purdie
The SPDX class doens't get on well with non-standard licenses. Disable it for the purposes of this test to avoid errors. Add a new helper function to the core test code to allow this to be done easily. (From OE-Core rev: b9fb4c68f2ab5becb0a10418884e09dee93cd247) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12lib: Add copyright statements to files without oneRichard Purdie
Where there isn't a copyright statement, add one to make it explicit. Also add license identifiers as MIT if there isn't one. (From OE-Core rev: bb731d1f3d2a1d50ec0aed864dbca54cf795b040) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-08-12selftest/runtime_test/incompatible_lic: Use IMAGE_CLASSES for testimageRichard Purdie
testimage should be included via IMAGE_CLASSES, not globally with INHERIT. (From OE-Core rev: 4cdb29c7342b16a6c9294268a674a1414eed88e5) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-24selftest/incompatible_lic: Remove references to AVAILABLE_LICENSESPeter Kjellerstedt
The AVAILABLE_LICENSES variable has been removed from OE-Core. (From OE-Core rev: bf4a7eee09245c0f7f8939f4cd522646fec6e507) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-02license: Rework INCOMPATIBLE_LICENSE wildcard handlingRichard Purdie
The current wildcard handling is badly documented and inconsistently used and understood. Forcing users to have to use "GPL-3.0-only GPL-3.0-or-later" whilst explict is not very user friendly. Equally, using the current wildcards is ambigious. This supports pre-defined expansions only and at least makes it clear what GPL-3.0* means (it doesn't include the exception licenses). This is hopefully an acceptable compromise between literal meaning and having something usable. Non-SPDX forms of license in this field have been dropped and errors are shown for unsupported expansions and unsupported old style license terms. Users need to carefully consider how to migrate to the new syntax but the meaning should be well defined and clear from here forward. (From OE-Core rev: 724fc8047cae6ed6197d7deca887b1594871c90e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2022-03-02base/license: Rework INCOMPATIBLE_LICENSE variable handlingSaul Wold
This re-writes the INCOMPATIBLE_LICENSE checking code to replace the WHITELIST_<lic> with INCOMPATIBLE_LICENSE_EXCEPTIONS = '<pkg>:<lic> <pkg>:<lic> ...' This initial change leaves most of the code structure in place, but the code in base.bbclass needs to be re-written to make the check more consistent around packages (PKGS) and not recipe names (PN). This also is taking into account the changes for SPDX licenses. The aim is to provide a mode consistent variable where the variable name is known and can easily be queried. (From OE-Core rev: 0d19c45ba6cf43518f380ca5afe9753a2eda0691) Signed-off-by: Saul Wold <saul.wold@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02selftest: add core-image-weston to no-gpl3-no-meta-gpl2 image testAlexander Kanavin
This demonstrates more of the tricks and techniques that can be used to achieve gpl3-free images withough having to roll back to ancient versions of various core items via meta-gpl2. (From OE-Core rev: cb78db7aa14f147ce79c12539c9435cab06f92bf) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02meta: Manual override fixesRichard Purdie
The automated conversion of OE-Core to use the new override sytax isn't perfect. This patches some mis-converted lines and some lines which were missed by the automation. (From OE-Core rev: 4e9a06b64b43131b731fb59a0305f78a98e27fbd) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-08-02Convert to new override syntaxRichard Purdie
This is the result of automated script conversion: scripts/contrib/convert-overrides.py <oe-core directory> converting the metadata to use ":" as the override character instead of "_". (From OE-Core rev: 42344347be29f0997cc2f7636d9603b1fe1875ae) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-02-21selftest/incompatible_lic: Update the tests after the 'or-later' license ↵Richard Purdie
handling changes With the separate of the "-only" and "-or-later" licenses, we need to update the tests to match the messages now given in the output. Also use a mix of canonicalised and non-canonlised names in the reference recipes to help test those cases and ensure coverage. (From OE-Core rev: b7f38af7ac9449178c603c5349808b8c0dd84d35) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2020-09-23oeqa/selftest/incompatible_lib: Fix append usageRichard Purdie
It's pure luck this has worked so far, add a missing space to the append. (From OE-Core rev: 793e0575b1cebb953276b5f93ff31e48c19779c8) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-16incompatible_lic.py: Add tests for incompatible licenses with wildcardsPeter Kjellerstedt
Suggested-by: Quentin Schulz <quentin.schulz@streamunlimited.com> (From OE-Core rev: ef7c44c9bdf30a02ccc71f26c27aab45d6adf1fb) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-16license_image.bbclass: Report only the licenses that are incompatiblePeter Kjellerstedt
Instead of reporting ${LICENSE} when a package cannot be installed into an image because it is using an incompatible license, report the license(s) that are actually incompatible. (From OE-Core rev: b1863e570d4b169cd2f0ea7b4fe7c2348943cb2c) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-16base.bbclass: Report only the licenses that are incompatible for a packagePeter Kjellerstedt
Instead of reporting ${LICENSE} when a package is identified as using an incompatible license, report the license(s) that are actually incompatible. (From OE-Core rev: fb3405fac7b933a3f9d23e5faf6a3cf2d1990982) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-12-16license.bbclass: Introduce AVAILABLE_LICENSES that lists all licensesPeter Kjellerstedt
Previously, there was SRC_DISTRIBUTE_LICENSES, an undocumented variable that contained a static list of licenses. It was used by expand_wildcard_licenses() to expand any wildcards used in, e.g., INCOMPATIBLE_LICENSE. However, since this static list of licenses has not been kept up-to-date, many licenses were missing, with the result that if one tried to use any of those licenses with a wildcard, no licenses would be found, effectively ignoring that they should be marked as incompatible. This introduces a new (documented) variable, AVAILABLE_LICENSES, that is automatically updated to contain all licenses found in any directories specified by ${COMMON_LICENSE_DIR} and ${LICENSE_PATH}, and uses it instead of SRC_DISTRIBUTE_LICENSES when expanding wildcards. (From OE-Core rev: 8c9ef587fe499c612a878a1ab42092eb79b334ef) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-04selftest: add a test for gpl3-free imagesAlexander Kanavin
Existing tests check that adding a specific gpl3 package (bash) to core-image-minimal results in expected behaviour. These tests check the ability to build two common images without gpl3 components in them: 1. core-image-minimal needs no further tweaks and works out of the box. 2. core-image-full-cmdline requires dropping the GNU packages that it pulls in; for good measure this tweaked image is verified with runtime tests. These two tests allow dropping meta-gplv2 from being tested on the autobuilder, however there should be a community consensus first. (From OE-Core rev: a181f46b8aae066a4b8a26a8045797c38a63e834) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-10-15license_image.bbclass: check and reject packages which have incompatible ↵Alexander Kanavin
licenses The use case is setting INCOMPATIBLE_LICENSE per image, rather than as an awkward, and too strict global setting. This for example would allow building development images with gplv3 tools, but production images without them, and checking that nothing gpl3-licensed gets into the latter. Examples are provided via the selftest: four scenarios are tested: - bash is added to the image, with a default gpl3 license; this is rejected - bash is added to the image, with a "gpl3 & other" license; this is also rejected - bash is added to the image, with a "gpl3 | other" license; this is accepted, but only 'other' is added to the license manifest (this was already handled correctly previously). - bash is added to the image with a default gpl3 license, and is additionally whitelisted for that image; this is accepted. Eventually, this would allow deprecating the meta-gplv2 layer, while still enforcing the no-gpl3 rule where possible and needed. (From OE-Core rev: fd50395bc0783a3cce7b5b0d7398f22783ebbeca) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-06-12selftests: add tests for INCOMPATIBLE_LICENSEQuentin Schulz
One bug went unnoticed without these selftests: an INCOMPATIBLE_LICENSE with a non-SPDX license for a package with that non-SPDX license wasn't enforcing the denial of build for said package. See 4b6ce4604cc15e289a48f8586d58a101b7a70b52 ("meta: license: fix non-SPDX license being removed from INCOMPATIBLE_LICENSE") While adding a test for that particular case, let's add a few more so that we cover a handful more use cases of INCOMPATIBLE_LICENSE. (From OE-Core rev: 6c2ca52218c196e7ccf6b3275bffc3e3a04193c6) Signed-off-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>