[OE-core] [PATCH v2] oeqa/buildoptions.py: automate test case 929: check for correct GPL licenses
Costin Constantin
costin.c.constantin at intel.com
Thu Jul 23 13:40:44 UTC 2015
Signed-off-by: Costin Constantin <costin.c.constantin at intel.com>
---
meta/lib/oeqa/selftest/buildoptions.py | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index e79be9e..ab009f2 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -132,6 +132,36 @@ class BuildImagesTest(oeSelfTest):
res = bitbake("core-image-directfb", ignore_status=True)
self.assertEqual(res.status, 0, "\ncoreimagedirectfb failed to build. Please check logs for further details.\nbitbake output %s" % res.output)
+ @testcase(929)
+ def test_gpl_licenses(self):
+ """
+ Test for checking that correct GPL licenses are used when explicitly required.
+ """
+ self.add_command_to_tearDown('cleanup-workdir')
+ self.write_config("MACHINE = \"qemux86\"\nINHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nCOPYLEFT_LICENSE_INCLUDE = \"GPLv2* GPLv3*\"")
+ res = bitbake("core-image-minimal", ignore_status=True)
+ self.remove_config("MACHINE = \"qemux86\"\nINHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nCOPYLEFT_LICENSE_INCLUDE = \"GPLv2* GPLv3*\"")
+ self.assertEqual(res.status, 0, "core-image-minimal didn't build. Please check logs for further details %s" % res.output)
+ built_pkgs_list = os.listdir(self.builddir + "/tmp/deploy/sources/i586-poky-linux/")# the list containing built pkgs with ver.
+ pkg_name_split = [i.split("-") for i in built_pkgs_list]
+ pkgs = [] # this will contain the pkgs name as found in tmp/deploy/licenses
+ for i in pkg_name_split:
+ name = ""
+ for j in i:
+ if i.index(j) == 0:
+ name = j
+ elif j.isalpha() and i.index(j) != 0:
+ name = name + "-" + j
+ else:
+ pkgs.append(name)
+ break
+ license_dir = self.builddir + "/tmp/deploy/licenses/"
+ for i in pkgs:
+ if os.path.isdir(license_dir + i):
+ self.assertTrue(g.glob(license_dir + i + "/*GPL*"), "couldn't find GPL license in " + license_dir + "for package " + i)
+ else:
+ self.log.info("\nNo license dir for %s" % i)
+
class ArchiverTest(oeSelfTest):
@testcase(926)
def test_arch_work_dir_and_export_source(self):
--
2.1.4
More information about the Openembedded-core
mailing list