diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/lic_checksum.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/lic_checksum.py | 35 |
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 @@ | |||
1 | import os | ||
2 | import tempfile | ||
3 | |||
4 | from oeqa.selftest.case import OESelftestTestCase | ||
5 | from oeqa.utils.commands import bitbake | ||
6 | from oeqa.utils import CommandError | ||
7 | from oeqa.core.decorator.oeid import OETestID | ||
8 | |||
9 | class 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', """ | ||
23 | INHIBIT_DEFAULT_DEPS = "1" | ||
24 | LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" | ||
25 | SRC_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) | ||