test_metadata_summary.py 994 B

12345678910111213141516171819202122232425262728293031
  1. # Checks related to the patch's summary metadata variable
  2. #
  3. # Copyright (C) 2016 Intel Corporation
  4. #
  5. # SPDX-License-Identifier: GPL-2.0-only
  6. import base
  7. from data import PatchTestInput
  8. class Summary(base.Metadata):
  9. metadata = 'SUMMARY'
  10. def setUp(self):
  11. # these tests just make sense on patches that can be merged
  12. if not PatchTestInput.repo.canbemerged:
  13. self.skip('Patch cannot be merged')
  14. def test_summary_presence(self):
  15. if not self.added:
  16. self.skip('No added recipes, skipping test')
  17. for pn in self.added:
  18. # we are not interested in images
  19. if 'core-image' in pn:
  20. continue
  21. rd = self.tinfoil.parse_recipe(pn)
  22. summary = rd.getVar(self.metadata)
  23. # "${PN} version ${PN}-${PR}" is the default, so fail if default
  24. if summary.startswith('%s version' % pn):
  25. self.fail('%s is missing in newly added recipe' % self.metadata)