summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-18 15:16:04 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-02-21 22:01:28 +0000
commitd54cada0629176ba916ad48103cbb62436561062 (patch)
tree8b4558526e7a0eec96384c74604e8c360fa1bef4 /meta/lib
parent3266d1ee1c02312a9b6c62a50d1f7bbc2863446f (diff)
downloadpoky-d54cada0629176ba916ad48103cbb62436561062.tar.gz
selftest/incompatible_lic: Update the tests after the 'or-later' license 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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/selftest/cases/incompatible_lic.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
index 2a6382a1a8..152da6332a 100644
--- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
+++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -15,66 +15,66 @@ class IncompatibleLicenseTests(OESelftestTestCase):
15 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES) 15 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
16 # cannot be built when INCOMPATIBLE_LICENSE contains this SPDX license 16 # cannot be built when INCOMPATIBLE_LICENSE contains this SPDX license
17 def test_incompatible_spdx_license(self): 17 def test_incompatible_spdx_license(self):
18 self.lic_test('incompatible-license', 'GPL-3.0', 'GPL-3.0') 18 self.lic_test('incompatible-license', 'GPL-3.0-only', 'GPL-3.0-only')
19 19
20 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES) 20 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
21 # cannot be built when INCOMPATIBLE_LICENSE contains an alias (in 21 # cannot be built when INCOMPATIBLE_LICENSE contains an alias (in
22 # SPDXLICENSEMAP) of this SPDX license 22 # SPDXLICENSEMAP) of this SPDX license
23 def test_incompatible_alias_spdx_license(self): 23 def test_incompatible_alias_spdx_license(self):
24 self.lic_test('incompatible-license', 'GPL-3.0', 'GPLv3') 24 self.lic_test('incompatible-license', 'GPL-3.0-only', 'GPLv3')
25 25
26 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES) 26 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
27 # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded license 27 # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded license
28 # matching this SPDX license 28 # matching this SPDX license
29 def test_incompatible_spdx_license_wildcard(self): 29 def test_incompatible_spdx_license_wildcard(self):
30 self.lic_test('incompatible-license', 'GPL-3.0', '*GPL-3.0') 30 self.lic_test('incompatible-license', 'GPL-3.0-only', '*GPL-3.0-only')
31 31
32 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES) 32 # Verify that a package with an SPDX license (from AVAILABLE_LICENSES)
33 # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded alias 33 # cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded alias
34 # license matching this SPDX license 34 # license matching this SPDX license
35 def test_incompatible_alias_spdx_license_wildcard(self): 35 def test_incompatible_alias_spdx_license_wildcard(self):
36 self.lic_test('incompatible-license', 'GPL-3.0', '*GPLv3') 36 self.lic_test('incompatible-license', 'GPL-3.0-only', '*GPLv3')
37 37
38 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX 38 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
39 # license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX 39 # license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX
40 # license 40 # license
41 def test_incompatible_spdx_license_alias(self): 41 def test_incompatible_spdx_license_alias(self):
42 self.lic_test('incompatible-license-alias', 'GPL-3.0', 'GPL-3.0') 42 self.lic_test('incompatible-license-alias', 'GPL-3.0-only', 'GPL-3.0-only')
43 43
44 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX 44 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
45 # license cannot be built when INCOMPATIBLE_LICENSE contains this alias 45 # license cannot be built when INCOMPATIBLE_LICENSE contains this alias
46 def test_incompatible_alias_spdx_license_alias(self): 46 def test_incompatible_alias_spdx_license_alias(self):
47 self.lic_test('incompatible-license-alias', 'GPL-3.0', 'GPLv3') 47 self.lic_test('incompatible-license-alias', 'GPL-3.0-only', 'GPLv3')
48 48
49 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX 49 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
50 # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded 50 # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded
51 # license matching this SPDX license 51 # license matching this SPDX license
52 def test_incompatible_spdx_license_alias_wildcard(self): 52 def test_incompatible_spdx_license_alias_wildcard(self):
53 self.lic_test('incompatible-license-alias', 'GPL-3.0', '*GPL-3.0') 53 self.lic_test('incompatible-license-alias', 'GPL-3.0-only', '*GPL-3.0')
54 54
55 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX 55 # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
56 # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded 56 # license cannot be built when INCOMPATIBLE_LICENSE contains a wildcarded
57 # alias license matching the SPDX license 57 # alias license matching the SPDX license
58 def test_incompatible_alias_spdx_license_alias_wildcard(self): 58 def test_incompatible_alias_spdx_license_alias_wildcard(self):
59 self.lic_test('incompatible-license-alias', 'GPL-3.0', '*GPLv3') 59 self.lic_test('incompatible-license-alias', 'GPL-3.0-only', '*GPLv3')
60 60
61 # Verify that a package with multiple SPDX licenses (from 61 # Verify that a package with multiple SPDX licenses (from
62 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains 62 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains
63 # some of them 63 # some of them
64 def test_incompatible_spdx_licenses(self): 64 def test_incompatible_spdx_licenses(self):
65 self.lic_test('incompatible-licenses', 'GPL-3.0 LGPL-3.0', 'GPL-3.0 LGPL-3.0') 65 self.lic_test('incompatible-licenses', 'GPL-3.0-only LGPL-3.0-only', 'GPL-3.0-only LGPL-3.0-only')
66 66
67 # Verify that a package with multiple SPDX licenses (from 67 # Verify that a package with multiple SPDX licenses (from
68 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a 68 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a
69 # wildcard to some of them 69 # wildcard to some of them
70 def test_incompatible_spdx_licenses_wildcard(self): 70 def test_incompatible_spdx_licenses_wildcard(self):
71 self.lic_test('incompatible-licenses', 'GPL-3.0 LGPL-3.0', '*GPL-3.0') 71 self.lic_test('incompatible-licenses', 'GPL-3.0-only LGPL-3.0-only', '*GPL-3.0-only')
72 72
73 # Verify that a package with multiple SPDX licenses (from 73 # Verify that a package with multiple SPDX licenses (from
74 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a 74 # AVAILABLE_LICENSES) cannot be built when INCOMPATIBLE_LICENSE contains a
75 # wildcard matching all licenses 75 # wildcard matching all licenses
76 def test_incompatible_all_licenses_wildcard(self): 76 def test_incompatible_all_licenses_wildcard(self):
77 self.lic_test('incompatible-licenses', 'GPL-2.0 GPL-3.0 LGPL-3.0', '*') 77 self.lic_test('incompatible-licenses', 'GPL-2.0-only GPL-3.0-only LGPL-3.0-only', '*')
78 78
79 # Verify that a package with a non-SPDX license (neither in 79 # Verify that a package with a non-SPDX license (neither in
80 # AVAILABLE_LICENSES nor in SPDXLICENSEMAP) cannot be built when 80 # AVAILABLE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
@@ -91,7 +91,7 @@ INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0"
91 91
92 def test_bash_default(self): 92 def test_bash_default(self):
93 self.write_config(self.default_config()) 93 self.write_config(self.default_config())
94 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash cannot be installed into the image because it has incompatible license(s): GPL-3.0+" 94 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash cannot be installed into the image because it has incompatible license(s): GPL-3.0-or-later"
95 95
96 result = bitbake('core-image-minimal', ignore_status=True) 96 result = bitbake('core-image-minimal', ignore_status=True)
97 if error_msg not in result.output: 97 if error_msg not in result.output:
@@ -99,7 +99,7 @@ INCOMPATIBLE_LICENSE_pn-core-image-minimal = "GPL-3.0 LGPL-3.0"
99 99
100 def test_bash_and_license(self): 100 def test_bash_and_license(self):
101 self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " & SomeLicense"') 101 self.write_config(self.default_config() + '\nLICENSE_append_pn-bash = " & SomeLicense"')
102 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash cannot be installed into the image because it has incompatible license(s): GPL-3.0+" 102 error_msg = "ERROR: core-image-minimal-1.0-r0 do_rootfs: Package bash cannot be installed into the image because it has incompatible license(s): GPL-3.0-or-later"
103 103
104 result = bitbake('core-image-minimal', ignore_status=True) 104 result = bitbake('core-image-minimal', ignore_status=True)
105 if error_msg not in result.output: 105 if error_msg not in result.output: