summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2019-12-11 17:48:20 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-16 23:22:03 +0000
commitef7c44c9bdf30a02ccc71f26c27aab45d6adf1fb (patch)
tree422eb6a11e40139b24cfcc34775ecbf1b8a489b2
parentb1863e570d4b169cd2f0ea7b4fe7c2348943cb2c (diff)
downloadopenembedded-core-contrib-ef7c44c9bdf30a02ccc71f26c27aab45d6adf1fb.tar.gz
incompatible_lic.py: Add tests for incompatible licenses with wildcards
Suggested-by: Quentin Schulz <quentin.schulz@streamunlimited.com> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-selftest/recipes-test/license/incompatible-licenses.bb3
-rw-r--r--meta/lib/oeqa/selftest/cases/incompatible_lic.py42
2 files changed, 45 insertions, 0 deletions
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