| Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | # Copyright (C) 2017 Intel Corporation | 
| Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 2 | # | 
|  | 3 | # SPDX-License-Identifier: MIT | 
|  | 4 | # | 
| Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 5 |  | 
|  | 6 | import unittest | 
|  | 7 |  | 
|  | 8 | from checklayer import LayerType | 
|  | 9 | from checklayer.case import OECheckLayerTestCase | 
|  | 10 |  | 
|  | 11 | class 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)) |