summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r--meta/lib/oeqa/selftest/cases/incompatible_lic.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
index 8fb93af8a8..424a9e69c3 100644
--- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
+++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -39,3 +39,37 @@ class IncompatibleLicenseTests(OESelftestTestCase):
39 # INCOMPATIBLE_LICENSE contains this license 39 # INCOMPATIBLE_LICENSE contains this license
40 def test_incompatible_nonspdx_license(self): 40 def test_incompatible_nonspdx_license(self):
41 self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense') 41 self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense')
42
43class IncompatibleLicensePerImageTests(OESelftestTestCase):
44 def default_config(self):
45 return """
46IMAGE_INSTALL_append = "bash"
47INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0"
48"""
49
50 def test_bash_default(self):
51 self.write_config(self.default_config())
52 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash has an incompatible license GPLv3+ and cannot be installed into the image."
53
54 result = bitbake('core-image-minimal', ignore_status=True)
55 if error_msg not in result.output:
56 raise AssertionError(result.output)
57
58 def test_bash_and_license(self):
59 self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " & SomeLicense"')
60 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash has an incompatible license GPLv3+ & SomeLicense and cannot be installed into the image."
61
62 result = bitbake('core-image-minimal', ignore_status=True)
63 if error_msg not in result.output:
64 raise AssertionError(result.output)
65
66 def test_bash_or_license(self):
67 self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " | SomeLicense"')
68
69 bitbake('core-image-minimal')
70
71 def test_bash_whitelist(self):
72 self.write_config(self.default_config() + '\nWHITELIST_GPL-3.0_pn-core-image-minimal = "bash"')
73
74 bitbake('core-image-minimal')
75