summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
diff options
context:
space:
mode:
authorEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
committerEd Tanous <ed.tanous@intel.com>2019-07-31 20:59:18 +0300
commitb4f66bacb1b8e661d794fa7a189e2f66f5092e2e (patch)
tree5a8302cd349fdb68dadca003483c61917d4a6add /poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
parent43a183cc0926da36e3a218efa02ab4838ace316f (diff)
parentdd755025e33af27b059ea7ef3afbe850e4880b08 (diff)
downloadopenbmc-b4f66bacb1b8e661d794fa7a189e2f66f5092e2e.tar.xz
Merge branch 'master' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into intel
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py')
-rw-r--r--poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
new file mode 100644
index 000000000..8fb93af8a
--- /dev/null
+++ b/poky/meta/lib/oeqa/selftest/cases/incompatible_lic.py
@@ -0,0 +1,41 @@
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake
+
+class IncompatibleLicenseTests(OESelftestTestCase):
+
+ def lic_test(self, pn, pn_lic, lic):
+ error_msg = 'ERROR: Nothing PROVIDES \'%s\'\n%s was skipped: it has an incompatible license: %s' % (pn, pn, pn_lic)
+
+ self.write_config("INCOMPATIBLE_LICENSE += \"%s\"" % (lic))
+
+ result = bitbake('%s --dry-run' % (pn), ignore_status=True)
+ if error_msg not in result.output:
+ raise AssertionError(result.output)
+
+ # Verify that a package with an SPDX license (from SRC_DISTRIBUTE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains this SPDX license
+ def test_incompatible_spdx_license(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', 'GPL-3.0')
+
+ # Verify that a package with an SPDX license (from SRC_DISTRIBUTE_LICENSES)
+ # cannot be built when INCOMPATIBLE_LICENSE contains an alias (in
+ # SPDXLICENSEMAP) of this SPDX license
+ def test_incompatible_alias_spdx_license(self):
+ self.lic_test('incompatible-license', 'GPL-3.0', 'GPLv3')
+
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains this SPDX
+ # license
+ def test_incompatible_spdx_license_alias(self):
+ self.lic_test('incompatible-license-alias', 'GPLv3', 'GPL-3.0')
+
+ # Verify that a package with an alias (from SPDXLICENSEMAP) to an SPDX
+ # license cannot be built when INCOMPATIBLE_LICENSE contains this alias
+ def test_incompatible_alias_spdx_license_alias(self):
+ self.lic_test('incompatible-license-alias', 'GPLv3', 'GPLv3')
+
+ # Verify that a package with a non-SPDX license (neither in
+ # SRC_DISTRIBUTE_LICENSES nor in SPDXLICENSEMAP) cannot be built when
+ # INCOMPATIBLE_LICENSE contains this license
+ def test_incompatible_nonspdx_license(self):
+ self.lic_test('incompatible-nonspdx-license', 'FooLicense', 'FooLicense')