diff options
| author | Trevor Gamblin <tgamblin@baylibre.com> | 2023-10-20 10:42:02 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-20 17:02:13 +0100 |
| commit | 95a3f69be5cb4d706de65e4819cd86f0630ecfb9 (patch) | |
| tree | 84cfd7de6f87ec20a9337bd2143fbabe73d40476 | |
| parent | 1b04f4422ebcc58ecae4bb31e5b63543f1da19ae (diff) | |
| download | poky-95a3f69be5cb4d706de65e4819cd86f0630ecfb9.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: dc9126e45e74b915faaf296037e7ece41785bf4a)
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/lib/patchtest/tests/test_metadata_lic_files_chksum.py | 5 |
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)]) |
