diff options
| author | Paul Barker <pbarker@konsulko.com> | 2020-06-03 21:07:38 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-18 12:25:01 +0100 |
| commit | 6d7fc2624fc195f7dc27b81d294746613c756c11 (patch) | |
| tree | e8ae92e120cba53fc59420e5c650d86b69c02206 /meta/lib | |
| parent | 11ce1ec5a6aefb7e1ee4b995d2a3c9ad689cb016 (diff) | |
| download | poky-6d7fc2624fc195f7dc27b81d294746613c756c11.tar.gz | |
oe-selftest: Recursively patch test case paths
This ensures that builddir is updated correctly to point to the new
selftest build directory when we're given a list of test suites instead
of a list of test cases.
(From OE-Core rev: 6812affe76ee2704a8008d58ffc6a2e87b543f1d)
Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 56e211d0f3c6cb84f5982e5de00faeeed69c1912)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
| -rw-r--r-- | meta/lib/oeqa/selftest/context.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/context.py b/meta/lib/oeqa/selftest/context.py index 17f2a0cf6b..ba13732253 100644 --- a/meta/lib/oeqa/selftest/context.py +++ b/meta/lib/oeqa/selftest/context.py | |||
| @@ -10,6 +10,7 @@ import glob | |||
| 10 | import sys | 10 | import sys |
| 11 | import importlib | 11 | import importlib |
| 12 | import subprocess | 12 | import subprocess |
| 13 | import unittest | ||
| 13 | from random import choice | 14 | from random import choice |
| 14 | 15 | ||
| 15 | import oeqa | 16 | import oeqa |
| @@ -60,9 +61,9 @@ class OESelftestTestContext(OETestContext): | |||
| 60 | 61 | ||
| 61 | os.chdir(newbuilddir) | 62 | os.chdir(newbuilddir) |
| 62 | 63 | ||
| 63 | for t in suite: | 64 | def patch_test(t): |
| 64 | if not hasattr(t, "tc"): | 65 | if not hasattr(t, "tc"): |
| 65 | continue | 66 | return |
| 66 | cp = t.tc.config_paths | 67 | cp = t.tc.config_paths |
| 67 | for p in cp: | 68 | for p in cp: |
| 68 | if selftestdir in cp[p] and newselftestdir not in cp[p]: | 69 | if selftestdir in cp[p] and newselftestdir not in cp[p]: |
| @@ -70,6 +71,15 @@ class OESelftestTestContext(OETestContext): | |||
| 70 | if builddir in cp[p] and newbuilddir not in cp[p]: | 71 | if builddir in cp[p] and newbuilddir not in cp[p]: |
| 71 | cp[p] = cp[p].replace(builddir, newbuilddir) | 72 | cp[p] = cp[p].replace(builddir, newbuilddir) |
| 72 | 73 | ||
| 74 | def patch_suite(s): | ||
| 75 | for x in s: | ||
| 76 | if isinstance(x, unittest.TestSuite): | ||
| 77 | patch_suite(x) | ||
| 78 | else: | ||
| 79 | patch_test(x) | ||
| 80 | |||
| 81 | patch_suite(suite) | ||
| 82 | |||
| 73 | return (builddir, newbuilddir) | 83 | return (builddir, newbuilddir) |
| 74 | 84 | ||
| 75 | def prepareSuite(self, suites, processes): | 85 | def prepareSuite(self, suites, processes): |
