summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/devtool.py
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-02-21 14:33:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-05-27 00:21:04 +0100
commit48a8c893ade7bb2dd1319b9c00095a86fa100ca4 (patch)
tree8663597865706d661fde1142456b0079f4e4439e /meta/lib/oeqa/selftest/devtool.py
parent078915fbf5180ebb76891737c73cdc3b20a2bfca (diff)
downloadpoky-48a8c893ade7bb2dd1319b9c00095a86fa100ca4.tar.gz
selftest: Avoid sstate corruption by calling cleansstate
Currently selftest doesn't use sstates because some tests clean sstate cache; using sstates would give a performance boost instead of building everything from scratch. With this sstates are not corrupted using different methods depending on tests: devtool: These tests needed to delete the cache so SSTATE_DIR as SSTATE_MIRRORS and set a temporal SSTATE_DIR. sstatetests: This module already used a temporal SSTATE_DIR, so just set up the SSTATE_MIRRORS. Rest: Removed cleansstate, some of them required to force a certain task, others were just removed or changed for another task. [YOCTO #10929] (From OE-Core rev: 62c61087a10cc3b26fbff32c9e2efd1704a39724) (From OE-Core rev: 44ca8b1c23e4b2cf470e9be42705e3cca23b7f85) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/devtool.py')
-rw-r--r--meta/lib/oeqa/selftest/devtool.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index e992dcf771..302ec5d42e 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -9,7 +9,8 @@ import fnmatch
9 9
10import oeqa.utils.ftools as ftools 10import oeqa.utils.ftools as ftools
11from oeqa.selftest.base import oeSelfTest 11from oeqa.selftest.base import oeSelfTest
12from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, runqemu, get_test_layer 12from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
13from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer
13from oeqa.utils.decorators import testcase 14from oeqa.utils.decorators import testcase
14 15
15class DevtoolBase(oeSelfTest): 16class DevtoolBase(oeSelfTest):
@@ -114,6 +115,20 @@ class DevtoolBase(oeSelfTest):
114 115
115class DevtoolTests(DevtoolBase): 116class DevtoolTests(DevtoolBase):
116 117
118 @classmethod
119 def setUpClass(cls):
120 bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR'])
121 cls.original_sstate = bb_vars['SSTATE_DIR']
122 cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool')
123 cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate
124 cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n'
125 % cls.original_sstate)
126
127 @classmethod
128 def tearDownClass(cls):
129 cls.log.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate)
130 runCmd('rm -rf %s' % cls.devtool_sstate)
131
117 def setUp(self): 132 def setUp(self):
118 """Test case setup function""" 133 """Test case setup function"""
119 super(DevtoolTests, self).setUp() 134 super(DevtoolTests, self).setUp()
@@ -121,6 +136,7 @@ class DevtoolTests(DevtoolBase):
121 self.assertTrue(not os.path.exists(self.workspacedir), 136 self.assertTrue(not os.path.exists(self.workspacedir),
122 'This test cannot be run with a workspace directory ' 137 'This test cannot be run with a workspace directory '
123 'under the build directory') 138 'under the build directory')
139 self.append_config(self.sstate_conf)
124 140
125 def _check_src_repo(self, repo_dir): 141 def _check_src_repo(self, repo_dir):
126 """Check srctree git repository""" 142 """Check srctree git repository"""