blob: f0bee5493c2b805f99f11376101bdc56c89dc625 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001# Copyright (C) 2017 Intel Corporation
Brad Bishopc342db32019-05-15 21:57:59 -04002#
3# SPDX-License-Identifier: MIT
4#
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6import unittest
7
8from checklayer import LayerType
9from checklayer.case import OECheckLayerTestCase
10
11class DistroCheckLayer(OECheckLayerTestCase):
12 @classmethod
13 def setUpClass(self):
14 if self.tc.layer['type'] != LayerType.DISTRO:
15 raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\
16 self.tc.layer['name'])
17
18 def test_distro_defines_distros(self):
19 self.assertTrue(self.tc.layer['conf']['distros'],
20 "Layer is BSP but doesn't defines machines.")
21
22 def test_distro_no_set_distros(self):
23 from oeqa.utils.commands import get_bb_var
24
25 distro = get_bb_var('DISTRO')
26 self.assertEqual(self.td['bbvars']['DISTRO'], distro,
27 msg="Layer %s modified distro %s -> %s" % \
28 (self.tc.layer['name'], self.td['bbvars']['DISTRO'], distro))