summaryrefslogtreecommitdiffstats
path: root/meta/lib
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:22:22 +0100
commit65459f5b6d39f9fb2cdf66ba4f01b7889e41df16 (patch)
tree7b71fc8abbea8c4de154d2682a8c2a0c20204460 /meta/lib
parent65a03c3f949e27f64f43b6b0b6452218dfe1a4ec (diff)
downloadpoky-65459f5b6d39f9fb2cdf66ba4f01b7889e41df16.tar.gz
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>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/oetest.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 7dca77a969..514631249c 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -443,6 +443,8 @@ class RuntimeTestContext(TestContext):
443 modules = self.getTestModules() 443 modules = self.getTestModules()
444 bbpaths = self.d.getVar("BBPATH", True).split(":") 444 bbpaths = self.d.getVar("BBPATH", True).split(":")
445 445
446 shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR", True))
447 shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR", True))
446 for module in modules: 448 for module in modules:
447 json_file = self._getJsonFile(module) 449 json_file = self._getJsonFile(module)
448 if json_file: 450 if json_file:
@@ -454,6 +456,8 @@ class RuntimeTestContext(TestContext):
454 Extract packages that will be needed during runtime. 456 Extract packages that will be needed during runtime.
455 """ 457 """
456 458
459 import oe.path
460
457 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True) 461 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True)
458 packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True) 462 packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True)
459 463
@@ -477,13 +481,18 @@ class RuntimeTestContext(TestContext):
477 dst_dir = os.path.join(packaged_path) 481 dst_dir = os.path.join(packaged_path)
478 482
479 # Extract package and copy it to TEST_EXTRACTED_DIR 483 # Extract package and copy it to TEST_EXTRACTED_DIR
480 if extract and not os.path.exists(dst_dir): 484 pkg_dir = self._extract_in_tmpdir(pkg)
481 pkg_dir = self._extract_in_tmpdir(pkg) 485 if extract:
482 shutil.copytree(pkg_dir, dst_dir) 486
487 # Same package used for more than one test,
488 # don't need to extract again.
489 if os.path.exists(dst_dir):
490 continue
491 oe.path.copytree(pkg_dir, dst_dir)
483 shutil.rmtree(pkg_dir) 492 shutil.rmtree(pkg_dir)
484 493
485 # Copy package to TEST_PACKAGED_DIR 494 # Copy package to TEST_PACKAGED_DIR
486 elif not extract: 495 else:
487 self._copy_package(pkg) 496 self._copy_package(pkg)
488 497
489 def _getJsonFile(self, module): 498 def _getJsonFile(self, module):