summaryrefslogtreecommitdiffstats
path: root/scripts/lib/compatlayer/cases/bsp.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2017-02-20 15:12:49 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-04 23:18:19 +0000
commit93633edcf84dbf5d97a43cb8d1ebff790a6ab334 (patch)
tree5d6a97536fd882c475b43f76c735d171d5b5df26 /scripts/lib/compatlayer/cases/bsp.py
parent28376f9552087bef93919cc5cf4a8e88a02f6d04 (diff)
downloadpoky-93633edcf84dbf5d97a43cb8d1ebff790a6ab334.tar.gz
yocto-compat-layer.py: Add script to YP Compatible Layer validation
The yocto-compat-layer script serves as a tool to validate the alignament of a layer with YP Compatible Layers Programme [1], is based on an RFC sent to the ML to enable automatic testing of layers [2] that wants to be YP Compatible. The tool takes an layer (or set of layers) via command line option -l and detects what kind of layer is distro, machine or software and then executes a set of tests against the layer in order to validate the compatibility. The tests currently implemented are: common.test_readme: Test if a README file exists in the layer and isn't empty. common.test_parse: Test for execute bitbake -p without errors. common.test_show_environment: Test for execute bitbake -e without errors. common.test_signatures: Test executed in BSP and DISTRO layers to review doesn't comes with recipes that changes the signatures. bsp.test_bsp_defines_machines: Test if a BSP layers has machines configurations. bsp.test_bsp_no_set_machine: Test the BSP layer to doesn't set machine at adding layer. distro.test_distro_defines_distros: Test if a DISTRO layers has distro configurations. distro.test_distro_no_set_distro: Test the DISTRO layer to doesn't set distro at adding layer. Example of usage: $ source oe-init-build-env $ yocto-compat-layer.py LAYER_DIR [YOCTO #10596] [1] https://www.yoctoproject.org/webform/yocto-project-compatible-registration [2] https://lists.yoctoproject.org/pipermail/yocto-ab/2016-October/001801.html (From OE-Core rev: e14596ac33329bc61fe38a6582fa91f76ff5b147) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/compatlayer/cases/bsp.py')
-rw-r--r--scripts/lib/compatlayer/cases/bsp.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/lib/compatlayer/cases/bsp.py b/scripts/lib/compatlayer/cases/bsp.py
new file mode 100644
index 0000000000..5d9bf93e4a
--- /dev/null
+++ b/scripts/lib/compatlayer/cases/bsp.py
@@ -0,0 +1,26 @@
1# Copyright (C) 2017 Intel Corporation
2# Released under the MIT license (see COPYING.MIT)
3
4import unittest
5
6from compatlayer import LayerType
7from compatlayer.case import OECompatLayerTestCase
8
9class BSPCompatLayer(OECompatLayerTestCase):
10 @classmethod
11 def setUpClass(self):
12 if self.tc.layer['type'] != LayerType.BSP:
13 raise unittest.SkipTest("BSPCompatLayer: Layer %s isn't BSP one." %\
14 self.tc.layer['name'])
15
16 def test_bsp_defines_machines(self):
17 self.assertTrue(self.tc.layer['conf']['machines'],
18 "Layer is BSP but doesn't defines machines.")
19
20 def test_bsp_no_set_machine(self):
21 from oeqa.utils.commands import get_bb_var
22
23 machine = get_bb_var('MACHINE')
24 self.assertEqual(self.td['bbvars']['MACHINE'], machine,
25 msg="Layer %s modified machine %s -> %s" % \
26 (self.tc.layer['name'], self.td['bbvars']['MACHINE'], machine))