diff options
author | Randy Witt <randy.e.witt@linux.intel.com> | 2015-03-02 10:55:38 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-09 16:00:19 +0000 |
commit | cab59ce08916c45c1d9da1cf9a92a67574f6c2c3 (patch) | |
tree | 3b4f2e36d8c74a59660ed97c2615c59d8ef6747b | |
parent | 5df681259ae078c9d04d426fb5971eaa79d35ba5 (diff) | |
download | openembedded-core-cab59ce08916c45c1d9da1cf9a92a67574f6c2c3.tar.gz openembedded-core-cab59ce08916c45c1d9da1cf9a92a67574f6c2c3.tar.bz2 openembedded-core-cab59ce08916c45c1d9da1cf9a92a67574f6c2c3.zip |
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]
Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r-- | meta-selftest/recipes-test/emptytest/emptytest.bb | 5 | ||||
-rw-r--r-- | meta/lib/oeqa/selftest/lic-checksum.py | 28 |
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 @@ +include test_recipe.inc + +# Set LICENSE to something so that bitbake -p that is ran at the beginning +# is successful since test_recipe.inc has not yet been modified. +LICENSE = "" 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 @@ +import os +import tempfile + +from oeqa.selftest.base import oeSelfTest +from oeqa.utils.commands import bitbake +from oeqa.utils import CommandError + +class LicenseTests(oeSelfTest): + + # Verify that changing a license file that has an absolute path causes + # the license qa to fail due to a mismatched md5sum. + def test_foo(self): + bitbake_cmd = '-c configure emptytest' + error_msg = 'ERROR: emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc' + + lic_file, lic_path = tempfile.mkstemp() + os.close(lic_file) + self.track_for_cleanup(lic_path) + + self.write_recipeinc('emptytest', 'LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"' % lic_path) + result = bitbake(bitbake_cmd) + + with open(lic_path, "w") as f: + f.write("data") + + result = bitbake(bitbake_cmd, ignore_status=True) + if error_msg not in result.output: + raise AssertionError(result.output) |