From aec629185efe563c361844049b1009bc99a4f4fc Mon Sep 17 00:00:00 2001 From: Dhruva Gole Date: Tue, 30 Nov 2021 11:13:35 +0530 Subject: 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 Signed-off-by: Richard Purdie --- scripts/lib/checklayer/cases/common.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/lib/checklayer/cases/common.py') 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'], -- cgit v1.2.3-54-g00ecf