diff options
author | Dhruva Gole <goledhruva@gmail.com> | 2021-11-30 11:13:35 +0530 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-03 23:37:16 +0000 |
commit | aec629185efe563c361844049b1009bc99a4f4fc (patch) | |
tree | 1967d9e80b6869ad3e71a076d904c81adb54d128 /scripts | |
parent | 10c55a23bd5f1f73eaab56d3d7eb0e6df492254a (diff) | |
download | poky-aec629185efe563c361844049b1009bc99a4f4fc.tar.gz |
yocto-check-layer: Add additional README checks
This adds:
- Test case to review if the README file specifies the maintainer.
- Test case to review if the README file specifies the word patch.
- Test case to review if the README file contains an email address.
[YOCTO #11131]
(From OE-Core rev: 5d4937bce191b7e22b807c0595d4845c88ecc560)
Signed-off-by: Dhruva Gole <goledhruva@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/checklayer/cases/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py index 4495f71b24..52c786f77b 100644 --- a/scripts/lib/checklayer/cases/common.py +++ b/scripts/lib/checklayer/cases/common.py | |||
@@ -6,6 +6,7 @@ | |||
6 | import glob | 6 | import glob |
7 | import os | 7 | import os |
8 | import unittest | 8 | import unittest |
9 | import re | ||
9 | from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures | 10 | from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures |
10 | from checklayer.case import OECheckLayerTestCase | 11 | from checklayer.case import OECheckLayerTestCase |
11 | 12 | ||
@@ -25,6 +26,11 @@ class CommonCheckLayer(OECheckLayerTestCase): | |||
25 | data = f.read() | 26 | data = f.read() |
26 | self.assertTrue(data, | 27 | self.assertTrue(data, |
27 | msg="Layer contains a README file but it is empty.") | 28 | msg="Layer contains a README file but it is empty.") |
29 | self.assertIn('maintainer',data) | ||
30 | self.assertIn('patch',data) | ||
31 | # Check that there is an email address in the README | ||
32 | email_regex = re.compile(r"[^@]+@[^@]+") | ||
33 | self.assertTrue(email_regex.match(data)) | ||
28 | 34 | ||
29 | def test_parse(self): | 35 | def test_parse(self): |
30 | check_command('Layer %s failed to parse.' % self.tc.layer['name'], | 36 | check_command('Layer %s failed to parse.' % self.tc.layer['name'], |