Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | # Copyright (C) 2017 Intel Corporation |
| 2 | # Released under the MIT license (see COPYING.MIT) |
| 3 | |
| 4 | import unittest |
| 5 | |
| 6 | from checklayer import LayerType |
| 7 | from checklayer.case import OECheckLayerTestCase |
| 8 | |
| 9 | class DistroCheckLayer(OECheckLayerTestCase): |
| 10 | @classmethod |
| 11 | def setUpClass(self): |
| 12 | if self.tc.layer['type'] != LayerType.DISTRO: |
| 13 | raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\ |
| 14 | self.tc.layer['name']) |
| 15 | |
| 16 | def test_distro_defines_distros(self): |
| 17 | self.assertTrue(self.tc.layer['conf']['distros'], |
| 18 | "Layer is BSP but doesn't defines machines.") |
| 19 | |
| 20 | def test_distro_no_set_distros(self): |
| 21 | from oeqa.utils.commands import get_bb_var |
| 22 | |
| 23 | distro = get_bb_var('DISTRO') |
| 24 | self.assertEqual(self.td['bbvars']['DISTRO'], distro, |
| 25 | msg="Layer %s modified distro %s -> %s" % \ |
| 26 | (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro)) |