Skip to contentSkip to conversation

yocto-check-layer: Address Bug#11131

PATCH New Dhruva Gole 1 participant 1 message Nov 30, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 yocto-check-layer: Address Bug#11131

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.

---
 scripts/lib/checklayer/cases/common.py | 6 ++++++
 1 file changed, 6 insertions(+)
scripts/lib/checklayer/cases/common.py +6 -0
index b82304e361..8d4aab7973 100644
@@ -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'],
Signature · 1 line
2.25.1