summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-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):