diff options
Diffstat (limited to 'meta/lib/patchtest/tests/test_patch_cve.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_patch_cve.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/patchtest/tests/test_patch_cve.py b/meta/lib/patchtest/tests/test_patch_cve.py index 144e130707..0ae85adcf9 100644 --- a/meta/lib/patchtest/tests/test_patch_cve.py +++ b/meta/lib/patchtest/tests/test_patch_cve.py | |||
@@ -19,12 +19,12 @@ | |||
19 | 19 | ||
20 | import base | 20 | import base |
21 | import os | 21 | import os |
22 | import re | 22 | import pyparsing |
23 | 23 | ||
24 | class CVE(base.Base): | 24 | class CVE(base.Base): |
25 | 25 | ||
26 | re_cve_pattern = re.compile("CVE\-\d{4}\-\d+", re.IGNORECASE) | 26 | re_cve_pattern = pyparsing.Regex("CVE\-\d{4}\-\d+") |
27 | re_cve_payload_tag = re.compile("\+CVE:(\s+CVE\-\d{4}\-\d+)+") | 27 | re_cve_payload_tag = pyparsing.Regex("\+CVE:(\s+CVE\-\d{4}\-\d+)+") |
28 | 28 | ||
29 | def setUp(self): | 29 | def setUp(self): |
30 | if self.unidiff_parse_error: | 30 | if self.unidiff_parse_error: |
@@ -39,10 +39,10 @@ class CVE(base.Base): | |||
39 | 39 | ||
40 | def test_cve_tag_format(self): | 40 | def test_cve_tag_format(self): |
41 | for commit in CVE.commits: | 41 | for commit in CVE.commits: |
42 | if self.re_cve_pattern.search(commit.shortlog) or self.re_cve_pattern.search(commit.commit_message): | 42 | if self.re_cve_pattern.search_string(commit.shortlog) or self.re_cve_pattern.search_string(commit.commit_message): |
43 | tag_found = False | 43 | tag_found = False |
44 | for line in commit.payload.splitlines(): | 44 | for line in commit.payload.splitlines(): |
45 | if self.re_cve_payload_tag.match(line): | 45 | if self.re_cve_payload_tag.search_string(line): |
46 | tag_found = True | 46 | tag_found = True |
47 | break | 47 | break |
48 | if not tag_found: | 48 | if not tag_found: |