distro.py 967 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2017 Intel Corporation
  2. #
  3. # SPDX-License-Identifier: MIT
  4. #
  5. import unittest
  6. from checklayer import LayerType
  7. from checklayer.case import OECheckLayerTestCase
  8. class DistroCheckLayer(OECheckLayerTestCase):
  9. @classmethod
  10. def setUpClass(self):
  11. if self.tc.layer['type'] not in (LayerType.DISTRO, LayerType.CORE):
  12. raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\
  13. self.tc.layer['name'])
  14. def test_distro_defines_distros(self):
  15. self.assertTrue(self.tc.layer['conf']['distros'],
  16. "Layer is BSP but doesn't defines machines.")
  17. def test_distro_no_set_distros(self):
  18. from oeqa.utils.commands import get_bb_var
  19. distro = get_bb_var('DISTRO')
  20. self.assertEqual(self.td['bbvars']['DISTRO'], distro,
  21. msg="Layer %s modified distro %s -> %s" % \
  22. (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))