blob: df1b3035eb347cd76c7df551ee938c14b70ee6a8 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4import unittest
5
6from checklayer import LayerType
7from checklayer.case import OECheckLayerTestCase
8
9class 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))