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-06 22:48:04 +0100 |
commit | a26f23d3ce8f7e9f59dbc9bf27516377fd7a0a6d (patch) | |
tree | 191b2c53e3d3b3459ea1beb7e7d9ac8e4d11ff0d /meta/classes | |
parent | 0440b5ace411c61f802376d4e1c9eac93e72d65f (diff) | |
download | openembedded-core-a26f23d3ce8f7e9f59dbc9bf27516377fd7a0a6d.tar.gz openembedded-core-a26f23d3ce8f7e9f59dbc9bf27516377fd7a0a6d.tar.bz2 openembedded-core-a26f23d3ce8f7e9f59dbc9bf27516377fd7a0a6d.zip |
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]
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-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): shutil.copytree(foldername, target_folder) if not isfolder: shutil.copy2(mod.path, os.path.join(exportpath, "oeqa/runtime")) - # copy __init__.py files - oeqadir = os.path.dirname(pkgutil.get_loader("oeqa").path) - shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa")) - shutil.copy2(os.path.join(oeqadir, "runtime/__init__.py"), os.path.join(exportpath, "oeqa/runtime")) + # Get meta layer + for layer in d.getVar("BBLAYERS", True).split(): + if os.path.basename(layer) == "meta": + meta_layer = layer + break # copy oeqa/oetest.py and oeqa/runexported.py + oeqadir = os.path.join(meta_layer, "lib/oeqa") shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa")) shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath) # copy oeqa/utils/*.py |