diff options
author | Thomas Roos <throos@amazon.de> | 2023-04-14 16:31:40 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-04-20 11:56:05 +0100 |
commit | 67e22b9fc9c7dc7bdedf07f1c2d64f61d569b89e (patch) | |
tree | c7fdebedda55db00bda6084d8a259a7773821648 /meta/lib/oeqa/selftest/context.py | |
parent | d8e9c1c0496283b36cd1b76b21e0538a45201524 (diff) | |
download | poky-67e22b9fc9c7dc7bdedf07f1c2d64f61d569b89e.tar.gz |
oeqa/selftest: Use SSTATE_DIR of parent build dir
This will configure the build-st/conf/local.conf with the SSTATE_DIR
of the parent build dir to speed up the build, test, dev process.
(From OE-Core rev: 71dca60ddcf4370ff7e91de6ddf8a7d4cf76db50)
Signed-off-by: Thomas Roos <throos@amazon.de>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/context.py')
-rw-r--r-- | meta/lib/oeqa/selftest/context.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 0a7a9da72a..f2a5ba792f 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
@@ -16,6 +16,7 @@ from random import choice | |||
16 | import oeqa | 16 | import oeqa |
17 | import oe | 17 | import oe |
18 | import bb.utils | 18 | import bb.utils |
19 | import bb.tinfoil | ||
19 | 20 | ||
20 | from oeqa.core.context import OETestContext, OETestContextExecutor | 21 | from oeqa.core.context import OETestContext, OETestContextExecutor |
21 | from oeqa.core.exception import OEQAPreRun, OEQATestNotFound | 22 | from oeqa.core.exception import OEQAPreRun, OEQATestNotFound |
@@ -79,6 +80,12 @@ class OESelftestTestContext(OETestContext): | |||
79 | self.removebuilddir = removebuilddir | 80 | self.removebuilddir = removebuilddir |
80 | 81 | ||
81 | def setup_builddir(self, suffix, selftestdir, suite): | 82 | def setup_builddir(self, suffix, selftestdir, suite): |
83 | # Get SSTATE_DIR from the parent build dir | ||
84 | with bb.tinfoil.Tinfoil(tracking=True) as tinfoil: | ||
85 | tinfoil.prepare(quiet=2, config_only=True) | ||
86 | d = tinfoil.config_data | ||
87 | sstatedir = str(d.getVar('SSTATE_DIR')) | ||
88 | |||
82 | builddir = os.environ['BUILDDIR'] | 89 | builddir = os.environ['BUILDDIR'] |
83 | if not selftestdir: | 90 | if not selftestdir: |
84 | selftestdir = get_test_layer() | 91 | selftestdir = get_test_layer() |
@@ -118,6 +125,9 @@ class OESelftestTestContext(OETestContext): | |||
118 | if os.environ[e].endswith(builddir): | 125 | if os.environ[e].endswith(builddir): |
119 | os.environ[e] = os.environ[e].replace(builddir, newbuilddir) | 126 | os.environ[e] = os.environ[e].replace(builddir, newbuilddir) |
120 | 127 | ||
128 | # Set SSTATE_DIR to match the parent SSTATE_DIR | ||
129 | subprocess.check_output("echo 'SSTATE_DIR ?= \"%s\"' >> %s/conf/local.conf" % (sstatedir, newbuilddir), cwd=newbuilddir, shell=True) | ||
130 | |||
121 | os.chdir(newbuilddir) | 131 | os.chdir(newbuilddir) |
122 | 132 | ||
123 | def patch_test(t): | 133 | def patch_test(t): |