summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/lic_checksum.py
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-05-12 14:40:21 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-06 19:02:43 +0100
commit157c3be2ca93f076033f725ec1ee912df91f7488 (patch)
tree8ef896ff7adf78d63b34059cd5b017a4f0a3419a /meta/lib/oeqa/selftest/cases/lic_checksum.py
parent10c512b60d1167122b5fe778b93838dca3def717 (diff)
downloadpoky-157c3be2ca93f076033f725ec1ee912df91f7488.tar.gz
oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
New framework has different classes/decorators so adapt current test cases to support these. Changes include changes on base classes and decorators. Also include paths in selftest/__init__.py isn't needed because the loader is the standard unittest one. (From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/lic_checksum.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/lic_checksum.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/lic_checksum.py b/meta/lib/oeqa/selftest/cases/lic_checksum.py
new file mode 100644
index 0000000000..37407157c1
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/lic_checksum.py
@@ -0,0 +1,35 @@
1import os
2import tempfile
3
4from oeqa.selftest.case import OESelftestTestCase
5from oeqa.utils.commands import bitbake
6from oeqa.utils import CommandError
7from oeqa.core.decorator.oeid import OETestID
8
9class LicenseTests(OESelftestTestCase):
10
11 # Verify that changing a license file that has an absolute path causes
12 # the license qa to fail due to a mismatched md5sum.
13 @OETestID(1197)
14 def test_nonmatching_checksum(self):
15 bitbake_cmd = '-c populate_lic emptytest'
16 error_msg = 'emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
17
18 lic_file, lic_path = tempfile.mkstemp()
19 os.close(lic_file)
20 self.track_for_cleanup(lic_path)
21
22 self.write_recipeinc('emptytest', """
23INHIBIT_DEFAULT_DEPS = "1"
24LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
25SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
26""" % (lic_path, lic_path))
27 result = bitbake(bitbake_cmd)
28
29 with open(lic_path, "w") as f:
30 f.write("data")
31
32 self.write_config("INHERIT_remove = \"report-error\"")
33 result = bitbake(bitbake_cmd, ignore_status=True)
34 if error_msg not in result.output:
35 raise AssertionError(result.output)