diff options
author | Paulo Neves <ptsneves@gmail.com> | 2022-02-06 14:45:07 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-04-19 14:14:11 +0100 |
commit | 15df00f0f0e3c15560b3f0774227817deade81f9 (patch) | |
tree | 203392fe7962d0ce3ed78c1e7dbdef3147c287dd /meta/lib | |
parent | caea484eb828cf90e63b69680c087a739ac343fa (diff) | |
download | poky-15df00f0f0e3c15560b3f0774227817deade81f9.tar.gz |
selftest/lic_checksum: Add test for filename containing space
A fix is being added to bitbake to correctly handle spaces inside
checksum filenames. Add a test to oe-selftest to ensure this is
tested and doesn't regress in future.
(From OE-Core rev: 324109f034f069ee3e91a1a705b3449911a448de)
Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/lic_checksum.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/lic_checksum.py b/meta/lib/oeqa/selftest/cases/lic_checksum.py index f8681ed755..8f1226e6a5 100644 --- a/meta/lib/oeqa/selftest/cases/lic_checksum.py +++ b/meta/lib/oeqa/selftest/cases/lic_checksum.py | |||
@@ -4,12 +4,30 @@ | |||
4 | 4 | ||
5 | import os | 5 | import os |
6 | import tempfile | 6 | import tempfile |
7 | import urllib | ||
7 | 8 | ||
8 | from oeqa.selftest.case import OESelftestTestCase | 9 | from oeqa.selftest.case import OESelftestTestCase |
9 | from oeqa.utils.commands import bitbake | 10 | from oeqa.utils.commands import bitbake |
10 | 11 | ||
11 | class LicenseTests(OESelftestTestCase): | 12 | class LicenseTests(OESelftestTestCase): |
12 | 13 | ||
14 | def test_checksum_with_space(self): | ||
15 | bitbake_cmd = '-c populate_lic emptytest' | ||
16 | |||
17 | lic_file, lic_path = tempfile.mkstemp(" -afterspace") | ||
18 | os.close(lic_file) | ||
19 | #self.track_for_cleanup(lic_path) | ||
20 | |||
21 | self.write_config("INHERIT:remove = \"report-error\"") | ||
22 | |||
23 | self.write_recipeinc('emptytest', """ | ||
24 | INHIBIT_DEFAULT_DEPS = "1" | ||
25 | LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" | ||
26 | SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e" | ||
27 | """ % (urllib.parse.quote(lic_path), urllib.parse.quote(lic_path))) | ||
28 | result = bitbake(bitbake_cmd) | ||
29 | |||
30 | |||
13 | # Verify that changing a license file that has an absolute path causes | 31 | # Verify that changing a license file that has an absolute path causes |
14 | # the license qa to fail due to a mismatched md5sum. | 32 | # the license qa to fail due to a mismatched md5sum. |
15 | def test_nonmatching_checksum(self): | 33 | def test_nonmatching_checksum(self): |