mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
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: 54690f18f04a2ab993a85d551ce4f8d0fa56618a) Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
3ad5aa3f16
commit
06a7e7a14d
@@ -6,7 +6,6 @@
|
||||
|
||||
import base
|
||||
import collections
|
||||
import parse_cve_tags
|
||||
import parse_shortlog
|
||||
import parse_signed_off_by
|
||||
import pyparsing
|
||||
@@ -33,8 +32,6 @@ class TestMbox(base.Base):
|
||||
rexp_detect = pyparsing.Regex('\[\s?YOCTO.*\]')
|
||||
rexp_validation = pyparsing.Regex('\[(\s?YOCTO\s?#\s?(\d+)\s?,?)+\]')
|
||||
revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
|
||||
prog = parse_cve_tags.cve_tag
|
||||
patch_prog = parse_cve_tags.patch_cve_tag
|
||||
signoff_prog = parse_signed_off_by.signed_off_by
|
||||
revert_shortlog_regex = pyparsing.Regex('Revert\s+".*"')
|
||||
maxlength = 90
|
||||
@@ -143,27 +140,6 @@ class TestMbox(base.Base):
|
||||
if not commit.commit_message.strip():
|
||||
self.fail('Please include a commit message on your patch explaining the change', commit=commit)
|
||||
|
||||
def test_cve_presence_in_commit_message(self):
|
||||
if self.unidiff_parse_error:
|
||||
self.skip('Parse error %s' % self.unidiff_parse_error)
|
||||
|
||||
# we are just interested in series that introduce CVE patches, thus discard other
|
||||
# possibilities: modification to current CVEs, patch directly introduced into the
|
||||
# recipe, upgrades already including the CVE, etc.
|
||||
new_patches = [p for p in self.patchset if p.path.endswith('.patch') and p.is_added_file]
|
||||
if not new_patches:
|
||||
self.skip('No new patches introduced')
|
||||
|
||||
for commit in TestMbox.commits:
|
||||
# skip those patches that revert older commits, these do not required the tag presence
|
||||
if self.revert_shortlog_regex.search_string(commit.shortlog):
|
||||
continue
|
||||
if not self.patch_prog.search_string(commit.payload):
|
||||
self.skip("No CVE tag in added patch, so not needed in mbox")
|
||||
elif not self.prog.search_string(commit.payload):
|
||||
self.fail('A CVE tag should be provided in the commit message with format: "CVE: CVE-YYYY-XXXX"',
|
||||
commit=commit)
|
||||
|
||||
def test_bugzilla_entry_format(self):
|
||||
for commit in TestMbox.commits:
|
||||
if not self.rexp_detect.search_string(commit.commit_message):
|
||||
|
||||
Reference in New Issue
Block a user