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:36:21 +0000
commit5d4937bce191b7e22b807c0595d4845c88ecc560 (patch)
tree0166cb51d9e1f64ecb55abdd954055cdeeac91f4 /scripts
parentf5d63bb34627825bd9ff07ba686ce7c05f4db561 (diff)
downloadopenembedded-core-contrib-5d4937bce191b7e22b807c0595d4845c88ecc560.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] 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 @@
import glob
import os
import unittest
+import re
from checklayer import get_signatures, LayerType, check_command, get_depgraph, compare_signatures
from checklayer.case import OECheckLayerTestCase
@@ -25,6 +26,11 @@ class CommonCheckLayer(OECheckLayerTestCase):
data = f.read()
self.assertTrue(data,
msg="Layer contains a README file but it is empty.")
+ self.assertIn('maintainer',data)
+ self.assertIn('patch',data)
+ # Check that there is an email address in the README
+ email_regex = re.compile(r"[^@]+@[^@]+")
+ self.assertTrue(email_regex.match(data))
def test_parse(self):
check_command('Layer %s failed to parse.' % self.tc.layer['name'],