diff options
Diffstat (limited to 'meta/lib/patchtest')
| -rw-r--r-- | meta/lib/patchtest/tests/test_mbox.py | 14 | ||||
| -rw-r--r-- | meta/lib/patchtest/tests/test_patch.py | 4 |
2 files changed, 9 insertions, 9 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox.py b/meta/lib/patchtest/tests/test_mbox.py index 95002c9e2a..2449564d0f 100644 --- a/meta/lib/patchtest/tests/test_mbox.py +++ b/meta/lib/patchtest/tests/test_mbox.py | |||
| @@ -100,7 +100,7 @@ class TestMbox(base.Base): | |||
| 100 | self.skip("Skipping merge test since patch is not intended for master branch. Target detected is %s" % PatchTestInput.repo.branch) | 100 | self.skip("Skipping merge test since patch is not intended for master branch. Target detected is %s" % PatchTestInput.repo.branch) |
| 101 | if not PatchTestInput.repo.ismerged: | 101 | if not PatchTestInput.repo.ismerged: |
| 102 | commithash, author, date, shortlog = headlog() | 102 | commithash, author, date, shortlog = headlog() |
| 103 | self.fail('Series does not apply on top of target branch. Rebase your series and ensure the target is correct', | 103 | self.fail('Series does not apply on top of target branch %s' % PatchTestInput.repo.branch, |
| 104 | data=[('Targeted branch', '%s (currently at %s)' % (PatchTestInput.repo.branch, commithash))]) | 104 | data=[('Targeted branch', '%s (currently at %s)' % (PatchTestInput.repo.branch, commithash))]) |
| 105 | 105 | ||
| 106 | def test_target_mailing_list(self): | 106 | def test_target_mailing_list(self): |
| @@ -114,7 +114,7 @@ class TestMbox(base.Base): | |||
| 114 | for commit in TestMbox.commits: | 114 | for commit in TestMbox.commits: |
| 115 | match = project_regex.search_string(commit.subject) | 115 | match = project_regex.search_string(commit.subject) |
| 116 | if match: | 116 | if match: |
| 117 | self.fail('Series sent to the wrong mailing list. Check the project\'s README (%s) and send the patch to the indicated list' % match.group('project'), | 117 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', |
| 118 | commit=commit) | 118 | commit=commit) |
| 119 | 119 | ||
| 120 | for patch in self.patchset: | 120 | for patch in self.patchset: |
| @@ -122,7 +122,7 @@ class TestMbox(base.Base): | |||
| 122 | base_path = folders[0] | 122 | base_path = folders[0] |
| 123 | for project in [self.bitbake, self.doc, self.oe, self.poky]: | 123 | for project in [self.bitbake, self.doc, self.oe, self.poky]: |
| 124 | if base_path in project.paths: | 124 | if base_path in project.paths: |
| 125 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists. Send the series again to the correct mailing list (ML)', | 125 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', |
| 126 | data=[('Suggested ML', '%s [%s]' % (project.listemail, project.gitrepo)), | 126 | data=[('Suggested ML', '%s [%s]' % (project.listemail, project.gitrepo)), |
| 127 | ('Patch\'s path:', patch.path)]) | 127 | ('Patch\'s path:', patch.path)]) |
| 128 | 128 | ||
| @@ -130,18 +130,18 @@ class TestMbox(base.Base): | |||
| 130 | if base_path.startswith('scripts'): | 130 | if base_path.startswith('scripts'): |
| 131 | for poky_file in self.poky_scripts: | 131 | for poky_file in self.poky_scripts: |
| 132 | if patch.path.startswith(poky_file): | 132 | if patch.path.startswith(poky_file): |
| 133 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists. Send the series again to the correct mailing list (ML)', | 133 | self.fail('Series sent to the wrong mailing list or some patches from the series correspond to different mailing lists', |
| 134 | data=[('Suggested ML', '%s [%s]' % (self.poky.listemail, self.poky.gitrepo)),('Patch\'s path:', patch.path)]) | 134 | data=[('Suggested ML', '%s [%s]' % (self.poky.listemail, self.poky.gitrepo)),('Patch\'s path:', patch.path)]) |
| 135 | 135 | ||
| 136 | def test_mbox_format(self): | 136 | def test_mbox_format(self): |
| 137 | if self.unidiff_parse_error: | 137 | if self.unidiff_parse_error: |
| 138 | self.fail('Series cannot be parsed correctly due to malformed diff lines. Create the series again using git-format-patch and ensure it can be applied using git am', | 138 | self.fail('Series has malformed diff lines. Create the series again using git-format-patch and ensure it applies using git am', |
| 139 | data=[('Diff line',self.unidiff_parse_error)]) | 139 | data=[('Diff line',self.unidiff_parse_error)]) |
| 140 | 140 | ||
| 141 | def test_commit_message_presence(self): | 141 | def test_commit_message_presence(self): |
| 142 | for commit in TestMbox.commits: | 142 | for commit in TestMbox.commits: |
| 143 | if not commit.commit_message.strip(): | 143 | if not commit.commit_message.strip(): |
| 144 | self.fail('Mbox is missing a descriptive commit message. Please include a commit message on your patch explaining the change', commit=commit) | 144 | self.fail('Please include a commit message on your patch explaining the change', commit=commit) |
| 145 | 145 | ||
| 146 | def test_cve_presence_in_commit_message(self): | 146 | def test_cve_presence_in_commit_message(self): |
| 147 | if self.unidiff_parse_error: | 147 | if self.unidiff_parse_error: |
| @@ -161,7 +161,7 @@ class TestMbox(base.Base): | |||
| 161 | if not self.patch_prog.search_string(commit.payload): | 161 | if not self.patch_prog.search_string(commit.payload): |
| 162 | self.skip("No CVE tag in added patch, so not needed in mbox") | 162 | self.skip("No CVE tag in added patch, so not needed in mbox") |
| 163 | elif not self.prog.search_string(commit.payload): | 163 | elif not self.prog.search_string(commit.payload): |
| 164 | self.fail('Missing or incorrectly formatted CVE tag in mbox. Correct or include the CVE tag in the mbox with format: "CVE: CVE-YYYY-XXXX"', | 164 | self.fail('A CVE tag should be provided in the commit message with format: "CVE: CVE-YYYY-XXXX"', |
| 165 | commit=commit) | 165 | commit=commit) |
| 166 | 166 | ||
| 167 | def test_bugzilla_entry_format(self): | 167 | def test_bugzilla_entry_format(self): |
diff --git a/meta/lib/patchtest/tests/test_patch.py b/meta/lib/patchtest/tests/test_patch.py index b6904b185f..65d0f930b0 100644 --- a/meta/lib/patchtest/tests/test_patch.py +++ b/meta/lib/patchtest/tests/test_patch.py | |||
| @@ -50,7 +50,7 @@ class TestPatch(base.Base): | |||
| 50 | for newpatch in TestPatch.newpatches: | 50 | for newpatch in TestPatch.newpatches: |
| 51 | payload = newpatch.__str__() | 51 | payload = newpatch.__str__() |
| 52 | if not self.upstream_status_regex.search_string(payload): | 52 | if not self.upstream_status_regex.search_string(payload): |
| 53 | self.fail('Added patch file is missing Upstream-Status in the header. Add Upstream-Status: <Valid status> to the header', | 53 | self.fail('Added patch file is missing Upstream-Status: <Valid status> in the commit message', |
| 54 | data=[('Standard format', self.standard_format), ('Valid status', self.valid_status)]) | 54 | data=[('Standard format', self.standard_format), ('Valid status', self.valid_status)]) |
| 55 | for line in payload.splitlines(): | 55 | for line in payload.splitlines(): |
| 56 | if self.patchmetadata_regex.match(line): | 56 | if self.patchmetadata_regex.match(line): |
| @@ -87,7 +87,7 @@ class TestPatch(base.Base): | |||
| 87 | if TestPatch.prog.search_string(payload): | 87 | if TestPatch.prog.search_string(payload): |
| 88 | break | 88 | break |
| 89 | else: | 89 | else: |
| 90 | self.fail('A patch file has been added, but does not have a Signed-off-by tag. Sign off the added patch file (%s)' % newpatch.path) | 90 | self.fail('A patch file has been added without a Signed-off-by tag. Sign off the added patch file (%s)' % newpatch.path) |
| 91 | 91 | ||
| 92 | def test_cve_tag_format(self): | 92 | def test_cve_tag_format(self): |
| 93 | for commit in TestPatch.commits: | 93 | for commit in TestPatch.commits: |
