diff options
author | Trevor Gamblin <tgamblin@baylibre.com> | 2023-09-13 13:00:46 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-14 15:20:08 +0100 |
commit | 4a6f38c5327b40a45c340af49fee9a0d5cc890bd (patch) | |
tree | 669ae555ecc031990579baa207d40f38ab7e1335 /meta/lib/patchtest/tests/test_mbox_author.py | |
parent | e12e6d94ecbea6e0dafc080f2f196e12228730eb (diff) | |
download | poky-4a6f38c5327b40a45c340af49fee9a0d5cc890bd.tar.gz |
patchtest: Add tests from patchtest oe repo
Copy the core components of the patchtest-oe repo into
meta/lib/patchtest in oe-core.
(From OE-Core rev: 257f64f4e4414b78981104aec132b067beb5a92a)
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/patchtest/tests/test_mbox_author.py')
-rw-r--r-- | meta/lib/patchtest/tests/test_mbox_author.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/patchtest/tests/test_mbox_author.py b/meta/lib/patchtest/tests/test_mbox_author.py new file mode 100644 index 0000000000..6c79f164d4 --- /dev/null +++ b/meta/lib/patchtest/tests/test_mbox_author.py | |||
@@ -0,0 +1,29 @@ | |||
1 | # Checks related to the patch's author | ||
2 | # | ||
3 | # Copyright (C) 2016 Intel Corporation | ||
4 | # | ||
5 | # SPDX-License-Identifier: GPL-2.0 | ||
6 | |||
7 | import base | ||
8 | import re | ||
9 | |||
10 | class Author(base.Base): | ||
11 | |||
12 | auh_email = '<auh@auh.yoctoproject.org>' | ||
13 | |||
14 | invalids = [re.compile("^Upgrade Helper.+"), | ||
15 | re.compile(re.escape(auh_email)), | ||
16 | re.compile("uh@not\.set"), | ||
17 | re.compile("\S+@example\.com")] | ||
18 | |||
19 | |||
20 | def test_author_valid(self): | ||
21 | for commit in self.commits: | ||
22 | for invalid in self.invalids: | ||
23 | if invalid.search(commit.author): | ||
24 | self.fail('Invalid author %s' % commit.author, 'Resend the series with a valid patch\'s author', commit) | ||
25 | |||
26 | def test_non_auh_upgrade(self): | ||
27 | for commit in self.commits: | ||
28 | if self.auh_email in commit.payload: | ||
29 | self.fail('Invalid author %s in commit message' % self.auh_email, 'Resend the series with a valid patch\'s author', commit) | ||