diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2016-06-06 07:15:40 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-06-07 15:22:38 +0100 |
commit | d9b3ee8b38f877c1723e48f1aa311c28102786fb (patch) | |
tree | 5ba5ad84fbda7d3de15c10ff73105ea9f8565826 /meta/classes/testexport.bbclass | |
parent | 84441a96f0d369634c4a777ba3bc135a9893fc95 (diff) | |
download | poky-d9b3ee8b38f877c1723e48f1aa311c28102786fb.tar.gz |
lib/oeqa/otest.py: Fix import tests from other layers with python3
In python3 the functionality to import modules has been changed and
this broke the capability to add runtime tests from other layers.
This commit returns this capability to testimage and testexport.
[YOCTO #9705]
(From OE-Core rev: a26f23d3ce8f7e9f59dbc9bf27516377fd7a0a6d)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/testexport.bbclass')
-rw-r--r-- | meta/classes/testexport.bbclass | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/meta/classes/testexport.bbclass b/meta/classes/testexport.bbclass index 51b7d93d2b..c86eaac197 100644 --- a/meta/classes/testexport.bbclass +++ b/meta/classes/testexport.bbclass | |||
@@ -96,11 +96,13 @@ def exportTests(d,tc): | |||
96 | shutil.copytree(foldername, target_folder) | 96 | shutil.copytree(foldername, target_folder) |
97 | if not isfolder: | 97 | if not isfolder: |
98 | shutil.copy2(mod.path, os.path.join(exportpath, "oeqa/runtime")) | 98 | shutil.copy2(mod.path, os.path.join(exportpath, "oeqa/runtime")) |
99 | # copy __init__.py files | 99 | # Get meta layer |
100 | oeqadir = os.path.dirname(pkgutil.get_loader("oeqa").path) | 100 | for layer in d.getVar("BBLAYERS", True).split(): |
101 | shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa")) | 101 | if os.path.basename(layer) == "meta": |
102 | shutil.copy2(os.path.join(oeqadir, "runtime/__init__.py"), os.path.join(exportpath, "oeqa/runtime")) | 102 | meta_layer = layer |
103 | break | ||
103 | # copy oeqa/oetest.py and oeqa/runexported.py | 104 | # copy oeqa/oetest.py and oeqa/runexported.py |
105 | oeqadir = os.path.join(meta_layer, "lib/oeqa") | ||
104 | shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa")) | 106 | shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa")) |
105 | shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath) | 107 | shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath) |
106 | # copy oeqa/utils/*.py | 108 | # copy oeqa/utils/*.py |