summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-01 22:36:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-06-02 15:59:07 +0100
commite2a71c7d25632b67981d80e129aae775ffcda617 (patch)
treee904667624d5ab182f9d3254bb16a9429878c342 /meta/lib/oeqa
parent7c0d6ee5b196db410992952c0e046712ecc3cfc2 (diff)
downloadpoky-e2a71c7d25632b67981d80e129aae775ffcda617.tar.gz
selftest/incompatible_lic: Ensure create_sdpx isn't used with the tests
The SPDX class doens't get on well with non-standard licenses. Disable it for the purposes of this test to avoid errors. Add a new helper function to the core test code to allow this to be done easily. (From OE-Core rev: b9fb4c68f2ab5becb0a10418884e09dee93cd247) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/selftest/case.py7
-rw-r--r--meta/lib/oeqa/selftest/cases/incompatible_lic.py2
2 files changed, 9 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/case.py b/meta/lib/oeqa/selftest/case.py
index dcad4f76ec..54d90c78ac 100644
--- a/meta/lib/oeqa/selftest/case.py
+++ b/meta/lib/oeqa/selftest/case.py
@@ -249,6 +249,13 @@ class OESelftestTestCase(OETestCase):
249 self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data)) 249 self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data))
250 ftools.write_file(self.machineinc_path, data) 250 ftools.write_file(self.machineinc_path, data)
251 251
252 def disable_class(self, classname):
253 destfile = "%s/classes/%s.bbclass" % (self.builddir, classname)
254 os.makedirs(os.path.dirname(destfile), exist_ok=True)
255 self.track_for_cleanup(destfile)
256 self.logger.debug("Creating empty class: %s\n" % (destfile))
257 ftools.write_file(destfile, "")
258
252 # check does path exist 259 # check does path exist
253 def assertExists(self, expr, msg=None): 260 def assertExists(self, expr, msg=None):
254 if not os.path.exists(expr): 261 if not os.path.exists(expr):
diff --git a/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
index 4edf60fc55..1597d30ab0 100644
--- a/meta/lib/oeqa/selftest/cases/incompatible_lic.py
+++ b/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -113,6 +113,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
113 raise AssertionError(result.output) 113 raise AssertionError(result.output)
114 114
115 def test_bash_and_license(self): 115 def test_bash_and_license(self):
116 self.disable_class("create-spdx")
116 self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " & SomeLicense"') 117 self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " & SomeLicense"')
117 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" 118 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"
118 119
@@ -121,6 +122,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
121 raise AssertionError(result.output) 122 raise AssertionError(result.output)
122 123
123 def test_bash_or_license(self): 124 def test_bash_or_license(self):
125 self.disable_class("create-spdx")
124 self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " | SomeLicense"') 126 self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " | SomeLicense"')
125 127
126 bitbake('core-image-minimal') 128 bitbake('core-image-minimal')