summaryrefslogtreecommitdiffstats
path: root/meta/lib/patchtest/tests
diff options
context:
space:
mode:
authorTrevor Gamblin <tgamblin@baylibre.com>2023-11-01 10:20:55 -0400
committerSteve Sakoman <steve@sakoman.com>2023-11-24 05:01:37 -1000
commitd171bc2f28ac332a1c59a9edacd6f09baef1d10f (patch)
tree4db5f69d327a11a909ddf0d18ced3dd0184ae7c4 /meta/lib/patchtest/tests
parent52e8e9e2b6bf89f0b4ef6afa7be27fd3bfe30cb7 (diff)
downloadpoky-d171bc2f28ac332a1c59a9edacd6f09baef1d10f.tar.gz
patchtest: remove test for CVE tag in mbox
After patchtest went live it was determined that testing for a CVE tag in the mbox commit message is unnecessary, since it will already be in the shortlog and in any carried patches. Remove the test and the associated selftest files so that its absence isn't flagged in future test results. (From OE-Core rev: bf9671896eb60880b5dad36c2706855932ce091f) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 54690f18f04a2ab993a85d551ce4f8d0fa56618a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/lib/patchtest/tests')
-rw-r--r--meta/lib/patchtest/tests/test_mbox.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py
index 2449564d0f..0b623b7d17 100644
--- a/meta/lib/patchtest/tests/test_mbox.py
+++ b/meta/lib/patchtest/tests/test_mbox.py
@@ -6,7 +6,6 @@
6 6
7import base 7import base
8import collections 8import collections
9import parse_cve_tags
10import parse_shortlog 9import parse_shortlog
11import parse_signed_off_by 10import parse_signed_off_by
12import pyparsing 11import pyparsing
@@ -33,8 +32,6 @@ class TestMbox(base.Base):
33 rexp_detect = pyparsing.Regex('\[\s?YOCTO.*\]') 32 rexp_detect = pyparsing.Regex('\[\s?YOCTO.*\]')
34 rexp_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]') 33 rexp_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
35 revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') 34 revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
36 prog = parse_cve_tags.cve_tag
37 patch_prog = parse_cve_tags.patch_cve_tag
38 signoff_prog = parse_signed_off_by.signed_off_by 35 signoff_prog = parse_signed_off_by.signed_off_by
39 revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"') 36 revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
40 maxlength = 90 37 maxlength = 90
@@ -143,27 +140,6 @@ class TestMbox(base.Base):
143 if not commit.commit_message.strip(): 140 if not commit.commit_message.strip():
144 self.fail('Please include a commit message on your patch explaining the change', commit=commit) 141 self.fail('Please include a commit message on your patch explaining the change', commit=commit)
145 142
146 def test_cve_presence_in_commit_message(self):
147 if self.unidiff_parse_error:
148 self.skip('Parse error %s' % self.unidiff_parse_error)
149
150 # we are just interested in series that introduce CVE patches, thus discard other
151 # possibilities: modification to current CVEs, patch directly introduced into the
152 # recipe, upgrades already including the CVE, etc.
153 new_patches = [p for p in self.patchset if p.path.endswith('.patch') and p.is_added_file]
154 if not new_patches:
155 self.skip('No new patches introduced')
156
157 for commit in TestMbox.commits:
158 # skip those patches that revert older commits, these do not required the tag presence
159 if self.revert_shortlog_regex.search_string(commit.shortlog):
160 continue
161 if not self.patch_prog.search_string(commit.payload):
162 self.skip("No CVE tag in added patch, so not needed in mbox")
163 elif not self.prog.search_string(commit.payload):
164 self.fail('A CVE tag should be provided in the commit message with format: "CVE: CVE-YYYY-XXXX"',
165 commit=commit)
166
167 def test_bugzilla_entry_format(self): 143 def test_bugzilla_entry_format(self):
168 for commit in TestMbox.commits: 144 for commit in TestMbox.commits:
169 if not self.rexp_detect.search_string(commit.commit_message): 145 if not self.rexp_detect.search_string(commit.commit_message):