diff options
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_mbox.py | 24 |
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 | ||
7 | import base | 7 | import base |
8 | import collections | 8 | import collections |
9 | import parse_cve_tags | ||
10 | import parse_shortlog | 9 | import parse_shortlog |
11 | import parse_signed_off_by | 10 | import parse_signed_off_by |
12 | import pyparsing | 11 | import 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): |