summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRandy Witt <randy.e.witt@linux.intel.com>2015-03-02 10:55:38 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-03-10 10:47:44 +0000
commitf0f6b234a7e855dd40c0dc0f3d1d843c7f59e7e1 (patch)
tree91c3304352318987764e95a05a0ad7cd5eb4b0dc
parenta39ce568e091a0305ea2806cdd041cda42680d65 (diff)
downloadpoky-f0f6b234a7e855dd40c0dc0f3d1d843c7f59e7e1.tar.gz
lib/oeqa/selftest/lic-checksum: Verify failure when checksum changes.
The test added verifies that when a file with an absolute path in LIC_FILES_CHKSUM changes without a corresponding change to the md5sum, it triggers the license qa test again with a failure. [Yocto #6450] (From OE-Core rev: cab59ce08916c45c1d9da1cf9a92a67574f6c2c3) Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta-selftest/recipes-test/emptytest/emptytest.bb5
-rw-r--r--meta/lib/oeqa/selftest/lic-checksum.py28
2 files changed, 33 insertions, 0 deletions
diff --git a/meta-selftest/recipes-test/emptytest/emptytest.bb b/meta-selftest/recipes-test/emptytest/emptytest.bb
new file mode 100644
index 0000000000..e87f4d7543
--- /dev/null
+++ b/meta-selftest/recipes-test/emptytest/emptytest.bb
@@ -0,0 +1,5 @@
1include test_recipe.inc
2
3# Set LICENSE to something so that bitbake -p that is ran at the beginning
4# is successful since test_recipe.inc has not yet been modified.
5LICENSE = ""
diff --git a/meta/lib/oeqa/selftest/lic-checksum.py b/meta/lib/oeqa/selftest/lic-checksum.py
new file mode 100644
index 0000000000..0c1afa6127
--- /dev/null
+++ b/meta/lib/oeqa/selftest/lic-checksum.py
@@ -0,0 +1,28 @@
1import os
2import tempfile
3
4from oeqa.selftest.base import oeSelfTest
5from oeqa.utils.commands import bitbake
6from oeqa.utils import CommandError
7
8class LicenseTests(oeSelfTest):
9
10 # Verify that changing a license file that has an absolute path causes
11 # the license qa to fail due to a mismatched md5sum.
12 def test_foo(self):
13 bitbake_cmd = '-c configure emptytest'
14 error_msg = 'ERROR: emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
15
16 lic_file, lic_path = tempfile.mkstemp()
17 os.close(lic_file)
18 self.track_for_cleanup(lic_path)
19
20 self.write_recipeinc('emptytest', 'LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"' % lic_path)
21 result = bitbake(bitbake_cmd)
22
23 with open(lic_path, "w") as f:
24 f.write("data")
25
26 result = bitbake(bitbake_cmd, ignore_status=True)
27 if error_msg not in result.output:
28 raise AssertionError(result.output)