summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/oetest.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 8dd494a064..a50f9d8187 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -409,6 +409,7 @@ class RuntimeTestContext(TestContext):
409 409
410 needed_packages = {} 410 needed_packages = {}
411 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True) 411 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True)
412 packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True)
412 modules = self.getTestModules() 413 modules = self.getTestModules()
413 bbpaths = self.d.getVar("BBPATH", True).split(":") 414 bbpaths = self.d.getVar("BBPATH", True).split(":")
414 415
@@ -433,6 +434,8 @@ class RuntimeTestContext(TestContext):
433 extract = package.get("extract", True) 434 extract = package.get("extract", True)
434 if extract: 435 if extract:
435 dst_dir = os.path.join(extracted_path, pkg) 436 dst_dir = os.path.join(extracted_path, pkg)
437 else:
438 dst_dir = os.path.join(packaged_path)
436 439
437 # Extract package and copy it to TEST_EXTRACTED_DIR 440 # Extract package and copy it to TEST_EXTRACTED_DIR
438 if extract and not os.path.exists(dst_dir): 441 if extract and not os.path.exists(dst_dir):
@@ -440,6 +443,10 @@ class RuntimeTestContext(TestContext):
440 shutil.copytree(pkg_dir, dst_dir) 443 shutil.copytree(pkg_dir, dst_dir)
441 shutil.rmtree(pkg_dir) 444 shutil.rmtree(pkg_dir)
442 445
446 # Copy package to TEST_PACKAGED_DIR
447 elif not extract:
448 self._copy_package(pkg)
449
443 def _getJsonFile(self, module): 450 def _getJsonFile(self, module):
444 """ 451 """
445 Returns the path of the JSON file for a module, empty if doesn't exitst. 452 Returns the path of the JSON file for a module, empty if doesn't exitst.
@@ -492,6 +499,21 @@ class RuntimeTestContext(TestContext):
492 499
493 return extract_dir 500 return extract_dir
494 501
502 def _copy_package(self, pkg):
503 """
504 Copy the RPM, DEB or IPK package to dst_dir
505 """
506
507 from oeqa.utils.package_manager import get_package_manager
508
509 pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg)
510 dst_dir = self.d.getVar("TEST_PACKAGED_DIR", True)
511 pm = get_package_manager(self.d, pkg_path)
512 pkg_info = pm.package_info(pkg)
513 file_path = pkg_info[pkg]["filepath"]
514 shutil.copy2(file_path, dst_dir)
515 shutil.rmtree(pkg_path)
516
495class ImageTestContext(RuntimeTestContext): 517class ImageTestContext(RuntimeTestContext):
496 def __init__(self, d, target, host_dumper): 518 def __init__(self, d, target, host_dumper):
497 super(ImageTestContext, self).__init__(d, target) 519 super(ImageTestContext, self).__init__(d, target)