diff options
| author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2017-02-21 14:33:07 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:08 +0000 |
| commit | 9365e5f7a986fc1991f53a675e2186f8459d8a79 (patch) | |
| tree | 57ddf6821d0963fc6e1da3b047cafefc6cd1f66b /meta/lib/oeqa/selftest/devtool.py | |
| parent | 093f673b2a0afe968101c431914b91940b8abf70 (diff) | |
| download | poky-9365e5f7a986fc1991f53a675e2186f8459d8a79.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)
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.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index 79a4b1fbaf..8bf9f05bb9 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
| @@ -9,7 +9,8 @@ import fnmatch | |||
| 9 | 9 | ||
| 10 | import oeqa.utils.ftools as ftools | 10 | import oeqa.utils.ftools as ftools |
| 11 | from oeqa.selftest.base import oeSelfTest | 11 | from oeqa.selftest.base import oeSelfTest |
| 12 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, runqemu, get_test_layer | 12 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer |
| 13 | from oeqa.utils.commands import get_bb_vars, runqemu, get_test_layer | ||
| 13 | from oeqa.utils.decorators import testcase | 14 | from oeqa.utils.decorators import testcase |
| 14 | 15 | ||
| 15 | class DevtoolBase(oeSelfTest): | 16 | class DevtoolBase(oeSelfTest): |
| @@ -117,6 +118,20 @@ class DevtoolBase(oeSelfTest): | |||
| 117 | 118 | ||
| 118 | class DevtoolTests(DevtoolBase): | 119 | class DevtoolTests(DevtoolBase): |
| 119 | 120 | ||
| 121 | @classmethod | ||
| 122 | def setUpClass(cls): | ||
| 123 | bb_vars = get_bb_vars(['TOPDIR', 'SSTATE_DIR']) | ||
| 124 | cls.original_sstate = bb_vars['SSTATE_DIR'] | ||
| 125 | cls.devtool_sstate = os.path.join(bb_vars['TOPDIR'], 'sstate_devtool') | ||
| 126 | cls.sstate_conf = 'SSTATE_DIR = "%s"\n' % cls.devtool_sstate | ||
| 127 | cls.sstate_conf += ('SSTATE_MIRRORS += "file://.* file:///%s/PATH"\n' | ||
| 128 | % cls.original_sstate) | ||
| 129 | |||
| 130 | @classmethod | ||
| 131 | def tearDownClass(cls): | ||
| 132 | cls.log.debug('Deleting devtool sstate cache on %s' % cls.devtool_sstate) | ||
| 133 | runCmd('rm -rf %s' % cls.devtool_sstate) | ||
| 134 | |||
| 120 | def setUp(self): | 135 | def setUp(self): |
| 121 | """Test case setup function""" | 136 | """Test case setup function""" |
| 122 | super(DevtoolTests, self).setUp() | 137 | super(DevtoolTests, self).setUp() |
| @@ -124,6 +139,7 @@ class DevtoolTests(DevtoolBase): | |||
| 124 | self.assertTrue(not os.path.exists(self.workspacedir), | 139 | self.assertTrue(not os.path.exists(self.workspacedir), |
| 125 | 'This test cannot be run with a workspace directory ' | 140 | 'This test cannot be run with a workspace directory ' |
| 126 | 'under the build directory') | 141 | 'under the build directory') |
| 142 | self.append_config(self.sstate_conf) | ||
| 127 | 143 | ||
| 128 | def _check_src_repo(self, repo_dir): | 144 | def _check_src_repo(self, repo_dir): |
| 129 | """Check srctree git repository""" | 145 | """Check srctree git repository""" |
