summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDhruva Gole <goledhruva@gmail.com>2021-11-30 11:13:35 +0530
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-03 23:37:16 +0000
commitaec629185efe563c361844049b1009bc99a4f4fc (patch)
tree1967d9e80b6869ad3e71a076d904c81adb54d128 /scripts
parent10c55a23bd5f1f73eaab56d3d7eb0e6df492254a (diff)
downloadpoky-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.py6
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 @@
6import glob 6import glob
7import os 7import os
8import unittest 8import unittest
9import re
9from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures 10from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures
10from checklayer.case import OECheckLayerTestCase 11from 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'],