summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/layerindexlib/tests/common.py
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2018-07-23 22:29:11 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-02 10:18:27 +0100
commit1ac19d1bf111a4836625f5cbb28a751d5c427395 (patch)
treeae9fa1448b425522952cbc8af90cf79912c746b1 /bitbake/lib/layerindexlib/tests/common.py
parent0dea95093115acc08f6ad19dc931d532a601cbec (diff)
downloadpoky-1ac19d1bf111a4836625f5cbb28a751d5c427395.tar.gz
bitbake: layerindexlib: Initial layer index processing module implementation
The layer index module is expected to be used by various parts of the system in order to access a layerindex-web (such as layers.openembedded.org) and perform basic processing on the information, such as dependency scanning. Along with the layerindex implementation are associated tests. The tests properly honor BB_SKIP_NETTESTS='yes' to prevent test failures. Tests Implemented: - Branch, LayerItem, LayerBranch, LayerDependency, Recipe, Machine and Distro objects - LayerIndex setup using the layers.openembedded.org restapi - LayerIndex storing and retrieving from a file - LayerIndex verify dependency resolution ordering - LayerIndex setup using simulated cooker data (Bitbake rev: fd0ee6c10dbb5592731e56f4c592fe687682a3e6) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/layerindexlib/tests/common.py')
-rw-r--r--bitbake/lib/layerindexlib/tests/common.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/bitbake/lib/layerindexlib/tests/common.py b/bitbake/lib/layerindexlib/tests/common.py
new file mode 100644
index 0000000000..22a54585c8
--- /dev/null
+++ b/bitbake/lib/layerindexlib/tests/common.py
@@ -0,0 +1,43 @@
1# Copyright (C) 2017-2018 Wind River Systems, Inc.
2#
3# This program is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License version 2 as
5# published by the Free Software Foundation.
6#
7# This program is distributed in the hope that it will be useful,
8# but WITHOUT ANY WARRANTY; without even the implied warranty of
9# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10# See the GNU General Public License for more details.
11#
12# You should have received a copy of the GNU General Public License
13# along with this program; if not, write to the Free Software
14# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15
16import unittest
17import tempfile
18import os
19import bb
20
21import logging
22
23class LayersTest(unittest.TestCase):
24
25 def setUp(self):
26 self.origdir = os.getcwd()
27 self.d = bb.data.init()
28 # At least one variable needs to be set
29 self.d.setVar('DL_DIR', os.getcwd())
30
31 if os.environ.get("BB_SKIP_NETTESTS") == "yes":
32 self.d.setVar('BB_NO_NETWORK', '1')
33
34 self.tempdir = tempfile.mkdtemp()
35 self.logger = logging.getLogger("BitBake")
36
37 def tearDown(self):
38 os.chdir(self.origdir)
39 if os.environ.get("BB_TMPDIR_NOCLEAN") == "yes":
40 print("Not cleaning up %s. Please remove manually." % self.tempdir)
41 else:
42 bb.utils.prunedir(self.tempdir)
43