diff options
-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): |