From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCHv3 8/8] incompatible_lic.py: Add tests for incompatible licenses with wildcards
Date: Wed, 11 Dec 2019 17:48:20 +0100 [thread overview]
Message-ID: <20191211164820.26588-8-pkj@axis.com> (raw)
In-Reply-To: <20191211164820.26588-1-pkj@axis.com>
Suggested-by: Quentin Schulz <quentin.schulz@streamunlimited.com>
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
PATCHv2: New in this patch set.
PATCHv3: Added the missing incompatible-licenses.bb recipe file.
.../license/incompatible-licenses.bb | 3 ++
.../oeqa/selftest/cases/incompatible_lic.py | 42 +++++++++++++++++++
2 files changed, 45 insertions(+)
create mode 100644 meta-selftest/recipes-test/license/incompatible-licenses.bb
diff --git a/meta-selftest/recipes-test/license/incompatible-licenses.bb b/meta-selftest/recipes-test/license/incompatible-licenses.bb
new file mode 100644
index 0000000000..9c1545efba
--- /dev/null
+++ b/meta-selftest/recipes-test/license/incompatible-licenses.bb
@@ -0,0 +1,3 @@
+SUMMARY = "Recipe with multiple SPDX licenses"
+DESCRIPTION = "Is licensed with multiple SPDX licenses to be used for testing"
+LICENSE = "GPL-2.0 & GPL-3.0 & LGPL-3.0"
diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
index 458a940618..3eabd79097 100644
--- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
+++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -23,6 +23,18 @@ class IncompatibleLicenseTests(OESelftestTestCase):
def test_incompatible_alias_spdx_license(self):
self.lic_test('incompatible-license', 'GPL-3.0', 'GPLv3')
+ # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded license
+ # matching this SPDX license
+ def test_incompatible_spdx_license_wildcard(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', '*GPL-3.0')
+
+ # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded alias
+ # license matching this SPDX license
+ def test_incompatible_alias_spdx_license_wildcard(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', '*GPLv3')
+
# Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
# license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX
# license
@@ -34,6 +46,36 @@ class IncompatibleLicenseTests(OESelftestTestCase):
def test_incompatible_alias_spdx_license_alias(self):
self.lic_test('incompatible-license-alias', 'GPL-3.0', 'GPLv3')
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded
+ # license matching this SPDX license
+ def test_incompatible_spdx_license_alias_wildcard(self):
+ self.lic_test('incompatible-license-alias', 'GPL-3.0', '*GPL-3.0')
+
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded
+ # alias license matching the SPDX license
+ def test_incompatible_alias_spdx_license_alias_wildcard(self):
+ self.lic_test('incompatible-license-alias', 'GPL-3.0', '*GPLv3')
+
+ # Verify that a package with multiple SPDX licenses (from
+ # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains
+ # some of them
+ def test_incompatible_spdx_licenses(self):
+ self.lic_test('incompatible-licenses', 'GPL-3.0 LGPL-3.0', 'GPL-3.0 LGPL-3.0')
+
+ # Verify that a package with multiple SPDX licenses (from
+ # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a
+ # wildcard to some of them
+ def test_incompatible_spdx_licenses_wildcard(self):
+ self.lic_test('incompatible-licenses', 'GPL-3.0 LGPL-3.0', '*GPL-3.0')
+
+ # Verify that a package with multiple SPDX licenses (from
+ # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a
+ # wildcard matching all licenses
+ def test_incompatible_all_licenses_wildcard(self):
+ self.lic_test('incompatible-licenses', 'GPL-2.0 GPL-3.0 LGPL-3.0', '*')
+
# Verify that a package with a non-SPDX license (neither in
# AVAILABLE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
# INCOMPATIBLE_LICENSE contains this license
--
2.21.0
next prev parent reply other threads:[~2019-12-11 16:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-11 16:48 [PATCHv3 1/8] license.bbclass: Introduce AVAILABLE_LICENSES that lists all licenses Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 2/8] licenses.conf: Remove the SRC_DISTRIBUTE_LICENSES variable Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 3/8] license.bbclass: Make incompatible_pkg_license return incompatible lics Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 4/8] base.bbclass: Simplify the check for whitelisted licenses Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 5/8] base.bbclass: Report only the licenses that are incompatible for a package Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 6/8] package.bbclass: Report only the licenses that are incompatible Peter Kjellerstedt
2019-12-11 16:48 ` [PATCHv3 7/8] license_image.bbclass: " Peter Kjellerstedt
2019-12-11 16:48 ` Peter Kjellerstedt [this message]
2020-08-20 22:35 ` [OE-core] [PATCHv3 1/8] license.bbclass: Introduce AVAILABLE_LICENSES that lists all licenses Denys Dmytriyenko
2020-08-22 4:13 ` Christopher Larson
2020-08-22 14:29 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191211164820.26588-8-pkj@axis.com \
--to=peter.kjellerstedt@axis.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox