[oe-commits] [openembedded-core] 33/33: incompatible_lic.py: Add tests for incompatible licenses with wildcards

git at git.openembedded.org git at git.openembedded.org
Mon Dec 16 23:28:14 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit ef7c44c9bdf30a02ccc71f26c27aab45d6adf1fb
Author: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
AuthorDate: Wed Dec 11 17:48:20 2019 +0100

    incompatible_lic.py: Add tests for incompatible licenses with wildcards
    
    Suggested-by: Quentin Schulz <quentin.schulz at streamunlimited.com>
    Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 .../recipes-test/license/incompatible-licenses.bb  |  3 ++
 meta/lib/oeqa/selftest/cases/incompatible_lic.py   | 42 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

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 0000000..9c1545e
--- /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 458a940..3eabd79 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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list