mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
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>
This commit is contained in:
@@ -249,6 +249,13 @@ class OESelftestTestCase(OETestCase):
|
|||||||
self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data))
|
self.logger.debug("Writing to: %s\n%s\n" % (self.machineinc_path, data))
|
||||||
ftools.write_file(self.machineinc_path, data)
|
ftools.write_file(self.machineinc_path, data)
|
||||||
|
|
||||||
|
def disable_class(self, classname):
|
||||||
|
destfile = "%s/classes/%s.bbclass" % (self.builddir, classname)
|
||||||
|
os.makedirs(os.path.dirname(destfile), exist_ok=True)
|
||||||
|
self.track_for_cleanup(destfile)
|
||||||
|
self.logger.debug("Creating empty class: %s\n" % (destfile))
|
||||||
|
ftools.write_file(destfile, "")
|
||||||
|
|
||||||
# check does path exist
|
# check does path exist
|
||||||
def assertExists(self, expr, msg=None):
|
def assertExists(self, expr, msg=None):
|
||||||
if not os.path.exists(expr):
|
if not os.path.exists(expr):
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
|
|||||||
raise AssertionError(result.output)
|
raise AssertionError(result.output)
|
||||||
|
|
||||||
def test_bash_and_license(self):
|
def test_bash_and_license(self):
|
||||||
|
self.disable_class("create-spdx")
|
||||||
self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " & SomeLicense"')
|
self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " & SomeLicense"')
|
||||||
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"
|
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"
|
||||||
|
|
||||||
@@ -121,6 +122,7 @@ INCOMPATIBLE_LICENSE:pn-core-image-minimal = "GPL-3.0* LGPL-3.0*"
|
|||||||
raise AssertionError(result.output)
|
raise AssertionError(result.output)
|
||||||
|
|
||||||
def test_bash_or_license(self):
|
def test_bash_or_license(self):
|
||||||
|
self.disable_class("create-spdx")
|
||||||
self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " | SomeLicense"')
|
self.write_config(self.default_config() + '\nLICENSE:append:pn-bash = " | SomeLicense"')
|
||||||
|
|
||||||
bitbake('core-image-minimal')
|
bitbake('core-image-minimal')
|
||||||
|
|||||||
Reference in New Issue
Block a user