summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-10-20 10:42:02 -0400
committerSteve Sakoman <steve@sakoman.com>2023-11-24 05:01:37 -1000
commit2a89e081caf7ea9095c411a99daf27254a8f9886 (patch)
treefbe9edc6d9df06a60699436defa1cef86dff0058
parent7dd1867c771a122c5398476d4a78574a4e2e0ae6 (diff)
downloadpoky-2a89e081caf7ea9095c411a99daf27254a8f9886.tar.gz
patchtest: fix lic_files_chksum test regex
the test_lic_files_chksum_modified_not_mentioned test in patchtest wasn't picking up on 'License-Update:' tags correctly. Use pyparsing's AtLineStart class to simplify the regex setup and search. (From OE-Core rev: 978c819c33c0552750f5383f0ed761d505b4bdf5) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit dc9126e45e74b915faaf296037e7ece41785bf4a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py b/meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py
index cb3e7c9d34..fa4a28c7b2 100644
--- a/meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py
+++ b/meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py
@@ -12,8 +12,7 @@ class LicFilesChkSum(base.Metadata):
12 metadata = 'LIC_FILES_CHKSUM' 12 metadata = 'LIC_FILES_CHKSUM'
13 license = 'LICENSE' 13 license = 'LICENSE'
14 closed = 'CLOSED' 14 closed = 'CLOSED'
15 lictag = 'License-Update' 15 lictag_re = pyparsing.AtLineStart("License-Update:")
16 lictag_re = pyparsing.Regex("^%s:" % lictag)
17 16
18 def test_lic_files_chksum_presence(self): 17 def test_lic_files_chksum_presence(self):
19 if not self.added: 18 if not self.added:
@@ -71,5 +70,5 @@ class LicFilesChkSum(base.Metadata):
71 if self.lictag_re.search_string(commit.commit_message): 70 if self.lictag_re.search_string(commit.commit_message):
72 break 71 break
73 else: 72 else:
74 self.fail('LIC_FILES_CHKSUM changed on target %s but there is no "%s" tag in commit message. Include it with a brief description' % (pn, self.lictag), 73 self.fail('LIC_FILES_CHKSUM changed on target %s but there is no "License-Update:" tag in commit message. Include it with a brief description' % pn,
75 data=[('Current checksum', pretest), ('New checksum', test)]) 74 data=[('Current checksum', pretest), ('New checksum', test)])