summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/lic_checksum.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/lic_checksum.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/lic_checksum.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/lic_checksum.py b/meta/lib/oeqa/selftest/cases/lic_checksum.py
index bae935d697..2d0b805b90 100644
--- a/meta/lib/oeqa/selftest/cases/lic_checksum.py
+++ b/meta/lib/oeqa/selftest/cases/lic_checksum.py
@@ -1,16 +1,36 @@
1# 1#
2# Copyright OpenEmbedded Contributors
3#
2# SPDX-License-Identifier: MIT 4# SPDX-License-Identifier: MIT
3# 5#
4 6
5import os 7import os
6import tempfile 8import tempfile
9import urllib
7 10
8from oeqa.selftest.case import OESelftestTestCase 11from oeqa.selftest.case import OESelftestTestCase
9from oeqa.utils.commands import bitbake 12from oeqa.utils.commands import bitbake
10from oeqa.utils import CommandError
11 13
12class LicenseTests(OESelftestTestCase): 14class LicenseTests(OESelftestTestCase):
13 15
16 def test_checksum_with_space(self):
17 bitbake_cmd = '-c populate_lic emptytest'
18
19 lic_file, lic_path = tempfile.mkstemp(" -afterspace")
20 os.close(lic_file)
21 #self.track_for_cleanup(lic_path)
22
23 self.write_config("INHERIT:remove = \"report-error\"")
24
25 self.write_recipeinc('emptytest', """
26INHIBIT_DEFAULT_DEPS = "1"
27LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
28SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
29""" % (urllib.parse.quote(lic_path), urllib.parse.quote(lic_path)))
30 result = bitbake(bitbake_cmd)
31 self.delete_recipeinc('emptytest')
32
33
14 # Verify that changing a license file that has an absolute path causes 34 # Verify that changing a license file that has an absolute path causes
15 # the license qa to fail due to a mismatched md5sum. 35 # the license qa to fail due to a mismatched md5sum.
16 def test_nonmatching_checksum(self): 36 def test_nonmatching_checksum(self):
@@ -21,7 +41,7 @@ class LicenseTests(OESelftestTestCase):
21 os.close(lic_file) 41 os.close(lic_file)
22 self.track_for_cleanup(lic_path) 42 self.track_for_cleanup(lic_path)
23 43
24 self.write_config("INHERIT_remove = \"report-error\"") 44 self.write_config("INHERIT:remove = \"report-error\"")
25 45
26 self.write_recipeinc('emptytest', """ 46 self.write_recipeinc('emptytest', """
27INHIBIT_DEFAULT_DEPS = "1" 47INHIBIT_DEFAULT_DEPS = "1"
@@ -34,5 +54,6 @@ SRC_URI = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"
34 f.write("data") 54 f.write("data")
35 55
36 result = bitbake(bitbake_cmd, ignore_status=True) 56 result = bitbake(bitbake_cmd, ignore_status=True)
57 self.delete_recipeinc('emptytest')
37 if error_msg not in result.output: 58 if error_msg not in result.output:
38 raise AssertionError(result.output) 59 raise AssertionError(result.output)