aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/testexport.bbclass
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-07-26 09:38:56 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-08-04 15:05:47 +0100
commit0338f66c0d246c3b8d94ac68d60fbc4c314e500b (patch)
tree9a7fb5f0979aadf70d0c848e267f4c09daaa6f02 /meta/classes/testexport.bbclass
parentf1cc272e4851fd994e9d052628a747ac19f90488 (diff)
downloadopenembedded-core-contrib-0338f66c0d246c3b8d94ac68d60fbc4c314e500b.tar.gz
openembedded-core-contrib-0338f66c0d246c3b8d94ac68d60fbc4c314e500b.tar.bz2
openembedded-core-contrib-0338f66c0d246c3b8d94ac68d60fbc4c314e500b.zip
oeqa/oetest.py: Allow to export packages using symlinks
Currently packages that contains symlinks can't be extracted and exported. This allows to export extracted such packages. A nice side effect is improved readability. [YOCTO #9932] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/testexport.bbclass')
-rw-r--r--meta/classes/testexport.bbclass24
1 files changed, 5 insertions, 19 deletions
diff --git a/meta/classes/testexport.bbclass b/meta/classes/testexport.bbclass
index 15fa470785..5147020820 100644
--- a/meta/classes/testexport.bbclass
+++ b/meta/classes/testexport.bbclass
@@ -47,6 +47,7 @@ def exportTests(d,tc):
import shutil
import pkgutil
import re
+ import oe.path
exportpath = d.getVar("TEST_EXPORT_DIR", True)
@@ -103,7 +104,7 @@ def exportTests(d,tc):
isfolder = True
target_folder = os.path.join(exportpath, "oeqa", "runtime", os.path.basename(foldername))
if not os.path.exists(target_folder):
- shutil.copytree(foldername, target_folder)
+ oe.path.copytree(foldername, target_folder)
if not isfolder:
shutil.copy2(mod.path, os.path.join(exportpath, "oeqa/runtime"))
json_file = "%s.json" % mod.path.rsplit(".", 1)[0]
@@ -132,27 +133,12 @@ def exportTests(d,tc):
create_tarball(d, "testexport.tar.gz", d.getVar("TEST_EXPORT_DIR", True))
# Copy packages needed for runtime testing
- export_pkg_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True), "packages")
test_pkg_dir = d.getVar("TEST_NEEDED_PACKAGES_DIR", True)
- need_pkg_dir = False
- for root, subdirs, files in os.walk(test_pkg_dir):
- for subdir in subdirs:
- tmp_dir = os.path.join(root.replace(test_pkg_dir, "").lstrip("/"), subdir)
- new_dir = os.path.join(export_pkg_dir, tmp_dir)
- bb.utils.mkdirhier(new_dir)
-
- for f in files:
- need_pkg_dir = True
- src_f = os.path.join(root, f)
- dst_f = os.path.join(export_pkg_dir, root.replace(test_pkg_dir, "").lstrip("/"), f)
- shutil.copy2(src_f, dst_f)
-
- if need_pkg_dir:
+ if os.listdir(test_pkg_dir):
+ export_pkg_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True), "packages")
+ oe.path.copytree(test_pkg_dir, export_pkg_dir)
# Create tar file for packages needed by the DUT
create_tarball(d, "testexport_packages_%s.tar.gz" % d.getVar("MACHINE", True), export_pkg_dir)
- else:
- # Remov packages dir from exported test
- bb.utils.remove(export_pkg_dir, True)
# Copy SDK
if d.getVar("TEST_EXPORT_SDK_ENABLED", True) == "1":