mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
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] (From OE-Core rev: 0338f66c0d246c3b8d94ac68d60fbc4c314e500b) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
65a03c3f94
commit
65459f5b6d
@@ -443,6 +443,8 @@ class RuntimeTestContext(TestContext):
|
||||
modules = self.getTestModules()
|
||||
bbpaths = self.d.getVar("BBPATH", True).split(":")
|
||||
|
||||
shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR", True))
|
||||
shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR", True))
|
||||
for module in modules:
|
||||
json_file = self._getJsonFile(module)
|
||||
if json_file:
|
||||
@@ -454,6 +456,8 @@ class RuntimeTestContext(TestContext):
|
||||
Extract packages that will be needed during runtime.
|
||||
"""
|
||||
|
||||
import oe.path
|
||||
|
||||
extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True)
|
||||
packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True)
|
||||
|
||||
@@ -477,13 +481,18 @@ class RuntimeTestContext(TestContext):
|
||||
dst_dir = os.path.join(packaged_path)
|
||||
|
||||
# Extract package and copy it to TEST_EXTRACTED_DIR
|
||||
if extract and not os.path.exists(dst_dir):
|
||||
pkg_dir = self._extract_in_tmpdir(pkg)
|
||||
shutil.copytree(pkg_dir, dst_dir)
|
||||
pkg_dir = self._extract_in_tmpdir(pkg)
|
||||
if extract:
|
||||
|
||||
# Same package used for more than one test,
|
||||
# don't need to extract again.
|
||||
if os.path.exists(dst_dir):
|
||||
continue
|
||||
oe.path.copytree(pkg_dir, dst_dir)
|
||||
shutil.rmtree(pkg_dir)
|
||||
|
||||
# Copy package to TEST_PACKAGED_DIR
|
||||
elif not extract:
|
||||
else:
|
||||
self._copy_package(pkg)
|
||||
|
||||
def _getJsonFile(self, module):
|
||||
|
||||
Reference in New Issue
Block a user